/* Tangled Trivia Second Screen — shared styles (tangledtrivia.com palette) */
:root {
  --bg: #090a12;
  --surface: #151724;
  --surface-2: #1e2233;
  --text: #F8FBFF;
  --muted: #A8B3C7;
  --accent: #8D55FF;
  --primary: #531BAE;
  --yellow: #FFE45C;
  --cyan: #2FE6D1;
  --coral: #FF6B6B;
  --success: #22D66F;
  --warn: #FFB84D;
  --error: #FF476F;
  --border: rgba(168, 179, 199, 0.22);
  --border-strong: rgba(255, 228, 92, 0.45);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.24);
}

/* Temporary site-wide linking CTA. Kept out of OBS broadcast/overlay pages. */
.tangled-link-ribbon {
  box-sizing: border-box;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 1.25rem;
  padding: 0.75rem 1rem;
  background: #ffe45c;
  color: #171324;
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: center;
}
.tangled-link-ribbon a {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  color: #321065;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.tangled-link-ribbon a:focus-visible {
  outline: 3px solid #321065;
  outline-offset: 3px;
}
.tangled-link-ribbon[hidden], .tangled-link-ribbon-close[hidden] { display: none !important; }
.tangled-link-ribbon .tangled-link-ribbon-close {
  flex: 0 0 auto;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: #321065;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.tangled-link-ribbon-close:focus-visible {
  outline: 3px solid #321065;
  outline-offset: 3px;
}
#tangledChatLinkPanel { scroll-margin-top: 2rem; }

