/* Base layout */
html {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  font-family: "Plus Jakarta Sans", sans-serif;
  background: linear-gradient(135deg, #e0f2fe, #f0f9ff 50%, #fef3c7);
}

html,
body,
body * {
  -webkit-user-select: none;
  user-select: none;
}

body > header {
  flex-shrink: 0;
}

body > main {
  flex: 1 1 0;
  min-height: 0;
  padding: 6px 10px;
  overflow: hidden;
  justify-content: flex-start;
}

body > main > section {
  min-height: 0;
  padding: 12px;
}

body > main:has(.two-player-screen:not(.hidden)) {
  width: 98%;
  max-width: 1600px;
}

.font-fredoka {
  font-family: "Fredoka", sans-serif;
}

.custom-card {
  border: 3px solid #fff;
  box-shadow: 0 10px 25px -5px #00000014,
              0 8px 10px -6px #0000000a;
}

.btn-bounce:active {
  transform: scale(.96);
}

button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

button,
select,
.unit-row {
  touch-action: manipulation;
}

button:focus-visible,
select:focus-visible,
.unit-row:has(input:focus-visible) {
  outline: 3px solid #0284c7;
  outline-offset: 3px;
}

/* Setup */
#startScreen:not(.hidden) {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  width: 100%;
  min-height: 0;
  overflow-y: auto;
}

#startScreen > .text-center {
  flex-shrink: 0;
  margin-bottom: 8px;
}

#startScreen > .mb-6 {
  margin-bottom: 8px;
}

#startScreen > div:has(#unitGrid) {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 60px;
}

#startScreen > div:has(#unitGrid) > div:first-child {
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 8px;
}

#unitGrid {
  flex: 1 1 0;
  min-height: 0;
  padding: 3px;
  overflow-x: hidden;
  overflow-y: auto;
  align-content: start;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

#startScreen > div:has(#questionDirectionSelect) {
  flex-shrink: 0;
  padding: 8px;
  gap: 7px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#startScreen > div:has(#startBtn) {
  flex-shrink: 0;
}

#startScreen select {
  min-height: 44px;
  font-size: 14px;
}

#startScreen label {
  font-size: 13px;
}

#startScreen button:not(#startBtn) {
  min-height: 44px;
}

#startBtn {
  padding: 10px;
}

.grade-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}

#gradeControl.hidden {
  display: none;
}

#gradeSelect {
  max-width: 155px;
  min-height: 44px;
  padding: 7px 9px;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  background: #e0f2fe;
  cursor: pointer;
}

.unit-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 48px;
  padding: 9px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  cursor: pointer;
}

.unit-row:hover {
  background: #f0f9ff;
}

.unit-row input {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: #0ea5e9;
}

.unit-title {
  flex: 1;
  min-width: 0;
  color: #1e293b;
  overflow-wrap: anywhere;
  font-family: "Fredoka", sans-serif;
  font-size: 14px;
}

.unit-number {
  color: #1e293b;
}

.unit-name {
  color: #0284c7;
}

.unit-count {
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

#dataStatus {
  flex-shrink: 0;
  margin-bottom: 6px;
}

#dataStatus:empty {
  display: none;
}

/* Gameplay */
.two-player-screen:not(.hidden) {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  width: 100%;
  min-height: 0;
  overflow: hidden;
}

.player-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  align-items: stretch;
  flex: 1 1 0;
  gap: 8px;
  min-height: 0;
}

.player-panels.single-player {
  grid-template-columns: minmax(0, 1fr);
  align-self: center;
  width: 100%;
  max-width: 960px;
}

.player-panel {
  --player-color: #0284c7;
  --panel-border: #f9cf00;

  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 11px;
  border: 2px solid var(--panel-border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px #0f172a0a;
  overflow-y: auto;
}

.player-panel.player-2 {
  --player-color: #7c3aed;
  --panel-border: #00bff9;
}

.player-header,
.player-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 8px;
}

