/* ── AKRO · akro.css ──────────────────────────────────────────────────── */
/* Aesthetic: late-night game show. Dark stage. Gold. Sharp. Electric.    */

@import url('https://fonts.googleapis.com/css2?family=Russo+One&family=Share+Tech+Mono&family=DM+Sans:ital,opsz,wght@0,9..40,300..700;1,9..40,300..400&display=swap');

/* ── Variables ─────────────────────────────────────────────────────────── */
:root {
  --bg:         #07070f;
  --bg2:        #0f0f1e;
  --surface:    #13132a;
  --surface2:   #1c1c38;
  --border:     #2a2a50;
  --gold:       #f0b429;
  --gold-light: #ffd166;
  --gold-dim:   #7a5c14;
  --pink:       #e843a0;
  --blue:       #4fa3ff;
  --green:      #3dd68c;
  --red:        #f04060;
  --text:       #eeeef8;
  --text-dim:   #7070a0;
  --text-faint: #3a3a60;
  --font-body:  'DM Sans', sans-serif;
  --font-head:  'Russo One', sans-serif;
  --font-mono:  'Share Tech Mono', monospace;
  --radius:     8px;
  --radius-lg:  14px;
  --shadow:     0 4px 24px rgba(0,0,0,.6);
  --glow-gold:  0 0 24px rgba(240,180,41,.25);
  --glow-pink:  0 0 24px rgba(232,67,160,.25);
}

/* ── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  min-height: 100dvh;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(240,180,41,.08) 0%, transparent 70%);
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, textarea { font: inherit; }

/* ── Boot screen ────────────────────────────────────────────────────────── */
.boot-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100dvh;
  gap: 2rem;
}
.boot-logo {
  font-family: var(--font-head);
  font-size: clamp(4rem, 15vw, 8rem);
  letter-spacing: .12em;
  color: var(--gold);
  text-shadow: var(--glow-gold), 0 0 60px rgba(240,180,41,.4);
  animation: pulse 2s ease-in-out infinite;
}
.boot-dots { display: flex; gap: .5rem; }
.boot-dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold-dim);
  animation: dot-bounce 1.2s ease-in-out infinite;
}
.boot-dots span:nth-child(2) { animation-delay: .2s; }
.boot-dots span:nth-child(3) { animation-delay: .4s; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .75; }
}
@keyframes dot-bounce {
  0%, 100% { transform: translateY(0); background: var(--gold-dim); }
  50% { transform: translateY(-6px); background: var(--gold); }
}

/* ── Chrome header ──────────────────────────────────────────────────────── */
.chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: rgba(7,7,15,.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}
.chrome-left, .chrome-right { display: flex; align-items: center; gap: 1rem; }