/* Tangled Jukebox */
.jukebox-page {
  background:
    radial-gradient(circle at 12% 8%, rgba(141, 85, 255, 0.22), transparent 28rem),
    radial-gradient(circle at 88% 22%, rgba(47, 230, 209, 0.12), transparent 30rem),
    var(--bg);
}
.jukebox-shell { max-width: 1120px !important; padding-top: 2rem; padding-bottom: 4rem; }
.jukebox-hero { margin-bottom: 1.25rem; }
.jukebox-hero h1 { font-size: clamp(2.2rem, 7vw, 4.5rem); line-height: 0.95; margin-bottom: 0.8rem; }
.jukebox-hero > p:not(.eyebrow):not(.jukebox-message) { max-width: 46rem; color: var(--muted); }
.jukebox-status,
.jukebox-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.jukebox-status.is-open { color: var(--success); border-color: rgba(34, 214, 111, 0.45); background: rgba(34, 214, 111, 0.08); }
.jukebox-status.is-closed { color: var(--error); border-color: rgba(255, 71, 111, 0.45); background: rgba(255, 71, 111, 0.08); }
.jukebox-status.is-override { color: var(--yellow); border-color: rgba(255, 228, 92, 0.45); background: rgba(255, 228, 92, 0.08); }
.jukebox-public-schedule { display: flex; align-items: center; flex-wrap: wrap; gap: 0.55rem 0.9rem; color: var(--muted); font-size: 0.9rem; }
.jukebox-current {
  min-height: 8rem;
  margin-bottom: 1.25rem;
  padding: 1.15rem;
  border: 1px solid rgba(47, 230, 209, 0.32);
  border-radius: 16px;
  background: linear-gradient(120deg, rgba(47, 230, 209, 0.1), rgba(141, 85, 255, 0.13));
  box-shadow: var(--shadow-soft);
}
.jukebox-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.jukebox-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.jukebox-request-card label { display: block; margin: 0.8rem 0 0.35rem; color: var(--muted); font-weight: 700; }
.jukebox-request-card input,
.jukebox-request-card textarea { color: #fff; caret-color: #fff; }
.jukebox-request-card input::placeholder,
.jukebox-request-card textarea::placeholder { color: var(--muted); opacity: 1; }
.jukebox-request-card textarea { width: 100%; resize: vertical; }
.jukebox-request-card button[type="submit"] { width: 100%; margin-top: 1rem; }
.jukebox-message { min-height: 1.5rem; margin: 0.7rem 0 0; color: var(--muted); }
.jukebox-message.is-success { color: var(--success); }
.jukebox-message.is-error { color: var(--error); }
.jukebox-list { display: grid; gap: 0.75rem; margin-top: 0.85rem; }
.jukebox-item { display: grid; grid-template-columns: 7rem minmax(0, 1fr) auto; align-items: center; gap: 0.8rem; padding: 0.7rem; border: 1px solid var(--border); border-radius: 12px; background: rgba(9, 10, 18, 0.48); }
.jukebox-item img { width: 7rem; aspect-ratio: 16 / 9; border-radius: 8px; object-fit: cover; }
.jukebox-item > div:not(.jukebox-actions) { min-width: 0; display: grid; gap: 0.15rem; }
.jukebox-item strong,
.jukebox-item a { color: var(--text); overflow-wrap: anywhere; }
.jukebox-item span,
.jukebox-item em { display: block; font-size: 0.83rem; }
.jukebox-item em { color: var(--yellow); }
.jukebox-house-gap { grid-template-columns: 1fr; border-style: dashed; border-color: rgba(47, 230, 209, 0.48); background: rgba(47, 230, 209, 0.06); }
.jukebox-house-gap strong { color: var(--cyan); }
.jukebox-item .jukebox-pill { margin-top: 0.25rem; }
.jukebox-inline-note,
.jukebox-inline-error { display: block; margin-top: 0.3rem; font-size: 0.78rem; line-height: 1.35; }
.jukebox-inline-note { color: var(--yellow); }
.jukebox-inline-error { color: var(--error); }
.jukebox-small-button { padding: 0.4rem 0.6rem; font-size: 0.78rem; }
.jukebox-user-delete { border-color: rgba(255, 71, 111, 0.62) !important; color: #ff9ab0 !important; }
.jukebox-user-delete:hover { background: rgba(255, 71, 111, 0.14) !important; border-color: var(--error) !important; }
.jukebox-history-card { margin-top: 1.25rem; }
.jukebox-list-compact .jukebox-item { grid-template-columns: 5rem minmax(0, 1fr) auto; padding: 0.45rem; }
.jukebox-list-compact .jukebox-item img { width: 5rem; }
.jukebox-control-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 0.8rem 1.2rem; margin-bottom: 1.25rem; }
.jukebox-control-bar > div { display: flex; align-items: center; gap: 0.6rem; }
.jukebox-control-bar button { width: auto; }
.jukebox-schedule-panel { margin-bottom: 1.25rem; }
.jukebox-schedule-panel h2,
.jukebox-schedule-panel .eyebrow { margin-bottom: 0; }
.jukebox-schedule-note { margin: 0.35rem 0 1rem; }
.jukebox-schedule-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(18rem, 0.75fr); gap: 1.25rem; align-items: start; }
.jukebox-schedule-form { display: grid; gap: 0.85rem; }
.jukebox-schedule-form fieldset { margin: 0; padding: 0; border: 0; }
.jukebox-schedule-form legend { margin-bottom: 0.4rem; color: var(--muted); font-weight: 700; }
.jukebox-check { display: inline-flex; align-items: center; gap: 0.5rem; width: fit-content; font-weight: 800; }
.jukebox-check input,
.jukebox-day-picker input { width: auto; margin: 0; }
.jukebox-day-picker { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.jukebox-day-picker label { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.38rem 0.55rem; border: 1px solid var(--border); border-radius: 8px; }
.jukebox-time-fields { display: grid; grid-template-columns: repeat(2, minmax(8rem, 0.55fr)) minmax(14rem, 1fr); gap: 0.75rem; }
.jukebox-time-fields label { display: grid; gap: 0.35rem; color: var(--muted); font-weight: 700; }
.jukebox-time-fields input,
.jukebox-time-fields select { width: 100%; color: var(--text); }
.jukebox-schedule-actions { display: flex; flex-wrap: wrap; gap: 0.65rem; }
.jukebox-schedule-actions button { width: auto; }
.jukebox-schedule-facts { display: grid; gap: 0.6rem; margin: 0; padding: 0.8rem; border: 1px solid var(--border); border-radius: 12px; background: rgba(9, 10, 18, 0.4); }
.jukebox-schedule-facts div { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 0.65rem; }
.jukebox-schedule-facts dt { color: var(--muted); }
.jukebox-schedule-facts dd { margin: 0; overflow-wrap: anywhere; }
.jukebox-actions { display: grid; gap: 0.4rem; }
.jukebox-actions button { width: auto; padding: 0.42rem 0.65rem; font-size: 0.78rem; }
.jukebox-actions .jukebox-danger { border-color: rgba(255, 71, 111, 0.6); background: rgba(255, 71, 111, 0.12); color: #ff9ab0; }
.jukebox-actions .jukebox-danger:hover { border-color: var(--error); background: rgba(255, 71, 111, 0.22); }

.jukebox-broadcast-page { margin: 0; overflow: hidden; background: #000; }
.jukebox-stage { position: relative; width: 100vw; height: 100vh; background: #000; }
.jukebox-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.jukebox-standby { position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; justify-items: center; text-align: center; background: radial-gradient(circle, #24114f 0, #090a12 62%); }
.jukebox-standby[hidden] { display: none; }
.jukebox-standby img { width: min(48vw, 650px); }
.jukebox-standby h1 { margin: 2rem 0 0; font-size: clamp(3rem, 8vw, 8rem); }
.jukebox-standby p { color: var(--cyan); font-size: clamp(1.2rem, 2.4vw, 2.5rem); }

.jukebox-broadcast-credit {
  position: absolute;
  left: 3vw;
  bottom: clamp(7.5rem, 13vh, 10rem);
  z-index: 3;
  width: min(46rem, 72vw);
  padding: 1rem 1.25rem 1.05rem 1.45rem;
  border-left: 5px solid var(--cyan);
  border-radius: 0 16px 16px 0;
  background: linear-gradient(105deg, rgba(5, 7, 15, 0.96), rgba(35, 17, 73, 0.92));
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.65);
  pointer-events: none;
  animation: jukebox-credit-in 0.35s ease-out both;
}
.jukebox-broadcast-credit[hidden] { display: none; }
.jukebox-broadcast-credit-label {
  margin: 0 0 0.18rem;
  color: var(--cyan);
  font-size: clamp(0.8rem, 1.4vw, 1.15rem);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.jukebox-broadcast-credit h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.7rem, 3.5vw, 3.15rem);
  line-height: 1.02;
  overflow-wrap: anywhere;
}
.jukebox-broadcast-credit-title {
  margin: 0.35rem 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: clamp(0.95rem, 1.65vw, 1.35rem);
}
.jukebox-broadcast-credit-dedication {
  margin: 0.65rem 0 0;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(255, 228, 92, 0.32);
  color: var(--yellow);
  font-size: clamp(1rem, 1.8vw, 1.5rem);
  font-style: italic;
  line-height: 1.25;
}
.jukebox-fallback-cta {
  position: absolute;
  left: 50%;
  bottom: 3.5vh;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: min(90vw, 70rem);
  padding: 0.8rem 1.35rem;
  border: 1px solid rgba(47, 230, 209, 0.62);
  border-radius: 999px;
  background: linear-gradient(100deg, rgba(9, 10, 18, 0.94), rgba(48, 22, 96, 0.92));
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.58);
  color: #fff;
  font-size: clamp(0.95rem, 1.7vw, 1.45rem);
  line-height: 1.1;
  transform: translateX(-50%);
  pointer-events: none;
  animation: jukebox-cta-in 0.4s ease-out both;
}
.jukebox-fallback-cta[hidden] { display: none; }
.jukebox-fallback-cta span { color: var(--yellow); font-weight: 900; white-space: nowrap; }
.jukebox-fallback-cta strong { font-size: 1em; }
@keyframes jukebox-credit-in {
  from { opacity: 0; transform: translateX(-2rem); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes jukebox-cta-in {
  from { opacity: 0; transform: translate(-50%, 1.25rem); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.jukebox-overlay-page { margin: 0; overflow: hidden; background: transparent; }
.jukebox-overlay {
  position: fixed;
  left: 3vw;
  bottom: 4vh;
  width: min(52rem, 80vw);
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  padding: 0.85rem;
  border: 2px solid rgba(47, 230, 209, 0.7);
  border-radius: 18px;
  background: linear-gradient(105deg, rgba(9, 10, 18, 0.97), rgba(38, 19, 79, 0.94));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.72);
}
.jukebox-overlay[hidden] { display: none; }
.jukebox-overlay img { width: 12rem; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 11px; }
.jukebox-overlay h1 { margin: 0; font-size: clamp(1.35rem, 3vw, 2.5rem); line-height: 1.05; }
.jukebox-overlay p { margin: 0.25rem 0 0; color: var(--muted); }
#overlayDedication { color: var(--yellow); font-size: 1.05rem; font-style: italic; }

@media (max-width: 760px) {
  .jukebox-columns { grid-template-columns: 1fr; }
  .jukebox-schedule-layout,
  .jukebox-time-fields { grid-template-columns: 1fr; }
  .jukebox-item { grid-template-columns: 5.5rem minmax(0, 1fr); }
  .jukebox-item img { width: 5.5rem; }
  .jukebox-item > .jukebox-actions,
  .jukebox-item > button,
  .jukebox-item > .jukebox-pill { grid-column: 1 / -1; }
  .jukebox-actions { display: flex; flex-wrap: wrap; }
}

/* Lotería player/operator states */
.loteria-howto,
.loteria-host-checklist {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 228, 92, 0.28);
  border-radius: 8px;
  background: rgba(255, 228, 92, 0.06);
  line-height: 1.45;
}
.loteria-howto ol,
.loteria-host-checklist { padding-left: 1.35rem; }
.loteria-howto ol { margin: 0.45rem 0 0; }
.loteria-round-meta { color: var(--yellow); font-weight: 700; }
.loteria-claim-status {
  display: none;
  margin: 0.75rem 0;
  padding: 0.75rem;
  border-radius: 6px;
  background: rgba(47, 230, 209, 0.09);
  border: 1px solid rgba(47, 230, 209, 0.24);
}
.loteria-claim-status.is-visible { display: block; }
.loteria-claim-status.is-winner { border-color: rgba(255, 228, 92, 0.55); background: rgba(255, 228, 92, 0.12); }
.loteria-claim-status.is-error { border-color: rgba(255, 71, 111, 0.45); background: rgba(255, 71, 111, 0.09); }
.loteria-end-card { text-align: center; border-color: rgba(255, 228, 92, 0.45); }
.loteria-end-kicker { color: var(--yellow); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 800; }
.loteria-operator-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem; }
.loteria-operator-meta input { width: 9rem; }
body.loteria-mode .right-sidebar { display: none; }
body.loteria-mode .app-main { max-width: 760px; }

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.container { max-width: 480px; margin: 0 auto; padding: 1rem; width: 100%; }
.container.wide { max-width: 720px; }

h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.2rem; margin: 0 0 0.5rem; }
.muted { color: var(--muted); }
.muted code { font-size: 0.85em; background: var(--bg); padding: 0.1rem 0.3rem; border-radius: 4px; }
.help-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  border: 1px solid var(--muted);
  border-radius: 50%;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  flex: 0 0 auto;
}
.help-tip:hover,
.help-tip:focus {
  color: var(--yellow);
  border-color: var(--yellow);
  outline: none;
}
.millix-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 0.25rem;
  vertical-align: middle;
  z-index: 20;
}
.millix-help .help-tip {
  background: rgba(9, 10, 18, 0.72);
}
.millix-tooltip {
  position: absolute;
  bottom: calc(100% + 0.55rem);
  left: 50%;
  width: min(17rem, 82vw);
  padding: 0.7rem 0.75rem;
  border: 1px solid rgba(255, 228, 92, 0.46);
  border-radius: 8px;
  background: rgba(13, 15, 26, 0.98);
  box-shadow: var(--shadow-soft);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s ease;
  text-align: left;
  text-transform: none;
  visibility: hidden;
  z-index: 1400;
}
.millix-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 0.7rem;
  height: 0.7rem;
  border-right: 1px solid rgba(255, 228, 92, 0.46);
  border-bottom: 1px solid rgba(255, 228, 92, 0.46);
  background: rgba(13, 15, 26, 0.98);
  transform: translate(-50%, -50%) rotate(45deg);
}
.millix-tooltip strong,
.millix-tooltip span,
.millix-tooltip a {
  display: block;
}
.millix-tooltip strong {
  margin-bottom: 0.25rem;
  color: var(--yellow);
  font-size: 0.8rem;
}
.millix-tooltip a {
  width: fit-content;
  margin-top: 0.4rem;
  color: var(--cyan);
  font-weight: 800;
  text-decoration: none;
}
.millix-tooltip a:hover {
  color: var(--yellow);
}
.millix-help:hover .millix-tooltip,
.millix-help:focus .millix-tooltip,
.millix-help:focus-within .millix-tooltip {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
  visibility: visible;
}
.right-sidebar .millix-tooltip,
.scoreboard-modal .millix-tooltip {
  left: auto;
  right: -0.25rem;
  transform: translateY(4px);
}
.right-sidebar .millix-tooltip::after,
.scoreboard-modal .millix-tooltip::after {
  left: auto;
  right: 0.45rem;
  transform: translateY(-50%) rotate(45deg);
}
.right-sidebar .millix-help:hover .millix-tooltip,
.right-sidebar .millix-help:focus .millix-tooltip,
.right-sidebar .millix-help:focus-within .millix-tooltip,
.scoreboard-modal .millix-help:hover .millix-tooltip,
.scoreboard-modal .millix-help:focus .millix-tooltip,
.scoreboard-modal .millix-help:focus-within .millix-tooltip {
  transform: translateY(0);
}
.control-note {
  margin: -0.25rem 0 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.subtle-panel {
  border: 1px solid rgba(168, 179, 199, 0.2);
  border-radius: 8px;
  padding: 0.75rem;
  background: rgba(9, 10, 18, 0.35);
}
.subtle-panel-title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
}
.subtle-panel.is-live-bank-on {
  border-style: dashed;
  opacity: 0.82;
}
.schedule-repeat-panel {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(163, 175, 191, 0.18);
}
.schedule-repeat-panel h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}
.schedule-repeat-panel p {
  margin: 0.25rem 0 0.75rem;
  font-size: 0.9rem;
}
.repeat-weekdays {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.75rem 0;
}
.repeat-weekdays label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid rgba(168, 179, 199, 0.3);
  border-radius: 999px;
  padding: 0.35rem 0.55rem;
  color: var(--text);
  background: rgba(9, 10, 18, 0.3);
  font-size: 0.9rem;
}
.repeat-weekdays input {
  width: auto;
  margin: 0;
}
.repeat-count-row {
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.repeat-count-row label {
  color: var(--muted);
  font-size: 0.9rem;
}
.repeat-count-row input {
  max-width: 6rem;
}
.repeat-preview,
.repeat-status {
  font-size: 0.9rem;
}
.repeat-advanced {
  margin-top: 0.75rem;
}
.repeat-advanced summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 0.9rem;
}
.repeat-advanced label {
  display: block;
  margin: 0.75rem 0 0.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}