.player-2 .player-header {
  flex-direction: row-reverse;
}

.player-header h2 {
  color: var(--player-color);
  font-family: "Fredoka", sans-serif;
  font-size: 38px;
  font-weight: 600;
}

.player-header strong {
  padding: 5px 10px;
  border-radius: 10px;
  background: #f1f5f9;
  color: var(--player-color);
  font-size: 16px;
}

.player-meta {
  flex-wrap: wrap;
  margin: 5px 0;
  color: #64748b;
  font-size: 12px;
}

.player-meta > span:first-child {
  color: var(--player-color);
  font-weight: 700;
}

.answer-timer {
  color: #e11d48;
  font-weight: 700;
  white-space: nowrap;
}

.player-progress {
  flex-shrink: 0;
  height: 5px;
  border-radius: 9px;
  background: #e2e8f0;
  overflow: hidden;
}

.player-progress > div {
  height: 100%;
  background: var(--player-color);
  transition: width .2s;
}

.player-unit {
  flex-shrink: 0;
  margin-top: 5px;
  overflow: hidden;
  color: #64748b;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-question {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  gap: 7px;
  min-height: 48px;
  margin-top: 6px;
  padding: 8px;
  border-radius: 12px;
  background: #f8fafc;
}

.player-question h3 {
  font-family: "Fredoka", sans-serif;
  font-size: clamp(20px, 2.5vw, 32px);
  font-weight: 600;
  overflow-wrap: anywhere;
  text-align: center;
}

.player-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  flex-shrink: 0;
  gap: 6px;
  margin-top: 7px;
}

.player-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 55px;
  padding: 8px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 20px;
  font-weight: bold;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-align: left;
}

.player-option:hover:not(:disabled) {
  border-color: var(--panel-border);
  background: #f8fafc;
}

.player-option:disabled {
  opacity: 1;
}

.option-letter {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: #f1f5f9;
  font-size: 14px;
  font-weight: bold;
}

.player-option.correct {
  border-color: #10b981;
  background: #ecfdf5;
  color: #065f46;
}

.player-option.incorrect {
  border-color: #f43f5e;
  background: #fff1f2;
  color: #9f1239;
}

.player-keys {
  flex-shrink: 0;
  margin-top: 4px;
  color: #64748b;
  font-size: 10px;
}

.menu-button {
  min-height: 44px;
}

.score-earned {
  animation: score-pop .4s ease-out;
}

@keyframes score-pop {
  50% {
    transform: scale(1.12);
    background: #dcfce7;
  }
}

.game-paused .player-question,
.game-paused .player-options {
  filter: blur(9px);
  pointer-events: none;
}

/* Results */
.player-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.result-player {
  --player-color: #0284c7;

  padding: 20px 8px;
  border-top: 4px solid var(--player-color);
  border-radius: 16px;
  background: #f8fafc;
}

.result-player.player-2 {
  --player-color: #7c3aed;
}

.result-player h3 {
  font-family: "Fredoka", sans-serif;
  font-size: 22px;
}

.result-player strong {
  color: var(--player-color);
  font-size: 28px;
}

.result-player p {
  margin-top: 5px;
  font-size: 13px;
}

.panel-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  gap: 8px;
  padding: 10px 8px;
  text-align: center;
}

.panel-result > span {
  color: #64748b;
  font-size: 18px;
}

.panel-result > strong {
  color: var(--player-color);
  font-family: "Fredoka", sans-serif;
  font-size: clamp(48px, 8vw, 92px);
  line-height: 1;
}

.panel-result > b {
  color: var(--player-color);
  font-size: 22px;
}

.panel-result > p {
  color: #475569;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.panel-result .panel-outcome {
  color: var(--player-color);
  font-family: "Fredoka", sans-serif;
  font-size: 22px;
  font-weight: 600;
}

.panel-result .player-waiting {
  margin-top: 8px;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
}

.score-breakdown {
  line-height: 1.7;
}

