/* ==========================================================================
   TV Party Trivia – Vibrant "Party" Theme
   High-energy, flashy, glass-morphism aesthetic with trivia flair.
   ========================================================================== */

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

:root {
  /* ---- Party Palette (Sleek & Vibrant) ---- */
  --bg-deep: #030308;
  --bg-card: rgba(18, 18, 28, 0.55);

  /* Trivia Neon Colors */
  --color-t: #ff1053;
  /* Electric Pink */
  --color-r: #00e5ff;
  /* Cyan Blue */
  --color-i: #ffd000;
  /* Game-show Gold */
  --color-v: #00ff88;
  /* Neon Green */
  --color-i2: #ff3366;
  /* Blaze Orange */
  --color-a: #9d00ff;
  /* Deep Purple */

  /* Legacy aliases for shared components */
  --color-b: var(--color-t);
  --color-n: var(--color-i);
  --color-g: var(--color-v);
  --color-o: var(--color-i2);

  --text-main: #f4f4f9;
  --text-dim: #9ba1b0;
  --gold: #ffd000;

  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-round: 50%;
}

/* ---- Reset ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Outfit', sans-serif;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  line-height: 1.5;
  background-color: var(--bg-deep);
}

/* Blurred background layer */
body::before {
  content: '';
  position: fixed;
  top: -50px;
  left: -50px;
  right: -50px;
  bottom: -50px;
  z-index: -1;
  background-image:
    url('/trivia_bg.png'),
    radial-gradient(circle 300px at 15% 30%, rgba(255, 16, 83, 0.15) 0%, transparent 100%),
    radial-gradient(circle 350px at 85% 20%, rgba(0, 229, 255, 0.15) 0%, transparent 100%),
    radial-gradient(circle 400px at 50% 80%, rgba(157, 0, 255, 0.15) 0%, transparent 100%);
  background-size: cover, auto, auto, auto;
  background-position: center;
  background-attachment: fixed;
  filter: blur(15px) brightness(0.65);
  animation: bgPulse 20s infinite alternate ease-in-out;
}

@keyframes bgPulse {
  0% {
    transform: scale(1) translate(0, 0);
  }

  100% {
    transform: scale(1.05) translate(-15px, 15px);
  }
}

.container {
  /* Safe area padding for mobile notches */
  padding-bottom: env(safe-area-inset-bottom, 20px);
  width: 100%;
  max-width: 520px;
  padding: clamp(8px, 2vw, 24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
}

/* Collapse default h1 margin so logo spacing is controlled by .trivia-logo alone */
h1 {
  margin: 0;
}

/* ===================== TRIVIA LOGO ===================== */
.trivia-logo {
  margin: 10px 0 4px;
  display: flex;
  justify-content: center;
  gap: 4px;
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.15));
}

.trivia-logo span {
  font-size: clamp(2.2rem, 8vw, 3rem);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1;
  text-shadow:
    0 4px 8px rgba(0, 0, 0, 0.4),
    0 0 20px currentColor;
  transition: transform 0.2s ease;
}

.trivia-logo span:hover {
  transform: scale(1.15) translateY(-2px);
}

.trivia-logo .t {
  color: var(--color-t);
}

.trivia-logo .r {
  color: var(--color-r);
}

.trivia-logo .i {
  color: var(--color-i);
}

.trivia-logo .v {
  color: var(--color-v);
}

.trivia-logo .i2 {
  color: var(--color-i2);
}

.trivia-logo .a {
  color: var(--color-a);
}

/* Small inline variant for inside panels */
.trivia-logo-sm {
  margin: 0 0 12px !important;
}

.trivia-logo-sm span {
  font-size: clamp(1.4rem, 5vw, 1.8rem) !important;
}

/* ===================== BINGO BOARD (kept for game.js compatibility) ===================== */
.bingo-board-wrapper {
  background: rgba(18, 18, 28, 0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 12px;
  border-radius: var(--radius-lg);
  margin: 24px 0;
  position: relative;
  width: calc(100vw - 16px);
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 24px 50px rgba(0, 0, 0, 0.5),
    0 0 0 2px rgba(255, 16, 83, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

/* Rainbow gradient top accent bar */
.bingo-board-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg,
      var(--color-t),
      var(--color-r),
      var(--color-i),
      var(--color-v),
      var(--color-i2),
      var(--color-a));
  z-index: 2;
}

/* Rainbow gradient bottom accent bar */
.bingo-board-wrapper::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg,
      var(--color-a),
      var(--color-i2),
      var(--color-v),
      var(--color-i),
      var(--color-r),
      var(--color-t));
  z-index: 2;
}