input, button, select {
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--muted);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
}
input { width: 100%; }
button {
  cursor: pointer;
  border-color: var(--yellow);
  background: var(--yellow);
  color: var(--primary);
  font-weight: 600;
}
button:hover { opacity: 0.9; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.secondary {
  background: transparent;
  color: var(--yellow);
  border-color: var(--muted);
}

/* Link styled as button */
a.btn-link {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  color: var(--primary);
  background: var(--yellow);
  border: 1px solid var(--yellow);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  text-decoration: none;
}
a.btn-link:hover { opacity: 0.9; }
a.btn-link.secondary {
  background: transparent;
  color: var(--yellow);
  border-color: var(--muted);
}

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.25rem; color: var(--muted); font-size: 0.9rem; }
input.input-readonly, input[readonly].input-readonly { background: var(--bg); color: var(--muted); cursor: not-allowed; }
.dashboard-form .form-group:last-of-type { margin-bottom: 0; }

.alert { padding: 0.6rem; border-radius: 8px; margin-bottom: 1rem; }
.alert.error { background: rgba(253, 44, 86, 0.2); color: var(--error); }
.alert.success { background: rgba(14, 187, 16, 0.2); color: var(--success); }
.alert.info { background: rgba(123, 22, 255, 0.2); color: var(--accent); }

.signup-recovery {
  margin: -0.25rem 0 1rem;
  padding: 0.85rem;
  border: 1px solid rgba(255, 226, 89, 0.45);
  border-radius: 10px;
  background: rgba(255, 226, 89, 0.08);
}
.signup-recovery strong,
.signup-recovery span { display: block; }
.signup-recovery span { margin-top: 0.25rem; color: var(--muted); font-size: 0.88rem; }
.signup-recovery-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.75rem; }
.signup-recovery-actions button,
.signup-recovery-actions .btn-link { flex: 1 1 190px; text-align: center; }

.card {
  background: var(--surface);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
}

/* Public profile page (separate from dashboard) */
.public-profile { max-width: 560px; }
.public-profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.public-profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--muted);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.public-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.public-profile-heading { min-width: 0; }
.public-profile-name { margin: 0 0 0.25rem; font-size: 1.5rem; }
.public-profile-username { margin: 0; font-size: 0.95rem; }
.public-profile-bio { margin-bottom: 1.25rem; }
.public-profile-bio-text { white-space: pre-wrap; color: var(--text); }
.public-profile-stats { margin-bottom: 1rem; }
.public-profile-stats-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2rem;
  margin: 0;
}
.public-profile-stat { margin: 0; }
.public-profile-stat dt { font-size: 0.85rem; margin-bottom: 0.15rem; }
.public-profile-stat dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.public-profile-footer { padding-top: 0.75rem; border-top: 1px solid rgba(163,175,191,0.2); }

.earnings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0.75rem 0;
}
.earnings-metric {
  border: 1px solid rgba(168, 179, 199, 0.22);
  border-radius: 8px;
  padding: 0.75rem;
  background: rgba(9, 10, 18, 0.35);
}
.earnings-metric span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}
.earnings-metric strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}
.wallet-cta {
  border: 1px solid rgba(255, 228, 92, 0.35);
  border-radius: 8px;
  padding: 0.85rem;
  background: rgba(255, 228, 92, 0.06);
  margin: 0.75rem 0;
}
.hosted-live-section {
  border: 1px solid rgba(34, 214, 111, 0.42);
  border-radius: 8px;
  padding: 0.85rem;
  background: rgba(34, 214, 111, 0.07);
  margin: 0 0 1rem;
}
.hosted-live-section h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}
.hosted-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.25rem;
  border: 1px solid rgba(168, 179, 199, 0.22);
  border-radius: 8px;
  background: rgba(9, 10, 18, 0.35);
  margin: 0 0 0.9rem;
}
.hosted-tab {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0.55rem 0.65rem;
}
.hosted-tab.is-active {
  background: var(--yellow);
  color: var(--primary);
}
.hosted-tab span {
  display: inline-flex;
  justify-content: center;
  min-width: 1.5rem;
  margin-left: 0.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: rgba(168, 179, 199, 0.18);
  font-size: 0.8rem;
}
.hosted-tab.is-active span {
  background: rgba(83, 27, 174, 0.15);
}
.hosted-tab-panel {
  margin: 0;
}
.hosted-game-row {
  margin-bottom: 0.85rem;
  padding: 0.8rem 0 0.9rem;
  border-bottom: 1px solid rgba(163, 175, 191, 0.2);
}
.hosted-game-row:last-child {
  margin-bottom: 0;
}
.hosted-game-row-live {
  border-bottom-color: rgba(34, 214, 111, 0.25);
  padding-top: 0;
}
.hosted-game-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.3rem;
}
.hosted-game-title,
.hosted-game-meta {
  margin: 0;
}
.hosted-game-meta {
  color: var(--muted);
  font-size: 0.88rem;
}
.hosted-live-pill {
  flex: 0 0 auto;
  border: 1px solid rgba(34, 214, 111, 0.55);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  color: var(--success);
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(34, 214, 111, 0.1);
}
.hosted-live-action {
  margin-top: 0.35rem;
}
.nav-earnings-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 228, 92, 0.45);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  margin-right: 0.45rem;
  font-size: 0.78rem;
  color: var(--yellow);
  background: rgba(255, 228, 92, 0.08);
}
.landing-container {
  max-width: 1120px;
}
.landing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 1.25rem;
  align-items: start;
  max-width: 1040px;
  margin: 0 auto;
}
.landing-main {
  max-width: 640px;
  width: 100%;
  justify-self: center;
}
.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.instant-play-panel {
  display: grid;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1rem;
  border: 1px solid rgba(255, 228, 92, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 228, 92, 0.09), rgba(47, 230, 209, 0.08)),
    rgba(21, 23, 36, 0.92);
  box-shadow: var(--shadow-soft);
}
.instant-play-panel h2 {
  font-size: 1.35rem;
}
.instant-play-panel p {
  margin: 0;
}
.instant-play-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.instant-play-status {
  min-height: 1.25rem;
  font-size: 0.9rem;
}
.instant-recaptcha {
  min-height: 78px;
}
.upcoming-games-card {
  position: sticky;
  top: 1rem;
}
.upcoming-games-card h2 {
  margin-bottom: 0.25rem;
}
.upcoming-games-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.9rem;
}
.upcoming-game {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem 0;
  border-top: 1px solid rgba(168, 179, 199, 0.18);
}
.upcoming-game h3 {
  margin: 0.15rem 0 0.15rem;
  font-size: 1rem;
}
.upcoming-game p,
.upcoming-game time {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.upcoming-game time {
  color: var(--yellow);
  font-variant-numeric: tabular-nums;
}
.upcoming-game-module {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border: 1px solid rgba(47, 230, 209, 0.38);
  border-radius: 999px;
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.upcoming-game-join {
  white-space: nowrap;
  padding: 0.45rem 0.65rem;
  font-size: 0.85rem;
}
.share-room-card {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(168, 179, 199, 0.2);
}
.share-room-card h2 {
  font-size: 1rem;
}
.share-room-card input[readonly] {
  color: var(--text);
  background: rgba(9, 10, 18, 0.5);
}
.post-game-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0.85rem 0;
}
.instant-game-controls {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 0.75rem;
}
.leaderboard-hero { margin-bottom: 1rem; }
.leaderboard-hero h1 { margin-bottom: 0.25rem; }
.leaderboard-card { overflow-x: auto; }
.leaderboard-table { min-width: 560px; }
.leaderboard-row {
  display: grid;
  grid-template-columns: 4.5rem minmax(14rem, 1fr) 10rem 5rem;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(168, 179, 199, 0.18);
}
.leaderboard-row:last-child { border-bottom: 0; }
.leaderboard-head {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-top: 0;
}
.leaderboard-rank {
  font-weight: 700;
  color: var(--yellow);
}
.leaderboard-player {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}
.leaderboard-player small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}
.leaderboard-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}
.leaderboard-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: var(--text);
  font-weight: 700;
}

