:root {
  --paper:#f2f6ec;
  --ink:#0d140d;
  --green:#8ae83f;
  --muted:#657260;
  --line:#c9d2c4;
  font-family:"Noto Sans TC","PingFang TC",system-ui,sans-serif;
  color:var(--ink);
  background:var(--paper);
  font-size:16px;
  line-height:1.4}
* {
  box-sizing:border-box}
body {
  margin:0;
  background-image:linear-gradient(#0d140d09 1px,transparent 1px),linear-gradient(90deg,#0d140d09 1px,transparent 1px);
  background-size:30px 30px}
button,a {
  -webkit-tap-highlight-color:transparent}
button {
  font:inherit;
  cursor:pointer;
  touch-action:manipulation;
  color:inherit}
button:disabled {
  cursor:default}
a {
  color:inherit;
  text-decoration:none}
button:focus-visible,a:focus-visible {
  outline:3px solid #31881a;
  outline-offset:3px}
h1:focus {
  outline:none}
[hidden] {
  display:none!important}
.topbar {
  height:58px;
  padding:0 max(20px,calc((100vw - 1120px)/2));
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  background:var(--ink);
  color:var(--paper)}
.brand {
  font-family:CrocoDisp,sans-serif;
  font-size:1.375rem;
  white-space:nowrap}
.brand span {
  font-family:system-ui,sans-serif;
  font-size:.875rem;
  margin-left:12px;
  color:var(--green);
  font-weight:700}
.gallery-link {
  font-size:.875rem;
  border-bottom:1px solid #f2f6ec80;
  padding:6px 0;
  white-space:nowrap}
.quiz-screen {
  max-width:1120px;
  height:calc(100svh - 58px);
  min-height:520px;
  margin:auto;
  padding:16px 24px 24px;
  display:grid;
  grid-template-rows:44px minmax(0,1fr);
  gap:20px}
.hud {
  position:relative;
  display:flex;
  justify-content:space-between;
  gap:12px;
  font-size:.875rem;
  align-items:flex-start}
.hud b {
  font:700 1.3125rem ui-monospace,monospace}
.hud progress {
  position:absolute;
  bottom:0;
  left:0;
  width:100%;
  height:5px;
  border:0;
  background:var(--line);
  color:var(--ink)}
progress::-webkit-progress-bar {
  background:var(--line)}
progress::-webkit-progress-value {
  background:var(--ink)}
progress::-moz-progress-bar {
  background:var(--ink)}
.play-area {
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  align-items:center;
  gap:40px;
  min-height:0}
.image-side {
  min-width:0;
  min-height:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  align-self:stretch;
  gap:12px}
.portrait-button {
  display:block;
  position:relative;
  padding:0;
  border:3px solid var(--ink);
  box-shadow:5px 5px 0 var(--ink);
  background:#202123;
  aspect-ratio:1;
  width:min(100%,calc(100svh - 220px),500px);
  flex:none}
.portrait-button img {
  position:absolute;
  inset:0;
  display:block;
  width:100%;
  height:100%;
  object-fit:contain}
.image-hint {
  font-size:.8125rem;
  color:var(--muted)}
.portrait-pair {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
  width:100%;
  max-width:560px}
.portrait-pair figure {
  margin:0;
  min-width:0}
.portrait-pair .portrait-button {
  width:100%}
.portrait-pair figcaption {
  text-align:center;
  font-size:.875rem;
  color:var(--muted);
  margin-top:12px}
.choice-panel {
  min-width:0}
.choice-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:14px;
  min-height:40px}
.choice-heading h1 {
  font-size:1.5rem;
  line-height:1.3;
  margin:0;
  font-family:CrocoDisp,system-ui,sans-serif}
.step {
  font:700 .875rem ui-monospace,monospace;
  color:var(--muted)}
.back {
  padding:8px 12px;
  min-height:40px;
  font-size:.875rem;
  background:transparent;
  border:1px solid var(--ink);
  white-space:nowrap}
.choices {
  display:grid;
  gap:10px}
.team-grid {
  grid-template-columns:repeat(3,minmax(0,1fr));
  grid-auto-rows:minmax(78px,auto)}
.name-grid {
  grid-template-columns:repeat(2,minmax(0,1fr));
  grid-auto-rows:minmax(78px,auto)}
.choice {
  border:2px solid var(--ink);
  background:#fff;
  min-width:0;
  padding:10px 6px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:5px;
  box-shadow:3px 3px 0 var(--ink)}
.choice strong {
  font-size:1rem;
  line-height:1.35;
  overflow-wrap:anywhere}
.remaining {
  font-size:.75rem;
  color:var(--muted)}