.bingo-headers,
.bingo-grid {
  display: grid;
  gap: 4px;
}

.bingo-headers {
  margin-bottom: 4px;
  padding: 6px 0;
}

/* Headers: Ball Circles */
.header-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: clamp(1.1rem, 4vw, 1.5rem);
  letter-spacing: 0;
  width: clamp(42px, 11vw, 56px);
  height: clamp(42px, 11vw, 56px);
  border-radius: 50%;
  margin: 0 auto;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  position: relative;
}

/* Gloss shine on ball headers */
.header-cell::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 20%;
  width: 40%;
  height: 30%;
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.5) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* Stripe across ball */
.header-cell::after {
  content: '';
  position: absolute;
  top: 38%;
  left: 5%;
  right: 5%;
  height: 24%;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  pointer-events: none;
}

.header-b {
  background: radial-gradient(circle at 35% 35%, rgba(255, 100, 170, 0.9), var(--color-t));
  box-shadow: 0 3px 12px rgba(255, 0, 127, 0.5);
}

.header-i {
  background: radial-gradient(circle at 35% 35%, rgba(100, 240, 255, 0.9), var(--color-r));
  box-shadow: 0 3px 12px rgba(0, 242, 255, 0.5);
}

.header-n {
  background: radial-gradient(circle at 35% 35%, rgba(255, 230, 100, 0.9), var(--color-i));
  box-shadow: 0 3px 12px rgba(255, 204, 0, 0.5);
  color: #1a1000;
}

.header-g {
  background: radial-gradient(circle at 35% 35%, rgba(120, 255, 100, 0.9), var(--color-v));
  box-shadow: 0 3px 12px rgba(57, 255, 20, 0.5);
  color: #0a1a00;
}

.header-o {
  background: radial-gradient(circle at 35% 35%, rgba(255, 160, 80, 0.9), var(--color-i2));
  box-shadow: 0 3px 12px rgba(255, 94, 0, 0.5);
}

/* --- Number Cells --- */
.bingo-cell {
  aspect-ratio: 1;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: clamp(1.2rem, 5vw, 1.6rem);
  color: #f0f0f5;
  position: relative;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow: hidden;
  z-index: 1;
  min-width: 56px;
  min-height: 56px;
}

/* Subtle column tint on cells */
.cell-b {
  border-bottom: 2px solid rgba(255, 16, 83, 0.3);
}

.cell-i {
  border-bottom: 2px solid rgba(0, 229, 255, 0.3);
}

.cell-n {
  border-bottom: 2px solid rgba(255, 208, 0, 0.3);
}

.cell-g {
  border-bottom: 2px solid rgba(0, 255, 136, 0.3);
}

.cell-o {
  border-bottom: 2px solid rgba(255, 51, 102, 0.3);
}

.bingo-cell:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  z-index: 2;
}