.faq-container {
  max-width: 920px;
}
.faq-hero {
  margin-bottom: 1rem;
}
.faq-hero h1 {
  margin-bottom: 0.35rem;
}
.faq-search {
  margin: 1rem 0 0.85rem;
}
.faq-search label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.faq-search input {
  max-width: 42rem;
}
.faq-search p {
  min-height: 1.25rem;
  margin: 0.35rem 0 0;
  font-size: 0.86rem;
}
.faq-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.9rem 0 0;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(9, 10, 18, 0.34);
}
.faq-tab {
  min-height: 2.25rem;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  padding: 0.45rem 0.7rem;
}
.faq-tab:hover {
  box-shadow: none;
}
.faq-tab.is-active {
  border-color: rgba(255, 228, 92, 0.62);
  background: rgba(255, 228, 92, 0.11);
  color: var(--yellow);
}
.faq-section {
  margin: 1rem 0 1.25rem;
}
.faq-section h2 {
  margin: 0 0 0.6rem;
  color: var(--cyan);
}
.faq-item {
  margin-bottom: 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(21, 23, 36, 0.88);
  overflow: hidden;
}
.faq-item[open] {
  border-color: rgba(47, 230, 209, 0.4);
}
.faq-item summary {
  cursor: pointer;
  padding: 0.85rem 1rem;
  color: var(--text);
  font-weight: 800;
}
.faq-item summary:hover {
  color: var(--yellow);
}
.faq-answer {
  padding: 0 1rem 1rem;
  color: var(--muted);
}
.faq-answer p {
  margin: 0.65rem 0 0;
}
.faq-answer strong {
  color: var(--text);
}
.faq-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.faq-link-row a {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid rgba(47, 230, 209, 0.35);
  border-radius: 8px;
  color: var(--cyan);
  text-decoration: none;
}
.faq-link-row a:hover {
  border-color: rgba(255, 228, 92, 0.62);
  color: var(--yellow);
}
.faq-target {
  animation: faq-target-pulse 2.1s ease-out;
}
@keyframes faq-target-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 228, 92, 0.34); }
  70% { box-shadow: 0 0 0 12px rgba(255, 228, 92, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 228, 92, 0); }
}

.flex { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.mt { margin-top: 1rem; }
.mb { margin-bottom: 0.5rem; }

/* Top nav */
.topnav {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--muted);
  margin-bottom: 1rem;
}
.topnav a {
  color: var(--yellow);
  text-decoration: none;
  font-size: 0.9rem;
}
.topnav a:hover { text-decoration: underline; color: var(--text); }
.topnav a:first-child { font-weight: 600; color: var(--text); }

/* Player: bingo / Lotería board */
.bingo-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  max-width: 280px;
  margin: 0 auto 1rem;
}
.bingo-board.loteria-board {
  grid-template-columns: repeat(4, 1fr);
}
.bingo-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--muted);
  border-radius: 4px;
  font-weight: 600;
}
.bingo-cell.marked { background: var(--yellow); color: var(--primary); }

/* Trivia options */
.trivia-options { display: flex; flex-direction: column; gap: 0.5rem; }
.trivia-option {
  padding: 0.8rem;
  background: var(--surface);
  border: 2px solid var(--muted);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}
.trivia-option:hover { border-color: var(--yellow); }
.trivia-option.selected { border-color: var(--yellow); background: rgba(238, 238, 34, 0.15); }
.trivia-option.correct { border-color: var(--success); background: rgba(14, 187, 16, 0.2); }
.trivia-option.wrong { border-color: var(--error); background: rgba(253, 44, 86, 0.2); }

/* Host dashboard */
.players-list { list-style: none; padding: 0; margin: 0; }
.players-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  border-bottom: 1px solid var(--muted);
}
.claims-queue { margin-top: 1rem; }
.claim-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }

/* Trivia question bank */
.trivia-section-title { font-size: 1.05rem; margin: 0 0 0.5rem; color: var(--text); }
.trivia-question-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  max-height: 280px;
  overflow-y: auto;
}
.trivia-question-list li {
  padding: 0.6rem;
  margin-bottom: 0.5rem;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--muted);
}
.trivia-question-list .q-text { font-weight: 600; margin-bottom: 0.25rem; }
.trivia-question-list .q-opts { font-size: 0.9rem; color: var(--muted); margin-bottom: 0.5rem; }
.trivia-question-list .q-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.trivia-add-form { margin-bottom: 1rem; padding: 0.75rem; background: var(--bg); border-radius: 8px; }
.trivia-options-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.trivia-options-row input[type="radio"] { width: auto; margin: 0; }
.trivia-option-label { width: 1.2rem; flex-shrink: 0; color: var(--muted); font-size: 0.9rem; }
.trivia-option-input { flex: 1; min-width: 0; }

/* Final scoreboard */
.scoreboard-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.scoreboard-champion {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--yellow);
  text-align: center;
  animation: scoreboard-champion-in 0.55s ease-out both;
}
.winner-spotlight {
  justify-items: center;
  text-align: center;
  gap: 0.35rem;
  margin: 0.2rem 0 1rem;
  padding: 0.5rem 0 0.65rem;
}
.winner-spotlight-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.winner-spotlight-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 116px;
  height: 116px;
  margin: 0.2rem 0;
}
.winner-spotlight-avatar::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background:
    conic-gradient(from 20deg, var(--yellow), var(--cyan), var(--accent), var(--coral), var(--yellow));
  filter: blur(10px);
  opacity: 0.42;
  animation: winner-aura 3.2s linear infinite;
}
.winner-avatar {
  position: relative;
  z-index: 1;
  border: 4px solid rgba(255, 228, 92, 0.9);
  box-shadow:
    0 0 0 6px rgba(255, 228, 92, 0.12),
    0 18px 42px rgba(0, 0, 0, 0.35);
}
.winner-spotlight h3 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.45rem, 6vw, 2rem);
  line-height: 1.1;
}
.winner-spotlight p:last-child {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.35;
}
@keyframes winner-aura {
  to { transform: rotate(360deg); }
}
@keyframes scoreboard-champion-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .scoreboard-champion,
  .winner-spotlight-avatar::before {
    animation: none;
  }
}

