/* ═══════════════════════════════════════════════════════
   VAULT RUN — Global Styles
   Edit colours at the top (CSS variables).
   The game canvas is rendered by Phaser inside #game-container.
═══════════════════════════════════════════════════════ */

/* ── Brand colours — change these to restyle the whole UI ── */
:root {
  --gold:        #f5c518;
  --gold-dark:   #c9a000;
  --green:       #2ecc71;
  --green-dark:  #1a7a43;
  --red:         #e74c3c;
  --blue:        #3498db;
  --purple:      #9b59b6;
  --dark:        #1a1a2e;
  --dark2:       #16213e;
  --panel-bg:    rgba(0,0,0,0.72);
  --text:        #f0e6c8;
  --text-dim:    #a09070;
  --radius:      10px;
  --font:        'Segoe UI', 'Arial Rounded MT Bold', Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--dark);
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Game wrapper — centres the canvas and overlays ── */
#game-wrapper {
  position: relative;
  width: 900px;
  height: 460px;
  max-width: 100vw;
  overflow: hidden;
}

#game-container {
  position: absolute;
  inset: 0;
}

#game-container canvas {
  display: block;
}

/* ── Shared button row ── */
.btn-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ── Section label ── */
.section-label {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ── Fine print ── */
.fine-print {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
}

/* ── Store balance header ── */
.store-balance {
  font-size: 16px;
  font-weight: bold;
  color: var(--green);
}

/* ── HUD overlay ── */
#hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  background: var(--panel-bg);
  border-bottom: 2px solid var(--gold-dark);
  font-size: 13px;
  gap: 8px;
  z-index: 10;
  pointer-events: none;
}
#hud.hidden { display: none; }

#hud-left, #hud-right { display: flex; flex-direction: column; gap: 2px; }
#hud-center { font-size: 18px; font-weight: bold; color: var(--gold); }

#hud-role  { font-weight: bold; color: var(--gold); font-size: 15px; }
#hud-carry { color: var(--text-dim); }
#hud-balance { color: var(--green); font-weight: bold; }
#hud-items { font-size: 18px; letter-spacing: 3px; }

/* ── Toast notifications ── */
#toast-area {
  position: absolute;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  z-index: 20;
  pointer-events: none;
}

.toast {
  background: var(--panel-bg);
  border: 1px solid var(--gold-dark);
  border-radius: var(--radius);
  padding: 7px 18px;
  font-size: 13px;
  color: var(--text);
  animation: toast-in 0.2s ease, toast-out 0.4s ease 2.6s forwards;
  white-space: nowrap;
}
.toast.good  { border-color: var(--green);  color: var(--green);  }
.toast.bad   { border-color: var(--red);    color: var(--red);    }
.toast.warn  { border-color: var(--gold);   color: var(--gold);   }

@keyframes toast-in  { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
@keyframes toast-out { from { opacity:1; } to { opacity:0; } }

/* ── Mini-map ── */
#minimap {
  position: absolute;
  bottom: 8px;
  right: 8px;
  border: 2px solid var(--gold-dark);
  border-radius: 6px;
  background: rgba(0,0,0,0.6);
  z-index: 10;
  pointer-events: none;
}

/* ── HTML screens (Menu / Loadout / Result / Store) ── */
.screen {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, var(--dark) 0%, var(--dark2) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 28px 24px;
  z-index: 30;
  overflow-y: auto;
}
.screen.hidden { display: none; }

.vr-title {
  font-size: 52px;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 24px var(--gold-dark), 2px 2px 0 #000;
  letter-spacing: 2px;
  text-align: center;
}

.vr-subtitle {
  font-size: 15px;
  color: var(--text-dim);
  text-align: center;
  max-width: 520px;
  line-height: 1.5;
}

.vr-btn {
  background: var(--gold);
  color: #1a1000;
  font-size: 16px;
  font-weight: 700;
  padding: 12px 36px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  min-width: 180px;
  text-align: center;
}
.vr-btn:hover  { background: var(--gold-dark); transform: scale(1.03); }
.vr-btn:active { transform: scale(0.97); }
.vr-btn.secondary { background: transparent; color: var(--text-dim); border: 1px solid var(--text-dim); }
.vr-btn.secondary:hover { color: var(--text); border-color: var(--text); }
.vr-btn.danger { background: var(--red); color: #fff; }

/* ── Role selection cards ── */
.role-cards {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.role-card {
  background: var(--panel-bg);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 12px 16px;
  width: 175px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
  text-align: center;
}
.role-card:hover          { border-color: var(--gold-dark); transform: translateY(-2px); }
.role-card.selected       { border-color: var(--gold); }
.role-card .role-emoji    { font-size: 30px; }
.role-card .role-name     { font-size: 13px; font-weight: bold; margin: 6px 0 3px; color: var(--gold); }
.role-card .role-desc     { font-size: 10px; color: var(--text-dim); line-height: 1.35; }

/* ── Difficulty selector ── */
.diff-row {
  display: flex;
  gap: 10px;
}
.diff-btn {
  background: var(--panel-bg);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 8px 18px;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 13px;
  transition: border-color 0.15s;
}
.diff-btn:hover    { border-color: var(--gold-dark); }
.diff-btn.selected { border-color: var(--gold); color: var(--gold); font-weight: bold; }

/* ── Result screen ── */
.result-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 400px;
  font-size: 14px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.result-row .label { color: var(--text-dim); }
.result-row .val   { font-weight: bold; color: var(--gold); }

/* ── Store overlay ── */
.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 680px;
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 4px;
}
.store-item {
  background: var(--panel-bg);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.store-item .s-emoji { font-size: 28px; }
.store-item .s-name  { font-weight: bold; font-size: 13px; color: var(--gold); }
.store-item .s-desc  { font-size: 11px; color: var(--text-dim); line-height: 1.4; flex: 1; }
.store-item .s-price { font-size: 12px; color: var(--green); font-weight: bold; }
.store-item .s-owned { font-size: 11px; color: var(--text-dim); }
.store-item button   { margin-top: 4px; }

/* ── Multiplayer screens ── */
.mp-field-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}
.mp-field-row label { font-size: 13px; color: var(--text-dim); white-space: nowrap; }

.vr-input {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  padding: 8px 12px;
  width: 280px;
  font-family: var(--font);
}
.vr-input:focus { outline: none; border-color: var(--gold-dark); }

.mp-status {
  font-size: 13px;
  color: var(--green);
  font-weight: bold;
}

.mp-code-display {
  font-size: 28px;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 6px;
}

.lobby-player-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 360px;
  max-height: 160px;
  overflow-y: auto;
}

.lobby-player {
  background: var(--panel-bg);
  border-radius: 6px;
  padding: 8px 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 13px;
}

/* ── Scrollbar styling ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gold-dark); border-radius: 3px; }
