@import url('https://fonts.googleapis.com/css2?family=Monoton&family=Orbitron:wght@400;500;600;700&family=Rajdhani:wght@400;500;600&display=swap');

:root {
  --bg: #000000;
  --fg: #f8f8f8;
  --accent: #00ffff;
  --accent-secondary: #ff00ff;
  --accent-yellow: #ffff00;
  --danger: #ff4d6d;
  --panel: rgba(0, 0, 0, 0.78);
  --panel-border: rgba(0, 255, 255, 0.35);
  --panel-glow: rgba(255, 0, 255, 0.25);
  --grid-line: rgba(0, 255, 255, 0.12);
  --border: rgba(0, 255, 255, 0.22);
  --transition: all 0.2s ease;
  --nav-height: 78px;
  --font-display: 'Orbitron', 'Segoe UI', sans-serif;
  --font-body: 'Rajdhani', 'Segoe UI', sans-serif;
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  font-family: var(--font-body);
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: var(--bg);
  color: var(--fg);
  overflow-x: hidden;
  padding-top: clamp(1.25rem, 5vh, 3rem);
  padding-bottom: calc(var(--nav-height) + var(--safe-area-bottom));
  position: relative;
  font-weight: 500;
  letter-spacing: 0.01em;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(18, 18, 36, 0.85), rgba(2, 2, 12, 0.98)),
    radial-gradient(circle at 20% 10%, rgba(0, 255, 255, 0.27), transparent 60%),
    radial-gradient(circle at 80% 25%, rgba(255, 0, 255, 0.32), transparent 65%),
    radial-gradient(circle at 30% 90%, rgba(0, 128, 255, 0.25), transparent 60%);
  background-size: 100% 200%, 150% 240%, 160% 240%, 150% 260%;
  background-position: 50% 0%, 45% 10%, 55% 70%, 50% 100%;
  animation: auroraVertical 28s ease-in-out infinite alternate, auroraGlow 14s ease-in-out infinite;
  opacity: 0.94;
  mix-blend-mode: screen;
  will-change: background-position, opacity;
  z-index: -2;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent 0 26px, var(--grid-line) 26px 30px),
    repeating-linear-gradient(90deg, transparent 0 26px, rgba(255, 0, 255, 0.13) 26px 30px),
    linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.3));
  background-size: 100% 60px, 60px 100%, 100% 100%;
  background-position: 0 0, 0 0, 0 0;
  opacity: 0.45;
  animation: gridDrift 22s linear infinite, gridPulse 12s ease-in-out infinite;
  mix-blend-mode: screen;
  z-index: -1;
  pointer-events: none;
}

@keyframes auroraVertical {
  0% {
    background-position: 50% 0%, 45% 10%, 55% 70%, 50% 100%;
  }
  50% {
    background-position: 50% 60%, 45% 45%, 55% 40%, 50% 60%;
  }
  100% {
    background-position: 50% 120%, 45% 85%, 55% 15%, 50% 10%;
  }
}

@keyframes auroraGlow {
  0%, 100% {
    opacity: 0.9;
  }
  40% {
    opacity: 1;
  }
  70% {
    opacity: 0.96;
  }
}

@keyframes gridDrift {
  0% {
    background-position: 0 0, 0 0, 0 0;
  }
  50% {
    background-position: 0 24px, 24px 0, 0 0;
  }
  100% {
    background-position: 0 48px, 48px 0, 0 0;
  }
}

@keyframes gridPulse {
  0%, 100% {
    opacity: 0.38;
  }
  50% {
    opacity: 0.55;
  }
}

body.has-bottom-nav {
  padding-bottom: calc(var(--nav-height) + var(--safe-area-bottom) + 1.5rem);
}

body:not(.has-bottom-nav) {
  justify-content: center;
  padding-top: 0;
}

main {
  width: min(960px, 94vw);
  background: var(--panel);
  border: 2px solid var(--panel-border);
  border-radius: 20px;
  padding: clamp(2.25rem, 5vw, 3rem) clamp(1.4rem, 4vw, 3rem);
  backdrop-filter: blur(22px);
  box-shadow: 0 0 0 2px rgba(255, 0, 255, 0.18), 0 0 48px var(--panel-glow);
  animation: fadeIn 0.6s ease;
  margin: 0 auto 3rem;
  position: relative;
  overflow: hidden;
}

body:not(.has-bottom-nav) main {
  margin-bottom: 0;
}

h1, h2, h3 {
  margin-top: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-display);
}

h1 {
  margin-bottom: 1.75rem;
}

h2 {
  margin-bottom: 1.2rem;
}

