:root {
  color-scheme: dark;
  --ink: #f1f5ff;
  --muted: #aeb9cc;
  --line: rgba(220,235,255,.08);
  --paper: rgba(15,19,29,.62);
  --canvas: #11141b;
  --glow: rgba(192,220,255,.75);
  --sans: "Manrope", "Noto Sans JP", system-ui, sans-serif;
  font-family: "Noto Sans JP", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

@property --selection-ring-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

* { box-sizing: border-box; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: #11141b;
}
button, input, textarea, select { font: inherit; }
button { color: inherit; }
.app-shell { width: min(100% - 48px, 1640px); margin: 0 auto; }
.topbar {
  position: relative;
  display: flex;
  height: 74px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(220,235,255,.055);
}
.header-timer { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); white-space: nowrap; cursor: pointer; }
.header-timer:focus-visible { outline: 1px solid rgba(255,211,110,.7); outline-offset: 5px; }
.timer-value { display: block; min-width: 3.1ch; color: #f5f8ff; font: 700 38px/1 "DM Mono", monospace; text-align: center; font-variant-numeric: tabular-nums; text-shadow: 0 0 8px rgba(104,151,255,.68), 0 0 20px rgba(58,112,255,.4); }
.timer-value.is-low { color: #ff5868; text-shadow: 0 0 8px rgba(255,66,84,.82), 0 0 20px rgba(255,52,72,.5); }
.timer-hint { position: absolute; right: calc(100% + 7px); bottom: 3px; color: #9baac0; font: 10px/1 var(--sans); white-space: nowrap; }
.timer-cutin { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; overflow: hidden; background: rgba(5,7,12,.22); pointer-events: none; }
.timer-cutin[hidden] { display: none; }
.timer-cutin::before { position: absolute; inset: -18% -30%; content: ""; background: linear-gradient(108deg, transparent 24%, rgba(113,5,20,.94) 39%, rgba(235,28,47,.98) 49%, rgba(105,3,18,.97) 52%, rgba(189,14,34,.94) 68%, transparent 83%); transform: translateX(-125%) skewX(-8deg); }
.timer-cutin span { position: relative; color: #fff; font-size: clamp(38px, 8vw, 86px); font-weight: 900; letter-spacing: .08em; text-shadow: 0 0 10px rgba(255,255,255,.95), 0 0 30px rgba(255,84,100,.8); opacity: 0; transform: translateX(-8vw) scale(.92); }
.timer-cutin.is-visible::before { animation: timer-cutin-sweep 1.05s cubic-bezier(.2,.72,.2,1) both; }
.timer-cutin.is-visible span { animation: timer-cutin-text 1.28s ease-out both; }
@keyframes timer-cutin-sweep { 0% { transform: translateX(-125%) skewX(-8deg); } 28% { transform: translateX(-4%) skewX(-8deg); } 58% { transform: translateX(0) skewX(-8deg); } 100% { transform: translateX(125%) skewX(-8deg); } }
@keyframes timer-cutin-text { 0% { opacity: 0; transform: translateX(-8vw) scale(.92); } 18% { opacity: 1; transform: translateX(0) scale(1); } 72% { opacity: 1; transform: translateX(0) scale(1); } 100% { opacity: 0; transform: translateX(8vw) scale(1.02); } }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #f8fbff; text-decoration: none; font-size: 15px; text-shadow: 0 0 10px rgba(192,220,255,.48); }
.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0 8px 0 0;
  appearance: none;
  border: 1px solid rgba(205,229,255,.2);
  border-radius: 0;
  color: #fff;
  background-color: #121823;
  background-image: linear-gradient(45deg, transparent 50%, #aebbd0 50%), linear-gradient(135deg, #aebbd0 50%, transparent 50%);
  background-repeat: no-repeat;
  background-position: calc(100% - 6px) 15px, calc(100% - 3px) 15px;
  background-size: 3px 3px;
  font: 700 20px/1 var(--sans);
  text-align: center;
  text-align-last: center;
  text-shadow: 0 0 7px #fff, 0 0 18px rgba(155,207,255,.92);
  box-shadow: none;
  cursor: pointer;
}
.brand-mark option, .question-heading option { color: #f1f5ff; background: #141923; text-shadow: none; }
.brand-mark:focus-visible, .question-heading:focus-visible { outline: 1px solid rgba(205,229,255,.65); outline-offset: 3px; }
.question-heading { width: 100px; height: 28px; margin-left: 7px; padding: 0 14px 0 12px; appearance: none; border: 0; border-left: 1px solid rgba(220,235,255,.1); border-radius: 0; color: #c7d4e9; background-color: transparent; background-image: linear-gradient(45deg, transparent 50%, #9eacc1 50%), linear-gradient(135deg, #9eacc1 50%, transparent 50%); background-repeat: no-repeat; background-position: calc(100% - 6px) 12px, calc(100% - 3px) 12px; background-size: 3px 3px; font-size: 15px; font-weight: 500; white-space: nowrap; text-shadow: 0 0 8px rgba(192,220,255,.7); cursor: pointer; }
.topbar-actions { display: flex; align-items: center; gap: 7px; }
.icon-button.result-exit-button { display: none; }
.is-result-mode .result-exit-button { display: grid; }
.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 0;
  color: #dce8fa;
  background: transparent;
  font-size: 23px;
  text-shadow: 0 0 9px rgba(190,218,255,.72);
  cursor: pointer;
}
.icon-button:hover { border-color: rgba(220,235,255,.09); color: #fff; background: rgba(255,255,255,.04); box-shadow: 0 0 18px rgba(124,173,255,.12); }
.icon-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; filter: drop-shadow(0 0 4px rgba(190,218,255,.8)); }
.icon-button svg.settings-gear { width: 19px; height: 19px; fill: currentColor; stroke: none; filter: drop-shadow(0 0 4px rgba(190,218,255,.65)); }
.help-button { border-color: rgba(190,218,255,.12); border-radius: 50%; font: 700 17px/1 var(--sans); }
.help-dialog { width: min(620px, calc(100% - 28px)); max-height: min(90vh, 780px); overflow-y: auto; padding: 0; border: 1px solid rgba(214,232,255,.1); border-radius: 0; color: #f2f6ff; background: #141923; box-shadow: 0 18px 48px rgba(0,0,0,.65); }
.help-dialog::backdrop { background: rgba(1,3,7,.78); backdrop-filter: blur(4px); }
.help-form { display: grid; gap: 16px; padding: 21px; }
.help-section { display: grid; gap: 7px; }
.help-section h2 { margin: 0; padding-bottom: 5px; border-bottom: 1px solid rgba(220,235,255,.1); color: #dbe9ff; font-size: 12px; text-shadow: 0 0 8px rgba(120,171,255,.35); }
.help-list { display: grid; gap: 5px; margin: 0; }
.help-list > div { display: grid; grid-template-columns: minmax(145px,.7fr) minmax(0,1fr); gap: 12px; align-items: baseline; padding: 3px 0; }
.help-list dt { color: #edf4ff; font-size: 11px; font-weight: 600; }
.help-list dd { margin: 0; color: #b9c7dc; font-size: 11px; line-height: 1.55; }
.help-list kbd { display: inline-block; padding: 2px 5px; border: 1px solid #354155; border-radius: 3px; color: #eaf2ff; background: #151c27; font: 10px "DM Mono", monospace; white-space: nowrap; }
.help-note { margin: 0; color: #9baac0; font-size: 10px; }
main { padding: 22px 0 38px; }
.is-result-mode main { padding-top: 22px; }
.prompt-stage { display: grid; width: min(100%, 1280px); grid-template-columns: 38px minmax(0,1fr) 38px; align-items: center; gap: 13px; margin: 0 auto; }
.result-announcement { display: none; min-height: 42px; align-items: center; justify-content: center; gap: 10px; margin: 0 auto 12px; color: #fff; font-size: 22px; font-weight: 800; text-align: center; text-shadow: 0 0 9px rgba(255,255,255,.85), 0 0 24px rgba(135,182,255,.75); }
.is-result-mode .result-announcement { display: flex; visibility: hidden; }
.result-announcement.is-visible { visibility: visible; animation: result-winner-in .35s ease-out both; }
.result-announcement.is-winner::before { content: "WINNER"; color: #ffd87a; font: 700 10px "DM Mono", monospace; letter-spacing: .16em; text-shadow: 0 0 8px rgba(255,205,89,.7); opacity: 0; animation: result-winner-label-in .35s ease-out both; }
.prompt-card {
  display: flex;
  min-width: 0;
  height: 155px;
  min-height: 155px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 20px;
  border: 1px solid #273243;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: default;
}
.prompt-card.is-start-pending { cursor: pointer; transition: border-color .18s ease, box-shadow .18s ease; }
.prompt-card.is-start-pending:hover, .prompt-card.is-start-pending:focus-visible { border-color: rgba(225,239,255,.55); box-shadow: 0 0 22px rgba(137,183,255,.12); outline: 0; }
.prompt-copy {
  min-width: 0;
  width: 88%;
  margin-inline: auto;
  text-align: center;
}
.topic-display {
  overflow-wrap: anywhere;
  color: #f8fbff;
  font-size: 36px;
  font-weight: 800;
  line-height: 1.35;
  text-shadow: 0 0 4px rgba(235,245,255,.46), 0 0 12px rgba(137,183,255,.22);
}
.provider-display { min-height: 1.4em; margin-top: 7px; color: #d3dced; font-size: 13px; line-height: 1.35; text-shadow: 0 0 9px rgba(173,207,255,.58); }
.provider-display > span { display: block; }
.provider-display > .group-display { margin-top: 2px; color: #9baac0; font-size: 9px; line-height: 1.2; opacity: .8; text-shadow: 0 0 6px rgba(173,207,255,.4); }
.question-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}
.question-nav {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 0;
  color: #d6e5fa;
  background: #151c27;
  font: 24px/1 var(--sans);
  text-shadow: 0 0 8px rgba(205,229,255,.9);
  cursor: pointer;
}
.question-nav:hover:not(:disabled) { background: rgba(147,190,255,.1); box-shadow: 0 0 18px rgba(125,175,255,.17); }
.question-nav:disabled { color: rgba(220,235,255,.22); cursor: default; }
.board-scroll { overflow-x: auto; margin-top: 20px; padding: 0 0 9px; scrollbar-color: rgba(176,204,245,.26) transparent; scrollbar-width: thin; }
.is-result-mode .board-scroll { margin-top: 0; }
.scoreboard {
  --player-count: 4;
  position: relative;
  display: grid;
  width: max-content;
  max-width: none;
  min-width: 0;
  margin-inline: auto;
  grid-template-columns: repeat(var(--player-count), var(--block-width, 180px));
  gap: 13px;
  align-items: stretch;
}
.scoreboard::after { position: absolute; top: 529px; right: 0; left: 0; z-index: 3; height: 1px; content: ""; background: rgba(239,245,255,.42); pointer-events: none; }
.is-result-mode .scoreboard::after { top: max(199px, min(529px, calc(100vh - 421px))); }
.player-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 535px;
  flex-direction: column;
  align-items: center;
  padding: 19px 14px 15px;
  border-radius: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  transition: box-shadow .18s ease, background .18s ease;
}
.player-card.is-selected { background: transparent; box-shadow: none; }
.is-result-mode .player-card { min-height: 0; }
.player-key {
  position: static;
  min-width: 22px;
  height: 20px;
  margin: 2px 0 0;
  padding: 0 4px;
  border: 0;
  border-radius: 0;
  color: rgba(230,240,255,.68);
  background: transparent;
  font: 11px/20px "DM Mono", monospace;
  text-shadow: 0 0 6px rgba(193,221,255,.46);
  cursor: pointer;
}
.player-key:hover { color: #fff; text-shadow: 0 0 6px #fff, 0 0 15px rgba(147,197,255,.95); }
.scoreboard.needs-selection .player-key { animation: key-pulse .32s ease-in-out 2; color: #fff; text-shadow: 0 0 7px #fff, 0 0 20px rgba(147,197,255,1); }
@keyframes key-pulse { 50% { transform: scale(1.28); } }
.total-value {
  position: absolute;
  right: 0;
  bottom: calc(var(--stack-height, 0px) + 7px);
  left: 0;
  z-index: 5;
  width: 100%;
  padding: 0;
  color: rgb(var(--total-rgb, 255,255,255));
  font-family: var(--sans);
  font-size: var(--total-font-size, 32px);
  font-weight: 800;
  line-height: .98;
  letter-spacing: -.045em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 var(--total-glow-small, 5px) rgba(var(--total-rgb, 255,255,255),.95), 0 0 var(--total-glow-large, 12px) rgba(var(--total-rgb, 139,188,255),var(--total-glow-opacity, .55));
}
.score-viewport {
  position: relative;
  width: 100%;
  height: 510px;
  min-height: 510px;
  flex: 0 0 510px;
  overflow: hidden;
}
.is-result-mode .score-viewport {
  height: max(180px, min(510px, calc(100vh - 440px)));
  min-height: 0;
  flex: 0 0 max(180px, min(510px, calc(100vh - 440px)));
}
.score-list { position: absolute; right: 0; bottom: 0; left: 0; width: 100%; min-height: 0; margin: 0; padding: 0; list-style: none; }
.score-entry {
  position: absolute;
  right: 0;
  bottom: var(--block-bottom);
  left: 0;
  display: grid;
  height: var(--block-height);
  place-items: center;
  overflow: visible;
  border: 1px solid #77879d;
  border-radius: 3px;
  color: #fff;
  background: rgba(51,64,82,.42);
  box-shadow: 0 0 6px rgba(180,210,255,.2);
}
.score-entry::after { display: none; }
.score-entry.score-green { border-color: #55df83; background: rgba(20,122,58,.42); box-shadow: 0 0 6px rgba(85,223,131,.24), 0 0 12px rgba(85,223,131,.1); }
.score-entry.score-blue { border-color: #6aaeff; background: rgba(35,91,158,.44); box-shadow: 0 0 6px rgba(106,174,255,.3), 0 0 12px rgba(106,174,255,.14); }
.score-entry.score-yellow { border-color: #e7c83d; background: rgba(150,117,0,.42); box-shadow: 0 0 6px rgba(231,200,61,.24), 0 0 12px rgba(231,200,61,.1); }
.score-entry.score-red { border-color: #ef737b; background: rgba(168,39,53,.42); box-shadow: 0 0 6px rgba(239,115,123,.24), 0 0 12px rgba(239,115,123,.1); }
.score-entry.score-question { border-color: var(--question-color); background: var(--question-fill); box-shadow: 0 0 6px var(--question-glow), 0 0 12px var(--question-glow); }
.score-entry.score-question.is-new { animation: result-block-appear 1.1s cubic-bezier(.2,.72,.25,1) both; transform-origin: center bottom; }
.entry-value { position: relative; z-index: 4; display: block; padding: 0; border: 0; color: #fff; background: transparent; font-family: "DM Mono", monospace; font-size: 14px; font-weight: 700; line-height: 1.15; text-align: center; text-shadow: none; }
.score-entry.score-question .entry-value { position: absolute; top: 50%; left: 50%; width: 100%; white-space: nowrap; transform: translate(-50%, -50%); }
.score-entry.is-new { z-index: 2; }
.score-entry.is-new::before { content: ""; position: absolute; right: 0; bottom: calc(100% - 1px); left: 0; z-index: 3; width: 100%; height: clamp(90px, 22vh, 190px); background: linear-gradient(to top, rgba(51,64,82,.78) 0%, rgba(51,64,82,.42) 38%, rgba(51,64,82,.14) 72%, rgba(51,64,82,0) 100%); -webkit-mask-image: linear-gradient(to top, #000 0%, #000 48%, transparent 100%); mask-image: linear-gradient(to top, #000 0%, #000 48%, transparent 100%); animation: score-trail .56s linear both; pointer-events: none; }
.score-entry.score-question.is-new::before { background: linear-gradient(to top, rgba(var(--question-rgb),.82) 0%, rgba(var(--question-rgb),.44) 38%, rgba(var(--question-rgb),.14) 72%, rgba(var(--question-rgb),0) 100%); }
.score-entry.score-green.is-new::before { background: linear-gradient(to top, rgba(20,122,58,.82) 0%, rgba(20,122,58,.44) 38%, rgba(20,122,58,.14) 72%, rgba(20,122,58,0) 100%); }
.score-entry.score-blue.is-new::before { background: linear-gradient(to top, rgba(35,91,158,.84) 0%, rgba(35,91,158,.46) 38%, rgba(35,91,158,.14) 72%, rgba(35,91,158,0) 100%); }
.score-entry.score-yellow.is-new::before { background: linear-gradient(to top, rgba(150,117,0,.82) 0%, rgba(150,117,0,.44) 38%, rgba(150,117,0,.14) 72%, rgba(150,117,0,0) 100%); }
.score-entry.score-red.is-new::before { background: linear-gradient(to top, rgba(168,39,53,.82) 0%, rgba(168,39,53,.44) 38%, rgba(168,39,53,.14) 72%, rgba(168,39,53,0) 100%); }
@keyframes score-trail {
  0% { opacity: 0; }
  10% { opacity: .9; }
  25% { opacity: .82; }
  50% { opacity: .64; }
  75% { opacity: .36; }
  100% { opacity: 0; }
}
@keyframes result-block-appear {
  0% { opacity: 0; transform: translateY(14px) scaleY(.84); }
  45% { opacity: .72; }
  100% { opacity: 1; transform: translateY(0) scaleY(1); }
}
.player-name { width: 100%; overflow: hidden; margin: 15px 0 0; color: #fff; font-size: 16px; font-weight: 700; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.player-card.is-selected .player-name { color: #fff; text-shadow: 0 0 7px var(--player-glow, #fff), 0 0 18px var(--player-glow, #fff), 0 0 32px var(--player-glow, #fff); }
.is-result-mode .player-card.is-selected:not(.is-result-winner) .player-name { text-shadow: none; }
.scoreboard.show-result-winners .player-name.is-result-winner { color: #fff; text-shadow: 0 0 8px var(--player-glow, #fff), 0 0 18px var(--player-glow, #fff), 0 0 30px rgba(255,215,106,.8); }
.total-value.is-result-total { opacity: 0; animation: result-total-rise .62s cubic-bezier(.2,.72,.25,1) var(--result-delay, 0ms) both; }
.result-rank { position: absolute; right: 0; bottom: calc(var(--stack-height, 0px) + var(--total-font-size, 32px) + 12px); left: 0; z-index: 6; color: #fff; font: 700 15px/1 "DM Mono", monospace; text-align: center; text-shadow: 0 0 7px rgba(255,255,255,.45); opacity: 0; transform: translateY(8px); }
.result-rank.is-rank-first { color: #ffd87a; text-shadow: 0 0 8px rgba(255,211,110,.82), 0 0 17px rgba(255,178,67,.55); }
.result-rank.is-rank-second { color: #e2e8f0; text-shadow: 0 0 8px rgba(226,232,240,.7), 0 0 16px rgba(190,202,220,.38); }
.result-rank.is-rank-third { color: #d68a58; text-shadow: 0 0 8px rgba(214,138,88,.76), 0 0 16px rgba(180,105,64,.42); }
.result-rank.is-result-winner::before { content: "👑"; position: absolute; bottom: 100%; left: 50%; opacity: 0; font-size: 23px; line-height: 1; transform: translate(-50%, 8px) scale(.7); }
.scoreboard.show-result-awards .result-rank.is-result-winner::before { animation: result-crown-in .55s cubic-bezier(.2,.75,.25,1) .12s both; }
.scoreboard.show-result-awards .result-rank { animation: result-rank-in .48s ease-out var(--result-delay, 0ms) both; }
@keyframes result-total-rise { from { opacity: 0; transform: translateY(22px) scale(.9); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes result-rank-in { to { opacity: 1; transform: translateY(0); } }
@keyframes result-winner-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes result-winner-label-in { to { opacity: 1; } }
@keyframes result-crown-in { to { opacity: 1; transform: translate(-50%, 0) scale(1); } }

.settings-dialog {
  width: min(560px, calc(100% - 28px));
  max-height: min(90vh, 780px);
  overflow-y: auto;
  padding: 0;
  border: 1px solid rgba(214,232,255,.1);
  border-radius: 0;
  color: #f2f6ff;
  background: #141923;
  box-shadow: 0 18px 48px rgba(0,0,0,.65);
}
.settings-dialog::backdrop { background: rgba(1,3,7,.78); backdrop-filter: blur(4px); }
.settings-form { display: grid; gap: 9px; padding: 21px; }
.settings-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.settings-header h1 { margin: 0; color: #fff; font-size: 18px; font-weight: 700; text-shadow: 0 0 11px rgba(201,225,255,.8); }
.close-button { display: grid; width: 30px; height: 30px; place-items: center; padding: 0; border: 1px solid #354155; border-radius: 0; color: #edf4ff; background: #151c27; font-size: 22px; text-shadow: 0 0 8px #fff; cursor: pointer; }
.field-label { display: grid; gap: 5px; color: #d4e0f3; font-size: 11px; font-weight: 600; text-shadow: 0 0 7px rgba(170,208,255,.5); }
.field-label input, .field-label textarea, .field-label select, .name-field input, .prompt-row input {
  width: 100%;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 0;
  outline: 0;
  color: #fff;
  background: #18202c;
  font-size: 13px;
  box-shadow: inset 0 0 15px rgba(150,190,255,.035);
}
.field-label input, .field-label select, .name-field input { height: 36px; padding: 0 10px; }
.field-label textarea { min-height: 66px; resize: vertical; padding: 8px 10px; line-height: 1.5; }
.field-label input:focus, .field-label textarea:focus, .field-label select:focus, .name-field input:focus, .prompt-row input:focus { box-shadow: 0 0 13px rgba(139,188,255,.19), inset 0 0 14px rgba(157,202,255,.08); }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; margin-top: 5px; }
.settings-grid .field-label { gap: 5px; }
.settings-tabs { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); margin-top: 8px; border-bottom: 1px solid rgba(220,235,255,.16); }
.settings-tab { min-height: 40px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: #91a3bb; background: transparent; font: 600 12px var(--sans); cursor: pointer; }
.settings-tab[aria-selected="true"] { border-bottom-color: #e8f3ff; color: #fff; text-shadow: 0 0 8px rgba(220,238,255,.8); }
.settings-panel { display: grid; gap: 14px; padding-top: 12px; }
.settings-panel[hidden] { display: none; }
.question-count-setting { width: min(180px, 100%); }
.timer-duration-setting { display: flex; align-items: center; gap: 12px; margin-top: 2px; color: #d4e0f3; font-size: 11px; }
.timer-duration-fields { display: flex; align-items: center; gap: 8px; }
.timer-duration-fields label { display: flex; align-items: center; gap: 5px; color: #aebbd0; }
.timer-duration-fields input { width: 64px; height: 34px; padding: 0 8px; border: 1px solid transparent; border-radius: 0; outline: 0; color: #fff; background: #18202c; font: 13px "DM Mono", monospace; }
.timer-duration-fields input:focus { box-shadow: 0 0 13px rgba(139,188,255,.19), inset 0 0 14px rgba(157,202,255,.08); }
.name-settings-header { display: flex; align-items: center; gap: 8px; margin-top: 5px; color: #d4e0f3; font-size: 11px; }
.name-settings-header > span { margin-left: auto; color: #9baac0; font-size: 10px; }
.randomize-button { min-height: 30px; padding: 0 9px; border: 1px solid #354155; border-radius: 0; color: #edf4ff; background: #151c27; font-size: 10px; text-shadow: 0 0 7px rgba(220,235,255,.5); cursor: pointer; }
.randomize-button:hover { border-color: #6e83a1; background: #1b2635; }
.name-groups { display: grid; gap: 9px; }
.name-group { display: grid; gap: 5px; }
.name-group h2 { margin: 0; padding-top: 7px; border-top: 1px solid rgba(220,235,255,.08); color: #e7f0ff; font: 700 11px var(--sans); text-shadow: 0 0 7px rgba(160,204,255,.55); }
.block-name-input { width: 100px; height: 26px; margin-right: 5px; padding: 0 6px; border: 1px solid rgba(220,235,255,.14); border-radius: 0; outline: 0; color: #fff; background: #18202c; font: 700 11px var(--sans); }
.block-name-input:focus { border-color: rgba(205,229,255,.55); box-shadow: 0 0 10px rgba(139,188,255,.18); }
.name-fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.name-field { display: flex; align-items: center; gap: 7px; min-width: 0; }
.name-field > span { width: 14px; flex: 0 0 14px; color: #d4e5ff; font: 9px "DM Mono", monospace; text-align: center; text-shadow: 0 0 7px rgba(194,222,255,.9); }
.prompt-source-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; color: #b8c8e0; font-size: 11px; }
.prompt-source-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.prompt-source-row button:disabled { opacity: .55; cursor: wait; }
.prompt-fields { display: grid; gap: 13px; margin-top: 8px; }
.settings-block { display: grid; gap: 5px; }
.settings-block h2 { margin: 0 0 2px; padding-top: 9px; border-top: 1px solid rgba(220,235,255,.08); color: #e7f0ff; font: 700 12px var(--sans); text-shadow: 0 0 8px rgba(160,204,255,.75); }
.prompt-row { display: grid; grid-template-columns: 37px minmax(0,1fr) minmax(105px,.52fr) minmax(80px,.36fr); align-items: center; gap: 7px; }
.prompt-row:not(.has-group) { grid-template-columns: 37px minmax(0,1fr) minmax(105px,.52fr); }
.prompt-row-title { color: #b8c8e0; font: 9px "DM Mono", monospace; text-align: center; text-shadow: 0 0 6px rgba(180,215,255,.58); }
.prompt-row-labels { color: #cbd9ed; font-size: 9px; text-shadow: 0 0 6px rgba(180,215,255,.5); }
.prompt-row-labels > span { padding-left: 8px; }
.prompt-row input { height: 32px; padding: 0 8px; font-size: 11px; }
.prompt-row input::placeholder { color: rgba(221,234,252,.45); }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 5; padding: 9px 13px; border: 1px solid #354155; border-radius: 0; color: #fff; background: #151c27; font-size: 11px; text-shadow: 0 0 8px #fff; box-shadow: none; opacity: 0; pointer-events: none; transform: translateY(5px); transition: opacity .15s ease, transform .15s ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

body.is-light-theme {
  color-scheme: light;
  color: #1e2b40;
  background: #f5f7fb;
}
body.is-light-theme .topbar { border-bottom-color: rgba(36,55,82,.14); }
body.is-light-theme .brand { color: #17243a; text-shadow: 0 1px 0 rgba(255,255,255,.9); }
body.is-light-theme .brand-mark { border-color: #aebbd0; color: #24344d; background-color: #e7edf6; text-shadow: none; }
body.is-light-theme .brand-mark option, body.is-light-theme .question-heading option { color: #1e2b40; background: #fff; }
body.is-light-theme .brand-mark:focus-visible, body.is-light-theme .question-heading:focus-visible { outline-color: #5578af; }
body.is-light-theme .question-heading { border-left-color: rgba(36,55,82,.18); color: #344761; background-image: linear-gradient(45deg, transparent 50%, #60748f 50%), linear-gradient(135deg, #60748f 50%, transparent 50%); text-shadow: none; }
body.is-light-theme .icon-button { color: #344761; text-shadow: 0 1px 3px rgba(44,75,120,.2); }
body.is-light-theme .icon-button:hover { border-color: rgba(48,72,110,.2); color: #17243a; background: rgba(52,93,154,.08); box-shadow: 0 0 16px rgba(70,120,190,.12); }
body.is-light-theme .icon-button svg { filter: drop-shadow(0 1px 2px rgba(60,95,150,.25)); }
body.is-light-theme .header-timer:focus-visible { outline-color: rgba(54,104,187,.6); }
body.is-light-theme .timer-value { color: #17243a; text-shadow: 0 0 8px rgba(94,150,245,.48), 0 0 18px rgba(77,129,220,.25); }
body.is-light-theme .timer-value.is-low { color: #d62d43; text-shadow: 0 0 8px rgba(255,66,84,.42), 0 0 18px rgba(255,52,72,.22); }
body.is-light-theme .timer-hint { color: #687991; }
body.is-light-theme .prompt-card { border-color: #c7d1df; background: rgba(255,255,255,.62); }
body.is-light-theme .prompt-card.is-start-pending:hover, body.is-light-theme .prompt-card.is-start-pending:focus-visible { border-color: #6d8fbe; box-shadow: 0 0 22px rgba(69,119,188,.14); }
body.is-light-theme .topic-display { color: #1c2940; text-shadow: 0 1px 0 #fff, 0 0 10px rgba(84,137,213,.16); }
body.is-light-theme .provider-display { color: #53647d; text-shadow: none; }
body.is-light-theme .provider-display > .group-display { color: #65758a; text-shadow: none; }
body.is-light-theme .question-nav { border-color: #d2dbe7; color: #344b69; background: #e5ebf4; text-shadow: none; }
body.is-light-theme .question-nav:hover:not(:disabled) { background: #dbe6f4; box-shadow: 0 0 14px rgba(70,120,190,.13); }
body.is-light-theme .question-nav:disabled { color: rgba(52,71,97,.32); }
body.is-light-theme .board-scroll { scrollbar-color: rgba(76,105,145,.38) transparent; }
body.is-light-theme .scoreboard::after { background: rgba(55,70,91,.42); }
body.is-light-theme .player-key { color: #65758a; text-shadow: none; }
body.is-light-theme .player-key:hover { color: #1c355a; text-shadow: 0 0 8px rgba(100,151,225,.48); }
body.is-light-theme .scoreboard.needs-selection .player-key { color: #1c355a; text-shadow: 0 0 8px rgba(100,151,225,.65); }
body.is-light-theme * { text-shadow: none !important; }
body.is-light-theme .timer-value { text-shadow: none !important; }
body.is-light-theme .timer-value.is-low { text-shadow: none !important; }
body.is-light-theme .topic-display, body.is-light-theme .provider-display { text-shadow: none !important; }
body.is-light-theme .total-value { color: #17243a; text-shadow: none !important; }
body.is-light-theme .score-entry { border-color: #7892b5; color: #fff; background: #4e6e98; box-shadow: none !important; }
body.is-light-theme .score-entry.score-green { border-color: #68cb8b; background: #258c53; }
body.is-light-theme .score-entry.score-blue { border-color: #7ca1eb; background: #3d68bf; }
body.is-light-theme .score-entry.score-yellow { border-color: #d9b45e; background: #a98220; }
body.is-light-theme .score-entry.score-red { border-color: #e77c87; background: #bd4054; }
body.is-light-theme .score-entry.score-question { background: color-mix(in srgb, var(--question-color) 76%, #10233f) !important; }
body.is-light-theme .score-entry .entry-value { color: #fff; text-shadow: none !important; }
body.is-light-theme .score-entry.is-new::before { background: linear-gradient(to top, rgba(78,110,152,1) 0%, rgba(78,110,152,.72) 38%, rgba(78,110,152,.3) 72%, rgba(78,110,152,0) 100%); }
body.is-light-theme .score-entry.score-question.is-new::before { background: linear-gradient(to top, rgba(var(--question-rgb),1) 0%, rgba(var(--question-rgb),.72) 38%, rgba(var(--question-rgb),.3) 72%, rgba(var(--question-rgb),0) 100%); }
body.is-light-theme .score-entry.score-green.is-new::before { background: linear-gradient(to top, rgba(37,140,83,1) 0%, rgba(37,140,83,.72) 38%, rgba(37,140,83,.3) 72%, rgba(37,140,83,0) 100%); }
body.is-light-theme .score-entry.score-blue.is-new::before { background: linear-gradient(to top, rgba(61,104,191,1) 0%, rgba(61,104,191,.72) 38%, rgba(61,104,191,.3) 72%, rgba(61,104,191,0) 100%); }
body.is-light-theme .score-entry.score-yellow.is-new::before { background: linear-gradient(to top, rgba(169,130,32,1) 0%, rgba(169,130,32,.72) 38%, rgba(169,130,32,.3) 72%, rgba(169,130,32,0) 100%); }
body.is-light-theme .score-entry.score-red.is-new::before { background: linear-gradient(to top, rgba(189,64,84,1) 0%, rgba(189,64,84,.72) 38%, rgba(189,64,84,.3) 72%, rgba(189,64,84,0) 100%); }
body.is-light-theme .player-name { color: #1e2b40; }
body.is-light-theme .player-card.is-selected .player-name {
  position: relative;
  width: max-content;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 9px;
  color: #1e2b40;
  text-shadow: none !important;
  background: transparent;
}
body.is-light-theme .player-card.is-selected .player-name::before {
  position: absolute;
  inset: 0;
  padding: 2px;
  border-radius: inherit;
  content: "";
  background: conic-gradient(from var(--selection-ring-angle), #000 0deg 300deg, #fff 325deg, #000 350deg 360deg);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  filter: drop-shadow(0 0 4px rgba(255,255,255,1)) drop-shadow(0 0 10px rgba(255,255,255,.9));
  pointer-events: none;
  animation: selected-name-ring-spin 2.4s linear infinite;
}
@keyframes selected-name-ring-spin {
  to { --selection-ring-angle: 360deg; }
}
body.is-light-theme.is-result-mode .player-card.is-selected:not(.is-result-winner) .player-name { text-shadow: none !important; }
body.is-light-theme .scoreboard.show-result-winners .player-name.is-result-winner { color: #18263d; }
body.is-light-theme .result-rank { color: #26364d; }
body.is-light-theme .result-rank.is-rank-first { color: #a46b00; }
body.is-light-theme .result-rank.is-rank-second { color: #687589; }
body.is-light-theme .result-rank.is-rank-third { color: #96562f; }
body.is-light-theme .result-announcement { color: #1d2a40; }
body.is-light-theme .result-announcement.is-winner::before { color: #9c6907; }
body.is-light-theme .settings-dialog, body.is-light-theme .help-dialog { border-color: #c5d0de; color: #23324a; background: #fff; box-shadow: 0 18px 48px rgba(28,45,70,.22); }
body.is-light-theme .settings-dialog::backdrop, body.is-light-theme .help-dialog::backdrop { background: rgba(28,42,63,.35); }
body.is-light-theme .settings-header h1 { color: #1c2b43; text-shadow: none; }
body.is-light-theme .close-button { border-color: #c9d3e0; color: #354963; background: #edf1f7; text-shadow: none; }
body.is-light-theme .field-label, body.is-light-theme .timer-duration-setting, body.is-light-theme .name-settings-header { color: #34445d; text-shadow: none; }
body.is-light-theme .field-label input, body.is-light-theme .field-label textarea, body.is-light-theme .field-label select, body.is-light-theme .name-field input, body.is-light-theme .prompt-row input, body.is-light-theme .timer-duration-fields input, body.is-light-theme .block-name-input { border-color: #cbd5e1; color: #1d2a40; background: #f3f6fa; box-shadow: none; }
body.is-light-theme .field-label input::placeholder, body.is-light-theme .prompt-row input::placeholder { color: #7a899d; }
body.is-light-theme .timer-duration-fields label, body.is-light-theme .name-settings-header > span { color: #66758a; }
body.is-light-theme .settings-tabs { border-bottom-color: #d8e0e9; }
body.is-light-theme .settings-tab { color: #687991; }
body.is-light-theme .settings-tab[aria-selected="true"] { border-bottom-color: #3e659d; color: #233c60; text-shadow: none; }
body.is-light-theme .name-group h2, body.is-light-theme .settings-block h2 { border-top-color: #d9e1eb; color: #2c405b; text-shadow: none; }
body.is-light-theme .name-field > span { color: #526984; text-shadow: none; }
body.is-light-theme .prompt-row-title, body.is-light-theme .prompt-row-labels { color: #586a82; text-shadow: none; }
body.is-light-theme .prompt-source-row { color: #52647c; }
body.is-light-theme .randomize-button { border-color: #c7d2df; color: #344963; background: #edf2f8; text-shadow: none; }
body.is-light-theme .randomize-button:hover { border-color: #8da3bf; background: #e3ebf5; }
body.is-light-theme .help-section h2 { border-bottom-color: #d7e0eb; color: #2d4668; text-shadow: none; }
body.is-light-theme .help-list dt { color: #263a56; }
body.is-light-theme .help-list dd, body.is-light-theme .help-note { color: #586a82; }
body.is-light-theme .help-list kbd { border-color: #cbd5e1; color: #30445e; background: #edf2f8; }
body.is-light-theme .toast { border-color: #c4cfdd; color: #213149; background: #fff; text-shadow: none; box-shadow: 0 4px 16px rgba(32,50,76,.14); }

@media (max-width: 700px) {
  .app-shell { width: calc(100% - 28px); }
  .topbar { height: auto; min-height: 62px; display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-rows: auto auto; row-gap: 7px; padding: 8px 0; }
  .brand { gap: 7px; font-size: 13px; }
  .header-timer { position: relative; grid-column: 1 / -1; grid-row: 2; justify-self: center; transform: none; }
  .timer-value { font-size: 30px; }
  .brand-mark { width: 29px; height: 29px; font-size: 18px; }
  .topbar-actions { grid-column: 2; grid-row: 1; }
  .question-heading { width: 86px; margin-left: 3px; padding-left: 8px; font-size: 12px; background-position: calc(100% - 6px) 12px, calc(100% - 3px) 12px; }
  main { padding-top: 14px; }
  .is-result-mode main { padding-top: 14px; }
  .prompt-stage { grid-template-columns: 30px minmax(0,1fr) 30px; gap: 7px; }
  .prompt-card { height: 128px; min-height: 128px; padding: 12px 9px; }
  .topic-display { font-size: 28px; }
  .provider-display { font-size: 11px; }
  .provider-display > .group-display { font-size: 8px; }
  .question-controls { gap: 3px; }
  .question-nav { width: 29px; height: 31px; font-size: 21px; }
  .board-scroll { margin-right: -14px; }
  .scoreboard { width: max-content; min-width: 0; max-width: none; margin-inline: 0; grid-template-columns: repeat(var(--player-count), var(--block-width, 128px)); gap: 9px; }
  .scoreboard::after { top: 527px; }
  .player-card { min-height: 480px; padding: 17px 11px 13px; }
  .score-viewport { height: 510px; min-height: 510px; flex: 0 0 510px; }
  .settings-form { padding: 17px; }
  .help-form { padding: 17px; }
  .help-list > div { grid-template-columns: minmax(115px,.7fr) minmax(0,1fr); gap: 8px; }
  .help-list dt, .help-list dd { font-size: 10px; }
  .settings-grid { gap: 6px; }
  .settings-grid .field-label { font-size: 10px; }
  .timer-duration-fields input { width: 56px; }
  .prompt-row { grid-template-columns: 25px minmax(0,1fr) minmax(75px,.5fr) minmax(62px,.34fr); gap: 5px; }
  .prompt-row:not(.has-group) { grid-template-columns: 25px minmax(0,1fr) minmax(75px,.5fr); }
  .prompt-row input { height: 31px; padding: 0 6px; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
  .score-entry.is-new::before { animation-duration: .01ms !important; }
  .score-entry.score-question.is-new { animation-duration: .01ms !important; }
}