.bingo-cell:active {
  transform: translateY(1px) scale(0.96);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* ---- Dauber Mark (circular stamp overlay) ---- */
.bingo-cell.marked {
  animation: dauberStamp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.bingo-cell.marked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80%;
  height: 80%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
}

/* Number text stays above the dauber */
.bingo-cell.marked>* {
  position: relative;
  z-index: 1;
}

@keyframes dauberStamp {
  0% {
    transform: scale(1);
  }

  40% {
    transform: scale(1.12);
  }

  100% {
    transform: scale(1);
  }
}

/* Column-colored dauber marks */
.cell-b.marked::after {
  background: radial-gradient(circle, rgba(255, 0, 127, 0.75) 0%, rgba(255, 0, 127, 0.4) 100%);
  box-shadow: 0 0 12px rgba(255, 0, 127, 0.4);
}

.cell-b.marked {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.cell-i.marked::after {
  background: radial-gradient(circle, rgba(0, 200, 255, 0.75) 0%, rgba(0, 242, 255, 0.35) 100%);
  box-shadow: 0 0 12px rgba(0, 242, 255, 0.4);
}

.cell-i.marked {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.cell-n.marked::after {
  background: radial-gradient(circle, rgba(255, 204, 0, 0.75) 0%, rgba(255, 204, 0, 0.35) 100%);
  box-shadow: 0 0 12px rgba(255, 204, 0, 0.4);
}

.cell-n.marked {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.cell-g.marked::after {
  background: radial-gradient(circle, rgba(57, 255, 20, 0.75) 0%, rgba(57, 255, 20, 0.35) 100%);
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.4);
}

.cell-g.marked {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.cell-o.marked::after {
  background: radial-gradient(circle, rgba(255, 94, 0, 0.75) 0%, rgba(255, 94, 0, 0.35) 100%);
  box-shadow: 0 0 12px rgba(255, 94, 0, 0.4);
}

.cell-o.marked {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Free Space: Gold Star */
.bingo-cell.free-space {
  background: rgba(255, 204, 0, 0.1) !important;
  border: 1.5px solid rgba(255, 204, 0, 0.35) !important;
  cursor: default;
}

.bingo-cell.free-space::after {
  content: '' !important;
  background: radial-gradient(circle, rgba(255, 204, 0, 0.65) 0%, rgba(255, 180, 0, 0.3) 100%) !important;
  box-shadow: 0 0 15px rgba(255, 204, 0, 0.4) !important;
  animation: starPulse 2.5s infinite ease-in-out;
}

@keyframes starPulse {

  0%,
  100% {
    box-shadow: 0 0 8px rgba(255, 204, 0, 0.3);
    opacity: 0.7;
  }

  50% {
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.6);
    opacity: 1;
  }
}

.free-text {
  font-size: 0.6rem;
  font-weight: 900;
  color: var(--color-i);
  letter-spacing: 1px;
  z-index: 1;
  position: relative;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}

.free-star {
  font-size: 1.1rem;
  display: block;
  filter: drop-shadow(0 0 4px rgba(255, 204, 0, 0.6));
}

/* ===================== BUTTONS ===================== */
.btn {
  width: 100%;
  padding: 18px;
  border-radius: var(--radius-md);
  border: none;
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.btn-primary {
  background: linear-gradient(135deg, rgba(255, 16, 83, 0.9) 0%, rgba(157, 0, 255, 0.9) 100%);
  color: white;
  box-shadow: 0 8px 24px rgba(255, 16, 83, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(255, 16, 83, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.5);
  background: linear-gradient(135deg, rgba(255, 30, 100, 1) 0%, rgba(170, 30, 255, 1) 100%);
}

.btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.97);
  box-shadow: 0 4px 10px rgba(255, 16, 83, 0.2);
}

.btn:disabled {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: not-allowed;
  box-shadow: none;
}

/* ===================== FORM INPUTS ===================== */
.input-group {
  width: 100%;
  margin-bottom: 20px;
  text-align: left;
}

.input-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

input[type="text"] {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  color: white;
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

input[type="text"]:focus {
  outline: none;
  background: rgba(0, 0, 0, 0.5);
  border-color: var(--color-r);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.25), inset 0 2px 4px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

input[type="text"]::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

/* ===================== AVATAR SELECTION ===================== */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
  margin-bottom: 24px;
}

.avatar-option {
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.avatar-option img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 5px;
  transition: transform 0.2s ease;
}

.avatar-option.selected {
  background: rgba(255, 0, 127, 0.12);
  border-color: var(--color-t);
  box-shadow: 0 0 18px rgba(255, 0, 127, 0.35);
}

.avatar-option:hover:not(.selected) {
  background: rgba(0, 242, 255, 0.08);
  border-color: rgba(0, 242, 255, 0.3);
  box-shadow: 0 0 10px rgba(0, 242, 255, 0.12);
}

/* ===================== GAME STATUS BARS ===================== */
.status-bar {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 12px 18px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid rgba(255, 204, 0, 0.15);
  box-shadow: 0 0 8px rgba(255, 204, 0, 0.05);
}

.status-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-dim);
  text-transform: uppercase;
}

.status-value {
  font-weight: 900;
  font-size: 1.1rem;
}

/* ===================== SETTINGS PANEL ===================== */
.settings-panel {
  width: 100%;
  background: linear-gradient(135deg, rgba(255, 16, 83, 0.08) 0%, rgba(0, 229, 255, 0.08) 50%, rgba(157, 0, 255, 0.08) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 24px;
  margin: 24px 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2), inset 0 1px rgba(255, 255, 255, 0.05);
}

.settings-title {
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-i);
  text-shadow: 0 0 10px rgba(255, 204, 0, 0.3);
  margin-bottom: 16px;
  text-align: center;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.setting-row:last-child {
  margin-bottom: 0;
}

.setting-row label {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--color-r);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.slider-value {
  font-weight: 900;
  font-size: 0.95rem;
  color: var(--color-i);
  min-width: 32px;
  text-align: center;
}

/* Neon Range Slider */
.neon-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 120px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  transition: background 0.2s;
}

.neon-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-r);
  box-shadow: 0 0 12px rgba(0, 242, 255, 0.5);
  cursor: pointer;
  transition: box-shadow 0.2s;
}