h3 {
  margin-bottom: 0.95rem;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button, .btn {
  appearance: none;
  border: 2px solid var(--accent-secondary);
  background: rgba(0, 0, 0, 0.65);
  color: var(--fg);
  border-radius: 12px;
  padding: 0.85rem 1.6rem;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-align: center;
  text-transform: uppercase;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.05), inset 0 0 12px rgba(0, 255, 255, 0.15);
}

button:hover,
.btn:hover {
  background: rgba(0, 255, 255, 0.12);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.45);
}

button:focus-visible,
.btn:focus-visible {
  outline: 3px solid var(--accent-yellow);
  outline-offset: 2px;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

button.is-active,
.btn.is-active {
  border-color: var(--accent);
  background: rgba(0, 255, 255, 0.18);
  box-shadow: 0 0 16px rgba(0, 255, 255, 0.3);
}

.answers {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: minmax(92px, auto);
  gap: 0.95rem;
  align-content: stretch;
}

.answers button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.85rem;
  min-height: clamp(92px, 18vh, 140px);
  padding: 1.15rem 1.2rem;
  font-size: clamp(0.95rem, 2.1vw, 1.05rem);
  line-height: 1.3;
  text-align: left;
  opacity: 0;
  transform: translateY(12px);
  animation: answerReveal 0.45s ease forwards;
}

.answers button:nth-child(2) {
  animation-delay: 0.05s;
}

.answers button:nth-child(3) {
  animation-delay: 0.1s;
}

.answers button:nth-child(4) {
  animation-delay: 0.15s;
}

@keyframes answerReveal {
  0% {
    opacity: 0;
    transform: translateY(14px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.btn--ghost {
  background: rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.28);
}

.btn--ghost:hover,
.btn--ghost:focus {
  background: rgba(255, 0, 255, 0.14);
  border-color: var(--accent-secondary);
}

.btn--danger {
  background: rgba(255, 77, 109, 0.24);
  border-color: rgba(255, 77, 109, 0.45);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(255, 77, 109, 0.28);
}

.btn--danger:hover,
.btn--danger:focus-visible {
  background: rgba(255, 77, 109, 0.36);
  border-color: rgba(255, 110, 140, 0.7);
  color: #ffffff;
}

.btn--block {
  width: 100%;
  justify-content: center;
}

body[data-page='game'] main {
  width: min(840px, calc(100vw - 2rem));
  padding: clamp(1.8rem, 4vw, 2.4rem) clamp(1.2rem, 4vw, 2rem);
  gap: clamp(0.75rem, 1.6vw, 1.2rem);
  min-height: calc(100vh - clamp(1.25rem, 5vh, 3rem) - var(--nav-height) - var(--safe-area-bottom));
  display: flex;
  flex-direction: column;
}

body[data-page='game'] .game-question {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
}

body[data-page='game'] #question-text {
  word-break: break-word;
}

body[data-page='game'] .answers {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: minmax(96px, auto);
  gap: clamp(0.65rem, 1.8vw, 1rem);
  min-height: 0;
}

body[data-page='game'] .answers button {
  height: 100%;
  align-items: center;
  padding: clamp(0.95rem, 2.4vw, 1.25rem) clamp(1rem, 2.6vw, 1.4rem);
}

.game-results-screen {
  display: none;
  width: 100%;
}

.game-results-screen:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: clamp(1.2rem, 2vw, 1.6rem);
  padding: clamp(1.6rem, 4vw, 2.4rem);
  border-radius: 18px;
  border: 1px solid rgba(0, 255, 255, 0.18);
  background: linear-gradient(165deg, rgba(8, 16, 26, 0.92), rgba(3, 6, 14, 0.88));
  box-shadow:
    0 28px 48px rgba(0, 0, 0, 0.55),
    0 0 36px rgba(0, 255, 255, 0.12);
}

body[data-page='game'].game-postgame main {
  height: auto;
  max-height: none;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2vw, 1.6rem);
}

body[data-page='game'].game-postgame .game-results-screen {
  flex: 1 1 auto;
}

.game-results-screen__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-align: center;
}

.game-results-screen__header h2 {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 1.6rem);
}

.game-results-screen__headline {
  margin: 0;
  font-size: clamp(0.95rem, 2.2vw, 1.1rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(0, 255, 255, 0.9);
}

.game-results-screen__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1rem, 2.5vw, 1.6rem);
}

@media (min-width: 768px) {
  .game-results-screen__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.game-results-screen__panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: clamp(1rem, 2.6vw, 1.5rem);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(0, 255, 255, 0.06);
}

.game-results-screen__panel h3 {
  margin: 0;
  font-size: 0.92rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

.game-results-screen__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

#final-score-list .final-score-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
}

