/* ui_kits/lounge/styles.css — layout-only; tokens inherited from colors_and_type.css */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700;800;900&display=swap');
@import url('../../colors_and_type.css');

html, body { margin: 0; padding: 0; min-height: 100vh; }
body {
  background: var(--bg-page);
  background-image:
    radial-gradient(1200px 700px at 50% -10%, rgba(246,227,177,.08), transparent 60%),
    radial-gradient(900px 600px at 0% 100%, rgba(20,87,63,.32), transparent 70%),
    radial-gradient(900px 600px at 100% 100%, rgba(6,36,27,.5), transparent 70%),
    var(--bg-page);
  background-attachment: fixed;
  color: var(--fg-1);
  font-family: var(--font-sans);
}
*, *::before, *::after { box-sizing: border-box; }
button { font-family: inherit; }

/* ── Atoms ─────────────────────────────────────────────────────────── */

.shield {
  width: 48px; height: 56px;
  background: var(--grad-shield);
  clip-path: polygon(20% 0, 80% 0, 100% 18%, 100% 68%, 50% 100%, 0% 68%, 0 18%);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 900;
  color: var(--mb-gold-1);
  letter-spacing: .04em;
  flex: none;
}
.shield.lg { width: 72px; height: 84px; font-size: 26px; }

.btn {
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 12px 22px;
  cursor: pointer;
  transition: transform 130ms ease, filter 130ms ease, box-shadow 130ms ease;
}
.btn:active { transform: translateY(0); filter: brightness(.95); }
.btn-primary {
  background: var(--grad-gold);
  color: #2c1f08;
  border: 1px solid rgba(122,90,35,.6);
  box-shadow: 0 14px 28px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.55);
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.05) saturate(1.05); box-shadow: 0 16px 32px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.55), 0 0 0 4px rgba(246,227,177,.18); }
.btn-secondary {
  background: rgba(2,12,9,.55);
  color: var(--mb-cream);
  border: 1px solid var(--line-line);
}
.btn-secondary:hover { background: rgba(2,12,9,.75); border-color: var(--line-strong); color: var(--mb-gold-1); }
.btn[disabled], .btn.disabled { opacity: .5; filter: saturate(.6); cursor: not-allowed; }

.chip {
  font-size: 10px; font-weight: 800;
  letter-spacing: 0.14em; text-transform: uppercase;
  border-radius: 999px; padding: 8px 14px;
  border: 1px solid var(--line-line);
  background: rgba(2,12,9,.5);
  color: var(--mb-cream-soft);
  cursor: pointer;
  transition: all 130ms ease;
}
.chip.on {
  background: linear-gradient(180deg, rgba(246,227,177,.18), rgba(184,144,74,.1));
  color: var(--mb-gold-1);
  border-color: rgba(246,227,177,.45);
}
.chip:hover { color: var(--mb-gold-1); }

.eyebrow { font-size: 10px; font-weight: 950; letter-spacing: 0.18em; text-transform: uppercase; color: var(--fg-eyebrow); }
.note { font-size: 12px; color: var(--fg-3); line-height: 1.45; }

.field {
  display: flex; flex-direction: column; gap: 6px;
}
.field span.label { font-size: 10px; font-weight: 950; letter-spacing: 0.18em; text-transform: uppercase; color: var(--fg-eyebrow); }
.field input, .field select {
  font-family: var(--font-sans);
  font-size: 14px; font-weight: 700;
  background: rgba(2,12,9,.55);
  color: var(--mb-cream);
  border: 1px solid var(--line-line);
  border-radius: 14px;
  padding: 12px 16px;
  outline: none;
  transition: border-color 130ms ease, background 130ms ease;
}
.field input:focus, .field select:focus { border-color: rgba(246,227,177,.7); background: rgba(2,12,9,.75); }
.field input[readonly] { color: var(--fg-3); background: rgba(2,12,9,.35); border-color: var(--line-subtle); }

/* ── Layout shells ─────────────────────────────────────────────────── */

.app-shell {
  min-height: 100vh;
  display: flex; flex-direction: column;
}
.lounge-stage {
  flex: 1;
  width: min(100vw, 1560px);
  margin: 0 auto;
  padding: 28px clamp(20px, 4vw, 48px);
}

.surface {
  background: linear-gradient(180deg, rgba(10,51,39,.92), rgba(3,17,12,.96));
  border: 1px solid var(--line-line);
  border-radius: 25px;
  box-shadow: var(--shadow-card);
  padding: 24px 28px;
}

