@font-face { font-family: 'Aeonik Fono'; src: local('Aeonik Fono'), local('AeonikFono-Regular'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Aeonik Mono'; src: local('Aeonik Mono'), local('AeonikMono-Regular'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Aeonik Mono'; src: local('Aeonik Mono Bold'), local('AeonikMono-Bold'); font-weight: 700; font-display: swap; }

:root {
  --cream: #F4EFEA;
  --ink: #383838;
  --white: #FFFFFF;
  --surface: #F8F8F7;
  --sky: #97D4FF;
  --sky-press: #6FC2FF;
  --blue: #2BA5FF;
  --orange: #FF9538;
  --alert: #FF5A1F;
  --sound: #FFDE00;
  --peach: #FFDCBD;
  --ice: #CEEBFF;
  --mint: #B0FFF4;
  --teal: #16AA98;
  --sand: #E1D6CB;
  --muted: #666666;
  --disabled: #818181;
  --hairline: #D7D7D7;

  --font-display: 'Aeonik Fono', 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-mono: 'Aeonik Mono', 'SF Mono', Menlo, Consolas, 'PingFang SC', 'Microsoft YaHei', monospace;
  --font-text: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;

  --header-mobile: 70px;
  --header-desktop: 80px;
  --header-height: var(--header-mobile);
  --header-offset: 0px;
}

@media (min-width: 728px) {
  :root { --header-height: var(--header-desktop); }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  padding-top: var(--header-offset);
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-mono);
  -webkit-font-smoothing: antialiased;
}

p {
  font-family: var(--font-text);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

button { font: inherit; color: inherit; }
fieldset { border: 0; min-width: 0; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.container {
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
}

@media (min-width: 728px) { .container { max-width: 728px; padding: 0 20px; } }
@media (min-width: 960px) { .container { max-width: 1302px; padding: 0 30px; } }

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 16px;
  border: 2px solid var(--ink);
  background: var(--white);
  font-family: var(--font-text);
  font-size: 14px;
  transform: translateY(-200%);
}

.skip-link:focus { transform: none; outline: 2px solid var(--blue); outline-offset: 2px; }

/* Header */

.site-header {
  position: static;
  inset: 0 0 auto;
  z-index: 99;
  background: var(--cream);
}

@media (min-width: 960px) and (hover: hover) and (pointer: fine) {
  :root { --header-offset: var(--header-height); }
  .site-header { position: fixed; }
  .site-header.is-scrolled { border-bottom: 2px solid var(--ink); }
}

.header__inner {
  display: flex;
  align-items: center;
  height: var(--header-height);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}

.logo:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.logo__mark { width: 40px; height: 40px; }

.logo__text {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* CTA: dark base plate + bordered face */

.cta {
  display: inline-flex;
  flex: none;
  border: 0;
  border-radius: 2px;
  background: var(--ink);
  cursor: pointer;
  text-decoration: none;
}

.cta[hidden] { display: none; }

.cta__face {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11.5px 18px;
  border: 2px solid var(--ink);
  border-radius: 2px;
  background: var(--sky);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 14px;
  font-weight: 400;
  line-height: 16.8px;
  text-transform: uppercase;
  white-space: nowrap;
}

.cta__icon { width: 20px; height: 20px; margin: -2px 0; }

.cta:active .cta__face { background: var(--sky-press); }

.cta:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.cta:disabled { cursor: not-allowed; background: transparent; }
.cta:disabled .cta__face {
  transform: none;
  color: var(--muted);
  background: var(--surface);
  border-color: var(--disabled);
}

/* Start page */

.hero__inner {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding-top: 32px;
  padding-bottom: 48px;
}

.hero {
  display: flex;
  align-items: center;
  min-height: calc(100dvh - var(--header-height));
}

@media (min-width: 960px) {
  .hero__inner { flex-direction: row; align-items: center; gap: 48px; padding-top: 48px; padding-bottom: 48px; }
  .hero__text { flex: 0 1 560px; max-width: 560px; min-width: 0; }
  .hero__art { flex: 1; min-width: 0; }
}

@media (min-width: 1302px) { .hero__inner { gap: 80px; } }

.hero__title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  line-height: 30.52px;
  text-transform: uppercase;
}

.hero__description {
  margin-top: 20px;
  font-size: 16px;
  line-height: 25.6px;
}

@media (min-width: 728px) {
  .hero__title { font-size: 40px; line-height: 43.6px; }
  .hero__description { font-size: 18px; line-height: 28.8px; }
}

@media (min-width: 960px) { .hero__title { font-size: 44px; line-height: 48px; } }

.hero__ctas {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-top: 40px;
}

@media (min-width: 728px) {
  .hero__ctas { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 16px; }
}

.hero__art {
  border: 2px solid var(--ink);
  background: var(--sky);
}

.hero__art svg { display: block; width: 100%; height: auto; }

/* Game page */

.game {
  min-height: calc(100dvh - var(--header-offset));
  padding: 24px 0;
  background: var(--sky);
}

@media (min-width: 960px) {
  .game > .container { max-width: 1600px; }
}

.game__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: 24px;
}