#final-score-list .final-score-rank {
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 1.6rem;
  text-align: right;
  color: rgba(255, 255, 255, 0.62);
}

#final-score-list .final-score-name {
  font-size: 0.84rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
}

#question-summary-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

#question-summary-list li {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

#question-summary-list li span {
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  display: block;
  word-break: break-word;
}

#question-summary-list li .question-summary__question {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.9);
  text-transform: none;
}

#question-summary-list li .question-summary__answer {
  color: rgba(0, 255, 255, 0.8);
}

#question-summary-list li .question-summary__result {
  font-weight: 700;
}

#final-score-list .final-score-points {
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: rgba(0, 255, 255, 0.9);
}

#question-summary-list li.is-correct {
  border-color: rgba(60, 255, 155, 0.35);
  background: rgba(60, 255, 155, 0.08);
}

#question-summary-list li.is-wrong {
  border-color: rgba(255, 77, 109, 0.28);
  background: rgba(255, 77, 109, 0.06);
}

#question-summary-list li.is-timeout {
  border-color: rgba(255, 221, 87, 0.28);
  background: rgba(255, 221, 87, 0.05);
}

#question-summary-list li.question-summary__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.65);
  border-style: dashed;
}

.game-header {
  display: flex;
  flex-direction: column;
  gap: clamp(0.75rem, 2vw, 1.25rem);
  align-items: stretch;
}

.game-header__primary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 4vw, 1.75rem);
  text-align: center;
}

.game-header .mode-title {
  margin: 0;
  font-size: clamp(1.05rem, 3vw, 1.25rem);
  font-weight: 700;
  letter-spacing: 0.12em;
}

.header-meta {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: center;
}

.game-header-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
}

.game-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.game-header__actions .badge:empty {
  display: none;
}

.game-score-display {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.7rem;
  color: rgba(0, 255, 255, 0.92);
  box-shadow: 0 0 14px rgba(0, 255, 255, 0.18);
}

.game-score-display__label {
  color: rgba(255, 255, 255, 0.78);
}

.game-score-display__value {
  font-weight: 700;
}

.game-question__controls {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: clamp(0.55rem, 1.8vw, 1rem);
  width: 100%;
  margin-bottom: 0.5rem;
}

.game-question__meta {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: clamp(0.35rem, 1vw, 0.6rem);
  width: 100%;
  flex: 1 1 auto;
  padding: 0.45rem clamp(0.55rem, 1.4vw, 0.85rem);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(8, 16, 26, 0.72);
  box-shadow: inset 0 0 0 1px rgba(0, 255, 255, 0.06);
}

.game-question__meta-top {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(0.35rem, 1vw, 0.6rem);
  row-gap: 0.4rem;
}

.game-question__meta .game-forfeit-btn {
  margin-left: auto;
  align-self: center;
  padding: 0.28rem 0.75rem;
}

.game-forfeit-btn {
  background: rgba(255, 77, 109, 0.18);
  border: 1px solid rgba(255, 77, 109, 0.6);
  color: #ff4d6d;
  padding: 0.3rem 0.85rem;
  font-size: 0.68rem;
  border-radius: 18px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 0 12px rgba(255, 77, 109, 0.18);
}

.game-forfeit-btn:hover,
.game-forfeit-btn:focus-visible {
  background: rgba(255, 77, 109, 0.28);
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(255, 77, 109, 0.3);
}

.game-question__timer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  width: 100%;
  max-width: 180px;
  min-width: 0;
  margin: 0 auto;
  align-self: center;
}

.game-question__timer {
  font-size: clamp(0.92rem, 2.8vw, 1.18rem);
  width: 100%;
  padding: 0.22rem 0.5rem;
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.game-question__timer-bar {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
  position: relative;
}

/* visible, glowing fill that smoothly transitions width set by JS */
.game-question__timer-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(43,255,156,0.95), rgba(255,221,87,0.95), rgba(255,77,109,0.95));
  transition: width 0.12s linear, background 0.25s ease;
  border-radius: inherit;
  will-change: width, background;
  box-shadow: 0 0 12px rgba(43, 255, 156, 0.35);
  transform-origin: left center;
}

/* Larger, more tappable answer buttons */
.answer-option {
  min-height: clamp(92px, 18vh, 140px);
  padding: 1.15rem 1.2rem;
  font-size: clamp(0.95rem, 2.1vw, 1.05rem);
  line-height: 1.3;
}

/* Keep small-screen adjustments sensible */
@media (max-width: 640px) {
  .game-question__timer-bar {
    height: 5px;
  }
  .game-question__timer-fill {
    transition: width 0.14s linear, background 0.2s ease;
    box-shadow: 0 0 10px rgba(43, 255, 156, 0.28);
  }

  .answers button,
  .answer-option {
    min-height: 84px;
    padding: 0.9rem 1.05rem;
    font-size: clamp(0.9rem, 4vw, 1rem);
  }
}

