:root {
  color-scheme: light;
  --bg: #f8faf7;
  --surface: #ffffff;
  --surface-strong: #f0f6f4;
  --text: #19211f;
  --muted: #5e6a66;
  --line: #dce6e2;
  --primary: #0f7c6c;
  --primary-strong: #095f53;
  --accent: #d84f3f;
  --focus: #2f74d0;
  --shadow: 0 18px 40px rgba(24, 38, 35, 0.12);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.7; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.site-header { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding: 12px clamp(16px, 4vw, 48px); background: rgba(248, 250, 247, 0.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.brand { font-weight: 800; text-decoration: none; }
.site-nav { display: flex; gap: 14px; color: var(--muted); font-size: 0.95rem; }
.site-nav a { text-decoration: none; }
.hero, .game-hero { display: grid; align-items: center; min-height: clamp(390px, 70vh, 620px); padding: clamp(40px, 8vw, 96px) clamp(16px, 4vw, 48px); background: linear-gradient(90deg, rgba(10, 29, 26, 0.76), rgba(10, 29, 26, 0.38)), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1400' height='900' viewBox='0 0 1400 900'%3E%3Crect width='1400' height='900' fill='%232e8378'/%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.22' stroke-width='8'%3E%3Ccircle cx='1010' cy='300' r='170'/%3E%3Ccircle cx='1010' cy='300' r='250'/%3E%3Cpath d='M170 630h410M210 700h300M250 560h250'/%3E%3C/g%3E%3Cg fill='%23ffd166' fill-opacity='.85'%3E%3Ccircle cx='1070' cy='280' r='12'/%3E%3Ccircle cx='930' cy='215' r='10'/%3E%3Ccircle cx='970' cy='410' r='8'/%3E%3C/g%3E%3C/svg%3E"); background-size: cover; background-position: center; color: #fff; }
.hero__content, .game-hero > div { width: min(760px, 100%); }
.game-hero { min-height: clamp(190px, 32vh, 300px); padding: clamp(28px, 5vw, 52px) clamp(16px, 4vw, 48px); }
.game-hero h1 { max-width: 16em; margin-bottom: 10px; font-size: clamp(2rem, 5vw, 3.5rem); }
.game-hero p { max-width: 720px; margin-bottom: 0; font-size: 1rem; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 0.85rem; font-weight: 800; }
.hero .eyebrow, .game-hero .eyebrow { color: #ffd166; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { max-width: 12em; margin: 0 0 16px; font-size: clamp(2.2rem, 8vw, 5.4rem); line-height: 1.05; }
h2 { margin: 0 0 12px; font-size: clamp(1.45rem, 4vw, 2.25rem); line-height: 1.25; }
h3 { margin: 8px 0; font-size: 1.2rem; line-height: 1.35; }
.hero p, .game-hero p { max-width: 640px; margin: 0 0 24px; font-size: 1.08rem; }
.section { padding: clamp(44px, 8vw, 84px) clamp(16px, 4vw, 48px); }
.section--muted { background: var(--surface-strong); }
.section__heading, .section__lead { width: min(760px, 100%); }
.game-grid, .content-grid, .mood-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; width: min(1120px, 100%); margin-top: 24px; }
.game-card, .content-grid article, .game-panel, .mood-card { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.game-card, .content-grid article, .mood-card { padding: 20px; }
.game-card__meta, .label, .status { color: var(--muted); font-size: 0.9rem; }
.game-card--disabled { opacity: 0.72; }
.mood-card__label { margin: 0; color: var(--accent); font-size: 0.86rem; font-weight: 900; }
.mood-card h3 { margin-top: 4px; }
.mood-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.mood-links a { display: inline-flex; align-items: center; min-height: 42px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-strong); font-weight: 800; text-decoration: none; }
.mood-links a:hover { border-color: var(--primary); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; min-width: 112px; padding: 10px 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; }
.button--primary { border-color: var(--primary); background: var(--primary); color: #fff; }
.button--primary:hover { background: var(--primary-strong); }
.button--quiet { background: transparent; }
.button:disabled { cursor: not-allowed; opacity: 0.46; }
.game-shell { padding: clamp(24px, 5vw, 54px) clamp(16px, 4vw, 48px); }
.game-panel { width: min(760px, 100%); margin: 0 auto; padding: clamp(18px, 4vw, 32px); }
.game-panel__top { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.timer-face { display: grid; place-items: center; min-height: 168px; margin: 20px 0; border: 1px solid var(--line); border-radius: 8px; background: #101918; color: #f7fffc; font-variant-numeric: tabular-nums; }
.reaction-pad { display: grid; place-items: center; width: 100%; min-height: 220px; margin: 20px 0; border: 1px solid var(--line); border-radius: 8px; background: #263231; color: #f7fffc; text-align: center; cursor: pointer; user-select: none; transition: background-color 160ms ease, transform 160ms ease; }
.reaction-pad[data-state="waiting"] { background: #9b2f2f; }
.reaction-pad[data-state="ready"] { background: #15803d; transform: scale(1.01); }
.reaction-pad[data-state="too-soon"] { background: #795319; }
.reaction-pad strong { display: block; font-size: clamp(1.7rem, 8vw, 3.6rem); line-height: 1.15; }
.reaction-pad span { color: rgba(255,255,255,.78); }
.timer-face span:first-child { display: block; font-size: clamp(3rem, 16vw, 6.5rem); font-weight: 900; line-height: 1; }
.timer-face span:last-child { margin-top: -18px; color: #b7ccc6; }
.score-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.score-row > div { min-height: 82px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-strong); }
.score-row strong { display: block; margin-top: 4px; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.control-row, .share-row { display: flex; flex-wrap: wrap; gap: 10px; }
.share-row { margin-top: 10px; }
.site-footer { padding: 32px clamp(16px, 4vw, 48px); border-top: 1px solid var(--line); color: var(--muted); }
[hidden] { display: none !important; }
.section--compact { padding-top: clamp(28px, 5vw, 52px); padding-bottom: clamp(28px, 5vw, 52px); }
.primary-action, .secondary-action { display: flex; justify-content: center; margin-top: 14px; }
.button--large { width: min(100%, 360px); min-height: 58px; font-size: 1.12rem; }
.button--retry { border-color: #d9a423; background: #fff4cc; color: #3f3000; }
.result-card { margin-top: 18px; padding: clamp(16px, 4vw, 24px); border: 1px solid var(--line); border-radius: 8px; background: #fffdf7; text-align: center; }
.result-card__label { margin: 0 0 4px; color: var(--muted); font-size: .92rem; font-weight: 700; }
.result-card__value { display: block; font-size: clamp(2.4rem, 12vw, 4.8rem); line-height: 1.05; font-variant-numeric: tabular-nums; }
.result-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 16px 0 0; }
.result-metrics div { padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-strong); }
.result-metrics dt { color: var(--muted); font-size: .86rem; }
.result-metrics dd { margin: 2px 0 0; font-size: 1.15rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.stars { margin-top: 16px; color: #d99a00; font-size: clamp(1.35rem, 6vw, 2.1rem); }
.result-message { margin: 6px 0 0; font-size: 1.18rem; font-weight: 900; }
.link-pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.pill { display: inline-flex; align-items: center; min-height: 44px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font-weight: 800; text-decoration: none; }
.pill--current { background: #e3efec; color: var(--muted); }
.color-stage { margin: 20px 0; padding: clamp(14px, 4vw, 22px); border: 1px solid var(--line); border-radius: 8px; background: #fdfefd; text-align: center; }
.target-swatch { width: min(160px, 52vw); aspect-ratio: 1; margin: 0 auto 12px; border: 1px solid var(--line); border-radius: 8px; background: transparent; }
.target-label { margin: 0 0 14px; font-weight: 900; }
.color-choices { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.color-choice { min-height: 70px; border: 3px solid #fff; border-radius: 8px; box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.color-choice:focus-visible { outline: 4px solid var(--focus); outline-offset: 2px; }
.page-main { padding: clamp(28px, 6vw, 72px) clamp(16px, 4vw, 48px); }
.page-section { width: min(860px, 100%); margin: 0 auto; }
.page-section h1 { max-width: none; color: var(--text); font-size: clamp(2rem, 6vw, 3.4rem); }
.page-section h2 { margin-top: 28px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; }
.footer-nav a { color: var(--muted); text-decoration: none; }
.consent-banner { position: fixed; right: clamp(12px, 3vw, 24px); bottom: clamp(12px, 3vw, 24px); left: clamp(12px, 3vw, 24px); z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 16px; width: min(920px, calc(100% - 24px)); margin-left: auto; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.98); box-shadow: var(--shadow); }
.consent-banner__body { min-width: 0; }
.consent-banner__body p { margin: 0; }
.consent-banner__title { font-weight: 900; }
.consent-banner__actions { display: flex; flex-wrap: wrap; gap: 10px; flex: 0 0 auto; }
.consent-manage { position: fixed; right: 12px; bottom: 12px; z-index: 25; min-height: 38px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.94); color: var(--muted); font: inherit; font-size: .86rem; font-weight: 800; cursor: pointer; box-shadow: 0 8px 22px rgba(24,38,35,.12); }
.tap-area { display: grid; place-items: center; width: 100%; min-height: 220px; margin: 20px 0; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: #183b4a; color: #f7fffc; font: inherit; text-align: center; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.tap-area[data-state="countdown"] { background: #795319; }
.tap-area[data-state="playing"] { background: #0f7c6c; }
.tap-area[data-state="finished"] { background: #263231; }
.tap-area strong { display: block; font-size: clamp(2rem, 10vw, 4.4rem); line-height: 1.1; }
.tap-area span { display: block; }
.tap-area__rate { margin-top: 8px; color: rgba(255,255,255,.78); font-weight: 800; font-variant-numeric: tabular-nums; }
.timer-face--hidden { min-height: 150px; }
.memory-stage { margin: 20px 0 14px; padding: clamp(16px, 4vw, 24px); border: 1px solid var(--line); border-radius: 8px; background: #101918; color: #f7fffc; text-align: center; }
.memory-stage__level { margin: 0 0 8px; color: #b7ccc6; font-weight: 800; }
.memory-number { display: block; min-height: 1.2em; font-size: clamp(2.4rem, 12vw, 5.4rem); line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: .08em; }
.memory-form { margin: 14px 0 0; }
.memory-form label { display: block; margin-bottom: 6px; color: var(--muted); font-weight: 800; }
.memory-form__row { display: flex; gap: 10px; }
.memory-input { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.next-games { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.result-card[hidden] ~ .next-games { display: none; }
.next-games__title { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: .92rem; font-weight: 900; }
.next-game-card { display: block; min-height: 72px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-strong); color: var(--text); text-decoration: none; }
.next-game-card strong, .next-game-card span { display: block; }
.next-game-card span { margin-top: 2px; color: var(--muted); font-size: .86rem; line-height: 1.45; }
.result-card + .secondary-action .button--retry { width: min(100%, 360px); min-height: 54px; }
@media (max-width: 620px) {
  .site-header { position: static; align-items: flex-start; flex-direction: column; }
  .hero { min-height: 390px; }
  .game-hero { min-height: auto; padding-top: 28px; padding-bottom: 28px; }
  h1 { font-size: clamp(2rem, 12vw, 3.2rem); }
  .score-row { grid-template-columns: 1fr; }
  .control-row .button, .share-row .button, .link-pills .pill { flex: 1 1 140px; }
  .game-panel { padding: 16px; }
  .timer-face, .reaction-pad { min-height: 150px; }
  .color-choices { grid-template-columns: repeat(2, 1fr); }
  .color-choice { min-height: 64px; }
  .consent-banner { align-items: stretch; flex-direction: column; }
  .consent-banner__actions .button { flex: 1 1 130px; }
  .tap-area { min-height: 190px; }
  .memory-form__row { flex-direction: column; }
  .next-games, .mood-grid { grid-template-columns: 1fr; }
  .next-game-card { min-height: 62px; }
  .mood-links a { flex: 1 1 130px; justify-content: center; }
}
.score-row--four { grid-template-columns: repeat(4, 1fr); }
.game-canvas { display: block; width: 100%; max-width: 520px; margin: 20px auto; border: 1px solid var(--line); border-radius: 8px; background: #101918; box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); touch-action: none; user-select: none; -webkit-user-select: none; }
.game-canvas--vertical { aspect-ratio: 2 / 3; }
.game-canvas--wide { max-width: 680px; aspect-ratio: 16 / 9; }
.game-canvas--square { max-width: 520px; aspect-ratio: 1; }
@media (max-width: 620px) {
  .score-row--four { grid-template-columns: repeat(2, 1fr); }
  .game-canvas { margin: 16px auto; }
  .game-canvas--vertical { max-height: 58vh; }
}