/* ── Top header ─────────────────────────────────────────────────── */

.lounge-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.lounge-brand { display: flex; gap: 14px; align-items: center; }
.lounge-brand strong { display: block; font-family: var(--font-serif); font-size: 22px; line-height: 1; letter-spacing: -0.02em; }
.lounge-brand small { display: block; font-size: 11px; color: var(--fg-eyebrow); letter-spacing: 0.14em; text-transform: uppercase; font-weight: 800; margin-top: 4px; }

.user-pill {
  display: flex; gap: 10px; align-items: center;
  background: rgba(2,12,9,.55);
  border: 1px solid var(--line-line);
  padding: 8px 14px 8px 8px;
  border-radius: 999px;
  box-shadow: var(--shadow-pill);
}
.user-pill .avatar {
  width: 36px; height: 36px; border-radius: 999px;
  background: linear-gradient(180deg,#14573f,#0a3327);
  color: var(--mb-gold-1);
  font-family: var(--font-serif); font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(246,227,177,.4);
}
.user-pill b { font-size: 13px; display: block; }
.user-pill small { font-size: 10px; color: var(--fg-eyebrow); letter-spacing: 0.14em; text-transform: uppercase; font-weight: 800; }

.top-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ── Login gate ────────────────────────────────────────────────────── */

.login-gate {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 700px at 50% -10%, rgba(246,227,177,.06), transparent 60%), rgba(2,8,6,.78);
  backdrop-filter: blur(8px);
  z-index: 50;
  padding: 40px 20px;
}
.login-card {
  width: min(440px, 100%);
  background: linear-gradient(180deg, rgba(10,51,39,.96), rgba(3,17,12,.99));
  border: 1px solid var(--line-line);
  border-radius: 32px;
  box-shadow: var(--shadow-elevated);
  padding: 36px 36px 32px;
  display: flex; flex-direction: column; gap: 20px;
}
.login-card .header { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.login-card .header strong { font-family: var(--font-serif); font-size: 26px; letter-spacing: -0.02em; }
.login-card .header span { font-size: 11px; color: var(--fg-eyebrow); letter-spacing: 0.18em; text-transform: uppercase; font-weight: 900; }
.login-card .dev-hint { font-size: 11px; color: var(--fg-3); text-align: center; line-height: 1.5; }
.login-card .dev-hint code { background: rgba(246,227,177,.08); padding: 2px 6px; border-radius: 6px; color: var(--mb-gold-1); font-family: var(--font-mono); font-size: 11px; }

/* ── Dashboard ─────────────────────────────────────────────────────── */

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr);
  gap: 22px;
  margin-bottom: 22px;
}
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }

.hero {
  padding: 32px;
  display: flex; flex-direction: column; gap: 14px;
}
.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(38px, 4.5vw, 60px);
  line-height: 0.92;
  letter-spacing: -0.04em;
  margin: 0;
}
.hero h1 span { color: var(--mb-gold-2); }
.hero p { color: var(--fg-2); max-width: 60ch; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

.console {
  margin-top: 18px;
  padding: 28px;
  background: linear-gradient(180deg, rgba(15,70,51,.5), rgba(6,36,27,.7));
  border: 1px solid var(--line-line);
  border-radius: 25px;
  display: flex; flex-direction: column; gap: 18px;
  box-shadow: var(--shadow-card);
}
.console h2 { font-family: var(--font-serif); font-size: 28px; letter-spacing: -0.02em; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }

.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.mode {
  background: rgba(2,12,9,.55);
  border: 1px solid var(--line-line);
  border-radius: 18px;
  padding: 18px 14px;
  display: flex; flex-direction: column; gap: 4px; align-items: flex-start;
  color: var(--mb-cream);
  cursor: pointer;
  transition: all 130ms ease;
}
.mode b { font-family: var(--font-serif); font-size: 32px; line-height: 1; }
.mode span { font-size: 10px; font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-eyebrow); }
.mode.active {
  background: linear-gradient(180deg, rgba(246,227,177,.22), rgba(184,144,74,.12));
  border-color: rgba(246,227,177,.55);
  color: var(--mb-gold-1);
  box-shadow: 0 12px 28px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.08);
}
.mode.active span { color: var(--mb-gold-1); }
.mode:hover { border-color: var(--line-strong); }