.game-question__round {
  display: flex;
  flex-direction: row;
  align-items: center;
  text-align: center;
  gap: 0.45rem;
  min-width: 0;
}

.game-question__round-label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.game-question__round-value {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.85);
}

.game-status-chip {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.85);
  gap: 0.35rem;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  align-self: flex-end;
}

.game-status-chip.is-success {
  border-color: rgba(0, 255, 170, 0.6);
  background: rgba(0, 255, 170, 0.15);
  color: rgba(0, 255, 170, 0.9);
  box-shadow: 0 0 18px rgba(0, 255, 170, 0.28);
}

.game-status-chip.is-error {
  border-color: rgba(255, 77, 109, 0.6);
  background: rgba(255, 77, 109, 0.15);
  color: rgba(255, 77, 109, 0.9);
  box-shadow: 0 0 18px rgba(255, 77, 109, 0.3);
}

.game-status-chip.is-info {
  border-color: rgba(0, 255, 255, 0.5);
  background: rgba(0, 255, 255, 0.15);
  color: rgba(0, 255, 255, 0.9);
  box-shadow: 0 0 18px rgba(0, 255, 255, 0.28);
}

.game-question > h2 {
  margin: 0;
  font-size: clamp(1.05rem, 3.4vw, 1.38rem);
  line-height: 1.35;
  text-align: center;
}

.game-versus {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: clamp(0.35rem, 1vw, 0.55rem);
  margin-bottom: 0;
}

.game-versus__player {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(0.35rem, 1vw, 0.6rem);
  padding: 0.45rem clamp(0.55rem, 1.8vw, 0.85rem);
  border-radius: 14px;
  border: 1px solid rgba(0, 255, 255, 0.16);
  background: rgba(6, 18, 26, 0.68);
  box-shadow: inset 0 0 0 1px rgba(0, 255, 255, 0.08);
  min-width: 0;
}

.game-versus__identity {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.game-versus__player--opponent .game-versus__identity {
  justify-content: flex-end;
}

.game-versus__avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(0, 255, 255, 0.35);
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.35);
}

.game-versus__name {
  font-size: clamp(0.7rem, 1.9vw, 0.86rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
  max-width: min(150px, 42vw);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-versus__player--opponent .game-versus__name {
  text-align: right;
}

.game-versus__score {
  font-size: clamp(0.95rem, 2.6vw, 1.18rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(0, 255, 255, 0.92);
  min-width: 2.75rem;
  text-align: right;
}

.game-versus__player[hidden] {
  display: none !important;
}

.answer-option {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(0, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.45);
  color: rgba(255, 255, 255, 0.92);
  text-align: left;
  padding: clamp(0.68rem, 2vw, 0.9rem) clamp(0.8rem, 2.4vw, 1.2rem);
  font-size: clamp(0.82rem, 2.5vw, 0.95rem);
  line-height: 1.35;
  letter-spacing: 0.05em;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.answer-option::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 255, 255, 0.1), transparent 60%);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.answer-option:hover,
.answer-option:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(0, 255, 255, 0.7);
  box-shadow: 0 0 16px rgba(0, 255, 255, 0.35);
}

.answer-option:hover::before,
.answer-option:focus-visible::before {
  opacity: 1;
}

.answer-option.correct {
  border-color: rgba(60, 255, 155, 0.85);
  box-shadow: 0 0 22px rgba(60, 255, 155, 0.4);
  background: rgba(60, 255, 155, 0.16);
}

.answer-option.wrong {
  border-color: rgba(255, 77, 109, 0.7);
  box-shadow: 0 0 18px rgba(255, 77, 109, 0.3);
  background: rgba(255, 77, 109, 0.08);
  opacity: 0.9;
}

.answer-option.is-selected,
.answer-option.is-pressed {
  transform: scale(0.985);
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.35);
}

.round-summary {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.round-summary p {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.78);
}

.game-post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.game-proposal-actions {
  display: flex;
  gap: 0.5rem;
}

.modal-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.round-option-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.game-entry-overlay,
#countdown-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 20%, rgba(0, 255, 255, 0.12), transparent 70%),
    rgba(4, 6, 18, 0.78);
  backdrop-filter: blur(14px);
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.game-entry-overlay.is-visible,
#countdown-overlay.is-visible {
  opacity: 1;
  pointer-events: all;
}