/* ── 3-column game layout: players | main | right (prev answer + leaderboards) ── */
.app-with-scoreboard {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.app-main .container {
  width: 100%;
}

/* Left sidebar — current players */
.players-sidebar {
  display: none;
  flex-shrink: 0;
  width: 200px;
  padding: 1rem;
  background: var(--surface);
  border-right: 1px solid var(--muted);
  overflow-y: auto;
}
.players-sidebar h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 0.75rem;
  color: var(--muted);
}
.sidebar-players-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar-players-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(163,175,191,0.15);
  font-size: 0.85rem;
}
.sidebar-players-list li:last-child { border-bottom: none; }
.sidebar-player-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Right sidebar — previous answer + dual leaderboards */
.right-sidebar {
  display: none;
  flex-shrink: 0;
  width: 240px;
  padding: 1rem;
  background: var(--surface);
  border-left: 1px solid var(--muted);
  overflow-y: auto;
}
.right-sidebar-section {
  margin-bottom: 1.25rem;
}
.right-sidebar-section:last-child { margin-bottom: 0; }
.right-sidebar-section h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 0.5rem;
  color: var(--muted);
  border-bottom: 1px solid rgba(163,175,191,0.25);
  padding-bottom: 0.35rem;
}
.total-mlx-earned-section {
  margin-bottom: 1.25rem;
}
.total-mlx-earned-line {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text);
}
.total-mlx-earned-line span {
  font-weight: 600;
  color: var(--success);
}
.scoring-rule-values {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
}
.scoring-rule-values span {
  display: inline-flex;
  align-items: center;
  min-height: 1.6rem;
  padding: 0.25rem 0.45rem;
  border: 1px solid rgba(168, 179, 199, 0.18);
  border-radius: 6px;
  background: rgba(9, 10, 18, 0.38);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
}
.scoring-rule-note {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}
.modal-scoring-rules {
  margin-bottom: 1rem;
}
.modal-scoring-rules .scoring-rule-values span {
  font-size: 0.82rem;
}
.prev-answer-box {
  background: var(--bg);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  color: var(--text);
  border-left: 3px solid var(--yellow);
  word-break: break-word;
}
.prev-answer-question {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0 0 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prev-answer-value {
  font-weight: 600;
  color: var(--success);
}
.leaderboard-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.leaderboard-list li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(163,175,191,0.12);
  font-size: 0.82rem;
}
.leaderboard-list li:last-child { border-bottom: none; }
.leaderboard-rank { width: 1.2rem; flex-shrink: 0; color: var(--muted); font-size: 0.75rem; }
.leaderboard-rank.rank-medal {
  width: auto;
  min-width: 1.85rem;
  font-size: 1rem;
  text-align: center;
  line-height: 1.2;
}
.leaderboard-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leaderboard-score { flex-shrink: 0; color: var(--yellow); font-weight: 600; font-size: 0.8rem; }
.leaderboard-score.negative-score { color: var(--error); }
.leaderboard-empty { color: var(--muted); font-size: 0.8rem; font-style: italic; }

/* Legacy scoreboard sidebar (kept for compatibility) */
.scoreboard-sidebar {
  display: none;
}

/* Mobile FAB + modal for standings */
.scoreboard-fab {
  display: flex;
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--primary);
  border: 2px solid var(--primary);
  font-size: 1.5rem;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 900;
}
.scoreboard-fab:hover { opacity: 0.95; }
.scoreboard-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}
.scoreboard-modal-overlay.open {
  display: flex;
}
.scoreboard-modal {
  background: var(--surface);
  border-radius: 12px;
  padding: 1.25rem;
  max-width: 340px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  border: 1px solid var(--muted);
  position: relative;
}
.scoreboard-modal h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}
.scoreboard-modal h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin: 1rem 0 0.4rem;
  border-bottom: 1px solid rgba(163,175,191,0.2);
  padding-bottom: 0.25rem;
}
.scoreboard-modal h4:first-of-type { margin-top: 0; }
.scoreboard-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 8px;
  font-size: 1.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: var(--bg);
  border: 1px solid var(--muted);
  color: var(--text);
}
.scoreboard-modal-close:hover { background: var(--muted); color: var(--bg); }

/* First correct trivia modal — centered, auto-closes 5s */
.first-correct-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1001;
  background: rgba(0, 0, 0, 0.75);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  box-sizing: border-box;
  animation: firstCorrectFadeIn 0.3s ease-out;
}
.first-correct-modal-overlay.open {
  display: flex;
}
@keyframes firstCorrectFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.first-correct-modal {
  position: relative;
  text-align: center;
  padding: 2rem 2.5rem;
  min-width: 280px;
  max-width: 90vw;
  background: linear-gradient(145deg, var(--surface) 0%, #1a1b20 100%);
  border-radius: 16px;
  border: 2px solid var(--yellow);
  box-shadow:
    0 0 0 4px rgba(238, 238, 34, 0.15),
    0 0 40px rgba(123, 22, 255, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: firstCorrectPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes firstCorrectPop {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.first-correct-label {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
}
.first-correct-name {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  font-weight: 700;
  color: var(--yellow);
  text-shadow: 0 0 20px rgba(238, 238, 34, 0.4);
}
.first-correct-mlx {
  margin: 0;
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  font-weight: 600;
  color: var(--success);
}
.first-correct-answer {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.4;
}

.answer-feedback-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1002;
  background: rgba(0, 0, 0, 0.75);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  box-sizing: border-box;
}
.answer-feedback-modal-overlay.open {
  display: flex;
}
.answer-feedback-modal {
  width: min(92vw, 420px);
  text-align: center;
  padding: 1.75rem;
  background: linear-gradient(145deg, var(--surface) 0%, #1a1b20 100%);
  border: 2px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: var(--shadow), 0 0 32px rgba(141, 85, 255, 0.16);
  animation: answer-feedback-in 0.26s ease-out both;
}
.answer-feedback-modal.correct {
  border-color: var(--success);
  box-shadow: var(--shadow), 0 0 34px rgba(34, 214, 111, 0.24);
}
.answer-feedback-modal.wrong {
  border-color: var(--error);
}
.answer-feedback-modal.missed {
  border-color: var(--yellow);
}
.answer-feedback-label {
  margin: 0 0 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-size: 0.85rem;
}
.answer-feedback-result {
  margin: 0;
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  font-weight: 800;
  color: var(--yellow);
}
.answer-feedback-choice,
.answer-feedback-answer,
.answer-feedback-mlx,
.answer-feedback-next {
  margin: 0.65rem 0 0;
  color: var(--muted);
  line-height: 1.4;
}
.answer-feedback-answer {
  color: var(--text);
  font-weight: 700;
}
.answer-feedback-mlx {
  color: var(--success);
  font-weight: 700;
}
.answer-feedback-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}
@keyframes answer-feedback-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (min-width: 768px) {
  .app-with-scoreboard { flex-direction: row; align-items: stretch; }
  .app-main { flex: 1; max-width: 520px; }
  .host-page .app-main { max-width: 720px; }
  .players-sidebar { display: flex; flex-direction: column; }
  .right-sidebar { display: flex; flex-direction: column; }
  .scoreboard-fab { display: none; }
}
@media (max-width: 767px) {
  .players-sidebar { display: none; }
  .right-sidebar { display: none; }
  .scoreboard-fab { display: flex; }
}

/* Very wide screens: give more room to all columns */
@media (min-width: 1200px) {
  .players-sidebar { width: 220px; }
  .right-sidebar { width: 280px; }
}

@media (min-width: 600px) {
  .container.wide { padding: 1.5rem; }
}

/* ── Player avatars ── */
.player-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  vertical-align: middle;
}
.player-avatar-initial {
  font-weight: 700;
  color: #fff;
  font-size: 14px;
  text-transform: uppercase;
}
.player-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.player-row .player-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Scoreboard with avatars */
.scoreboard-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--muted);
}
.scoreboard-list li:last-child { border-bottom: none; }
.scoreboard-list li.podium-1 {
  background: linear-gradient(90deg, rgba(238, 238, 34, 0.12), transparent);
  border-radius: 8px;
  padding-left: 0.35rem;
  margin-left: -0.35rem;
}
.scoreboard-list li.podium-2 {
  background: linear-gradient(90deg, rgba(163, 175, 191, 0.14), transparent);
  border-radius: 8px;
  padding-left: 0.35rem;
  margin-left: -0.35rem;
}
.scoreboard-list li.podium-3 {
  background: linear-gradient(90deg, rgba(253, 181, 110, 0.12), transparent);
  border-radius: 8px;
  padding-left: 0.35rem;
  margin-left: -0.35rem;
}
.scoreboard-list .rank {
  width: 1.4rem;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.scoreboard-list .rank.rank-medal {
  width: auto;
  min-width: 2.15rem;
  font-size: 1.35rem;
  line-height: 1.2;
  text-align: center;
  color: var(--text);
}
.scoreboard-list .score-info { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.9rem; }

/* ── Auth modal ── */
.auth-modal-overlay,
.signup-success-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.auth-modal-overlay.open,
.signup-success-modal-overlay.open { display: flex; }
.auth-modal,
.signup-success-modal {
  background: var(--surface);
  border-radius: 16px;
  padding: 2rem;
  max-width: 380px;
  width: 100%;
  border: 1px solid var(--muted);
  box-shadow: 0 0 40px rgba(123, 22, 255, 0.2);
  text-align: center;
  position: relative;
}
.auth-modal h2 { font-size: 1.25rem; margin: 0 0 0.5rem; }
.auth-modal p { color: var(--muted); margin: 0 0 1.5rem; font-size: 0.95rem; }
.signup-success-modal h2 { font-size: 1.4rem; margin: 0 0 0.5rem; }
.signup-success-modal p { color: var(--muted); margin: 0 0 1rem; font-size: 0.95rem; }
.signup-success-modal:focus { outline: none; }
.signup-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  margin-bottom: 1rem;
  border: 2px solid rgba(34, 214, 111, 0.62);
  border-radius: 50%;
  background: rgba(34, 214, 111, 0.14);
  color: var(--success);
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
}
.signup-success-email {
  display: inline-flex;
  max-width: 100%;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(47, 230, 209, 0.34);
  border-radius: 999px;
  background: rgba(47, 230, 209, 0.08);
  color: var(--cyan) !important;
  overflow-wrap: anywhere;
}
.signup-success-dev {
  margin: 1rem 0;
  padding: 0.9rem;
  border: 1px dashed rgba(255, 228, 92, 0.42);
  border-radius: 8px;
  background: rgba(255, 228, 92, 0.08);
}
.signup-success-dev p {
  margin-bottom: 0.65rem;
  color: var(--yellow);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
}
.signup-success-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.signup-success-actions .btn-link,
.signup-success-actions button {
  width: 100%;
  text-align: center;
}
.auth-modal .auth-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 8px;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1px solid var(--muted);
  color: var(--text);
  cursor: pointer;
}
.auth-modal-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
body.modal-open { overflow: hidden; }

