/* quiz.css — Standalone dark-theme stylesheet for 85Schollies Roster Quiz */

/* ─── Font Face ──────────────────────────────────────────────────── */
@font-face {
  font-family: 'Flapjack';
  src: url('fonts/TAYFlapjack.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ─── Design Tokens ───────────────────────────────────────────────── */
:root {
  --quiz-correct: #538D4E;
  --quiz-close: #B59F3B;
  --quiz-wrong: #3A3A3C;
  --quiz-correct-bright: #4CAF50;
  --quiz-wrong-bright: #E53935;
  --quiz-surface: rgba(255, 255, 255, 0.08);
  --quiz-surface-hover: rgba(255, 255, 255, 0.15);
  --quiz-border: rgba(255, 255, 255, 0.2);

  /* Inherited from main app */
  --dark-blue: #121E34;
  --heading-fonts: "Flapjack", "industry-inc-base", sans-serif;
  --accent-fonts: "Inter", sans-serif;
  --body-fonts: "indivisible", sans-serif;
  --spacing-xxs: 4px;
  --spacing-xs: 8px;
  --spacing-s: 16px;
  --spacing-m: 24px;
  --spacing-l: 32px;
  --spacing-xl: 40px;
  --spacing-xxl: 48px;
  --border-radius: 10px;
  --border-radius-lg: 30px;
}

/* ─── Reset / Base ────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--dark-blue);
  color: white;
  font-family: var(--body-fonts, "Inter", sans-serif);
  font-weight: 200;
  font-size: 17px;
  min-height: 100vh;
  overflow-x: hidden;
  padding-top: 16px;
}

h1, h2, h3 {
  font-family: var(--heading-fonts, "industry-inc-base", sans-serif);
}

h1 {
  font-size: 2.75rem;
}
@media (max-width: 767px) {
  h1 {
    font-size: 2.25rem;
  }
}

a { color: white; }

button {
  cursor: pointer;
  font-family: inherit;
}

/* ─── Layout ──────────────────────────────────────────────────────── */
.quiz-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 var(--spacing-s);
}

/* Site header, hamburger, and nav overlay styles are in shared.css */

/* ─── Mode Panel Header ───────────────────────────────────────────── */
.quiz-mode-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-m);
}

.quiz-mode-title {
  font-size: 1.25rem;
  font-family: var(--heading-fonts, sans-serif);
}

/* ─── Buttons ─────────────────────────────────────────────────────── */
.quiz-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xxs);
  border: none;
  border-radius: var(--border-radius);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 10px 20px;
  transition: opacity 0.15s, background 0.15s;
}

.quiz-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.quiz-btn--primary {
  background: white;
  color: var(--dark-blue);
}

.quiz-btn--primary:hover:not(:disabled) { opacity: 0.9; }

.quiz-btn--ghost {
  background: var(--quiz-surface);
  border: 1px solid var(--quiz-border);
  color: white;
}

.quiz-btn--ghost:hover:not(:disabled) {
  background: var(--quiz-surface-hover);
}

.quiz-btn--correct {
  background: var(--quiz-correct-bright);
  color: white;
}

.quiz-btn--wrong {
  background: var(--quiz-wrong-bright);
  color: white;
}

.quiz-btn--stats {
  background: var(--quiz-surface);
  border: 1px solid var(--quiz-border);
  border-radius: var(--border-radius);
  color: white;
  font-size: 0.8125rem;
  padding: 6px 12px;
  min-width: 44px;
  min-height: 44px;
}

.quiz-btn--sm {
  font-size: 0.8125rem;
  padding: 7px 14px;
}

/* ─── Position Rooms ─────────────────────────────────────────────── */

/* Side picker on start screen */
.quiz-start-screen p.rooms-side-picker__label {
  font-size: 1.125rem;
  color: #ffffff;
  text-align: center;
  margin-top: var(--spacing-l);
  margin-bottom: 0;
}
.rooms-side-picker {
  display: flex;
  gap: var(--spacing-s);
  justify-content: center;
  margin-top: var(--spacing-m);
}

.rooms-side-btn {
  background: var(--quiz-surface);
  border: 1px solid var(--quiz-border);
  border-radius: var(--border-radius);
  color: white;
  padding: var(--spacing-m) var(--spacing-l);
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
  flex: 1;
  max-width: 200px;
}

.rooms-side-btn:hover {
  background: var(--quiz-surface-hover);
  border-color: rgba(255, 255, 255, 0.4);
}