.game-entry-card,
.countdown-panel {
  width: min(420px, calc(100vw - 2rem));
  padding: clamp(1.6rem, 4vw, 2rem);
  border-radius: 24px;
  border: 1px solid rgba(0, 255, 255, 0.25);
  background: rgba(10, 10, 24, 0.74);
  backdrop-filter: blur(12px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}

.game-entry-card > p {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

.loading-spinner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px solid rgba(0, 255, 255, 0.18);
  border-top-color: rgba(0, 255, 255, 0.8);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.countdown-panel {
  width: 100%;
  max-width: min(720px, calc(100vw - 3rem));
  padding: clamp(1.2rem, 3.5vw, 1.8rem);
  gap: 0.6rem;
  animation: pulseOverlay 1.6s ease-in-out infinite;
}

.countdown-number {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(2.6rem, 10vw, 4.8rem);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow: 0 0 20px rgba(0, 255, 255, 0.48);
}

#countdown-label {
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

.countdown-progress {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  position: relative;
}

.countdown-progress__fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(0, 255, 255, 0.85), rgba(255, 0, 255, 0.65));
  transition: width 0.2s linear;
}

@keyframes pulseOverlay {
  0%, 100% {
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 24px 60px rgba(0, 255, 255, 0.25);
    transform: scale(1.01);
  }
}

@media (min-width: 641px) {
  .game-question__controls {
    flex-wrap: nowrap;
  }
}

input, select {
  width: 100%;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--fg);
  margin-bottom: 1rem;
  transition: var(--transition);
}

input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 255, 255, 0.22);
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.flex {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.card {
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 16px;
  border: 1px solid var(--panel-border);
  box-shadow: inset 0 0 0 1px rgba(255, 0, 255, 0.18);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:focus,
.card:focus-visible,
.card:focus-within {
  outline: none;
  box-shadow: none;
}

.card:hover {
  border-color: var(--accent-secondary);
  box-shadow: inset 0 0 0 1px rgba(0, 255, 255, 0.35), 0 0 12px rgba(255, 0, 255, 0.3);
}

.home-main {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.home-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
  width: 100%;
}

.site-logo {
  width: clamp(140px, 28vw, 220px);
  display: block;
  margin: 0 auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 18px rgba(255, 0, 255, 0.45));
}

.home-join-form {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
}

.home-join-form input[type='text'] {
  border: 2px solid rgba(0, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.55);
  color: var(--fg);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-join-form input[type='text']::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

#lobby-code-input {
  text-align: center;
}

#lobby-code-input::placeholder {
  text-align: center;
  letter-spacing: 0.25em;
}

.home-hero__badge {
  margin-bottom: 0.25rem;
}

.home-hero__title {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3rem);
  letter-spacing: 0.08em;
}

/* ------- Global fade transitions for foreground cards ------- */
.fade-container {
  position: relative;
  transition: opacity 280ms ease, transform 280ms ease;
  will-change: opacity, transform;
}

.fade-container.fade-out {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.fade-container.fade-in {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .fade-container {
    transition: opacity 1ms ease;
    transform: none !important;
  }
  .fade-container.fade-out,
  .fade-container.fade-in {
    transform: none !important;
  }
}

.lobby-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.lobby-header__meta {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.lobby-back-btn {
  padding: 0.4rem 0.9rem;
  min-height: 0;
  border-radius: 10px;
  align-self: flex-start;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-top: 0.15rem;
}

.lobby-header + section,
.lobby-header + .grid {
  margin-top: 0.35rem;
}

.panel-subtitle {
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 1.5rem;
}

.popular-panel {
  width: 100%;
}

.popular-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.popular-list {
  display: grid;
  gap: 0.75rem;
}

.popular-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.popular-item__name {
  font-weight: 600;
  letter-spacing: 0.04em;
}

.popular-item__stats {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 4, 6, 0.9);
  z-index: 300;
  padding: clamp(1rem, 6vw, 3rem);
}

.modal-panel {
  width: min(560px, 100%);
  max-height: min(80vh, 540px);
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: rgba(16, 16, 24, 0.98);
  border: 1px solid rgba(0, 255, 255, 0.18);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.modal-close {
  padding: 0.4rem 0.8rem;
  font-size: 1.5rem;
  line-height: 1;
}

.category-list {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.category-list .btn {
  width: 100%;
  padding: clamp(0.9rem, 2.2vw, 1.25rem) clamp(0.75rem, 2vw, 1.1rem);
}

.category-select-btn {
  padding: clamp(0.9rem, 2.2vw, 1.25rem) clamp(0.75rem, 2vw, 1.1rem);
}

.category-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.category-option__emoji {
  font-size: clamp(1.8rem, 4.5vw, 2.4rem);
  line-height: 1;
}

.category-option__title {
  font-size: clamp(0.75rem, 2vw, 0.9rem);
  line-height: 1.1;
}

.category-option--inline {
  display: inline-flex;
  flex-direction: column;
}

.lobby-summary-card {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.lobby-code-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.lobby-code-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: center;
}

.lobby-link-hint {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.68);
  text-align: center;
  margin: 0;
}

.lobby-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem 1.2rem;
  margin: 0;
}

.lobby-details__row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: center;
}

