/* ════════════════════════════════════════
   VARIABLES – dark minimal palette
════════════════════════════════════════ */
:root {
  --bg:           #171717;
  --bg-card:      #242424;
  --bg-input:     #2e2e2e;
  --bg-hover:     #333333;
  --border:       rgba(255,255,255,0.10);
  --border-focus: rgba(255,255,255,0.28);
  --text:         #e8e8e8;
  --text-muted:   rgba(232,232,232,0.55);
  --text-dim:     rgba(232,232,232,0.28);
  --error:        #f87171;

  --radius-sm: 6px;
  --radius:    8px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

/* ════════════════════════════════════════
   RESET / BASE
════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* Ambient glow — subtle radial light in the upper centre */
body::before {
  content: '';
  position: fixed;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  height: 55%;
  background: radial-gradient(ellipse at center, rgba(99,102,241,0.07) 0%, transparent 68%);
  pointer-events: none;
  z-index: 0;
}
.screen { position: relative; z-index: 1; }

h1, h2, h3 { color: var(--text); }
h2 { font-size: 1.05rem; font-weight: 700; margin-bottom: 1rem; letter-spacing: 0.01em; }
h3 {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

/* ════════════════════════════════════════
   SCREENS
════════════════════════════════════════ */
.screen { display: none; min-height: 100vh; }

.screen.active              { display: flex; align-items: center; justify-content: center; padding: 2rem; }
#screen-lobby.active        { display: block; padding: 2rem; }
#screen-game.active         { display: flex; flex-direction: column; padding: 0; align-items: stretch; justify-content: flex-start; }
#screen-results.active      { display: flex; align-items: center; justify-content: center; padding: 2rem; }
#screen-public-rooms.active { display: flex; align-items: center; justify-content: center; padding: 2rem; }

/* ════════════════════════════════════════
   CARD
════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

/* ════════════════════════════════════════
   BUTTONS
════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
  border: none;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s cubic-bezier(0.4,0,0.2,1),
              opacity 0.15s,
              transform 0.12s cubic-bezier(0.4,0,0.2,1),
              box-shadow 0.15s cubic-bezier(0.4,0,0.2,1);
  white-space: nowrap;
}
.btn:disabled { opacity: 0.38; cursor: not-allowed; transform: none !important; }
.btn:hover:not(:disabled)  { transform: scale(1.02); }
.btn:active:not(:disabled) { transform: scale(0.98) translateY(1px); }

.btn-primary { background: #e8e8e8; color: #111111; }
.btn-primary:hover:not(:disabled) {
  background: #ffffff;
  box-shadow: 0 2px 14px rgba(232,232,232,0.18);
}

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-outline:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text);
  border-color: var(--border-focus);
}
.btn-outline.active {
  background: rgba(255,255,255,0.16);
  color: #ffffff;
  border-color: rgba(255,255,255,0.55);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10);
}

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

.btn-large { padding: 0.75rem 2rem; font-size: 0.95rem; width: 100%; margin-top: 0.5rem; }
.btn-sm    { padding: 0.3rem 0.65rem; font-size: 0.78rem; }
.btn-full  { width: 100%; margin-top: 0.5rem; }

.btn-group { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* ════════════════════════════════════════
   INPUTS
════════════════════════════════════════ */
input[type="text"] {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.9rem;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  width: 100%;
  outline: none;
  transition: border-color 0.25s cubic-bezier(0.4,0,0.2,1),
              box-shadow 0.25s cubic-bezier(0.4,0,0.2,1);
}
input[type="text"]::placeholder { color: var(--text-dim); }
input[type="text"]:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.06);
}
input[type="text"].error {
  border-color: var(--error);
  animation: shake 0.3s ease;
}

/* ════════════════════════════════════════
   JOIN SCREEN
════════════════════════════════════════ */
.join-card {
  max-width: 420px;
  width: 100%;
  text-align: center;
  padding: 2.5rem 2rem;
}

.title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.35rem;
  letter-spacing: -0.03em;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 2rem;
}

.field-group { text-align: left; margin-bottom: 0.75rem; }
.field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  text-align: left;
  user-select: none;
}
.toggle-row input[type="checkbox"] {
  width: auto;
  accent-color: #e8e8e8;
  flex-shrink: 0;
}