.neon-slider::-webkit-slider-thumb:hover {
  box-shadow: 0 0 20px rgba(0, 242, 255, 0.7);
}

.neon-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-r);
  box-shadow: 0 0 12px rgba(0, 242, 255, 0.5);
  cursor: pointer;
  border: none;
}

/* iOS Style Toggle Switch */
.toggle-container {
  display: flex;
  align-items: center;
}

.toggle-container input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.ios-toggle {
  position: relative;
  display: block;
  width: 51px;
  height: 31px;
  background: rgba(120, 120, 128, 0.32);
  /* iOS dark mode off state */
  border-radius: 16px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  flex-shrink: 0;
}

.ios-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: white;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 3px 1px rgba(0, 0, 0, 0.06);
}

.toggle-container input[type="checkbox"]:checked+.ios-toggle {
  background: #34C759;
  /* iOS Green */
}

.toggle-container input[type="checkbox"]:checked+.ios-toggle::after {
  transform: translateX(20px);
}

/* Subtitle text */
.subtitle {
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 4px 0 6px;
}

/* Form labels */
label {
  display: block;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--color-r);
  text-transform: uppercase;
  margin-bottom: 6px;
  letter-spacing: 1.5px;
}

/* Player count badge */
.player-count {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--color-v);
  text-shadow: 0 0 8px rgba(57, 255, 20, 0.3);
  margin-bottom: 8px;
}

/* Status messages */
.status-message {
  width: 100%;
  padding: 14px 18px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 16px;
  text-align: center;
}

.status-waiting {
  background: rgba(255, 204, 0, 0.08);
  border: 1px solid rgba(255, 204, 0, 0.2);
  color: var(--color-i);
  animation: waitingPulse 2.5s ease-in-out infinite;
}

@keyframes waitingPulse {

  0%,
  100% {
    box-shadow: 0 0 4px rgba(255, 204, 0, 0.1);
  }

  50% {
    box-shadow: 0 0 16px rgba(255, 204, 0, 0.2);
  }
}

/* Countdown text */
.countdown-text {
  font-size: 3rem;
  font-weight: 900;
  color: var(--color-i);
  text-shadow: 0 0 25px rgba(255, 204, 0, 0.5);
}

/* Panel (game over etc.) */
.panel {
  width: 100%;
  background: rgba(10, 5, 30, 0.85);
  border: 1.5px solid rgba(255, 204, 0, 0.2);
  border-radius: 20px;
  padding: 24px;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 20px rgba(255, 204, 0, 0.08);
}

.category-title {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--color-i);
  text-shadow: 0 0 15px rgba(255, 204, 0, 0.4);
  letter-spacing: 3px;
  text-transform: uppercase;
}

.waiting-message {
  color: rgba(255, 255, 255, 0.7);
  margin: 12px 0;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.setting-item:last-child {
  margin-bottom: 0;
}

.setting-info h4 {
  font-size: 0.9rem;
  font-weight: 800;
  margin-bottom: 2px;
}

.setting-info p {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.setting-control {
  display: flex;
  align-items: center;
  gap: 12px;
}

.setting-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(0, 242, 255, 0.3);
  background: rgba(0, 242, 255, 0.08);
  color: white;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.2s ease;
}

.setting-btn:hover {
  background: rgba(0, 242, 255, 0.15);
  box-shadow: 0 0 10px rgba(0, 242, 255, 0.2);
}

.setting-btn:active {
  transform: scale(0.9);
}

.setting-number {
  font-weight: 900;
  font-size: 1.2rem;
  min-width: 24px;
  text-align: center;
}

/* ===================== ALERTS ===================== */
#errorContainer {
  width: 100%;
}

#errorContainer:not(:empty) {
  margin-bottom: 16px;
}

.error-message {
  background: rgba(255, 0, 50, 0.15);
  border: 1px solid rgba(255, 0, 50, 0.4);
  color: #ff99aa;
  padding: 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.85rem;
}

.premium-alert {
  background: linear-gradient(135deg, rgba(255, 204, 0, 0.12) 0%, rgba(255, 120, 0, 0.12) 100%);
  border: 2px solid rgba(255, 204, 0, 0.5);
  padding: 24px 20px;
  border-radius: 18px;
  color: var(--gold);
  text-align: center;
  animation: premiumShake 0.5s ease-out, premiumGlow 2s infinite ease-in-out;
  box-shadow: 0 0 20px rgba(255, 204, 0, 0.15), inset 0 0 30px rgba(255, 204, 0, 0.05);
}