.lobby-details__row dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.62);
}

.lobby-details__row dd {
  margin: 0;
  font-size: clamp(0.9rem, 2.4vw, 1rem);
  font-weight: 600;
  letter-spacing: 0.06em;
}


.forfeit-modal {
  background: rgba(6, 10, 18, 0.92);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.forfeit-modal.is-visible {
  opacity: 1;
}

.forfeit-modal__panel {
  padding: clamp(1.6rem, 4vw, 2.3rem);
  gap: 1.4rem;
  align-items: center;
  text-align: center;
}

.forfeit-modal__header h2 {
  margin: 0;
  font-size: clamp(1.25rem, 3.4vw, 1.5rem);
}

.forfeit-modal__message {
  margin: 0;
  font-size: clamp(0.95rem, 2.8vw, 1.05rem);
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.82);
}

.forfeit-modal__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
}

.forfeit-modal__confirm {
  min-width: 160px;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  transform: none;
  width: 100%;
  --nav-padding-y: clamp(0.35rem, 1.6vw, 0.6rem);
  --nav-padding-x: clamp(0.75rem, 2.6vw, 1.2rem);
  padding: var(--nav-padding-y) var(--nav-padding-x);
  padding-bottom: calc(var(--nav-padding-y) + var(--safe-area-bottom));
  border-radius: 0;
  background: linear-gradient(180deg, rgba(6, 10, 18, 0.96), rgba(2, 4, 10, 0.94));
  border-top: 1px solid rgba(0, 255, 255, 0.22);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  justify-content: center;
  gap: clamp(0.6rem, 2vw, 1.2rem);
  box-shadow:
    0 -10px 30px rgba(0, 0, 0, 0.45),
    0 0 24px rgba(0, 255, 255, 0.2);
  backdrop-filter: blur(20px);
  z-index: 100;
  min-height: auto;
}

.bottom-nav__group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.5rem, 2vw, 1rem);
  flex: 1 1 0%;
  min-width: 0;
}

.bottom-nav__group--left {
  justify-content: flex-start;
}

.bottom-nav__group--right {
  justify-content: flex-end;
}

.bottom-nav__center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.65rem, 2.4vw, 1.1rem);
  flex: 0 0 auto;
  min-width: 0;
}

.bottom-nav__center > .nav-btn {
  margin: 0 auto;
}

.nav-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(48px, 14vw, 62px);
  height: clamp(48px, 14vw, 62px);
  border-radius: 18px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.42);
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  line-height: 1;
  appearance: none;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 10px 30px rgba(0, 0, 0, 0.45);
}

.nav-btn::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-right: 0.6rem;
  vertical-align: middle;
  flex: 0 0 20px;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}

/* Home */
.bottom-nav .nav-btn[data-nav="home"]::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%23fff' d='M3 9.75L12 3l9 6.75V21a1.5 1.5 0 0 1-1.5 1.5H4.5A1.5 1.5 0 0 1 3 21V9.75z'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%23fff' d='M3 9.75L12 3l9 6.75V21a1.5 1.5 0 0 1-1.5 1.5H4.5A1.5 1.5 0 0 1 3 21V9.75z'/></svg>");
}

/* Play / Start (use a play triangle) */
.bottom-nav .nav-btn[data-nav="play"]::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%23fff' d='M4 2v20l18-10L4 2z'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%23fff' d='M4 2v20l18-10L4 2z'/></svg>");
}

/* Scoreboard / Leaderboard (trophy) */
.bottom-nav .nav-btn[data-nav="scoreboard"]::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%23fff' d='M17 3H7v3a4 4 0 004 4h2a4 4 0 004-4V3zM7 11v2a5 5 0 005 5v3H9v2h6v-2h-3v-3a5 5 0 005-5v-2H7z'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%23fff' d='M17 3H7v3a4 4 0 004 4h2a4 4 0 004-4V3zM7 11v2a5 5 0 005 5v3H9v2h6v-2h-3v-3a5 5 0 005-5v-2H7z'/></svg>");
}