.name-choice strong {
  font-size:1.1875rem}
.name-choice span {
  font-size:.75rem}
.choice:disabled {
  background:#e6ebe2;
  color:#7b8576;
  border-color:#b5bfaf;
  box-shadow:none}
.choice:disabled .remaining {
  color:#7b8576}
.choice-footer {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:12px;
  margin-top:16px}
.skip {
  font-size:.875rem;
  min-height:44px;
  padding:9px 12px;
  border:1px solid var(--ink);
  background:transparent;
  white-space:nowrap}
.primary {
  padding:14px 20px;
  background:var(--green);
  border:2px solid var(--ink);
  box-shadow:4px 4px 0 var(--ink);
  font-weight:800;
  min-height:48px}
.primary:active,.choice:not(:disabled):active {
  transform:translate(2px,2px);
  box-shadow:1px 1px 0 var(--ink)}
.reveal {
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  border-top:5px solid var(--ink);
  padding:20px 0 4px}
.verdict {
  font-size:1.125rem;
  font-weight:800;
  margin:0 0 10px}
.correct .verdict {
  background:var(--green);
  padding:3px 10px}
.incorrect .verdict {
  color:#a3411c}
.reveal h1 {
  font:700 clamp(30px,4vw,46px)/1.35 CrocoDisp,system-ui,sans-serif;
  margin:0;
  overflow-wrap:anywhere}
.answer-team {
  font-size:1rem;
  color:var(--muted);
  margin:8px 0}
.answer-note {
  font-size:.875rem;
  margin:14px 0 0}
.next {
  margin-top:24px;
  width:100%;
  display:flex;
  justify-content:space-between;
  align-items:center}
.results {
  max-width:1000px;
  margin:36px auto;
  padding:0 24px 48px}
.result-card {
  padding:32px;
  background:#fff;
  border:3px solid var(--ink);
  box-shadow:7px 7px 0 var(--ink)}
.eyebrow {
  font-size:.875rem;
  font-weight:800;
  color:var(--muted)}
.result-card h1 {
  font-size:clamp(22px,4vw,40px)}
.result-card h1 span {
  font-family:ui-monospace,monospace;
  font-size:1.8em;
  background:var(--green);
  padding:0 8px}
.result-actions {
  display:flex;
  flex-wrap:wrap;
  gap:20px;
  align-items:center;
  margin-top:24px}
.secondary {
  border-bottom:1px solid;
  padding:10px 0}
.results h2 {
  margin-top:36px;
  font-size:1.25rem}
.review-grid {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:16px}
.review {
  background:#fff;
  border:2px solid var(--ink);
  overflow:hidden}
.review img {
  display:block;
  width:100%;
  height:auto;
  aspect-ratio:1}
.review>div {
  padding:12px}
.review h3 {
  margin:0;
  font-size:1.125rem}
.review p {
  font-size:.875rem;
  color:var(--muted);
  margin:5px 0}
.review .your-answer {
  color:#a3411c}
.loading {
  max-width:600px;
  margin:60px auto;
  padding:24px}
dialog {
  padding:0;
  border:3px solid var(--paper);
  background:#202123;
  max-width:95vw;
  max-height:94dvh;
  width:min(90vw,80dvh,800px);
  overflow:auto}
dialog::backdrop {
  background:#000c}
dialog img {
  display:block;
  width:100%;
  height:auto}
.zoom-close {
  position:static;
  padding:10px 14px;
  background:var(--paper);
  border:2px solid var(--ink);
  font-size:.875rem;
  z-index:1}
.zoom-toolbar {
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px;
  background:var(--paper);
  color:var(--ink);
  font-size:.875rem;
}
.zoom-toolbar a {
  display:flex;
  align-items:center;
  min-height:44px;
  padding:4px 8px;
  text-decoration:underline;
  text-underline-offset:3px;
}
.zoom-toolbar form {
  margin:0 0 0 auto;
}
.zoom-preview {
  aspect-ratio:1;
  background-position:center;
  background-size:cover;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  padding:16px;
  color:white;
  text-shadow:0 1px 4px black;
}
@media(hover:hover) {
  .choice:not(:disabled):hover,.back:hover,.skip:hover {
    background:#d9f9c9}
  .primary:hover {
    background:#abf276}
  .portrait-button:hover {
    outline:3px solid var(--green);
    outline-offset:3px}
}
@media(max-width:700px) {
  .topbar {
    height:50px;
    padding:0 16px}
  .brand {
    font-size:1.1875rem}
  .brand span {
    margin-left:8px;
    font-size:.875rem}
  .gallery-link {
    font-size:.875rem}
  .quiz-screen {
    height:calc(100svh - 50px);
    min-height:480px;
    padding:10px 16px max(12px,env(safe-area-inset-bottom));
    grid-template-rows:36px minmax(0,1fr);
    gap:12px}
  .hud b {
    font-size:1.125rem}
  .play-area {
    grid-template-columns:1fr;
    grid-template-rows:minmax(0,1fr) auto;
    gap:14px;
    align-items:stretch}
  .image-side {
    gap:0}
  .portrait-button {
    width:min(100%,calc(100svh - 425px),300px);
    box-shadow:4px 4px 0 var(--ink)}
  .image-hint {
    display:none}
  .portrait-pair {
    gap:12px;
    max-width:min(100%,calc((100svh - 385px)*2),440px)}
  .portrait-pair figcaption {
    font-size:.8125rem;
    margin-top:9px}
  .choice-heading {
    margin-bottom:10px;
    min-height:34px}
  .choice-heading h1 {
    font-size:1.25rem}
  .back {
    padding:6px 10px;
    min-height:34px}
  .choices {
    gap:8px;
    grid-auto-rows:minmax(58px,auto)}
  .choice {
    padding:6px 3px;
    gap:3px}
  .choice strong {
    font-size:.875rem}
  .name-choice strong {
    font-size:1.0625rem}
  .remaining {
    font-size:.75rem}
  .choice-footer {
    margin-top:12px;
    gap:8px}
  .skip {
    font-size:.875rem;
    padding:9px 10px}
  .reveal {
    padding:12px 0 4px}
  .reveal h1 {
    font-size:2rem}
  .verdict {
    font-size:1rem;
    margin-bottom:6px}
  .answer-team {
    margin:4px 0}
  .answer-note {
    margin:8px 0 0}
  .next {
    margin-top:16px;
    min-height:48px}
  .results {
    margin-top:22px;
    padding:0 16px 32px}
  .result-card {
    padding:20px}
  .review-grid {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px}
  .review h3 {
    font-size:1rem}
  .review>div {
    padding:9px}
}
@media(max-height:500px) and (min-width:701px) {
  .quiz-screen {
    min-height:380px;
    padding-top:8px;
    gap:10px;
    grid-template-rows:32px minmax(0,1fr)}
  .choices {
    grid-auto-rows:minmax(56px,auto);
    gap:8px}
  .choice-heading {
    margin-bottom:8px;
    min-height:32px}
  .choice-heading h1 {
    font-size:1.25rem}
  .choice {
    padding:5px}
  .choice-footer {
    margin-top:10px}
  .reveal {
    padding:12px 0}
  .image-hint {
    display:none}
  .portrait-button {
    width:min(100%,calc(100svh - 170px))}
}
@media(prefers-reduced-motion:reduce) {
  * {
    scroll-behavior:auto!important}
}
.team-stats table {
  width:100%;
  border-collapse:collapse;
  background:#fff;
  border:2px solid var(--ink);
  font-size:1rem}
.team-stats th,.team-stats td {
  padding:12px 16px;
  border-bottom:1px solid var(--line)}
.team-stats thead th {
  font-size:.875rem;
  color:var(--muted);
  font-weight:600}
.team-stats th {
  text-align:left}
.team-stats td,.team-stats th:not(:first-child) {
  text-align:right;
  white-space:nowrap}
.team-stats td {
  font-family:ui-monospace,monospace;
  font-variant-numeric:tabular-nums}
.team-stats td:last-child {
  font-weight:800}
.team-stats tbody th {
  width:60%;
  font-weight:700}
.rate-track {
  display:block;
  height:4px;
  background:var(--line);
  margin-top:7px;
  max-width:360px}
.rate-track>span {
  display:block;
  height:100%;
  background:var(--green)}
@media(max-width:700px) {
  .team-stats th,.team-stats td {
    padding:11px 10px}
  .team-stats tbody th {
    width:auto}
  .team-stats table {
    font-size:.875rem}
}
/* The same two image nodes stay mounted through choices and answer reveal. */
.image-side:not(.comparison) .portrait-pair {
  display: block;
  width: min(100%, calc(100svh - 220px), 500px);
}
.load-error {
  position: fixed;
  z-index: 3;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: min(90vw, 440px);
  background: var(--paper);
  border: 2px solid var(--ink);
  padding: 16px;
  box-shadow: 4px 4px 0 var(--ink);
}
button[aria-busy="true"] {
  opacity: .65;
  cursor: progress;
}
@media (max-width: 700px) {
  .image-side:not(.comparison) .portrait-pair {
    width: min(100%, calc(100svh - 425px), 300px);
  }
}