/* Dialogs */
.game-dialog {
  width: min(390px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 24px;
  border: 0;
  border-radius: 20px;
  color: #1e293b;
  box-shadow: 0 24px 70px #0f172a40;
  overflow-y: auto;
}

.game-dialog:not([open]) {
  display: none;
}

.game-dialog::backdrop {
  background: #0f172a80;
  backdrop-filter: blur(3px);
}

.game-dialog h2 {
  margin-bottom: 10px;
  font-family: "Fredoka", sans-serif;
  font-size: 24px;
  font-weight: 600;
}

.game-dialog p {
  color: #64748b;
  font-size: 14px;
  line-height: 1.6;
}

.game-dialog button:focus-visible {
  outline-color: #38bdf8;
}

.confirmation-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.confirmation-actions button {
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #f1f5f9;
  font-size: 13px;
  font-weight: 700;
}

.confirmation-actions .confirm-exit {
  background: #0284c7;
  color: #fff;
}

.end-set-dialog[open] {
  text-align: center;
}

.end-set-dialog .confirmation-actions {
  justify-content: center;
}

#nextSetBtn.hidden,
#infoResumeActions.hidden {
  display: none;
}

#gameInfoTitle {
  padding-right: 16px;
}

#gameInfoDialog p + p {
  margin-top: 10px;
}

.keyboard-player {
  display: block;
  padding-left: 16px;
}

.keyboard-note {
  display: block;
}

.keyboard-help kbd {
  display: inline-block;
  min-width: 1.4em;
  padding: 0 .4em;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  color: inherit;
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  font-size: 13px;
}

.modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Shared toolbar order */
.games-header-controls {
  flex-direction: row !important;
}

#backToMenuBtn {
  order: 10 !important;
}

#pauseBtn {
  order: 20 !important;
}

#restartGameBtn {
  order: 30 !important;
}


#infoBtn {
  order: 50 !important;
}

#fullscreenToggleBtn {
  order: 60 !important;
}

/* Short screens */
@media (max-height: 650px) {
  body > main > section {
    padding: 8px;
  }

  .player-panel {
    padding: 9px;
  }

  .player-question {
    margin-top: 5px;
    padding: 6px;
  }

  .player-question h3 {
    font-size: 32px;
  }

  .player-option {
    padding: 6px;
  }

  .player-meta {
    margin: 4px 0;
  }

  #startScreen > .text-center {
    margin-bottom: 6px;
  }

  #startTitle {
    font-size: 22px;
  }
}

/* Phones */
@media (max-width: 639px) {
  #unitGrid {
    grid-template-columns: minmax(0, 1fr);
  }

  #startScreen > div:has(#questionDirectionSelect) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #startScreen select {
    padding: 8px;
  }

  .player-panels,
  .player-results {
    grid-template-columns: minmax(0, 1fr);
  }

  .player-panels {
    gap: 6px;
  }

  .player-panel {
    padding: 9px;
    border-radius: 14px;
  }

  .player-header,
  .player-2 .player-header {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 3px;
  }

  .player-header h2 {
    font-size: 22px;
  }

  .player-header strong {
    padding: 3px 8px;
    font-size: 13px;
  }

  .player-meta {
    gap: 3px;
  }

  .player-option {
    gap: 5px;
    min-height: 44px;
    padding: 7px;
  }

  .player-question {
    gap: 4px;
    padding: 6px 4px;
  }

  .player-question h3 {
    font-size: clamp(18px, 4vw, 26px);
  }

  .player-keys {
    display: none;
  }
}