/* Settings (gear) */
.bottom-nav .nav-btn[data-nav="settings"]::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%23fff' d='M19.14 12.94a7.94 7.94 0 000-1.88l2.03-1.58a.5.5 0 00.12-.64l-1.92-3.32a.5.5 0 00-.6-.22l-2.39.96a7.86 7.86 0 00-1.62-.94L14.9 2.5a.5.5 0 00-.5-.5h-3.8a.5.5 0 00-.5.5l-.38 2.02c-.57.22-1.1.5-1.62.84L5.59 5.44a.5.5 0 00-.6.22L3.07 9a.5.5 0 00.12.64L5.22 11.2a8.03 8.03 0 000 1.6L3.19 14.38a.5.5 0 00-.12.64l1.92 3.32c.13.22.4.33.6.22l2.39-.96c.5.34 1.05.62 1.62.84l.38 2.02a.5.5 0 00.5.5h3.8a.5.5 0 00.5-.5l.38-2.02c.57-.22 1.1-.5 1.62-.84l2.39.96c.22.11.48 0 .6-.22l1.92-3.32a.5.5 0 00-.12-.64l-2.03-1.58zM12 15.5A3.5 3.5 0 1112 8.5a3.5 3.5 0 010 7z'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%23fff' d='M19.14 12.94a7.94 7.94 0 000-1.88l2.03-1.58a.5.5 0 00.12-.64l-1.92-3.32a.5.5 0 00-.6-.22l-2.39.96a7.86 7.86 0 00-1.62-.94L14.9 2.5a.5.5 0 00-.5-.5h-3.8a.5.5 0 00-.5.5l-.38 2.02c-.57.22-1.1.5-1.62.84L5.59 5.44a.5.5 0 00-.6.22L3.07 9a.5.5 0 00.12.64L5.22 11.2a8.03 8.03 0 000 1.6L3.19 14.38a.5.5 0 00-.12.64l1.92 3.32c.13.22.4.33.6.22l2.39-.96c.5.34 1.05.62 1.62.84l.38 2.02a.5.5 0 00.5.5h3.8a.5.5 0 00.5-.5l.38-2.02c.57-.22 1.1-.5 1.62-.84l2.39.96c.22.11.48 0 .6-.22l1.92-3.32a.5.5 0 00-.12-.64l-2.03-1.58zM12 15.5A3.5 3.5 0 1112 8.5a3.5 3.5 0 010 7z'/></svg>");
}

/* Account - show user icon if no avatar; otherwise avatar image should display */
.bottom-nav .nav-btn[data-nav="account"]::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%23fff' d='M12 12a4 4 0 100-8 4 4 0 000 8zm0 2c-3.3 0-6 2-6 4v1h12v-1c0-2-2.7-4-6-4z'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%23fff' d='M12 12a4 4 0 100-8 4 4 0 000 8zm0 2c-3.3 0-6 2-6 4v1h12v-1c0-2-2.7-4-6-4z'/></svg>");
}

/* When account has avatar, hide the pseudo-icon and show avatar */
.bottom-nav .nav-btn--account.has-avatar::before,
.bottom-nav .nav-btn--account[data-has-avatar="1"]::before {
  display: none !important;
}
.bottom-nav .nav-btn--account .nav-account-avatar {
  display: inline-block;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 9px;
  object-fit: cover;
  margin-right: 0.5rem;
}

/* Active / hover visual consistency */
.bottom-nav .nav-btn:hover::before,
.bottom-nav .nav-btn.is-active::before {
  opacity: 1;
  filter: none;
}

/* Mobile sizing */
@media (max-width: 640px) {
  .bottom-nav .nav-btn::before {
    width: 18px;
    height: 18px;
    margin-right: 0.35rem;
  }
  .bottom-nav .nav-btn--account .nav-account-avatar {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    margin-right: 0.35rem;
  }
}

/* Hide any inline/icon elements so they don't duplicate the CSS icon */
.bottom-nav .nav-btn > svg,
.bottom-nav .nav-btn > img.icon,
.bottom-nav .nav-btn > .icon,
.bottom-nav .nav-btn > i.icon {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
}

/* Base pseudo-icon for nav buttons */
.bottom-nav .nav-btn {
  position: relative;
  padding-left: 0.75rem; /* leave room for icon */
  padding-right: 0.75rem;
  align-items: center;
  display: inline-flex;
}

.bottom-nav .nav-btn::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-right: 0.6rem;
  vertical-align: middle;
  flex: 0 0 20px;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}

/* Home */
.bottom-nav .nav-btn[data-nav="home"]::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%23fff' d='M3 9.75L12 3l9 6.75V21a1.5 1.5 0 0 1-1.5 1.5H4.5A1.5 1.5 0 0 1 3 21V9.75z'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%23fff' d='M3 9.75L12 3l9 6.75V21a1.5 1.5 0 0 1-1.5 1.5H4.5A1.5 1.5 0 0 1 3 21V9.75z'/></svg>");
}