.button-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.online-aside {
  padding: 28px;
  display: flex; flex-direction: column; gap: 16px;
}
.online-aside h3 { font-family: var(--font-serif); font-size: 26px; letter-spacing: -0.02em; }
.players { display: flex; flex-direction: column; gap: 8px; }
.online-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.online-summary .summary {
  border: 1px solid var(--line-line);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(2,12,9,.45);
}
.online-summary small { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-eyebrow); font-weight: 800; }
.online-summary b { font-family: var(--font-serif); font-size: 24px; display: block; margin-top: 2px; }

.player-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(2,12,9,.45);
  border: 1px solid var(--line-subtle);
}
.player-row.online { background: linear-gradient(180deg, rgba(15,70,51,.6), rgba(6,36,27,.7)); border-color: var(--line-line); }
.player-row .left { display: flex; gap: 12px; align-items: center; }
.player-row .avatar { width: 34px; height: 34px; border-radius: 999px; background: rgba(2,12,9,.6); color: var(--fg-3); font-family: var(--font-serif); font-weight: 800; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line-subtle); }
.player-row.online .avatar { background: linear-gradient(180deg,#14573f,#0a3327); color: var(--mb-gold-1); border-color: rgba(246,227,177,.4); }
.player-row b { font-size: 14px; display: block; }
.player-row small { font-size: 11px; color: var(--fg-3); }

/* footer metric strip */
.metric-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border: 1px solid var(--line-line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(10,51,39,.85), rgba(3,17,12,.92));
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.metric-strip .cell { padding: 14px 16px; border-right: 1px solid var(--line-subtle); }
.metric-strip .cell:last-child { border-right: none; }
.metric-strip small { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-eyebrow); font-weight: 800; }
.metric-strip b { display: block; margin-top: 4px; font-family: var(--font-serif); font-size: 18px; }
@media (max-width: 800px) { .metric-strip { grid-template-columns: repeat(3, 1fr); } .metric-strip .cell:nth-child(3n) { border-right: none; } }

/* ── Race Lobby ─────────────────────────────────────────────────────── */

.lobby-card {
  max-width: 720px; margin: 0 auto;
  background: linear-gradient(180deg, rgba(10,51,39,.96), rgba(3,17,12,.99));
  border: 1px solid var(--line-line);
  border-radius: 32px;
  padding: 36px;
  box-shadow: var(--shadow-elevated);
  display: flex; flex-direction: column; gap: 22px;
}
.lobby-code-badge {
  font-family: var(--font-mono);
  font-size: 18px;
  background: rgba(246,227,177,.1);
  border: 1px solid var(--line-line);
  border-radius: 10px;
  padding: 4px 12px;
  color: var(--mb-gold-1);
  letter-spacing: 0.12em;
}
.lobby-player-list { display: flex; flex-direction: column; gap: 10px; }
.lobby-player {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(2,12,9,.45);
  border: 1px solid var(--line-subtle);
  transition: all 200ms ease;
}
.lobby-player.ready { border-color: rgba(97,210,147,.45); background: linear-gradient(180deg, rgba(97,210,147,.08), rgba(20,87,63,.4)); }
.lobby-player .left { display: flex; gap: 12px; align-items: center; }
.lobby-player .ready-pill {
  font-size: 10px; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 6px 12px; border-radius: 999px;
}
.lobby-player .ready-pill.yes { background: rgba(97,210,147,.16); color: #9ee6b8; border: 1px solid rgba(97,210,147,.5); }
.lobby-player .ready-pill.no  { background: rgba(216,98,90,.14); color: #f6b3ad; border: 1px solid rgba(216,98,90,.4); }
.lobby-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

/* ── Game table ─────────────────────────────────────────────────────── */

.game-stage {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-width: 1560px;
  margin: 0 auto;
  position: relative;
  display: flex; flex-direction: column;
  gap: 16px;
}
.hud-row {
  display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 8px;
}
.hud-pill {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(2,12,9,.7);
  border: 1px solid var(--line-line);
  border-radius: 999px;
  padding: 8px 12px;
  box-shadow: var(--shadow-pill);
  min-height: 50px;
}
.hud-pill.lead { background: linear-gradient(180deg, rgba(246,227,177,.18), rgba(184,144,74,.08)); border-color: rgba(246,227,177,.45); }
.hud-pill.quiet { opacity: .65; }
.hud-pill .lbl { font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--fg-eyebrow); font-weight: 950; }
.hud-pill .val { font-family: var(--font-serif); font-size: 20px; font-variant-numeric: tabular-nums lining-nums; line-height: 1.1; }
.hud-pill.lead .val { color: var(--mb-gold-1); }

.felt {
  flex: 1;
  position: relative;
  border-radius: clamp(28px, 3vw, 56px);
  background:
    radial-gradient(ellipse at 50% 110%, transparent, rgba(0,0,0,.65) 90%),
    radial-gradient(ellipse at 50% 50%, #1a5e44, #0d3b2b 70%, #06231a);
  border: 1px solid var(--line-line);
  box-shadow: var(--shadow-felt);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: clamp(18px, 2.5vw, 32px);
  overflow: hidden;
}
.felt::before, .felt::after { content: ''; position: absolute; pointer-events: none; }
.felt::before {
  inset: 12px; border-radius: inherit;
  border: 1px solid rgba(246,227,177,.18);
}
.felt::after {
  inset: 28px;
  border-radius: inherit;
  background: radial-gradient(ellipse at 50% 0%, rgba(246,227,177,.08), transparent 50%);
}
.felt-brand {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  text-align: center;
}
.felt-brand strong { font-family: var(--font-serif); font-size: 22px; color: var(--mb-gold-1); letter-spacing: 0.02em; }
.felt-brand small { display: block; font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(246,227,177,.5); margin-top: 2px; font-weight: 800; }

.tableau {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  margin: 28px 0;
}
.tableau-row { display: flex; gap: 6px; }

.pcard {
  width: clamp(46px, 4.5vw, 64px);
  aspect-ratio: 5 / 7;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,.18);
  font-family: var(--font-serif);
  position: relative;
  flex: none;
}
.pcard.face {
  background: linear-gradient(180deg,#fefaee,#f5e6c2);
  color: #0e1714;
  box-shadow: 0 8px 18px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.7), inset 0 0 0 1px rgba(0,0,0,.06);
}
.pcard.face.red { color: #a3232f; }
.pcard.back {
  background: repeating-linear-gradient(45deg, #0a3327, #0a3327 5px, #0f4633 5px, #0f4633 10px);
  border: 1px solid rgba(246,227,177,.3);
  box-shadow: 0 8px 18px rgba(0,0,0,.4), inset 0 0 0 1px rgba(246,227,177,.16);
  display: flex; align-items: center; justify-content: center;
  color: var(--mb-gold-1);
  font-size: 14px;
  position: relative;
}
.pcard.back::after {
  content: 'MB';
  position: absolute;
  inset: 16% 24%;
  border: 1px solid rgba(246,227,177,.42);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(11px, 1.2vw, 16px);
}
.pcard.face .corner-tl { position: absolute; top: 4px; left: 6px; font-size: 11px; font-weight: 900; line-height: 1; }
.pcard.face .corner-tl span { display: block; font-size: 10px; }
.pcard.face .corner-br { position: absolute; bottom: 4px; right: 6px; font-size: 11px; font-weight: 900; transform: rotate(180deg); line-height: 1; }
.pcard.face .pip { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: clamp(20px, 2.4vw, 30px); }
.pcard.playable { transform: translateY(-6px); border-color: rgba(246,227,177,.55); box-shadow: 0 14px 28px rgba(0,0,0,.4), 0 0 22px rgba(246,227,177,.4), inset 0 1px 0 rgba(255,255,255,.7); }

.dock {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 22px; align-items: flex-end;
  z-index: 3;
}
.dock-zone {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 18px;
  background: rgba(2,12,9,.6);
  border: 1px solid var(--line-line);
  border-radius: 18px;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-card);
}
.dock-zone .lbl { font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--fg-eyebrow); font-weight: 950; }
.dock-zone .hint { font-size: 10px; color: var(--fg-3); }

.controls-bar {
  display: flex; justify-content: space-between; gap: 14px; align-items: center;
  margin-top: 12px;
}

.race-badge {
  position: absolute; top: 12px; right: 14px;
  background: rgba(2,12,9,.7);
  border: 1px solid rgba(216,98,90,.45);
  color: #f6b3ad;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 10px; font-weight: 900; letter-spacing: 0.18em; text-transform: uppercase;
  display: flex; gap: 8px; align-items: center;
  z-index: 4;
}
.race-badge::before {
  content: ''; width: 8px; height: 8px; border-radius: 999px;
  background: #d8625a; box-shadow: 0 0 10px #d8625a;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