.rooms-side-btn__label {
  display: block;
  font-family: var(--heading-fonts, sans-serif);
  font-size: 1.25rem;
  margin-bottom: 4px;
}

.rooms-side-btn__count {
  display: block;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.5);
}

/* Top bar: side, timer, mistakes */
.rooms-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-xs);
  padding: var(--spacing-xs) 0;
}

.rooms-top-bar__side {
  font-family: var(--heading-fonts, sans-serif);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rooms-top-bar__timer {
  font-family: var(--heading-fonts, sans-serif);
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.8);
  font-variant-numeric: tabular-nums;
}

.rooms-top-bar__mistakes {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.75);
}

.rooms-pool__instruction {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: white;
  margin-bottom: var(--spacing-xs);
}

.rooms-pool__header {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: var(--spacing-xs);
  padding: 0 2px;
}

/* Player name chips */
.rooms-player-chip {
  background: var(--quiz-surface);
  border: 1px solid var(--quiz-border);
  border-radius: 6px;
  color: white;
  font-family: inherit;
  font-size: 0.8125rem;
  padding: 8px 10px;
  text-align: left;
  transition: background 0.12s, border-color 0.12s;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rooms-player-chip:hover {
  background: var(--quiz-surface-hover);
}

.rooms-player-chip--selected {
  background: rgba(255, 255, 255, 0.2);
  border-color: white;
  color: white;
  font-weight: 500;
}


/* Results screen */
.rooms-results {
  text-align: center;
  padding: var(--spacing-m);
}

.rooms-results__time {
  font-size: 4rem;
  font-family: var(--heading-fonts, sans-serif);
  line-height: 1;
  margin-bottom: var(--spacing-xs);
}

.rooms-results__label {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: var(--spacing-s);
}

.rooms-results__mistakes {
  font-size: 1.25rem;
  font-family: var(--heading-fonts, sans-serif);
  margin-bottom: var(--spacing-xs);
}

.rooms-results__flavor {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: var(--spacing-l);
}

.rooms-results__actions {
  display: flex;
  gap: var(--spacing-s);
  justify-content: center;
}

/* ─── Mobile compact progress row (hidden on desktop) ──────────────── */
.rooms-compact-progress {
  display: flex;
  gap: 6px;
  margin-bottom: var(--spacing-s);
}

.rooms-cp-item {
  flex: 1;
  min-width: 0;
}

.rooms-cp-item--full .rooms-cp-label { color: var(--quiz-correct-bright); }

.rooms-cp-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 2px;
  font-family: var(--heading-fonts, sans-serif);
}

.rooms-cp-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.rooms-cp-fill {
  height: 100%;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.rooms-cp-item--full .rooms-cp-fill {
  background: var(--quiz-correct-bright);
}

/* ─── Player list ────────────────────────────────────────────────── */
.rooms-mobile-pool {
  display: block;
}

.rooms-mobile-pool__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 4px;
  max-height: 65vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}


/* ─── Drawer (mobile bottom sheet) ─────────────────────────────────── */
.rooms-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 300;
}

.rooms-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1a2540;
  border-top: 1px solid var(--quiz-border);
  border-radius: 16px 16px 0 0;
  padding: var(--spacing-xs) var(--spacing-m) var(--spacing-l);
  padding-bottom: calc(var(--spacing-l) + env(safe-area-inset-bottom, 0px));
  z-index: 301;
  max-height: 75vh;
  max-width: 500px;
  margin: 0 auto;
  overflow-y: auto;
}

.rooms-drawer__handle {
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin: 0 auto var(--spacing-s);
}

.rooms-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.rooms-drawer__name {
  font-family: var(--heading-fonts, sans-serif);
  font-size: 1.25rem;
}

.rooms-drawer__close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.125rem;
  padding: 4px 8px;
  min-width: 44px;
  min-height: 44px;
}

.rooms-drawer__subtitle {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: var(--spacing-xs);
}

.rooms-drawer__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: var(--spacing-s);
}