.premium-alert-icon {
  font-size: 3rem;
  margin-bottom: 8px;
  animation: crownBounce 1.5s infinite ease-in-out;
}

.premium-alert h3 {
  font-size: 1.15rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 8px;
  text-shadow: 0 0 15px rgba(255, 204, 0, 0.5);
}

.premium-alert p {
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255, 230, 150, 0.9);
  margin: 4px 0;
}

.premium-alert-sub {
  font-size: 0.78rem !important;
  color: rgba(255, 255, 255, 0.5) !important;
  font-weight: 500 !important;
  margin-top: 10px !important;
}

@keyframes premiumShake {
  0% { transform: translateX(-10px); opacity: 0; }
  25% { transform: translateX(8px); }
  50% { transform: translateX(-5px); }
  75% { transform: translateX(3px); }
  100% { transform: translateX(0); opacity: 1; }
}

@keyframes premiumGlow {
  0%, 100% { box-shadow: 0 0 15px rgba(255, 204, 0, 0.1), inset 0 0 20px rgba(255, 204, 0, 0.03); }
  50% { box-shadow: 0 0 30px rgba(255, 204, 0, 0.25), inset 0 0 40px rgba(255, 204, 0, 0.08); }
}

@keyframes crownBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.1); }
}

/* ===================== MUSIC TOGGLE ===================== */
.music-toggle-btn {
  position: fixed;
  bottom: clamp(16px, 4vw, 24px);
  right: clamp(16px, 4vw, 24px);
  width: 50px;
  height: 50px;
  border-radius: var(--radius-round);
  background: rgba(0, 0, 0, 0.6);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 1000;
  transition: all 0.2s ease;
  backdrop-filter: blur(5px);
}

.music-toggle-btn:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.1);
}

.music-toggle-btn.muted {
  opacity: 0.6;
}

/* ===================== RESULT STAMPS ===================== */
.result-stamp {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg) scale(3);
  opacity: 0;
  font-size: 5rem;
  font-weight: 900;
  color: var(--color-i);
  text-transform: uppercase;
  border: 10px solid var(--color-i);
  padding: 10px 40px;
  border-radius: 20px;
  z-index: 1000;
  pointer-events: none;
  letter-spacing: 5px;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.result-stamp.visible {
  animation: stampIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes stampIn {
  from {
    transform: translate(-50%, -50%) rotate(-15deg) scale(3);
    opacity: 0;
  }

  to {
    transform: translate(-50%, -50%) rotate(-15deg) scale(1);
    opacity: 1;
  }
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 480px) {

  .container {
    max-width: 100%;
    padding: 6px;
  }

  .bingo-headers,
  .bingo-grid {
    gap: 3px;
  }

  .bingo-board-wrapper {
    padding: 8px;
    margin: 12px 0;
    width: calc(100vw - 12px);
  }

  .bingo-cell {
    font-size: clamp(1.1rem, 5.5vw, 1.5rem);
    min-width: 64px;
    min-height: 64px;
    border-radius: 10px;
  }

  .header-cell {
    width: clamp(48px, 14vw, 60px);
    height: clamp(48px, 14vw, 60px);
    font-size: clamp(1.2rem, 5vw, 1.5rem);
  }

  .avatar-grid {
    gap: 8px;
  }
}

/* Extra-small phones: allow horizontal scroll if cells can't fit */
@media (max-width: 360px) {
  .bingo-board-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .bingo-grid,
  .bingo-headers {
    min-width: max-content;
  }

  .bingo-cell {
    min-width: 56px;
    min-height: 56px;
  }
}

@media (max-width: 350px) {
  .trivia-logo span {
    font-size: 1.8rem;
  }
}

/* ===================== UTILITY CLASSES ===================== */
.hidden {
  display: none !important;
}

.mt-sm {
  margin-top: 8px;
}

.mt-md {
  margin-top: 16px;
}

.mt-lg {
  margin-top: 24px;
}

/* ===================== SUBTITLE ===================== */
.subtitle {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 20px;
}

/* ===================== FORM GROUP ===================== */
.form-group {
  width: 100%;
  margin-bottom: 20px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

/* ===================== AVATAR SELECTION ===================== */
.avatar-selection {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  margin-top: 6px;
}

.avatar-option {
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.avatar-option img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.avatar-option.selected {
  background: rgba(255, 16, 83, 0.15);
  border-color: var(--color-t);
  box-shadow: 0 8px 24px rgba(255, 16, 83, 0.3), inset 0 0 0 1px var(--color-t);
}

.avatar-option.selected img {
  transform: scale(1.15);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.avatar-option:hover:not(.selected) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* ===================== STATUS MESSAGE ===================== */
.status-message {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.85rem;
  text-align: center;
  letter-spacing: 1px;
  margin: 16px 0;
}

.status-waiting {
  background: rgba(255, 204, 0, 0.08);
  border: 1px solid rgba(255, 204, 0, 0.3);
  color: var(--gold);
  animation: waitPulse 2s infinite ease-in-out;
}

@keyframes waitPulse {

  0%,
  100% {
    opacity: 0.7;
  }

  50% {
    opacity: 1;
  }
}

/* ===================== PLAYER COUNT ===================== */
.player-count {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 16px;
  letter-spacing: 1px;
}

/* ===================== SETTINGS PANEL (GAME) ===================== */
.settings-title {
  font-size: 1rem;
  font-weight: 900;
  text-align: center;
  margin-bottom: 16px;
  color: var(--color-i);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 12px;
}

.setting-row:last-child {
  margin-bottom: 0;
}

.setting-row label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-dim);
  white-space: nowrap;
  min-width: 90px;
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.neon-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
}

.neon-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-i);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(255, 204, 0, 0.4);
}