/* Play / Start (use a play triangle) */
.bottom-nav .nav-btn[data-nav="play"]::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%23fff' d='M4 2v20l18-10L4 2z'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%23fff' d='M4 2v20l18-10L4 2z'/></svg>");
}

/* Scoreboard / Leaderboard (trophy) */
.bottom-nav .nav-btn[data-nav="scoreboard"]::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%23fff' d='M17 3H7v3a4 4 0 004 4h2a4 4 0 004-4V3zM7 11v2a5 5 0 005 5v3H9v2h6v-2h-3v-3a5 5 0 005-5v-2H7z'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%23fff' d='M17 3H7v3a4 4 0 004 4h2a4 4 0 004-4V3zM7 11v2a5 5 0 005 5v3H9v2h6v-2h-3v-3a5 5 0 005-5v-2H7z'/></svg>");
}

/* Settings (gear) */
.bottom-nav .nav-btn[data-nav="settings"]::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%23fff' d='M19.14 12.94a7.94 7.94 0 000-1.88l2.03-1.58a.5.5 0 00.12-.64l-1.92-3.32a.5.5 0 00-.6-.22l-2.39.96a7.86 7.86 0 00-1.62-.94L14.9 2.5a.5.5 0 00-.5-.5h-3.8a.5.5 0 00-.5.5l-.38 2.02c-.57.22-1.1.5-1.62.84L5.59 5.44a.5.5 0 00-.6.22L3.07 9a.5.5 0 00.12.64L5.22 11.2a8.03 8.03 0 000 1.6L3.19 14.38a.5.5 0 00-.12.64l1.92 3.32c.13.22.4.33.6.22l2.39-.96c.5.34 1.05.62 1.62.84l.38 2.02a.5.5 0 00.5.5h3.8a.5.5 0 00.5-.5l.38-2.02c.57-.22 1.1-.5 1.62-.84l2.39.96c.22.11.48 0 .6-.22l1.92-3.32a.5.5 0 00-.12-.64l-2.03-1.58zM12 15.5A3.5 3.5 0 1112 8.5a3.5 3.5 0 010 7z'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%23fff' d='M19.14 12.94a7.94 7.94 0 000-1.88l2.03-1.58a.5.5 0 00.12-.64l-1.92-3.32a.5.5 0 00-.6-.22l-2.39.96a7.86 7.86 0 00-1.62-.94L14.9 2.5a.5.5 0 00-.5-.5h-3.8a.5.5 0 00-.5.5l-.38 2.02c-.57.22-1.1.5-1.62.84L5.59 5.44a.5.5 0 00-.6.22L3.07 9a.5.5 0 00.12.64L5.22 11.2a8.03 8.03 0 000 1.6L3.19 14.38a.5.5 0 00-.12.64l1.92 3.32c.13.22.4.33.6.22l2.39-.96c.5.34 1.05.62 1.62.84l.38 2.02a.5.5 0 00.5.5h3.8a.5.5 0 00.5-.5l.38-2.02c.57-.22 1.1-.5 1.62-.84l2.39.96c.22.11.48 0 .6-.22l1.92-3.32a.5.5 0 00-.12-.64l-2.03-1.58zM12 15.5A3.5 3.5 0 1112 8.5a3.5 3.5 0 010 7z'/></svg>");
}

/* Account - show user icon if no avatar; otherwise avatar image should display */
.bottom-nav .nav-btn[data-nav="account"]::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%23fff' d='M12 12a4 4 0 100-8 4 4 0 000 8zm0 2c-3.3 0-6 2-6 4v1h12v-1c0-2-2.7-4-6-4z'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%23fff' d='M12 12a4 4 0 100-8 4 4 0 000 8zm0 2c-3.3 0-6 2-6 4v1h12v-1c0-2-2.7-4-6-4z'/></svg>");
}

/* When account has avatar, hide the pseudo-icon and show avatar */
.bottom-nav .nav-btn--account.has-avatar::before,
.bottom-nav .nav-btn--account[data-has-avatar="1"]::before {
  display: none !important;
}
.bottom-nav .nav-btn--account .nav-account-avatar {
  display: inline-block;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 9px;
  object-fit: cover;
  margin-right: 0.5rem;
}

/* Active / hover visual consistency */
.bottom-nav .nav-btn:hover::before,
.bottom-nav .nav-btn.is-active::before {
  opacity: 1;
  filter: none;
}

/* Mobile sizing */
@media (max-width: 640px) {
  .bottom-nav .nav-btn::before {
    width: 18px;
    height: 18px;
    margin-right: 0.35rem;
  }
  .bottom-nav .nav-btn--account .nav-account-avatar {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    margin-right: 0.35rem;
  }
}