.wordmark {
  font-family: var(--font-head);
  font-size: 1.2rem;
  letter-spacing: .15em;
  color: var(--gold);
  text-shadow: 0 0 12px rgba(240,180,41,.4);
}
.back-btn {
  font-size: .85rem;
  color: var(--text-dim);
  transition: color .15s;
}
.back-btn:hover { color: var(--text); }
.chrome-name {
  font-size: .85rem;
  color: var(--text-dim);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chrome-name.unnamed { color: var(--gold-dim); text-decoration: underline dotted; }
.chrome-account {
  font-size: 1rem;
  color: var(--text-faint);
  transition: color .15s;
}
.chrome-account:hover { color: var(--text-dim); }

/* ── Main content ───────────────────────────────────────────────────────── */
.content {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

/* ── Flash messages ─────────────────────────────────────────────────────── */
.flash {
  position: fixed;
  top: 4rem;
  left: 50%;
  transform: translateX(-50%);
  padding: .6rem 1.25rem;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 500;
  z-index: 999;
  transition: opacity .4s;
  pointer-events: none;
  white-space: nowrap;
}
.flash-error { background: var(--red); color: #fff; }
.flash-info  { background: var(--surface2); color: var(--gold); border: 1px solid var(--gold-dim); }
.flash-out { opacity: 0; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .65rem 1.5rem;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .02em;
  transition: all .15s;
  gap: .4rem;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary {
  background: var(--gold);
  color: #07070f;
  box-shadow: 0 2px 16px rgba(240,180,41,.3);
}
.btn-primary:not(:disabled):hover {
  background: var(--gold-light);
  box-shadow: 0 2px 24px rgba(240,180,41,.5);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.btn-outline:not(:disabled):hover {
  border-color: var(--text-dim);
  color: var(--text);
}

.btn-sm { padding: .4rem .9rem; font-size: .85rem; }

/* ── Inputs ─────────────────────────────────────────────────────────────── */
.text-input {
  width: 100%;
  padding: .6rem .85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .95rem;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.text-input:focus {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px rgba(240,180,41,.1);
}
.text-input::placeholder { color: var(--text-faint); }

/* ── Form pages ─────────────────────────────────────────────────────────── */
.form-page { max-width: 480px; }
.page-title {
  font-family: var(--font-head);
  font-size: 1.8rem;
  letter-spacing: .06em;
  color: var(--gold);
  margin-bottom: 1.5rem;
}
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.card-title {
  font-family: var(--font-head);
  font-size: 1rem;
  letter-spacing: .06em;
  color: var(--text-dim);
}
.field { display: flex; flex-direction: column; gap: .45rem; }
.field-label { font-size: .85rem; font-weight: 600; color: var(--text-dim); letter-spacing: .04em; text-transform: uppercase; }
.field-hint { font-size: .8rem; color: var(--text-faint); }

.radio-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.radio-col { display: flex; flex-direction: column; gap: .4rem; }
.radio-opt {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .9rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: .9rem;
  transition: border-color .15s, background .15s;
}
.radio-opt:has(input:checked) {
  border-color: var(--gold-dim);
  background: rgba(240,180,41,.08);
  color: var(--gold);
}
.radio-opt input { display: none; }

/* ── Game card layout update (left/right split) ──────────────────────── */
.game-card-left {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}
.game-card-right {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-shrink: 0;
}
.game-card-name {
  font-size: .82rem;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}

.vis-badge {
  font-size: .9rem;
  flex-shrink: 0;
}
.public-badge  { color: var(--green); }
.private-badge { color: var(--text-faint); }

.join-hint {
  font-size: .8rem;
  color: var(--gold-dim);
  font-weight: 600;
  white-space: nowrap;
}
.public-game-card:hover .join-hint { color: var(--gold); }

.refresh-btn {
  font-size: .85rem;
  color: var(--text-faint);
  margin-left: .4rem;
  padding: .1rem .3rem;
  border-radius: 4px;
  transition: color .15s, background .15s;
  vertical-align: middle;
}
.refresh-btn:hover { color: var(--text); background: var(--surface2); }
.refresh-btn:disabled { opacity: .35; cursor: not-allowed; }

.field-opt {
  font-weight: 400;
  color: var(--text-faint);
  text-transform: none;
  letter-spacing: 0;
}

/* ── Lobby ───────────────────────────────────────────────────────────────── */
.lobby-hero {
  text-align: center;
  padding: 3rem 0 2rem;
}
.hero-title {
  font-family: var(--font-head);
  font-size: clamp(3.5rem, 12vw, 6rem);
  letter-spacing: .12em;
  color: var(--gold);
  text-shadow: var(--glow-gold);
  line-height: 1;
  margin-bottom: .5rem;
}
.hero-sub {
  font-size: 1.05rem;
  color: var(--text-dim);
  letter-spacing: .08em;
  margin-bottom: 2rem;
}
.lobby-cta { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

.section-title {
  font-family: var(--font-head);
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 1rem;
}
.game-list-section { margin-top: 2.5rem; }
.game-list { display: flex; flex-direction: column; gap: .6rem; }
.empty-state { color: var(--text-faint); font-size: .9rem; }

.game-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .15s, background .15s;
}
.game-card:hover { border-color: var(--gold-dim); background: var(--surface2); }
.game-card-code {
  font-family: var(--font-mono);
  font-size: .95rem;
  color: var(--gold);
  display: flex;
  gap: .75rem;
  align-items: center;
}
.game-card-acro {
  font-size: .8rem;
  background: var(--gold);
  color: #07070f;
  padding: .1rem .4rem;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: .1em;
}
.game-card-status {
  font-size: .82rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: .35rem;
}

.phase-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.phase-dot-waiting    { background: var(--text-faint); }
.phase-dot-submitting { background: var(--blue); box-shadow: 0 0 6px var(--blue); }
.phase-dot-voting     { background: var(--pink); box-shadow: 0 0 6px var(--pink); }
.phase-dot-results    { background: var(--green); box-shadow: 0 0 6px var(--green); }
.phase-dot-final      { background: var(--gold); box-shadow: 0 0 6px var(--gold); }

.how-section { margin-top: 2.5rem; }
.how-list {
  padding-left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .65rem;
  color: var(--text-dim);
  font-size: .9rem;
}
.how-list strong { color: var(--text); }

/* ── Phase pages (shared) ─────────────────────────────────────────────── */
.phase-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding-top: 1rem;
}

.round-header {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.round-badge {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--text-faint);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.deadline-badge {
  font-size: .8rem;
  color: var(--text-faint);
}

.phase-label {
  font-family: var(--font-head);
  font-size: 1.1rem;
  letter-spacing: .08em;
  color: var(--text-dim);
}

.phase-hint {
  font-size: .88rem;
  color: var(--text-faint);
  text-align: center;
  max-width: 380px;
}

/* ── Acronym display ──────────────────────────────────────────────────── */
.acronym-display {
  display: flex;
  gap: .35rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.acro-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(2.8rem, 10vw, 4rem);
  height: clamp(2.8rem, 10vw, 4rem);
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  color: var(--gold);
  background: var(--surface);
  border: 2px solid var(--gold-dim);
  border-radius: var(--radius);
  text-shadow: 0 0 12px rgba(240,180,41,.4);
  box-shadow: var(--glow-gold);
}
.acro-small .acro-letter {
  width: 2.2rem;
  height: 2.2rem;
  font-size: 1.2rem;
}

/* ── Waiting page ────────────────────────────────────────────────────── */
.lobby-code {
  font-family: var(--font-head) !important;
  font-size: clamp(2.5rem, 10vw, 4rem) !important;
  letter-spacing: .2em;
  color: var(--gold) !important;
  text-shadow: var(--glow-gold);
  display: block !important;
}
.join-link-row {
  display: flex;
  gap: .5rem;
  width: 100%;
  max-width: 420px;
}
.join-link-input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--text-dim);
}

.players-list {
  align-self: stretch;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.player-row {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .5rem .75rem;
  border-radius: var(--radius);
  background: var(--surface);
  font-size: .9rem;
}
.player-row.is-you { background: rgba(240,180,41,.07); border: 1px solid rgba(240,180,41,.15); }
.player-row.waiting-more { background: transparent; }
.player-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
}
.player-dot.blink { background: var(--text-faint); animation: blink 1.4s infinite; }
@keyframes blink { 0%,100% { opacity: .3; } 50% { opacity: 1; } }
.you-badge {
  margin-left: auto;
  font-size: .72rem;
  color: var(--gold-dim);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.player-name.dim { color: var(--text-faint); font-style: italic; }

/* ── Submit page ─────────────────────────────────────────────────────── */
.submit-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.expansion-inputs {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}
.word-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
}
.word-letter {
  font-family: var(--font-head);
  font-size: 1.2rem;
  color: var(--gold);
}
.word-input {
  width: clamp(90px, 20vw, 140px);
  padding: .5rem .65rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .9rem;
  text-align: center;
  transition: border-color .15s;
  outline: none;
}
.word-input:focus {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px rgba(240,180,41,.1);
}

.submit-preview {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--gold-light);
  letter-spacing: .04em;
  min-height: 1.5rem;
  text-align: center;
}

.submitted-confirm {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .85rem 1.25rem;
  background: rgba(61,214,140,.08);
  border: 1px solid rgba(61,214,140,.2);
  border-radius: var(--radius);
  font-size: .95rem;
}
.check-icon { color: var(--green); font-size: 1.2rem; }
.submitted-confirm em { font-style: normal; color: var(--gold-light); }

/* ── Player progress dots ────────────────────────────────────────────── */
.player-progress {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-top: .25rem;
}
.progress-dot {
  width: 10px; height: 10px; border-radius: 50%;
  transition: background .3s;
}
.progress-dot.done    { background: var(--green); }
.progress-dot.pending { background: var(--border); }
.progress-dot.unknown { background: var(--text-faint); animation: blink 2s infinite; }
.progress-label { font-size: .8rem; }

/* ── Voting page ─────────────────────────────────────────────────────── */
.entries-list {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  width: 100%;
}
.entry-card {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: left;
  transition: border-color .15s, background .15s, transform .1s;
  gap: .75rem;
}
.entry-card:not(:disabled):hover {
  border-color: var(--pink);
  background: rgba(232,67,160,.06);
  transform: translateX(3px);
}
.entry-card.picked {
  border-color: var(--green) !important;
  background: rgba(61,214,140,.06) !important;
}
.entry-card.own-entry {
  opacity: .6;
}
.entry-card.dimmed { opacity: .45; }
.entry-text {
  font-family: var(--font-mono);
  font-size: .95rem;
  color: var(--text);
  flex: 1;
}
.entry-badge {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
  padding: .2rem .5rem;
  border-radius: 4px;
}
.own-badge  { background: var(--surface2); color: var(--text-faint); }
.vote-badge { background: rgba(61,214,140,.15); color: var(--green); }

/* ── Results page ────────────────────────────────────────────────────── */
.results-list {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  width: 100%;
}
.result-row {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  animation: slide-up .35s ease forwards;
}
.result-row.winner-row {
  border-color: var(--gold-dim);
  background: rgba(240,180,41,.06);
  box-shadow: var(--glow-gold);
}
.result-row.you-row {
  border-color: rgba(79,163,255,.3);
}
.result-rank {
  font-family: var(--font-head);
  font-size: 1.2rem;
  color: var(--text-faint);
  width: 1.8rem;
  flex-shrink: 0;
}
.result-content { flex: 1; display: flex; flex-direction: column; gap: .2rem; }
.result-text {
  font-family: var(--font-mono);
  font-size: .92rem;
  color: var(--text);
}
.result-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.result-author { font-size: .78rem; color: var(--text-faint); }
.bonus-badge {
  font-size: .72rem;
  color: var(--gold);
  background: rgba(240,180,41,.1);
  padding: .1rem .4rem;
  border-radius: 4px;
}
.result-votes {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .1rem;
  flex-shrink: 0;
  min-width: 2.5rem;
}
.vote-count { font-family: var(--font-head); font-size: 1.4rem; color: var(--text); }
.vote-label { font-size: .65rem; color: var(--text-faint); text-transform: uppercase; }
.delta-badge {
  font-size: .75rem;
  font-weight: 700;
  color: var(--green);
  background: rgba(61,214,140,.12);
  padding: .1rem .35rem;
  border-radius: 4px;
}

/* ── Scoreboard ──────────────────────────────────────────────────────── */
.scoreboard {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.scoreboard-title {
  font-family: var(--font-head);
  font-size: .75rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: .25rem;
}
.score-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .4rem 0;
  border-bottom: 1px solid var(--bg2);
}
.score-row:last-child { border-bottom: none; }
.score-row.is-you .score-name { color: var(--gold); }
.score-name { flex: 1; font-size: .9rem; }
.score-val {
  font-family: var(--font-head);
  font-size: 1.1rem;
  color: var(--text);
  min-width: 2rem;
  text-align: right;
}

/* ── Final page ──────────────────────────────────────────────────────── */
.final-page { padding-top: 2rem; }
.final-banner {
  text-align: center;
  padding: 2rem 1rem;
}
.final-winner-name {
  font-family: var(--font-head);
  font-size: clamp(2.2rem, 8vw, 3.5rem);
  letter-spacing: .06em;
  color: var(--gold);
  text-shadow: var(--glow-gold);
}
.final-win-text {
  font-family: var(--font-head);
  font-size: 1.2rem;
  letter-spacing: .12em;
  color: var(--text-dim);
  margin-top: .4rem;
}

.final-scores { margin-bottom: 2rem; }
.final-score-row {
  animation: slide-up .35s ease forwards;
  opacity: 0;
}
.score-rank {
  font-size: 1.1rem;
  width: 2rem;
  flex-shrink: 0;
}

.final-actions { display: flex; gap: .75rem; flex-wrap: wrap; justify-content: center; }

/* ── Account page ────────────────────────────────────────────────────── */
.transfer-row { display: flex; gap: .65rem; }
.export-box {
  margin-top: .75rem;
  padding: .65rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--text-dim);
  word-break: break-all;
  line-height: 1.5;
}
.mono-id {
  font-family: var(--font-mono);
  font-size: .78rem;
  word-break: break-all;
}

/* ── Spinner ─────────────────────────────────────────────────────────── */
.poll-spin {
  display: inline-block;
  width: 10px; height: 10px;
  border: 2px solid var(--text-faint);
  border-top-color: var(--gold-dim);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  vertical-align: middle;
  margin-left: .35rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Animations ──────────────────────────────────────────────────────── */
.phase-enter { animation: phase-in .4s ease forwards; }
@keyframes phase-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slide-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Error states ────────────────────────────────────────────────────── */
.error-state { color: var(--red); padding: 2rem 0; }

/* ── Dim utility ─────────────────────────────────────────────────────── */
.dim { color: var(--text-faint); }

/* ── Leaderboard ────────────────────────────────────────────────────── */
.lb-page { max-width: 560px; }
.lb-controls { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1.5rem; }
.lb-tabs {
  display: flex; gap: .35rem; flex-wrap: wrap;
}
.lb-tabs-sm .lb-tab { font-size: .78rem; padding: .35rem .7rem; }
.lb-tab {
  padding: .45rem .9rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-faint);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .15s;
}
.lb-tab:hover { color: var(--text-dim); border-color: var(--text-faint); }
.lb-tab.active {
  color: var(--gold);
  border-color: var(--gold-dim);
  background: rgba(240,180,41,.08);
}
.lb-body { min-height: 200px; }
.lb-table { display: flex; flex-direction: column; gap: 0; }
.lb-header-row {
  display: flex; align-items: center; gap: .5rem;
  padding: .4rem .75rem;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-faint);
  border-bottom: 1px solid var(--border);
}
.lb-row {
  display: flex; align-items: center; gap: .5rem;
  padding: .65rem .75rem;
  border-bottom: 1px solid var(--bg2);
  transition: background .15s;
}
.lb-row:hover { background: var(--surface); }
.lb-you { background: rgba(240,180,41,.05); }
.lb-you:hover { background: rgba(240,180,41,.08); }
.lb-col-rank { width: 2rem; flex-shrink: 0; font-family: var(--font-mono); font-size: .85rem; color: var(--text-faint); }
.lb-col-name { flex: 1; font-size: .9rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-col-stat { width: 4.5rem; flex-shrink: 0; text-align: right; font-family: var(--font-mono); font-size: .95rem; color: var(--gold); font-weight: 600; }
.lb-col-gp { width: 2.5rem; flex-shrink: 0; text-align: right; font-size: .8rem; color: var(--text-faint); }

/* ── Dialog ──────────────────────────────────────────────────────────── */
.dialog-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  animation: fade-in .15s ease;
  padding: 1rem;
}
.dialog-overlay.dialog-out { animation: fade-out .2s ease forwards; }
@keyframes fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }

.dialog {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow), 0 0 40px rgba(0,0,0,.5);
  animation: slide-up .25s ease;
}
.dialog-close {
  position: absolute;
  top: .75rem; right: .75rem;
  font-size: 1.5rem;
  color: var(--text-faint);
  background: none; border: none; cursor: pointer;
  width: 2rem; height: 2rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: color .15s, background .15s;
}
.dialog-close:hover { color: var(--text); background: var(--surface2); }
.dialog-title {
  font-family: var(--font-head);
  font-size: 1.3rem;
  letter-spacing: .06em;
  color: var(--gold);
  margin-bottom: 1.25rem;
}
.dialog-subtitle {
  font-family: var(--font-head);
  font-size: .9rem;
  letter-spacing: .06em;
  color: var(--text-dim);
  margin-top: 1.25rem;
  margin-bottom: .75rem;
}
.rules-list {
  padding-left: 1.25rem;
  display: flex; flex-direction: column;
  gap: .6rem;
  color: var(--text-dim);
  font-size: .9rem;
}
.rules-list strong { color: var(--text); }
.about-text {
  display: flex; flex-direction: column;
  gap: 1rem;
  color: var(--text-dim);
  font-size: .9rem;
  line-height: 1.65;
}
.about-text em { color: var(--gold-light); font-style: italic; }
.about-text strong { color: var(--text); }
.about-credit {
  margin-top: .5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: .85rem;
  color: var(--text-faint);
}