.join-actions { display: flex; gap: 0.6rem; margin-top: 1rem; }
.join-actions .btn { flex: 1; }

.join-hint {
  margin-top: 1.25rem;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.join-error {
  color: var(--error);
  font-size: 0.82rem;
  min-height: 1.2rem;
  margin-top: 0.5rem;
  text-align: center;
}

/* ════════════════════════════════════════
   PUBLIC ROOMS SCREEN
════════════════════════════════════════ */
.public-rooms-card { max-width: 520px; width: 100%; }

.public-rooms-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.public-rooms-header h2 { margin-bottom: 0; }

.public-rooms-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
  max-height: 360px;
  overflow-y: auto;
}

.public-room-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border);
  gap: 1rem;
}
.pr-info { display: flex; flex-direction: column; gap: 0.12rem; min-width: 0; }
.pr-host { font-weight: 600; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-meta { font-size: 0.74rem; color: var(--text-muted); }

/* ════════════════════════════════════════
   LOBBY SCREEN
════════════════════════════════════════ */
.lobby-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  max-width: 860px;
  margin: 0 auto;
}

.lobby-col { display: flex; flex-direction: column; }

/* Room code banner */
.room-code-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.2rem;
}
.room-code-left { display: flex; flex-direction: column; gap: 0.1rem; }
.room-code-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.room-code-value {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--text);
}

.room-code-badge {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.18rem 0.5rem;
  background: var(--bg-input);
}

/* Player list */
.player-list { display: flex; flex-direction: column; gap: 0.4rem; }

.player-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius);
  background: var(--bg-input);
  border: 1px solid transparent;
  transition: border-color 0.12s;
}
.player-item.me { border-color: rgba(255,255,255,0.25); }
.player-name  { font-weight: 600; font-size: 0.92rem; }
.player-stats { font-size: 0.75rem; color: var(--text-muted); }

/* Settings card */
.settings-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.settings-card-header h2 { margin-bottom: 0; }

.settings-host-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-style: italic;
}

/* Host-only lock: non-hosts see controls but can't interact */
/* Belt-and-suspenders: pointer-events disabled on the container AND each element */
.settings-card.locked .setting-group,
.settings-card.locked .btn-start-wrap {
  position: relative;
}
.settings-card.locked .btn-group,
.settings-card.locked .toggle-row {
  pointer-events: none;
}
.settings-card.locked .btn-group .btn,
.settings-card.locked .toggle-row input[type="checkbox"] {
  pointer-events: none;
  opacity: 0.38;
}
.settings-card.locked .setting-group > label {
  opacity: 0.55;
}
/* Read-only notice strip */
.settings-readonly-notice {
  display: none;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.45rem 0.85rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 1rem;
}
.settings-card.locked .settings-readonly-notice {
  display: block;
}

.setting-group { margin-bottom: 1.2rem; }
.setting-group > label {
  display: block;
  font-size: 0.70rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
  font-weight: 600;
}
.setting-desc {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.35rem;
}

/* Toggles sub-group */
.setting-toggles { display: flex; flex-direction: column; gap: 0.1rem; }
.setting-toggles > label { margin-bottom: 0.3rem; }

.lobby-status {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  min-height: 1.2rem;
  margin-bottom: 0.25rem;
}

/* ════════════════════════════════════════
   GAME HEADER
════════════════════════════════════════ */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 2rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}

.game-info { display: flex; align-items: center; gap: 0.75rem; }
.round-label { color: var(--text-muted); font-size: 0.88rem; }

.difficulty-badge {
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  border: 1px solid var(--border);
}

/* Right side of header — "End Round" button + timer */
.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.timer {
  font-size: 1.9rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  min-width: 75px;
  text-align: center;
  color: var(--text);
  transition: color 0.2s;
}
.timer.warning { color: var(--error); animation: pulse 0.6s infinite; }
.timer.no-limit { color: var(--text-dim); font-size: 1.5rem; }

/* ════════════════════════════════════════
   GAME LAYOUT
   Live feed: large central element in game-main.
   Your Guesses + Standings: right sidebar (game-side).
════════════════════════════════════════ */
.game-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 1.1rem;
  padding: 1.1rem 1.5rem 1.5rem;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  flex: 1;           /* fills remaining height inside the flex game screen */
  align-items: start;
}