.neon-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-i);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 8px rgba(255, 204, 0, 0.4);
}

.slider-value {
  font-weight: 900;
  font-size: 1rem;
  min-width: 35px;
  text-align: center;
  color: var(--color-i);
}

/* Styled Neon Checkbox */
.checkbox-container {
  display: flex;
  align-items: center;
}

.neon-checkbox {
  display: none;
}

.neon-checkbox-label {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0;
  color: transparent;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}

.neon-checkbox:checked+.neon-checkbox-label {
  background: rgba(255, 204, 0, 0.15);
  border-color: var(--color-i);
  box-shadow: 0 0 12px rgba(255, 204, 0, 0.3);
  font-size: 1.1rem;
  color: var(--color-i);
  font-weight: 900;
}

.neon-checkbox:checked+.neon-checkbox-label:active {
  transform: scale(0.9);
}

.neon-checkbox-label:hover {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
}

/* ===================== BINGO BOARD CONTAINER ===================== */
.bingo-board {
  width: 100%;
}

/* ===================== BINGO BUTTON ===================== */
.btn-bingo {
  width: 100%;
  padding: 18px;
  border-radius: 16px;
  border: none;
  font-family: inherit;
  font-size: 1.5rem;
  font-weight: 900;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-top: 16px;
  background: linear-gradient(135deg, var(--color-i) 0%, #ff9900 100%);
  color: #000;
  box-shadow: 0 6px 25px rgba(255, 204, 0, 0.35);
  transition: all 0.2s ease;
}

.btn-bingo:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255, 204, 0, 0.5);
  filter: brightness(1.1);
}

.btn-bingo:active {
  transform: scale(0.97);
}

/* ===================== SECONDARY BUTTON ===================== */
.btn-secondary {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

/* ===================== PANELS ===================== */
.panel,
.glass-panel {
  width: 100%;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: clamp(16px, 4vw, 32px);
  margin: 10px 0;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Join form fills all available vertical space */
#joinForm.glass-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.panel {
  text-align: center;
}

.category-title {
  font-size: 2rem;
  font-weight: 900;
  color: var(--color-i);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 12px;
  text-shadow: 0 0 20px rgba(255, 204, 0, 0.4);
}

.waiting-message {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.waiting-message p {
  margin-bottom: 10px;
}

/* ===================== COUNTDOWN ===================== */
.countdown-text {
  font-size: 4rem;
  font-weight: 900;
  color: var(--color-i);
  text-align: center;
  text-shadow: 0 0 30px rgba(255, 204, 0, 0.5);
  animation: countPulse 1s infinite ease-in-out;
}

@keyframes countPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.15);
  }
}

/* ===================== CONFETTI CANVAS ===================== */
.confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

/* ===================== WIN SCREEN CELEBRATION ===================== */

/* Full-screen flash on win */
.bingo-flash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 204, 0, 0.4);
  z-index: 998;
  pointer-events: none;
  animation: flashBang 0.5s ease-out forwards;
}

@keyframes flashBang {
  0% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

/* Panel celebrating state */
.panel.celebrating {
  animation: celebratePulse 1.5s ease-in-out infinite;
  border-color: rgba(255, 204, 0, 0.4);
  box-shadow: 0 0 30px rgba(255, 204, 0, 0.15);
}

@keyframes celebratePulse {

  0%,
  100% {
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.1);
  }

  50% {
    box-shadow: 0 0 40px rgba(255, 204, 0, 0.25);
  }
}