/* Nav user display */
.nav-user { display: flex; align-items: center; margin-left: auto; gap: 0.5rem; }
.nav-user a { color: var(--text) !important; text-decoration: none; display: flex; align-items: center; gap: 0.4rem; }
.nav-user a:hover { color: var(--yellow) !important; }
.nav-user a.nav-earnings-pill { color: var(--yellow) !important; }
.nav-user a.nav-earnings-pill:hover {
  border-color: rgba(255, 228, 92, 0.8);
  background: rgba(255, 228, 92, 0.14);
}

/* Avatar upload preview */
.avatar-preview-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg);
  border: 2px solid var(--muted);
}
.avatar-preview-initial {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: 2px solid var(--muted);
}
.form-hint { color: var(--muted); font-size: 0.8rem; margin-top: 0.2rem; }
.form-section-label {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 1.25rem 0 0.5rem;
  border-bottom: 1px solid rgba(163,175,191,0.3);
  padding-bottom: 0.25rem;
}

/* Stream display — Lotería wheel (loteria-wheel-core.js) */
.display-loteria-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}
.display-loteria-stage {
  position: relative;
  background: linear-gradient(180deg, #121214 0%, #0a0a0c 100%);
  border: 1px solid rgba(163, 175, 191, 0.22);
  border-radius: 16px;
  display: grid;
  place-items: center;
  padding: 0.75rem;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  overflow: hidden;
}
.display-loteria-stage.dim {
  filter: blur(1px) brightness(0.88);
}
.display-loteria-pointer {
  position: absolute;
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-bottom: 22px solid var(--accent);
  filter: drop-shadow(0 4px 10px rgba(123, 22, 255, 0.45));
  z-index: 3;
}
.display-loteria-wheel-ring {
  position: absolute;
  width: min(78vw, 400px);
  height: min(78vw, 400px);
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(163, 175, 191, 0.18), inset 0 0 28px rgba(123, 22, 255, 0.06);
  pointer-events: none;
}
#displayLoteriaWheel {
  width: min(88vw, 400px);
  height: min(88vw, 400px);
  max-width: 400px;
  max-height: 400px;
  aspect-ratio: 1 / 1;
  display: block;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, #14161c, #08090c 60%);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55), inset 0 0 60px rgba(0, 0, 0, 0.55);
}
.display-loteria-pulse {
  position: absolute;
  width: 38vmin;
  height: 38vmin;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(14, 187, 16, 0.22), inset 0 0 50px rgba(14, 187, 16, 0.06);
  animation: display-loteria-ring 2.2s ease-out infinite;
  z-index: 4;
  pointer-events: none;
}
@keyframes display-loteria-ring {
  0% { transform: scale(0.9); opacity: 0.9; }
  70% { transform: scale(1.18); opacity: 0.12; }
  100% { transform: scale(1.22); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .display-loteria-pulse { animation: none; opacity: 0.35; }
}
.display-loteria-stage .cele-wrap {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 5;
}
.display-loteria-stage .cele-wrap.show {
  opacity: 1;
  transform: scale(1);
}
.display-loteria-stage .cele-card {
  display: grid;
  gap: 0.35rem;
  place-items: center;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  background: radial-gradient(120% 140% at 10% 10%, rgba(123, 22, 255, 0.15), transparent 40%),
    radial-gradient(120% 140% at 90% 90%, rgba(14, 187, 16, 0.08), transparent 40%),
    rgba(8, 10, 16, 0.78);
  border: 1px solid rgba(123, 22, 255, 0.22);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65);
  text-align: center;
}
.display-loteria-stage .cele-num {
  font-size: clamp(2rem, 10vw, 3.5rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: 0.04em;
  color: var(--text);
  text-shadow: 0 0 14px rgba(123, 22, 255, 0.35);
}
.display-loteria-stage .cele-name {
  font-size: clamp(0.95rem, 3.5vw, 1.25rem);
  color: var(--muted);
}
.display-loteria-stage .confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 6;
  pointer-events: none;
}
.display-loteria-stage .confetti i {
  position: absolute;
  top: -10px;
  width: 6px;
  height: 12px;
  opacity: 0.9;
  animation: display-loteria-fall linear forwards;
}
@keyframes display-loteria-fall {
  to {
    transform: translateY(120vh) rotate(360deg);
    opacity: 0.75;
  }
}
.display-loteria-result {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  max-width: 420px;
  padding: 0.5rem 0.65rem;
  background: var(--bg);
  border: 1px solid rgba(163, 175, 191, 0.2);
  border-radius: 10px;
}
.display-loteria-badge {
  display: inline-grid;
  place-items: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.35rem;
  border-radius: 8px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #1e1f26 0%, #121318 100%);
  border: 1px solid rgba(163, 175, 191, 0.25);
}
.display-loteria-result-line {
  font-size: 0.88rem;
  line-height: 1.35;
}