.game-main {
  display: flex;
  flex-direction: column;
}

.game-side {
  display: flex;
  flex-direction: column;
}

/* Target word */
.target-card { text-align: center; }
.target-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.word-display {
  display: flex;
  gap: 0.45rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 0.55rem;
  min-height: 2.6rem;
}

.blank {
  width: 1.8rem;
  height: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 2px solid rgba(255,255,255,0.20);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-dim);
  transition: border-color 0.2s, color 0.2s;
}
.blank.revealed {
  color: var(--text);
  border-bottom-color: rgba(255,255,255,0.55);
}

.hint-display {
  font-size: 0.83rem;
  color: var(--text-muted);
  min-height: 1.4rem;
  font-weight: 600;
}

/* Language warning in settings */
.lang-warning {
  margin-top: 0.45rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.74rem;
  color: var(--text-muted);
  background: rgba(251, 191, 36, 0.06);
  border-left: 2px solid rgba(251, 191, 36, 0.35);
  border-radius: var(--radius-sm);
  line-height: 1.4;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.lang-warning.visible { opacity: 1; }

/* Debug answer display */
.answer-display {
  margin-top: 0.6rem;
  padding: 0.4rem 0.9rem;
  background: rgba(248, 113, 113, 0.07);
  border: 1px dashed rgba(248, 113, 113, 0.45);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.answer-display-label { margin-right: 0.3rem; }
.answer-display-word {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f87171;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Guess input */
.guess-input-card { padding: 1rem 1.2rem; }
.input-row { display: flex; gap: 0.5rem; }
.input-row input { flex: 1; }

.best-row {
  margin-top: 0.55rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.best-label { color: var(--text-muted); }
.best-score-value { font-weight: 700; font-size: 0.82rem; }

/* Correct indicator — shown in infinite mode after an exact guess */
.correct-indicator {
  margin-top: 0.6rem;
  padding: 0.5rem 0.85rem;
  background: rgba(34, 197, 94, 0.10);
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-radius: var(--radius);
  color: #22c55e;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
}

/* ════════════════════════════════════════
   LIVE FEED  (large central panel)
════════════════════════════════════════ */

/* Feed card fills remaining vertical space in game-main */
.feed-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-bottom: 0; /* last item in game-main, no extra gap needed */
}

/* Header row inside the feed card */
.feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.feed-header h3 { margin-bottom: 0; }

/* Large scrollable feed */
.live-feed {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  min-height: 280px;
  max-height: 58vh;
}

/* Feed entry — card layout with progress bar below the main row */
.feed-entry {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius);
  background: var(--bg-input);
  border: 1px solid var(--border);
  font-size: 0.85rem;
}

/* Top-ranked entry (best sort, position 0) gets a subtle highlight + glow */
@keyframes feedTopGlow {
  0%,100% { box-shadow: 0 0 0 0 transparent; }
  50%      { box-shadow: 0 0 8px rgba(255,255,255,0.06); }
}
.feed-entry.feed-top {
  background: var(--bg-hover);
  border-color: rgba(255,255,255,0.18);
  animation: feedTopGlow 4s ease-in-out infinite;
}
.feed-entry.feed-bonus { border-color: rgba(34,197,94,0.30); }

/* Own guesses in the feed */
.feed-entry.feed-me {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.18);
}
.feed-me-tag {
  color: var(--text) !important;
  font-weight: 700;
}

/* Horizontal content row inside each feed entry */
.feed-main-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.feed-word   { font-weight: 700; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.feed-player { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }

/* Progress bar under each feed entry */
.feed-progress {
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}
.feed-progress-fill {
  height: 100%;
  width: 0;
  background: hsl(var(--bar-hue), 70%, 55%);
  border-radius: inherit;
  transition: width 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Feed sort toggle — same visual as .sort-btn */
.feed-sort-btn {
  padding: 0.18rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.feed-sort-btn.active {
  background: rgba(255,255,255,0.12);
  color: var(--text);
  border-color: rgba(255,255,255,0.30);
}
.feed-sort-btn:hover:not(.active) { background: var(--bg-hover); color: var(--text); }

/* ════════════════════════════════════════
   YOUR GUESSES  (right sidebar panel)
════════════════════════════════════════ */

/* Guesses header with sort toggle */
.guesses-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.guesses-header h3 { margin-bottom: 0; }

.sort-toggle { display: flex; gap: 0.25rem; }

.sort-btn {
  padding: 0.18rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.sort-btn.active {
  background: rgba(255,255,255,0.12);
  color: var(--text);
  border-color: rgba(255,255,255,0.30);
}
.sort-btn:hover:not(.active) { background: var(--bg-hover); color: var(--text); }

/* Guess list — scrollable, sized for the sidebar */
.guess-list {
  min-height: 320px;
  max-height: 420px;
  overflow-y: auto;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-right: 2px; /* prevent scrollbar overlap */
}

.guess-entry {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius);
  background: var(--bg-input);
  border: 1px solid var(--border);
  font-size: 0.88rem;
}
.guess-entry.guess-bonus { border-color: rgba(34,197,94,0.30); }

.guess-main-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.guess-word  { font-weight: 700; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Progress bar under each guess */
.guess-progress {
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}
.guess-progress-fill {
  height: 100%;
  width: 0;
  background: hsl(var(--bar-hue), 70%, 55%);
  border-radius: inherit;
  transition: width 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ════════════════════════════════════════
   LEADERBOARD / STANDINGS
════════════════════════════════════════ */
.leaderboard { display: flex; flex-direction: column; gap: 0.35rem; }

.lb-entry {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius);
  background: var(--bg-input);
  border: 1px solid transparent;
}
.lb-entry.me { border-color: rgba(255,255,255,0.22); }
.lb-rank  { font-size: 0.82rem; font-weight: 700; min-width: 2rem; color: var(--text-muted); }
.lb-name  { flex: 1; font-weight: 600; font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { font-weight: 700; color: var(--text-muted); font-size: 0.84rem; }

/* ════════════════════════════════════════
   RESULTS SCREEN
════════════════════════════════════════ */
.results-wrapper { width: 100%; max-width: 560px; }
.results-card { text-align: center; }
.results-card h2 { font-size: 1.5rem; margin-bottom: 1rem; }

.target-reveal {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}
.result-word {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  margin-top: 0.2rem;
  letter-spacing: -0.02em;
}

.skip-round-banner {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 8px;
  color: #f87171;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.6rem 1rem;
  text-align: center;
  margin-bottom: 1rem;
}

.result-rankings { display: flex; flex-direction: column; gap: 0.45rem; margin-bottom: 1.5rem; }

.result-entry {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border);
  text-align: left;
}
.result-entry.me { border-color: rgba(255,255,255,0.22); }
.result-rank   { font-size: 0.9rem; font-weight: 700; min-width: 2.6rem; color: var(--text-muted); }
.result-name   { flex: 1; font-weight: 600; }
.result-score  { font-weight: 700; color: var(--text-muted); }
.result-points { font-size: 0.78rem; color: var(--text-muted); min-width: 4rem; text-align: right; }

/* Host note + two action buttons */
.results-host-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 1rem;
  margin-bottom: 0.1rem;
  min-height: 1.2rem;
}

.results-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.4rem;
}
.results-actions .btn { flex: 1; margin-top: 0; }

/* ════════════════════════════════════════
   SCORE BADGE PILLS
════════════════════════════════════════ */
.score-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.4;
  flex-shrink: 0;
}

.score-exact    { background: rgba(34, 197, 94, 0.12);  color: #22c55e; border: 1px solid rgba(34, 197, 94, 0.25); }
.score-blazing  { background: rgba(239, 68, 68, 0.12);  color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.25); }
.score-hot      { background: rgba(249, 115, 22, 0.12); color: #f97316; border: 1px solid rgba(249, 115, 22, 0.25); }
.score-warm     { background: rgba(234, 179, 8, 0.12);  color: #eab308; border: 1px solid rgba(234, 179, 8, 0.25); }
.score-cool     { background: rgba(59, 130, 246, 0.12); color: #3b82f6; border: 1px solid rgba(59, 130, 246, 0.25); }
.score-cold     { background: rgba(99, 102, 241, 0.12); color: #6366f1; border: 1px solid rgba(99, 102, 241, 0.25); }
.score-freezing { background: rgba(107, 114, 128, 0.12); color: #6b7280; border: 1px solid rgba(107, 114, 128, 0.25); }

/* Bonus tag */
.bonus-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.25);
  white-space: nowrap;
  flex-shrink: 0;
}


/* ════════════════════════════════════════
   NOTIFICATION TOAST
════════════════════════════════════════ */
.notification {
  position: fixed;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(-120px);
  background: var(--bg-card);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-md);
  padding: 0.6rem 1.4rem;
  font-size: 0.85rem;
  color: var(--text);
  z-index: 1000;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  max-width: 340px;
  text-align: center;
}
.notification.show { transform: translateX(-50%) translateY(0); }

/* ════════════════════════════════════════
   EMPTY STATE
════════════════════════════════════════ */
.empty-state {
  color: var(--text-dim);
  font-size: 0.82rem;
  font-style: italic;
  text-align: center;
  padding: 0.5rem 0;
}

/* ════════════════════════════════════════
   LEVEL BADGE
════════════════════════════════════════ */
.level-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.42rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(250,204,21,0.14);
  color: #facc15;
  border: 1px solid rgba(250,204,21,0.28);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.03em;
}

@keyframes levelGlow {
  0%,100% { box-shadow: 0 0 4px rgba(250,204,21,0.2); }
  50%      { box-shadow: 0 0 12px rgba(250,204,21,0.6), 0 0 24px rgba(250,204,21,0.3); }
}
.level-badge.glow { animation: levelGlow 1s ease-in-out 3; }

/* ════════════════════════════════════════
   LEVEL-UP TOAST
════════════════════════════════════════ */
.levelup-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(250,204,21,0.15);
  border: 1px solid rgba(250,204,21,0.4);
  color: #facc15;
  padding: 0.65rem 1.6rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 700;
  z-index: 1001;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s;
  opacity: 0;
  pointer-events: none;
  text-align: center;
}
.levelup-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ════════════════════════════════════════
   LEVEL DISPLAY IN LOBBY
════════════════════════════════════════ */
.level-display-card { padding: 1rem 1.5rem; }
.level-display { text-align: center; }
.level-display-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  font-weight: 600;
}
.level-display-number {
  font-size: 1.6rem;
  font-weight: 800;
  color: #facc15;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.level-progress-bar {
  height: 6px;
  background: rgba(250,204,21,0.12);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}
.level-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #facc15, #fbbf24);
  border-radius: inherit;
  transition: width 0.4s ease;
}
.level-display-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ════════════════════════════════════════
   ANIMATIONS