/* ── Lobby links ────────────────────────────────────────────────────── */
.lobby-links {
  margin-top: 2rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}
.link-btn {
  background: none; border: none;
  color: var(--text-faint);
  font-size: .85rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color .15s;
}
.link-btn:hover { color: var(--text-dim); }
.link-sep { color: var(--text-faint); font-size: .7rem; }

/* ── QR code ────────────────────────────────────────────────────────── */
.qr-canvas {
  display: flex;
  justify-content: center;
  padding: 1rem;
  background: #fff;
  border-radius: var(--radius);
  margin: .5rem 0;
}
.qr-info { text-align: center; margin: .25rem 0; }
#qr-scanner {
  width: 100%;
  max-height: 240px;
  background: #000;
  border-radius: var(--radius);
  object-fit: cover;
}
.import-actions { display: flex; gap: .5rem; }

/* ── Identity transfer ──────────────────────────────────────────────── */
.import-preview {
  flex-direction: column;
  gap: .4rem;
  padding: .75rem;
  background: var(--bg2);
  border-radius: var(--radius);
}
.import-ok { color: var(--green); font-weight: 600; font-size: .9rem; }
.import-err { color: var(--red); font-weight: 600; font-size: .9rem; }
.import-warn { color: var(--gold-dim); font-style: italic; }
.danger-card { border-color: rgba(240,64,96,.2); }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 420px) {
  .expansion-inputs { gap: .4rem; }
  .word-input { width: 80px; }
  .lobby-cta { flex-direction: column; }
}