/* Large classroom displays */
@media (min-width: 1600px) and (min-height: 850px) {
  body > main:has(.two-player-screen:not(.hidden)) {
    max-width: 94vw;
  }

  body > main:not(:has(.two-player-screen:not(.hidden))) {
    max-width: 1200px;
  }

  .player-panels {
    gap: 24px;
  }

  .player-panel {
    padding: 19px;
  }

  .player-panels.single-player {
    max-width: 1100px;
  }

  .player-header h2 {
    font-size: clamp(28px, 2vw, 56px);
  }

  .player-header strong {
    font-size: clamp(22px, 1.5vw, 40px);
  }

  .player-meta,
  .player-unit {
    font-size: clamp(18px, 1.1vw, 30px);
  }

  .player-question h3 {
    font-size: clamp(40px, 3vw, 90px);
  }

  .player-option {
    min-height: clamp(80px, 9vh, 160px);
    padding: 18px;
    font-size: clamp(24px, 1.6vw, 48px);
  }

  .option-letter {
    width: 44px;
    height: 44px;
    font-size: 22px;
  }

  .menu-button {
    min-height: 56px;
    font-size: 22px;
  }

  #startScreen select,
  #gradeSelect,
  .unit-title {
    font-size: 20px;
  }

  #startScreen label,
  .unit-count {
    font-size: 16px;
  }

  .unit-row {
    min-height: 60px;
  }

  .game-dialog {
    width: min(650px, calc(100vw - 32px));
  }

  .game-dialog p,
  .confirmation-actions button {
    font-size: 20px;
  }

  .game-dialog h2 {
    font-size: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .score-earned {
    animation: none;
  }

  .player-progress > div {
    transition: none;
  }
}
/* Friendly unit selection: unit topics replace technical word counts. */
#unitGrid { gap: 12px; }
#unitGrid .unit-row { min-height: 68px; padding: 12px 18px; border-radius: 16px; border-color: #cbd5e1; background: linear-gradient(120deg,#f8fbff,#eaf6ff); gap: 14px; transition: background .15s,box-shadow .15s,transform .15s; }
#unitGrid .unit-row:hover { background:#e0f2fe; box-shadow:0 5px 16px #0c4a6e20; transform:translateY(-1px); }
#unitGrid .unit-row:has(input:checked) { border-color:#38bdf8; background:linear-gradient(120deg,#eff6ff,#dcfce7); }
#unitGrid .unit-row input { width:23px;height:23px; }
#unitGrid .unit-number { font-family:'Fredoka',sans-serif; font-size:clamp(17px,1.6vw,23px);font-weight:700;color:#0f172a;white-space:nowrap; }
#unitGrid .unit-name { margin-left:auto;max-width:62%;text-align:right;font-family:'Fredoka',sans-serif;font-weight:600;font-size:clamp(16px,1.5vw,21px);line-height:1.25;color:#0369a1;overflow-wrap:anywhere; }
#startScreen > div.bg-slate-50 select {font-size:clamp(15px,1.3vw,18px);padding-top:12px;padding-bottom:12px;}
#startScreen > div.bg-slate-50 label {font-size:clamp(14px,1.2vw,17px);}
@media(max-width:600px){#unitGrid .unit-row{min-height:62px;padding:10px 12px}#unitGrid .unit-number{font-size:18px}#unitGrid .unit-name{font-size:16px;max-width:60%}}

/* Refine the selection-screen typography without shrinking game controls. */
#unitGrid .unit-row { min-height: 59px; padding: 9px 14px; }
#unitGrid .unit-number { font-size: clamp(15px, 1.35vw, 20px); }
#unitGrid .unit-name { font-size: clamp(14px, 1.3vw, 18px); }
#startScreen > div.bg-slate-50 select { font-size: clamp(14px, 1.15vw, 16px); }
#startScreen > div.bg-slate-50 label { font-size: clamp(13px, 1.05vw, 15px); }
@media(max-width:600px) {
  #unitGrid .unit-row { min-height: 56px; padding: 8px 11px; }
  #unitGrid .unit-number { font-size: 16px; }
  #unitGrid .unit-name { font-size: 14px; }
}
/* Make players' current scores prominent at every game viewport size. */
.player-header strong { font-size: clamp(21px, 1.8vw, 30px); font-weight: 800; padding: 6px 12px; }
@media(max-width:900px) { .player-header strong { font-size: clamp(19px, 2.6vw, 25px); } }
@media(min-width:1600px) and (min-height:850px) { .player-header strong { font-size: clamp(30px, 2vw, 44px); } }

/* Larger in-game and final scores, responsive without clipping. */
.player-header strong {font-size:clamp(26px,2.5vw,40px);font-weight:800;padding:7px 13px}
.panel-result > strong {font-size:clamp(62px,9vw,112px)}
.result-player strong {font-size:clamp(36px,4vw,55px);font-weight:800}
@media(max-width:900px){.player-header strong{font-size:clamp(24px,3.7vw,34px)}.panel-result > strong{font-size:clamp(55px,9vw,90px)}.result-player strong{font-size:clamp(32px,5vw,44px)}}
@media(max-width:480px){.player-header strong{font-size:24px;padding:5px 8px}.panel-result > strong{font-size:56px}.result-player strong{font-size:34px}}


/* Larger vocabulary prompts in each player's card during gameplay. */
#gameScreen .player-question h3,
.player-panels .player-question h3 {
  font-size: clamp(30px, 3.2vw, 52px);
  line-height: 1.16;
  overflow-wrap: anywhere;
}
@media (max-width: 900px) {
  #gameScreen .player-question h3,
  .player-panels .player-question h3 {
    font-size: clamp(26px, 4vw, 40px);
  }
}
@media (max-width: 480px) {
  #gameScreen .player-question h3,
  .player-panels .player-question h3 {
    font-size: clamp(25px, 5.4vw, 33px);
  }
}
@media (min-width: 1600px) and (min-height: 850px) {
  #gameScreen .player-question h3,
  .player-panels .player-question h3 {
    font-size: clamp(44px, 3.5vw, 76px);
  }
}

/* Results screen: use available height and style the return control explicitly. */
#resultsScreen:not(.hidden) {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  width: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  padding: clamp(18px, 2.4vh, 34px) clamp(16px, 2.4vw, 34px);
}
#resultsScreen #matchWinner {
  font-size: clamp(29px, 3vw, 46px);
  line-height: 1.15;
  flex-shrink: 0;
}
#resultsScreen #resultSubtitle {
  font-size: clamp(16px, 1.45vw, 21px);
  margin-bottom: clamp(8px, 1.5vh, 20px);
  flex-shrink: 0;
}
#resultsScreen .player-results {
  flex: 1 1 auto;
  min-height: 0;
  align-items: stretch;
  overflow-y: auto;
  margin: 0 0 clamp(12px, 2vh, 24px);
}
#resultsScreen .result-player {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(7px, 1.3vh, 18px);
  padding: clamp(14px, 2.5vh, 34px) 12px;
}
#resultsScreen .result-player h3 { font-size: clamp(23px, 2.3vw, 32px); }
#resultsScreen .result-player p { font-size: clamp(15px, 1.3vw, 19px); }
#resultsScreen > button.menu-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  align-self: center;
  flex: 0 0 auto;
  min-height: 54px;
  padding: 12px 28px;
  border: none;
  border-radius: 14px;
  background: #0284c7;
  color: #fff;
  font-family: "Fredoka", sans-serif;
  font-size: clamp(18px, 1.6vw, 23px);
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 5px 0 #075985, 0 8px 18px #0369a133;
  transition: background .15s ease, transform .15s ease;
}
#resultsScreen > button.menu-button:hover { background: #0369a1; }
#resultsScreen > button.menu-button:active { transform: translateY(2px); box-shadow: 0 3px 0 #075985; }
@media (max-height: 580px) {
  #resultsScreen:not(.hidden) { padding: 10px 16px; }
  #resultsScreen .result-player { padding: 10px; gap: 4px; }
  #resultsScreen > button.menu-button { min-height: 44px; padding: 8px 22px; }
}