════════════════════════════════════════ */
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-6px); }
  40%,80% { transform: translateX(6px); }
}

@keyframes pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* Guess entries: slide in from right */
@keyframes slideIn {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Feed entries: slide in from left */
@keyframes slideFeedIn {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Result entries: fade + rise */
@keyframes resultEntryIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes flashReveal {
  0%   { background: rgba(250,204,21,0.45); color: #facc15; border-bottom-color: #facc15; }
  100% { background: transparent; color: var(--text); border-bottom-color: rgba(255,255,255,0.55); }
}
.blank.flash-reveal { animation: flashReveal 0.7s ease-out; }

/* Screen transitions */
@keyframes screenFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes screenSlideUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes screenResultsIn {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.screen.active          { animation: screenFadeIn   0.25s cubic-bezier(0.4,0,0.2,1); }
#screen-game.active     { animation: screenSlideUp  0.3s  cubic-bezier(0.4,0,0.2,1); }
#screen-results.active  { animation: screenResultsIn 0.32s cubic-bezier(0.4,0,0.2,1); }

.animate-in      { animation: slideIn     0.2s  cubic-bezier(0.4,0,0.2,1); }
.animate-in-feed { animation: slideFeedIn 0.2s  cubic-bezier(0.4,0,0.2,1); }

/* Result entries with stagger via inline animation-delay */
.result-entry {
  animation: resultEntryIn 0.28s cubic-bezier(0.4,0,0.2,1) both;
}

/* Ambient background glow breathing */
@keyframes bgBreathe {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.55; }
}
body::before { animation: bgBreathe 9s ease-in-out infinite; }

/* ════════════════════════════════════════
   PLAYER COUNT — JOIN SCREEN
════════════════════════════════════════ */
.player-count-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-bottom: 1.1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.player-count-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  animation: dotPulse 2.2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%,100% { opacity: 1;   transform: scale(1);   box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
  50%      { opacity: 0.6; transform: scale(0.85); box-shadow: 0 0 0 4px rgba(34,197,94,0); }
}

/* ════════════════════════════════════════
   PROFILE PANEL
════════════════════════════════════════ */
.profile-panel {
  padding: 1rem 1.2rem;
  margin-top: -0.5rem;
}

.profile-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.profile-panel-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
}

.profile-name-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.profile-name-wrap input {
  padding-right: 3rem;
}

.profile-name-counter {
  position: absolute;
  right: 0.7rem;
  font-size: 0.72rem;
  color: var(--text-dim);
  pointer-events: none;
  white-space: nowrap;
}

.profile-color-section { margin-bottom: 0.85rem; }

.color-swatches {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s;
  flex-shrink: 0;
  padding: 0;
}

.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected {
  border-color: rgba(255,255,255,0.75);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.18);
  transform: scale(1.1);
}

.profile-error {
  color: var(--error);
  font-size: 0.78rem;
  min-height: 1rem;
  margin-bottom: 0.4rem;
}

/* ════════════════════════════════════════
   SKIP VOTE
════════════════════════════════════════ */
.skip-vote-card {
  padding: 0.65rem 1rem;
  /* uses default .card margin-bottom: 1rem for spacing from live feed */
}

.skip-vote-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}