/* If 5 items, let last one span full width */
.rooms-drawer__grid > :last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.rooms-drawer__btn {
  position: relative;
  background: var(--quiz-surface);
  border: 1px solid var(--quiz-border);
  border-radius: var(--border-radius);
  color: white;
  font-family: inherit;
  padding: 10px 12px;
  text-align: center;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.rooms-drawer__btn:active:not(:disabled) {
  background: var(--quiz-surface-hover);
}

.rooms-drawer__btn--full {
  opacity: 0.35;
  cursor: default;
}

.rooms-drawer__btn--flash-wrong {
  animation: rooms-flash-wrong 0.6s ease;
}

.rooms-drawer__btn-label {
  display: block;
  font-family: var(--heading-fonts, sans-serif);
  font-size: 1rem;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.rooms-drawer__btn-count {
  display: block;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 6px;
}

.rooms-drawer__btn-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.rooms-drawer__btn-fill {
  height: 100%;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.rooms-drawer__btn--full .rooms-drawer__btn-fill {
  background: var(--quiz-correct-bright);
}

.rooms-drawer__sass {
  text-align: center;
  font-size: 0.875rem;
  color: #f4b4b4;
  font-style: italic;
  padding: var(--spacing-xs) 0;
  min-height: 40px;
}

/* Drawer transitions */
.rooms-drawer-enter       { transition: transform 0.25s ease-out; }
.rooms-drawer-enter-start { transform: translateY(100%); }
.rooms-drawer-enter-end   { transform: translateY(0); }
.rooms-drawer-leave        { transition: transform 0.2s ease-in; }
.rooms-drawer-leave-start  { transform: translateY(0); }
.rooms-drawer-leave-end    { transform: translateY(100%); }

/* ─── Toast (all screen sizes) ─────────────────────────────────────── */
.rooms-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 24px;
  border-radius: var(--border-radius-lg);
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 400;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.rooms-toast--correct {
  background: var(--quiz-correct-bright);
  color: white;
}

.rooms-toast--wrong {
  background: #2a1a1a;
  border: 1px solid rgba(229, 57, 53, 0.4);
  color: #ef9a9a;
}

.rooms-toast-enter       { transition: opacity 0.2s ease, transform 0.2s ease; }
.rooms-toast-enter-start { opacity: 0; transform: translateX(-50%) translateY(-12px); }
.rooms-toast-enter-end   { opacity: 1; transform: translateX(-50%) translateY(0); }
.rooms-toast-leave        { transition: opacity 0.2s ease; }
.rooms-toast-leave-start  { opacity: 1; }
.rooms-toast-leave-end    { opacity: 0; }

/* ─── Stats Modal ─────────────────────────────────────────────────── */
.quiz-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: var(--spacing-s);
}

.quiz-modal {
  background: #1a2540;
  border: 1px solid var(--quiz-border);
  border-radius: var(--border-radius);
  max-width: 440px;
  width: 100%;
  padding: var(--spacing-m);
  position: relative;
}

.quiz-modal__title {
  font-family: var(--heading-fonts, sans-serif);
  font-size: 1.25rem;
  margin-bottom: var(--spacing-m);
}

.quiz-modal__close {
  position: absolute;
  top: var(--spacing-s);
  right: var(--spacing-s);
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 1.25rem;
  line-height: 1;
  padding: 4px 8px;
  transition: color 0.15s;
  min-width: 44px;
  min-height: 44px;
}

.quiz-modal__close:hover { color: white; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-s);
  margin-bottom: var(--spacing-m);
}

.stats-cell {
  background: var(--quiz-surface);
  border-radius: var(--border-radius);
  padding: var(--spacing-s);
  text-align: center;
}

.stats-cell__value {
  font-size: 2rem;
  font-family: var(--heading-fonts, sans-serif);
  line-height: 1;
}

.stats-cell__label {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
  margin-top: var(--spacing-xxs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ─── Footer ──────────────────────────────────────────────────────── */
.quiz-footer {
  padding: 40px 0 64px;
  text-align: center;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.5);
}

.quiz-footer__link {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: underline;
}

.quiz-footer__link:hover { color: white; }

/* ─── Utilities ───────────────────────────────────────────────────── */
.text-center { text-align: center; }
.mt-s { margin-top: var(--spacing-s); }
.mt-m { margin-top: var(--spacing-m); }
.mb-s { margin-bottom: var(--spacing-s); }
.mb-m { margin-bottom: var(--spacing-m); }

[x-cloak] { display: none !important; }

/* Section start screen */
.quiz-start-screen {
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-s);
}

.quiz-start-screen h2 {
  font-size: 1.5rem;
  margin-bottom: var(--spacing-s);
}

.quiz-start-screen p {
  color: rgba(255,255,255,0.75);
  margin-bottom: var(--spacing-m);
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

.quiz-start-screen .quiz-btn {
  min-width: 160px;
}

/* ─── Pause Button ───────────────────────────────────────────────── */
.rooms-pause-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 8px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}
.rooms-pause-btn:hover {
  color: white;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