.game__form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.game__title {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 400;
  line-height: 33.6px;
  text-transform: uppercase;
}

@media (min-width: 728px) { .game__title { font-size: 32px; line-height: 38.4px; } }
@media (min-width: 1302px) { .game__title { font-size: 40px; line-height: 48px; } }

.options {
  display: grid;
  gap: 24px;
  overflow-anchor: none;
}

@media (min-width: 960px) { .options { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1302px) { .options { gap: 32px; } }

.option {
  position: relative;
  display: flex;
  border-radius: 2px;
  background: var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option__face {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  padding: 16px 10px;
  border: 2px solid var(--ink);
  border-radius: 2px;
  transition: transform 120ms ease-in-out;
}

.option--peach .option__face { background: var(--peach); }
.option--ice .option__face { background: var(--ice); }
.option--mint .option__face { background: var(--mint); }

@media (min-width: 1302px) { .option__face { padding: 20px 16px; } }

.is-locked .option { cursor: default; }

.game__form:not(.is-locked) .option:has(input:checked) .option__face,
.game__form:not(.is-locked) .option:has(input:checked):active .option__face,
.game__form.is-locked .option.is-answer .option__face { transform: translate(10px, -10px); }

.option:has(input:focus-visible) .option__face { outline: 2px solid var(--blue); outline-offset: -2px; }

.option__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.option__title {
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 28.8px;
  text-transform: uppercase;
}

@media (min-width: 1302px) { .option__title { font-size: 32px; line-height: 38.4px; } }

.option__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 2px solid var(--ink);
  border-radius: 2px;
  background: var(--white);
  font-family: var(--font-mono);
  font-size: 18px;
  transition: background-color 150ms ease-in-out;
}

.option:has(input:checked) .option__icon { background: var(--sound); }

.option__window {
  display: block;
  flex: 1;
  padding: 12px;
  border: 2px solid var(--ink);
  background: var(--white);
}

@media (min-width: 728px) { .option__window { padding: 16px; } }

.option__text {
  display: block;
  font-family: var(--font-text);
  font-size: 16px;
  font-weight: 300;
  line-height: 25.6px;
  letter-spacing: 0.02em;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.option__text strong { font-weight: 600; }

.loading-label {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 16px;
  text-transform: uppercase;
}

.loading-label::after {
  content: '_';
  animation: blink 1.25s linear infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.skeleton { display: block; height: 12px; margin-top: 16px; background: var(--surface); border: 1px solid var(--hairline); }
.skeleton:nth-child(3) { width: 86%; }
.skeleton:nth-child(4) { width: 64%; }

.option__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option__tags:empty { display: none; }

.option__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.option__footer[hidden] { display: none; }

.option__source {
  display: flex;
  justify-content: flex-end;
  flex: 1 1 auto;
  min-width: 0;
  margin-left: auto;
}

.source {
  max-width: 100%;
  overflow: hidden;
  font-family: var(--font-text);
  font-size: 14px;
  font-weight: 400;
  line-height: 18.2px;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
}

a.source {
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

a.source::after { content: ' ↗'; }
a.source:hover { color: var(--muted); }
a.source:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.source--ai {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Leave-site confirmation */

.modal {
  width: min(480px, calc(100% - 48px));
  max-width: none;
  margin: auto;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 2px;
  background: var(--white);
  color: var(--ink);
  box-shadow: -12px 12px 0 0 var(--ink);
}

.modal::backdrop { background: rgba(56, 56, 56, 0.45); }

.modal__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
}

.modal__title {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 400;
  line-height: 21.6px;
  text-transform: uppercase;
}

.modal__text { font-weight: 400; line-height: 25.6px; }

.modal__target {
  padding: 8px 12px;
  border: 2px solid var(--ink);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 16px;
  overflow-wrap: anywhere;
}

.modal__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 12px;
}

.cta--secondary .cta__face { background: var(--cream); }
.cta--secondary:active .cta__face { background: var(--sand); }

.tag {
  padding: 4px 10px;
  border: 2px solid var(--ink);
  border-radius: 2px;
  background: var(--white);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.tag--chosen { background: var(--sound); }

.option__verdict {
  display: block;
  padding: 12px 16px;
  border: 2px solid var(--ink);
  border-radius: 2px;
  background: var(--white);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 16px;
  letter-spacing: 0.02em;
}

.option__verdict[hidden] { display: none; }

.option.is-answer .option__verdict,
.option.is-miss .option__verdict {
  font-size: 18px;
  font-weight: 700;
  line-height: 21.6px;
}

.option.is-answer .option__verdict { background: var(--teal); color: var(--white); }
.option.is-miss .option__verdict { background: var(--alert); color: var(--ink); }

.game__form .option.is-answer .option__icon { background: var(--teal); color: var(--white); font-weight: 700; }
.game__form .option.is-miss .option__icon { background: var(--alert); font-weight: 700; }

.option.is-answer .option__face { box-shadow: inset 0 0 0 4px var(--teal); }
.option.is-miss .option__face { box-shadow: inset 0 0 0 4px var(--alert); }

.option.is-miss { animation: option-shake 480ms ease-in-out; }

@keyframes option-shake {
  0%, 100% { transform: translateX(0); }
  15%, 45% { transform: translateX(-8px); }
  30%, 60% { transform: translateX(8px); }
  75% { transform: translateX(-4px); }
  90% { transform: translateX(4px); }
}

.fireworks {
  position: fixed;
  inset: 0;
  z-index: 98;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: none;
}

.fireworks.is-active { display: block; }

.panel {
  position: sticky;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-left: 4px;
  padding: 12px 16px;
  border: 2px solid var(--ink);
  border-radius: 2px;
  background: var(--white);
  box-shadow: -4px 4px 0 0 var(--ink);
  transition: background-color 200ms ease-in-out, box-shadow 200ms ease-in-out;
}

.panel__body { flex: 1; min-width: 0; }

@media (min-width: 728px) {
  .panel { gap: 24px; padding: 24px; }
}

.panel__title {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 400;
  line-height: 19.2px;
  text-transform: uppercase;
}

@media (min-width: 1302px) { .panel__title { font-size: 18px; line-height: 21.6px; } }

.panel__text { margin-top: 4px; font-size: 14px; line-height: 1.4; }

@media (min-width: 728px) { .panel__text { margin-top: 8px; font-size: 16px; line-height: 25.6px; } }

.panel.is-correct .panel__title::before,
.panel.is-wrong .panel__title::before {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  border: 2px solid var(--ink);
  content: '';
}

.panel.is-correct .panel__title::before { background: var(--teal); }
.panel.is-wrong .panel__title::before { background: var(--alert); }
.panel.is-error { background: var(--surface); }

@media (max-width: 959.98px), (hover: none), (pointer: coarse) {
  .panel.is-waiting { display: none; }
}

/* Desktop: the whole round fits in one viewport; long paragraphs scroll inside their card. */
@media (min-width: 960px) and (min-height: 600px) {
  .game { height: calc(100dvh - var(--header-offset)); min-height: 0; padding: 24px 0; }
  .game > .container { display: flex; flex-direction: column; height: 100%; }
  .game__head { margin-bottom: 16px; }
  .game__form { flex: 1; min-height: 0; gap: 16px; }
  .options { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr); }
  .option { min-height: 0; }
  .option__face { min-height: 0; }
  .option__window { min-height: 0; overflow-y: auto; scrollbar-width: thin; }
  .panel { position: static; margin-left: 0; padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .option.is-miss { animation: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