.skip-vote-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.skip-vote-bar {
  height: 5px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}

.skip-vote-fill {
  height: 100%;
  width: 0;
  background: #6b7280;
  border-radius: inherit;
  transition: width 0.35s cubic-bezier(0.4,0,0.2,1), background-color 0.3s ease;
}

.skip-vote-fill.amber { background: #f59e0b; }
.skip-vote-fill.green { background: #22c55e; }

@keyframes skipVoteReached {
  0%,100% { opacity: 1; }
  25%,75%  { opacity: 0.55; box-shadow: 0 0 8px rgba(34,197,94,0.7); }
}
.skip-vote-fill.pulse { animation: skipVoteReached 0.55s ease-out; }

@keyframes barRipple {
  0%   { opacity: 1; }
  50%  { opacity: 0.55; }
  100% { opacity: 1; }
}
.skip-vote-fill.ripple { animation: barRipple 0.3s ease-out; }

/* ════════════════════════════════════════
   LANGUAGE SELECTOR (join screen)
════════════════════════════════════════ */
.lang-selector {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.lang-flag-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1.3rem;
  line-height: 1;
  padding: 0.2rem 0.45rem;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
  opacity: 0.55;
}

.lang-flag-btn:hover  { opacity: 0.9; transform: scale(1.08); }
.lang-flag-btn.active { border-color: var(--accent); opacity: 1; }

/* ════════════════════════════════════════
   GAME LANGUAGE BUTTONS (settings panel)
════════════════════════════════════════ */
/* The .lang-btn class shares .btn .btn-outline — just needs wrap */
.setting-group .btn-group .lang-btn {
  font-size: 0.78rem;
  padding: 0.28rem 0.6rem;
}

/* ════════════════════════════════════════
   PUBLIC ROOMS — sort / filter controls
════════════════════════════════════════ */
.rooms-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.rooms-control-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.rooms-control-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 4rem;
}

/* Status badges on room entries */
.pr-status {
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: 99px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.pr-status.waiting { background: rgba(99,102,241,0.15); color: #818cf8; }
.pr-status.playing { background: rgba(34,197,94,0.15);  color: #4ade80; }

/* ════════════════════════════════════════
   TUTORIAL SCREEN
════════════════════════════════════════ */
.tutorial-card {
  max-width: 520px;
  width: 100%;
  padding: 1.5rem;
}

.tutorial-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.tutorial-header h2 { margin-bottom: 0; font-size: 1.2rem; }

.tutorial-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.25rem;
  max-height: 66vh;
  overflow-y: auto;
  padding-right: 4px;
}

.tutorial-section {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.tutorial-step-num {
  flex-shrink: 0;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.tutorial-step-content h3 {
  font-size: 0.78rem;
  margin-bottom: 0.3rem;
  color: var(--text);
}
.tutorial-step-content p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.tutorial-example {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}

.tutorial-example-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.65rem;
}

.tutorial-example-rows {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.tutorial-ex-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.tutorial-ex-word {
  font-weight: 700;
  font-size: 0.9rem;
}

/* ════════════════════════════════════════
   DISPLAY MODE TOGGLE
════════════════════════════════════════ */
.mode-toggle {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.mode-toggle-btn {
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.3rem 0.8rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.mode-toggle-btn.active {
  border-color: rgba(255,255,255,0.45);
  color: var(--text);
  background: rgba(255,255,255,0.08);
}
.mode-toggle-btn:hover:not(.active) {
  background: var(--bg-hover);
  color: var(--text);
}

/* ════════════════════════════════════════
   PHONE MODE
════════════════════════════════════════ */

/* === Join screen === */
body.phone-mode #screen-join.active {
  padding: 1rem;
  align-items: flex-start;
  padding-top: 1.5rem;
}
body.phone-mode .join-card {
  padding: 1.25rem 1rem;
  max-width: 100%;
}
body.phone-mode .title { font-size: 1.8rem; }
body.phone-mode .subtitle { font-size: 0.8rem; margin-bottom: 1.25rem; }
body.phone-mode .btn { font-size: 0.84rem; padding: 0.5rem 0.9rem; }
body.phone-mode .btn-large { font-size: 0.9rem; padding: 0.65rem 1.25rem; }

/* === Lobby === */
body.phone-mode #screen-lobby.active { padding: 0.75rem; }
body.phone-mode .lobby-layout {
  grid-template-columns: 1fr;
  max-width: 100%;
  gap: 0.75rem;
}
body.phone-mode .card { padding: 1rem; margin-bottom: 0.65rem; }
body.phone-mode .room-code-value { font-size: 1.2rem; }

/* === GAME SCREEN — phone mode ===
   Layout: header → [target pill] → [live feed, scrollable] → [skip vote] → [guess input]
   The guess input stays at the bottom even when the virtual keyboard opens
   because the entire game area is a flex column with height:100dvh and the
   feed uses flex:1/overflow-y:auto.                                          */
body.phone-mode #screen-game.active {
  display: flex;
  flex-direction: column;
  height: 100dvh;       /* dynamic viewport height — shrinks when keyboard opens */
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

body.phone-mode .game-header {
  padding: 0.45rem 0.75rem;
  flex-shrink: 0;
}
body.phone-mode .game-header .timer { font-size: 1.25rem; min-width: 55px; }
body.phone-mode .game-info .round-label { font-size: 0.78rem; }
body.phone-mode .game-info .room-code-badge { display: none; }
body.phone-mode .game-info .difficulty-badge { display: none; }

/* Single flex column, no grid */
body.phone-mode .game-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  gap: 0;
  max-width: 100%;
}

body.phone-mode .game-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Hide the "Your Guesses" sidebar — feed already shows all guesses */
body.phone-mode .game-side { display: none; }

/* Target word — compact pill at top */
body.phone-mode .target-card {
  padding: 0.45rem 0.75rem;
  margin: 0.45rem 0.6rem 0;
  flex-shrink: 0;
  text-align: center;
}
body.phone-mode .target-label { font-size: 0.58rem; margin-bottom: 0.2rem; }
body.phone-mode .word-display  { min-height: 1.6rem; gap: 0.25rem; margin-bottom: 0.15rem; }
body.phone-mode .blank         { width: 1.25rem; height: 1.6rem; font-size: 0.85rem; }
body.phone-mode .hint-display  { font-size: 0.75rem; min-height: 1.1rem; }

/* Skip vote — single compact line */
body.phone-mode .skip-vote-card {
  padding: 0.3rem 0.75rem;
  margin: 0 0.6rem 0;
  flex-shrink: 0;
}
body.phone-mode .skip-vote-row  { margin-bottom: 0.2rem; }
body.phone-mode .skip-vote-label { font-size: 0.68rem; }
body.phone-mode .skip-vote-bar  { height: 3px; }

/* Live feed — fills the available height, scrollable */
body.phone-mode .feed-card {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  margin: 0.45rem 0.6rem 0;
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
}
body.phone-mode .live-feed {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}
body.phone-mode .feed-entry  { padding: 0.3rem 0.55rem; font-size: 0.76rem; gap: 0.2rem; }
body.phone-mode .feed-progress { height: 2px; }
body.phone-mode .score-badge { font-size: 0.68rem; padding: 0.12rem 0.4rem; }

/* Guess input — always last in the flex column, never scrolled away */
body.phone-mode .guess-input-card {
  flex-shrink: 0;
  margin: 0.45rem 0.6rem 0.6rem;
  padding: 0.6rem 0.75rem;
}
body.phone-mode .input-row input { font-size: 0.88rem; padding: 0.55rem 0.75rem; }
body.phone-mode .best-row        { font-size: 0.72rem; margin-top: 0.35rem; }
body.phone-mode .correct-indicator { font-size: 0.75rem; padding: 0.35rem 0.6rem; }

/* ════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════ */
@media (max-width: 720px) {
  .lobby-layout { grid-template-columns: 1fr; }

  /* Stack game panels vertically: live feed on top, guesses below */
  .game-layout {
    grid-template-columns: 1fr;
    padding: 0.9rem;
  }

  /* On narrow screens show the side panel stacked below (natural order) */
  .game-side { display: flex; }

  .game-header { padding: 0.7rem 1rem; }

  /* Live feed height reduced slightly on small screens */
  .live-feed { max-height: 45vh; min-height: 220px; }
}

/* ════════════════════════════════════════
   LEAVE BUTTON (game header)
════════════════════════════════════════ */
.btn-leave {
  color: var(--text-dim);
  border-color: transparent;
  background: transparent;
  font-size: 1rem;
  padding: 0.25rem 0.5rem;
  opacity: 0.6;
  transition: opacity 0.15s, color 0.15s;
}
.btn-leave:hover:not(:disabled) {
  opacity: 1;
  color: var(--text-muted);
  background: var(--bg-hover);
  transform: none;
}

/* ════════════════════════════════════════
   CONFIRMATION MODAL
════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: screenFadeIn 0.15s ease;
}
.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  max-width: 320px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}
.modal-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.modal-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.45;
}
.modal-actions {
  display: flex;
  gap: 0.6rem;
}
.modal-actions .btn { flex: 1; }

/* ════════════════════════════════════════
   HOME PROFILE PANEL (join screen)
════════════════════════════════════════ */
.home-profile-toggle {
  margin-bottom: 0.75rem;
  width: 100%;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.home-profile-panel {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
  text-align: left;
  animation: screenFadeIn 0.2s ease;
}

.home-level-display {
  margin-bottom: 0.9rem;
}

/* ════════════════════════════════════════
   ACCOUNT SECTION
════════════════════════════════════════ */
.account-section {
  margin-top: 0.75rem;
}

.account-divider {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.75rem 0;
}
.account-divider::before,
.account-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.account-divider span {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  white-space: nowrap;
}

.account-prompt {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 0.65rem;
  line-height: 1.4;
}

.account-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.account-tab-btn {
  flex: 1;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.account-tab-btn.active {
  background: rgba(255,255,255,0.12);
  color: var(--text);
  border-color: rgba(255,255,255,0.3);
}

.account-tab-panel { }
.account-tab-panel .field-group { margin-bottom: 0.5rem; }
.account-tab-panel input[type="password"] {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.55rem 0.9rem;
  color: var(--text);
  font-size: 0.88rem;
  font-family: inherit;
  width: 100%;
  outline: none;
  transition: border-color 0.2s;
}
.account-tab-panel input[type="password"]:focus {
  border-color: var(--border-focus);
}

.account-loggedin-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.account-badge {
  font-size: 0.75rem;
  color: #22c55e;
  flex-shrink: 0;
}

.account-username {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.account-save-note {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.35rem;
}