/* Winner message text */
.winner-message-celebrate {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--color-i);
  text-shadow: 0 0 15px rgba(255, 204, 0, 0.4);
  margin-bottom: 16px;
  animation: winnerTextGlow 2s ease-in-out infinite;
}

@keyframes winnerTextGlow {

  0%,
  100% {
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.3);
  }

  50% {
    text-shadow: 0 0 25px rgba(255, 204, 0, 0.6);
  }
}

/* Winner avatar image */
.winner-avatar-celebrate {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: contain;
  border: 3px solid var(--color-i);
  box-shadow: 0 0 20px rgba(255, 204, 0, 0.4);
  margin: 12px auto;
  display: block;
  background: rgba(255, 255, 255, 0.05);
  padding: 6px;
  animation: avatarBounce 1.5s ease-in-out infinite;
}

@keyframes avatarBounce {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }
}

/* Winner name text */
.winner-name-celebrate {
  font-size: 1.1rem;
  font-weight: 900;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 8px;
}

/* Floating emoji celebration particles */
.celebration-particle {
  position: fixed;
  bottom: -40px;
  font-size: 1.5rem;
  z-index: 997;
  pointer-events: none;
  animation: floatUp 3s ease-out forwards;
}

@keyframes floatUp {
  0% {
    transform: translateY(0) scale(1) rotate(0deg);
    opacity: 1;
  }

  80% {
    opacity: 1;
  }

  100% {
    transform: translateY(-100vh) scale(0.5) rotate(360deg);
    opacity: 0;
  }
}

/* ===================== GAME OVER SCOREBOARD ===================== */

/* Title */
.game-over-title {
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--color-i), #ff9900, var(--color-i));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmerTitle 3s linear infinite;
}

@keyframes shimmerTitle {
  0% {
    background-position: 0% 50%;
  }

  100% {
    background-position: 200% 50%;
  }
}

/* Winner Spotlight */
.winner-spotlight {
  text-align: center;
  margin-bottom: 20px;
}

.winner-avatar-spotlight {
  width: clamp(72px, 18vw, 100px);
  height: clamp(72px, 18vw, 100px);
  border-radius: 50%;
  object-fit: contain;
  border: 3px solid var(--color-i);
  box-shadow: 0 0 25px rgba(255, 204, 0, 0.5), 0 0 60px rgba(255, 204, 0, 0.15);
  margin: 0 auto 10px;
  display: block;
  background: rgba(255, 255, 255, 0.05);
  padding: 6px;
  animation: spotlightPulse 2s ease-in-out infinite;
}

@keyframes spotlightPulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 25px rgba(255, 204, 0, 0.5), 0 0 60px rgba(255, 204, 0, 0.15);
  }

  50% {
    transform: scale(1.08);
    box-shadow: 0 0 35px rgba(255, 204, 0, 0.7), 0 0 80px rgba(255, 204, 0, 0.25);
  }
}

.winner-name-spotlight {
  font-size: clamp(1.1rem, 4vw, 1.5rem);
  font-weight: 900;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.winner-score-spotlight {
  font-size: clamp(0.9rem, 3vw, 1.1rem);
  font-weight: 800;
  color: var(--color-i);
  text-shadow: 0 0 12px rgba(255, 204, 0, 0.4);
}

/* Scoreboard Container */
.scoreboard {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

/* Individual Score Row */
.score-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 10px 14px;
  animation: slideInRow 0.5s ease-out both;
  transition: background 0.2s;
}

.score-row:hover {
  background: rgba(255, 255, 255, 0.08);
}

.score-row-winner {
  background: rgba(255, 204, 0, 0.08);
  border-color: rgba(255, 204, 0, 0.3);
  box-shadow: 0 0 15px rgba(255, 204, 0, 0.1);
}

@keyframes slideInRow {
  0% {
    opacity: 0;
    transform: translateX(-20px);
  }

  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Rank Badge */
.score-rank {
  font-size: clamp(1rem, 4vw, 1.3rem);
  min-width: 28px;
  text-align: center;
  flex-shrink: 0;
}

/* Score Avatar */
.score-avatar {
  width: clamp(36px, 10vw, 44px);
  height: clamp(36px, 10vw, 44px);
  border-radius: 50%;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  padding: 3px;
  flex-shrink: 0;
}

/* Score Info (name + bar) */
.score-info {
  flex: 1;
  min-width: 0;
}

.score-name {
  font-size: clamp(0.8rem, 3vw, 0.95rem);
  font-weight: 800;
  color: #fff;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}

/* Score Bar */
.score-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-t), var(--color-r), var(--color-i), var(--color-v));
  background-size: 300% 100%;
  border-radius: 3px;
  animation: barGrow 1s ease-out both, barShimmer 3s linear infinite;
  animation-delay: 0.5s, 0s;
}