/* Soft pastel play-screen styling; menu remains unchanged. */
#quizScreen:not(.hidden) {padding:12px;border-radius:24px;background:linear-gradient(135deg,#e8f5ff,#f3edff 52%,#fff2ec);}
#quizScreen .player-panels {gap:14px;}
#quizScreen .player-panel {--player-color:#287eb0;--panel-border:#b4dced;border:2px solid var(--panel-border);border-radius:22px;background:linear-gradient(145deg,#f9fdff,#eaf7ff);box-shadow:0 12px 26px #438bb01b;}
#quizScreen .player-panel.player-2 {--player-color:#8655ae;--panel-border:#dcc4ef;background:linear-gradient(145deg,#fefbff,#f2ebff);}
#quizScreen .player-header {padding:6px 10px;border-radius:15px;background:#dfedf9;}
#quizScreen .player-2 .player-header {background:#eee1fa;}
#quizScreen .player-header strong {border:1px solid #d2dce9;background:white;box-shadow:0 3px 10px #33415518;}
#quizScreen .player-progress {height:8px;background:#dbe6ee;}
#quizScreen .player-progress>div {background:linear-gradient(90deg,#72d0d7,var(--player-color));}
#quizScreen .player-question {border:1px solid #cae4f3;border-radius:17px;background:linear-gradient(145deg,#e5f5ff,#f9fcff);}
#quizScreen .player-2 .player-question {border-color:#e5d5f3;background:linear-gradient(145deg,#f0e5ff,#fcf9ff);}
#quizScreen .player-question h3 {color:#273952;}
#quizScreen .player-options {gap:10px;}
#quizScreen .player-option {border:2px solid #cbdfee;border-radius:15px;background:#eaf6ff;color:#273b50;box-shadow:0 4px 0 #ccdeeb;font-family:'Plus Jakarta Sans','Segoe UI',Arial,sans-serif;font-weight:800;transition:transform .14s,box-shadow .14s,filter .14s;}
#quizScreen .player-option:nth-child(4n+2) {background:#f0eaff;border-color:#d6c9ec;box-shadow:0 4px 0 #d7c9ec;}
#quizScreen .player-option:nth-child(4n+3) {background:#e8f8ef;border-color:#c3e4d1;box-shadow:0 4px 0 #bce2cc;}
#quizScreen .player-option:nth-child(4n+4) {background:#fff0e9;border-color:#f0d4c6;box-shadow:0 4px 0 #ecd1c6;}
#quizScreen .player-option:hover:not(:disabled) {transform:translateY(-2px);border-color:var(--player-color);filter:saturate(1.06);box-shadow:0 6px 14px #33415520;}
#quizScreen .option-letter {width:30px;height:30px;border-radius:10px;background:#fff;border:1px solid #d5dfea;color:#475569;}
#quizScreen .player-option:nth-child(n).correct {border-color:#76c8a2;background:#d4f6e5;color:#116847;box-shadow:0 3px 0 #90d6b2;}
#quizScreen .player-option:nth-child(n).incorrect {border-color:#edb1bc;background:#ffe0e8;color:#a42647;box-shadow:0 3px 0 #e8bac5;}
@media(max-width:700px){#quizScreen:not(.hidden){padding:7px;border-radius:16px}#quizScreen .player-panels{gap:8px}#quizScreen .player-panel{border-radius:16px}#quizScreen .player-options{gap:6px}#quizScreen .player-option{border-radius:10px}}
@media(prefers-reduced-motion:reduce){#quizScreen .player-option{transition:none}}
/* Credit belongs to setup; hiding setup hides this link during play and results. */
.designer-credit {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 20;
  padding: 5px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: #f8fafc;
  color: #64748b;
  font-size: 10px;
  line-height: 1.4;
  text-decoration: none;
}
.designer-credit:hover { border-color: #bae6fd; background: #f0f9ff; color: #0369a1; }
.designer-credit:focus-visible { outline: 2px solid #38bdf8; outline-offset: 3px; }
body > main:has(#startScreen:not(.hidden)) { padding-bottom: 38px; }