/* Wheel multiplayer — TV-style prize wheel (wheel-show-ui.js) */
.wheel-show-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin: 0 auto 1rem;
  max-width: min(96vw, 560px);
}
.wheel-show-stage {
  position: relative;
  width: 100%;
  max-width: min(96vw, 520px);
  aspect-ratio: 1;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.55));
}
.wheel-show-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 3px rgba(255, 215, 0, 0.45),
    inset 0 0 50px rgba(0, 0, 0, 0.35);
}
.wheel-show-pointer {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: clamp(14px, 3.5vw, 22px) solid transparent;
  border-right: clamp(14px, 3.5vw, 22px) solid transparent;
  border-top: clamp(28px, 7vw, 44px) solid #ffd54f;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.65));
  z-index: 3;
  pointer-events: none;
}
.wheel-show-caption {
  text-align: center;
  font-size: 0.95rem;
  min-height: 1.4em;
  max-width: 36rem;
}
.display-view .wheel-show-wrap {
  max-width: min(96vw, 640px);
}
.display-view .wheel-show-stage {
  max-width: min(96vw, 600px);
}

/* Wheel multiplayer — puzzle-first layout + hero banner */
.wheel-card .wheel-hero {
  margin: 0 0 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(75, 20, 140, 0.35) 0%, rgba(22, 23, 26, 0.95) 100%);
  border: 1px solid rgba(123, 22, 255, 0.35);
}
.wheel-hero-headline {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
}
.wheel-hero-sub {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.4;
}
.wheel-hero-timer {
  margin: 0.45rem 0 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--warn);
}
.wheel-turn-strip {
  margin: 0.35rem 0 0.25rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 214, 120, 0.95);
  line-height: 1.25;
}
.wheel-your-turn-flash {
  margin: 0.35rem 0 0.25rem;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-align: center;
  color: #1a1020;
  background: linear-gradient(90deg, #ffd060, #ff8c42);
  animation: wheel-your-turn-pulse 1.1s ease-in-out infinite;
}
@keyframes wheel-your-turn-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.88;
    transform: scale(1.02);
  }
}
.wheel-board {
  text-align: center;
  margin: 0 0 1rem;
  padding: 0.85rem 1rem 1rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(163, 175, 191, 0.2);
}
.wheel-board .wheel-category {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.wheel-mask {
  margin: 0;
  font-size: 1.65rem;
  letter-spacing: 0.18rem;
  font-weight: 800;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}
.wheel-mask-display {
  font-size: clamp(1.35rem, 4vw, 2.25rem);
  letter-spacing: 0.14em;
}
.wheel-mask-host {
  font-size: 1.35rem;
  letter-spacing: 0.12em;
}
.wheel-seat-summary {
  margin-top: 0.65rem;
  font-size: 0.92rem;
  text-align: center;
}
.wheel-host-steps {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem 0.65rem 1.5rem;
  font-size: 0.86rem;
  line-height: 1.55;
  border-radius: 10px;
  background: rgba(22, 23, 26, 0.75);
  border: 1px solid rgba(163, 175, 191, 0.2);
  list-style-position: outside;
}
.wheel-host-steps li {
  margin: 0.2rem 0;
  opacity: 0.55;
  transition: opacity 0.15s ease;
}
.wheel-host-steps li.wheel-host-step-active {
  opacity: 1;
  font-weight: 700;
  color: var(--warn);
}
.wheel-hero-host {
  margin-bottom: 0.65rem;
}

/* Game-night visual polish */
body {
  background:
    linear-gradient(180deg, rgba(9, 10, 18, 0.62), rgba(9, 10, 18, 0.96)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 76px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 76px),
    linear-gradient(135deg, #090a12 0%, #15112a 46%, #101c24 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: 7px;
  background: linear-gradient(90deg, var(--yellow), var(--cyan), var(--accent), var(--coral));
  box-shadow: 0 0 24px rgba(47, 230, 209, 0.28);
  pointer-events: none;
  z-index: 3000;
}

.container {
  padding: 1.15rem;
}

h1,
h2,
h3 {
  line-height: 1.15;
  text-wrap: balance;
}

h1 {
  font-size: clamp(1.7rem, 5vw, 2.45rem);
  font-weight: 900;
  color: var(--text);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.28), 0 0 22px rgba(255, 228, 92, 0.12);
}

h2 {
  font-weight: 800;
}

a {
  color: var(--cyan);
}

input,
button,
select,
textarea {
  border-color: var(--border);
  background: rgba(21, 23, 36, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(47, 230, 209, 0.28);
  outline-offset: 2px;
  border-color: rgba(47, 230, 209, 0.72);
}

button,
a.btn-link {
  border-color: rgba(255, 228, 92, 0.9);
  background: linear-gradient(180deg, #fff06f 0%, var(--yellow) 48%, #ffc857 100%);
  color: #23133c;
  box-shadow: 0 4px 0 #9c6d13, 0 12px 26px rgba(255, 184, 77, 0.15);
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease, opacity 0.14s ease;
}

button:hover,
a.btn-link:hover {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 5px 0 #9c6d13, 0 16px 32px rgba(255, 184, 77, 0.22);
}

button:active,
a.btn-link:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #9c6d13, 0 8px 18px rgba(255, 184, 77, 0.14);
}

button:disabled {
  transform: none;
  box-shadow: none;
}

button.secondary,
a.btn-link.secondary {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(47, 230, 209, 0.35);
  color: var(--cyan);
  box-shadow: none;
}

button.secondary:hover,
a.btn-link.secondary:hover {
  border-color: rgba(47, 230, 209, 0.72);
  box-shadow: 0 10px 22px rgba(47, 230, 209, 0.08);
}

.topnav {
  position: sticky;
  top: 0;
  z-index: 1200;
  background: rgba(13, 15, 26, 0.86);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(16px);
}

.topnav a {
  color: var(--cyan);
  font-weight: 700;
}

.topnav a:first-child {
  color: var(--text);
  font-weight: 900;
}

.topnav a:hover {
  color: var(--yellow);
  text-decoration: none;
}

.topnav .brand-link {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  padding: 0.1rem 0;
}

.brand-logo {
  display: block;
  width: clamp(130px, 21vw, 210px);
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.34));
}

.landing-logo-title {
  margin: 0 auto 0.75rem;
  text-align: center;
}

.landing-logo {
  display: block;
  width: min(100%, 520px);
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.32));
}

.card,
.auth-modal,
.signup-success-modal,
.scoreboard-modal,
.trivia-add-form,
.trivia-question-list li,
.prev-answer-box,
.display-loteria-result,
.wheel-board,
.wheel-host-steps,
.wheel-card .wheel-hero {
  border-radius: 8px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012)),
    rgba(21, 23, 36, 0.9);
  box-shadow: var(--shadow-soft);
}

.card,
.auth-modal,
.signup-success-modal,
.scoreboard-modal {
  position: relative;
  overflow: hidden;
}

.card::before,
.auth-modal::before,
.signup-success-modal::before,
.scoreboard-modal::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--yellow), var(--cyan), var(--accent), var(--coral));
}

.alert {
  border: 1px solid var(--border);
  border-left-width: 4px;
  box-shadow: var(--shadow-soft);
}

.alert.error {
  background: rgba(255, 71, 111, 0.12);
  border-left-color: var(--error);
}

.alert.success {
  background: rgba(34, 214, 111, 0.12);
  border-left-color: var(--success);
}

.alert.info {
  background: rgba(141, 85, 255, 0.14);
  border-left-color: var(--cyan);
}

.players-sidebar,
.right-sidebar {
  background: rgba(13, 15, 26, 0.88);
  border-color: var(--border);
  box-shadow: var(--shadow-soft);
}

.players-sidebar h3,
.right-sidebar-section h3,
.form-section-label,
.wheel-turn-strip {
  color: var(--cyan);
  letter-spacing: 0.08em;
}

.players-list li,
.sidebar-players-list li,
.leaderboard-list li,
.scoreboard-list li {
  border-bottom-color: rgba(168, 179, 199, 0.14);
}

.player-avatar,
.public-profile-avatar,
.avatar-preview,
.avatar-preview-initial {
  border-color: rgba(255, 228, 92, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 228, 92, 0.08);
}

.bingo-board {
  gap: 5px;
  padding: 0.35rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 228, 92, 0.16);
}