@keyframes barGrow {
  0% {
    transform: scaleX(0);
    transform-origin: left;
  }

  100% {
    transform: scaleX(1);
    transform-origin: left;
  }
}

@keyframes barShimmer {
  0% {
    background-position: 0% 50%;
  }

  100% {
    background-position: 300% 50%;
  }
}

/* Points Display */
.score-pts {
  font-size: clamp(0.85rem, 3vw, 1rem);
  font-weight: 900;
  color: var(--color-i);
  min-width: 40px;
  text-align: right;
  flex-shrink: 0;
}

/* Leader Game Over Buttons */
.leader-gameover-btns {
  width: 100%;
  margin-top: 12px;
}

/* Waiting Message for Non-Leaders */
.waiting-msg {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dim);
  margin-top: 12px;
  animation: waitPulse 2s infinite ease-in-out;
}

/* ===================== TRIVIA BUTTONS & ANIMATIONS ===================== */
.trivia-answers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.btn-trivia {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  padding: 15px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
  cursor: pointer;
}

.btn-trivia::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.btn-trivia:hover:not(:disabled)::before {
  opacity: 1;
}

.btn-trivia:active:not(:disabled) {
  transform: scale(0.95);
}

.trivia-letter {
  display: none;
}

.trivia-text {
  font-weight: 800;
  font-size: 1.3rem;
  text-transform: none;
  word-break: break-word;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Button Variants */
.btn-trivia-a {
  background: rgba(255, 16, 83, 0.15);
  border-color: rgba(255, 16, 83, 0.4);
}

.btn-trivia-a .trivia-letter {
  color: var(--color-t);
}

.btn-trivia-a:hover:not(:disabled) {
  border-color: var(--color-t);
  box-shadow: 0 0 25px rgba(255, 16, 83, 0.4);
  transform: translateY(-4px);
}

.btn-trivia-b {
  background: rgba(0, 229, 255, 0.15);
  border-color: rgba(0, 229, 255, 0.4);
}

.btn-trivia-b .trivia-letter {
  color: var(--color-r);
}

.btn-trivia-b:hover:not(:disabled) {
  border-color: var(--color-r);
  box-shadow: 0 0 25px rgba(0, 229, 255, 0.4);
  transform: translateY(-4px);
}

.btn-trivia-c {
  background: rgba(255, 208, 0, 0.15);
  border-color: rgba(255, 208, 0, 0.4);
}

.btn-trivia-c .trivia-letter {
  color: var(--color-i);
}

.btn-trivia-c:hover:not(:disabled) {
  border-color: var(--color-i);
  box-shadow: 0 0 25px rgba(255, 208, 0, 0.4);
  transform: translateY(-4px);
}

.btn-trivia-d {
  background: rgba(0, 255, 136, 0.15);
  border-color: rgba(0, 255, 136, 0.4);
}

.btn-trivia-d .trivia-letter {
  color: var(--color-v);
}

.btn-trivia-d:hover:not(:disabled) {
  border-color: var(--color-v);
  box-shadow: 0 0 25px rgba(0, 255, 136, 0.4);
  transform: translateY(-4px);
}

/* Correct / Incorrect states */
.btn-correct {
  background: rgba(0, 255, 136, 0.4) !important;
  border-color: var(--color-v) !important;
  box-shadow: 0 0 30px var(--color-v) !important;
  animation: pulseCorrect 0.6s ease-out;
}

@keyframes pulseCorrect {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.15);
    box-shadow: 0 0 50px var(--color-v);
  }

  100% {
    transform: scale(1);
  }
}

.btn-wrong {
  background: rgba(255, 16, 83, 0.4) !important;
  border-color: var(--color-t) !important;
  box-shadow: 0 0 30px var(--color-t) !important;
  opacity: 0.5 !important;
  animation: shakeWrong 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shakeWrong {

  0%,
  100% {
    transform: translateX(0);
  }

  20%,
  60% {
    transform: translateX(-10px);
  }

  40%,
  80% {
    transform: translateX(10px);
  }
}

/* Feedback panel text */
.feedback-text-pop {
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.4;
  white-space: pre-line;
  /* important for newlines */
}

/* Feedback panel pop animation */
.feedback-pop {
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }

  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}