.bingo-cell {
  border-color: rgba(168, 179, 199, 0.22);
  background: linear-gradient(180deg, rgba(30, 34, 51, 0.96), rgba(16, 18, 30, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.bingo-cell.marked {
  background: linear-gradient(180deg, #fff06f, var(--yellow));
  color: #25163a;
  border-color: rgba(255, 228, 92, 0.88);
  box-shadow: 0 0 18px rgba(255, 228, 92, 0.24);
}

.trivia-options {
  gap: 0.65rem;
}

.trivia-option {
  background: linear-gradient(180deg, rgba(30, 34, 51, 0.96), rgba(16, 18, 30, 0.96));
  border-color: rgba(168, 179, 199, 0.24);
  box-shadow: var(--shadow-soft);
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.trivia-option:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 228, 92, 0.78);
}

.trivia-option.selected {
  border-color: var(--yellow);
  background: linear-gradient(180deg, rgba(255, 228, 92, 0.18), rgba(255, 184, 77, 0.08));
}

.trivia-option.correct {
  border-color: var(--success);
  background: linear-gradient(180deg, rgba(34, 214, 111, 0.22), rgba(34, 214, 111, 0.08));
}

.trivia-option.wrong {
  border-color: var(--error);
  background: linear-gradient(180deg, rgba(255, 71, 111, 0.22), rgba(255, 71, 111, 0.08));
}

.scoreboard-list li.podium-1,
.scoreboard-list li.podium-2,
.scoreboard-list li.podium-3 {
  border: 1px solid rgba(255, 228, 92, 0.14);
  padding: 0.45rem 0.55rem;
  margin-left: 0;
}

.scoreboard-list li.podium-1 {
  background: linear-gradient(90deg, rgba(255, 228, 92, 0.2), rgba(255, 228, 92, 0.03));
}

.scoreboard-list li.podium-2 {
  background: linear-gradient(90deg, rgba(47, 230, 209, 0.16), rgba(47, 230, 209, 0.03));
}

.scoreboard-list li.podium-3 {
  background: linear-gradient(90deg, rgba(255, 107, 107, 0.15), rgba(255, 107, 107, 0.03));
}

.scoreboard-champion,
.leaderboard-score,
.total-mlx-earned-line span {
  color: var(--yellow);
}

.scoreboard-fab {
  background: linear-gradient(180deg, var(--yellow), #ffc857);
  color: #24143c;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 0 #9c6d13, 0 18px 36px rgba(0, 0, 0, 0.3);
}

.first-correct-modal,
.display-loteria-stage {
  border-radius: 8px;
  border-color: var(--border-strong);
  box-shadow: var(--shadow), 0 0 32px rgba(141, 85, 255, 0.16);
}

.wheel-show-stage canvas {
  border-color: var(--border-strong);
  box-shadow:
    inset 0 0 0 3px rgba(255, 228, 92, 0.45),
    inset 0 0 50px rgba(0, 0, 0, 0.35),
    0 0 32px rgba(141, 85, 255, 0.16);
}

.first-correct-name {
  color: var(--yellow);
}

.display-loteria-pointer {
  border-bottom-color: var(--yellow);
  filter: drop-shadow(0 4px 12px rgba(255, 228, 92, 0.45));
}

.display-loteria-badge {
  background: linear-gradient(180deg, var(--yellow), #ffc857);
  border-color: rgba(255, 228, 92, 0.72);
  color: #24143c;
}

.wheel-show-pointer {
  border-top-color: var(--yellow);
  filter: drop-shadow(0 4px 10px rgba(255, 228, 92, 0.35));
}

.wheel-hero-headline,
.wheel-board .wheel-category {
  color: var(--yellow);
}

.wheel-mask {
  color: var(--text);
  text-shadow: 0 0 18px rgba(47, 230, 209, 0.18);
}

.wheel-your-turn-flash {
  border-radius: 8px;
  background: linear-gradient(90deg, var(--yellow), var(--coral));
  color: #23133c;
  box-shadow: 0 0 22px rgba(255, 184, 77, 0.22);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.55rem 0.45rem;
  border-bottom: 1px solid rgba(168, 179, 199, 0.16);
}

th {
  color: var(--cyan);
  font-size: 0.82rem;
  text-align: left;
}

@media (prefers-reduced-motion: reduce) {
  button,
  a.btn-link,
  .trivia-option,
  .answer-feedback-modal {
    transition: none;
    animation: none;
  }

  button:hover,
  a.btn-link:hover,
  .trivia-option:hover {
    transform: none;
  }
}

@media (max-width: 520px) {
  .earnings-grid { grid-template-columns: 1fr; }
  .landing-layout { grid-template-columns: 1fr; }
  .landing-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
  .landing-main > * {
    max-width: 100%;
    min-width: 0;
  }
  .instant-play-panel {
    order: -1;
    width: 100%;
    margin-bottom: 1rem;
    padding: 0.9rem;
  }
  .instant-play-panel h2 {
    font-size: 1.2rem;
  }
  .instant-play-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .instant-play-actions button {
    width: 100%;
    white-space: normal;
  }
  .landing-logo-title {
    width: 100%;
  }
  .landing-logo {
    width: min(100%, 340px);
  }
  .upcoming-games-card {
    position: static;
  }
  .upcoming-game {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .upcoming-game-join {
    width: fit-content;
  }
  .nav-earnings-pill,
  .nav-user > .millix-help { display: none; }
  .leaderboard-table { min-width: 0; }
  .leaderboard-row {
    grid-template-columns: 3.5rem minmax(0, 1fr);
    gap: 0.5rem;
  }
  .leaderboard-row > strong,
  .leaderboard-row > .muted { grid-column: 2; }
  .leaderboard-head { display: none; }
  .topnav {
    gap: 0.65rem;
    overflow-x: auto;
  }

  .brand-logo {
    width: 118px;
  }

  .card {
    padding: 0.9rem;
  }

  button,
  a.btn-link {
    max-width: 100%;
  }
}

/* Responsive navigation and dashboard hierarchy */
.topnav-toggle {
  display: none;
  width: 42px;
  height: 38px;
  padding: 0.55rem;
  border-color: rgba(47, 230, 209, 0.55);
  background: rgba(47,230,209,0.1);
  box-shadow: none;
}
.topnav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  margin: 3px 0;
  border-radius: 999px;
  background: var(--cyan);
}
.topnav #navLogout { display: none !important; }

.container.dashboard-shell { max-width: 1180px; }
.dashboard-heading {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: end;
  margin-bottom: 1.25rem;
}
.dashboard-heading h1 { margin-bottom: 0.35rem; }
.dashboard-section-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
}
.dashboard-section-nav a {
  padding: 0.42rem 0.68rem;
  border: 1px solid rgba(47,230,209,0.28);
  border-radius: 999px;
  background: rgba(47,230,209,0.05);
  color: var(--cyan);
  font-size: 0.8rem;
  font-weight: 800;
  text-decoration: none;
}
.dashboard-section-nav a:hover {
  border-color: rgba(255,228,92,0.55);
  color: var(--yellow);
}
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}
.dashboard-grid > .dashboard-section {
  min-width: 0;
  margin-bottom: 0;
}
.dashboard-grid > .dashboard-span { grid-column: 1 / -1; }
.dashboard-grid > .dashboard-compact { align-self: stretch; }
.dashboard-grid > .dashboard-section:not(.dashboard-featured)::before {
  background: linear-gradient(90deg, rgba(168,179,199,0.34), rgba(47,230,209,0.24));
}

@media (max-width: 760px) {
  .topnav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    overflow: visible;
    padding: 0.65rem 0.75rem;
  }
  .topnav .brand-link { grid-column: 1; }
  .topnav-toggle { display: block; grid-column: 2; grid-row: 1; align-self: center; justify-self: end; }
  .topnav > a:not(.brand-link),
  .topnav > .nav-user { display: none !important; }
  .topnav.is-open > a:not(.brand-link) {
    display: block !important;
    grid-column: 1 / -1;
    padding: 0.55rem 0.2rem;
    border-top: 1px solid rgba(168,179,199,0.14);
  }
  .topnav.is-open > .nav-user {
    display: flex !important;
    grid-column: 1 / -1;
    margin: 0;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(168,179,199,0.14);
    flex-wrap: wrap;
  }
  .topnav.is-open > .nav-user .nav-earnings-pill { display: inline-flex; }
  .dashboard-heading { display: grid; align-items: start; }
  .dashboard-section-nav { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.35rem; }
  .dashboard-section-nav a { flex: 0 0 auto; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-grid > .dashboard-span { grid-column: auto; }
}
