@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,650;12..96,750;12..96,800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  color-scheme: light;
  --paper: #f6f5ee;
  --card: #fffefa;
  --ink: #142a23;
  --muted: #4e6358;
  --link: #236247;
  --line: #dce3d8;
  --forest: #132f28;
  --mint: #a3e9b1;
  --yellow: #ffe292;
  --display: "Bricolage Grotesque", "Segoe UI", sans-serif;
  --body: "Inter", "Segoe UI", sans-serif;
  --mono: ui-monospace, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.6 var(--body); }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: default; }
a { color: var(--link); text-underline-offset: 0.22em; }
:focus-visible { outline: 3px solid #b26b21; outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; }
h2 { font-size: clamp(2rem, 4vw, 3.25rem); letter-spacing: -0.045em; font-weight: 750; }
h3 { font-size: 1.45rem; letter-spacing: -0.02em; font-weight: 750; }
section[id] { scroll-margin-top: 22px; }
.wrap { width: min(1120px, calc(100% - 56px)); margin-inline: auto; }

.skip-link { position: absolute; left: 12px; top: 10px; z-index: 2; padding: 8px 16px; background: var(--card); transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; color: inherit; text-decoration: none; font: 750 1.22rem/1 var(--display); letter-spacing: -0.035em; }
.brand img { border-radius: 10px; }
.site-nav { display: flex; align-items: center; justify-content: center; gap: clamp(20px, 3vw, 42px); }
.site-nav a { color: var(--muted); text-decoration: none; font-size: 0.9rem; font-weight: 650; }
:is(.site-nav, .site-footer) a:hover { text-decoration: underline; }
.intro-link span, .reading-link span { margin-left: 4px; }
.language-menu { position: relative; }
.language-menu a { display: block; }

.intro { display: flex; justify-content: space-between; align-items: end; gap: 30px; padding-block: clamp(38px, 4vw, 56px) 30px; }
.intro-copy { max-width: 800px; }
.intro h1 { font-size: clamp(2.8rem, 5.75vw, 4.75rem); font-weight: 750; letter-spacing: -0.045em; line-height: 1.02; text-wrap: balance; }
.intro p { max-width: 55ch; margin-top: 20px; font-size: clamp(1rem, 1.5vw, 1.16rem); color: var(--muted); }
.intro-link { flex-shrink: 0; margin-bottom: 3px; font-weight: 700; }

.game {
  --panel-dark: #15352d;
  --panel-light: #f8faf3;
  --panel-border: #d7e4d9;
  --game-motion: 160ms;
  padding: clamp(12px, 2.2vw, 24px);
  color: #f5fbf5;
  background:
    radial-gradient(ellipse at right top, #295142 0%, transparent 54%),
    #102920;
  border: 1px solid #264939;
  border-radius: 28px;
  box-shadow: 0 26px 54px -32px #152e26a6, 0 7px 16px -10px #152e2666;
}

.game-header { display: flex; justify-content: space-between; align-items: center; gap: 14px 24px; margin: 1px 2px 18px; }
.game-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.game-identity img { flex: 0 0 auto; border: 1px solid #537e66; border-radius: 13px; }
.game-header h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
.game-header p { margin-top: 3px; color: #c7dccf; font-size: 0.9rem; line-height: 1.35; }
.mode-control { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid #507963; border-radius: 14px; background: #102a22; }
.mode-control button { border: 0; border-radius: 10px; min-height: 44px; padding: 6px 15px; color: #d6e9da; background: transparent; white-space: nowrap; font-size: 0.875rem; font-weight: 700; transition: color var(--game-motion), background-color var(--game-motion); }
.mode-control button[aria-pressed="true"] { background: #c9f2ae; color: #142d20; }
.mode-control button[aria-pressed="false"]:hover { background: #2b4e40; color: #fff; }
.mode-control :focus-visible { outline-color: var(--yellow); outline-offset: 2px; }
.board { display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr); gap: clamp(10px, 1.4vw, 16px); }
.chart, .guess-panel { min-width: 0; padding: clamp(16px, 2.1vw, 28px); border: 1px solid; border-radius: 20px; }
.chart {
  background:
    radial-gradient(circle, #c0e5cc12 0.85px, transparent 1.1px) top right / 10px 10px,
    linear-gradient(145deg, #234f41, var(--panel-dark) 65%);
  border-color: #446b59;
  color: #f5fbf5;
}
.chart-heading, .guess-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; }
.chart-heading h3, .guess-heading h3 { font-size: clamp(1.5rem, 3vw, 2.05rem); text-wrap: balance; }
.chart-year { border-radius: 999px; border: 1px solid #648b77; padding: 3px 9px; color: #dbf5e2; background: var(--panel-dark); font: 0.83rem/1.5 var(--mono); }
.chart-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin: 14px 0 0; padding: 0; list-style: none; }
.chart-list li {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px 8px;
  padding: 8px 11px;
  border: 1px solid #54816a52;
  border-radius: 10px;
  background: #102f25e6;
  font-size: 0.89rem;
  line-height: 1.25;
  font-weight: 650;
}
.chart-list li > span:nth-child(2) { color: #dcf6e5; font: 650 0.83rem/1.25 var(--mono); font-variant-numeric: tabular-nums; }
.bar-track { grid-column: 1 / -1; height: 6px; overflow: hidden; border-radius: 8px; background: #34594b; }
.bar-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #74ccad, #d8f5a6); }
.chart-list li:first-child .bar-fill { background: linear-gradient(90deg, #e2ac57, #ffe6a4); }
.chart-list .locked { border-style: dashed; background: #17392ed9; color: #d3e6da; }
.chart-list .locked:has(+ .locked), .chart-list .locked + .locked { grid-column: auto; }
.chart-list .locked .bar-track { display: none; }
.chart-list .locked > span:nth-child(2) { color: #bcd7c9; font: 0.72rem/1.25 var(--body); }
.chart-scale { display: flex; justify-content: space-between; margin: 6px 12px 4px; color: #cee2d6; font: 0.71rem/1.4 var(--mono); }
.chart-note { color: #d3e5db; font-size: 0.75rem; }

.guess-panel { display: flex; flex-direction: column; background: var(--panel-light); border-color: var(--panel-border); color: var(--ink); }
.round-progress { display: grid; gap: 5px; justify-items: end; flex-shrink: 0; }
.attempts { display: flex; gap: 4px; }
.attempts span { width: 17px; height: 5px; border-radius: 9px; background: #467959; }
.attempts span[data-state="used"] { background: #d6dfd2; box-shadow: inset 0 0 0 1px #a8baad; }
.attempts span[data-state="correct"] { background: #1d5736; }
.attempt-count { font-size: 0.77rem; font-weight: 650; line-height: 1.25; color: var(--muted); }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 15px; }
.choices button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  min-height: 57px;
  padding: 8px 10px 8px 13px;
  border: 1px solid #ccdcd0;
  border-radius: 13px;
  box-shadow: 0 2px 3px #152e260e;
  background: var(--card);
  color: var(--ink);
  text-align: left;
  overflow-wrap: anywhere;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.18;
  transition: background-color var(--game-motion), border-color var(--game-motion), transform var(--game-motion), box-shadow var(--game-motion);
}
.choice-mark { display: grid; flex: 0 0 24px; place-items: center; aspect-ratio: 1; border-radius: 50%; background: #edf3eb; color: #386651; font-size: 1rem; line-height: 1; }
.choice-mark:empty::after { content: ""; width: 6px; height: 6px; margin-left: -2px; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: rotate(45deg); }
.choices button:hover:not(:disabled) { background: #eaf6e7; border-color: #7baa91; box-shadow: 0 4px 9px #152e261a; transform: translateY(-1px); }
.choices button:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
.choices button:disabled { box-shadow: none; background: #f0f3ed; color: #567063; }
.choices button:disabled .choice-mark:empty { visibility: hidden; }
.choices button[data-result="incorrect"] { border-color: #ead3c9; background: #faf1ed; color: #75493d; }
.choices button[data-result="incorrect"] .choice-mark { background: #f2dfd6; color: #754037; }
.choices button[data-result="correct"] { border-color: #79aa89; background: #e0f3de; color: #184c2e; }
.choices button[data-result="correct"] .choice-mark { background: #226541; color: #fff; }
.game-status { display: block; margin-top: 14px; padding: 9px 11px; border-inline-start: 3px solid #87ab96; border-radius: 7px 10px 10px 7px; background: #eaf1e8; color: #3d594a; font-size: 0.85rem; line-height: 1.45; }
.game-status[data-state="correct"] { border-color: #41875c; background: #e2f1e2; color: #225237; font-weight: 700; }
.game-status:is([data-state="ended"], [data-state="miss"]) { border-color: #bd8351; background: #f6eee3; color: #684625; }
.round-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 9px; margin-top: 8px; }
.round-actions > :is(button, a) { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 44px; border: 1px solid #c5d8c9; border-radius: 10px; padding: 6px 10px; text-wrap: balance; text-align: center; text-decoration: none; font-size: 0.81rem; font-weight: 700; line-height: 1.25; transition: background-color var(--game-motion), color var(--game-motion); }
.round-actions :is(.hint-button, .source-link) { background: transparent; color: var(--link); }
.round-actions :is(.hint-button, .source-link):hover { background: #e2efe0; }
.round-actions .next-button { border-color: var(--forest); background: var(--forest); color: #fff; }
.round-actions .next-button:hover { background: #29543e; }
.guess-panel noscript { margin-top: 10px; }

@media (prefers-reduced-motion: reduce) {
  .game { --game-motion: 0ms; }
  .choices button { transform: none !important; }
}

.guide-section { padding-block: clamp(59px, 7vw, 98px) 42px; }
.section-lead, .faq-section > div:first-child > p { margin-top: 12px; max-width: 62ch; color: var(--muted); }
.guide-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 0; margin: 27px 0 40px; list-style: none; }
.guide-steps li { padding: clamp(17px, 2.4vw, 25px); background: var(--card); border: 1px solid var(--line); border-top: 3px solid #83b596; border-radius: 12px; }
.guide-steps h3, .reading-grid h3 { margin-bottom: 9px; }
.guide-steps p, .reading-grid p, .prose p { color: var(--muted); }
.reading-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(24px, 6vw, 85px); }
.reading-grid article { padding-block: 24px; border-top: 1px solid #ced9ce; }
.reading-grid p + p, .prose p + p { margin-top: 13px; }
.reading-link { display: inline-block; margin-top: 12px; font-weight: 700; }
.faq-section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr); gap: 32px; align-items: start; padding-block: 37px 76px; border-top: 1px solid #ced9ce; }
.faq-list details { border-bottom: 1px solid #d7e0d5; }
.faq-list summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; cursor: pointer; list-style: none; padding: 15px 4px; font-weight: 700; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: ""; flex: 0 0 auto; width: 8px; height: 8px; margin-right: 7px; border-right: 2px solid var(--link); border-bottom: 2px solid var(--link); transform: rotate(45deg); }
.faq-list details[open] summary::after { transform: rotate(225deg); }
.faq-answer { padding: 0 4px 16px; color: var(--muted); }

.prose { max-width: 760px; min-height: 50vh; padding-block: 62px 80px; }
.prose h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); letter-spacing: -0.06em; margin-bottom: 18px; }
.prose h2 { margin: 29px 0 10px; font-size: 1.58rem; letter-spacing: -0.03em; }
.prose .effective { font: 0.85rem/1.6 var(--mono); margin-bottom: 18px; }
.site-footer {
  --footer-text: #f3ead7;
  --footer-muted: #c9bda4;
  --footer-accent: #f0c56b;
  --footer-border: #d8a64e38;
  padding-block: 48px;
  border-top: 1px solid var(--footer-border);
  background: #202318;
  color: var(--footer-text);
}

.footer-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: start; gap: 24px; }
.footer-brand .brand { font-size: 1.125rem; }
.footer-brand p { max-width: 36ch; margin-block: 12px 10px; color: var(--footer-muted); font-size: 0.8125rem; }
.footer-contact, .footer-nav a { color: var(--footer-muted); text-decoration: none; font-size: 0.875rem; }
.footer-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.footer-nav h2 { margin-bottom: 10px; font: 650 0.9375rem/1.4 var(--body); letter-spacing: normal; }
.footer-nav ul { margin: 0; padding: 0; list-style: none; }
.footer-nav a { display: inline-flex; align-items: center; min-height: 32px; }
.site-footer a:hover { color: var(--footer-accent); }
.site-footer :focus-visible { outline-color: var(--footer-accent); }
.footer-bottom { display: grid; gap: 4px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--footer-border); color: var(--footer-muted); text-align: center; font-size: 0.875rem; }

@media (max-width: 991px) {
  .footer-row { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 767px) {
  .footer-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-nav a, .footer-contact { display: inline-flex; align-items: center; min-height: 44px; }
}

@media (max-width: 810px) {
  .intro { align-items: start; flex-direction: column; gap: 12px; }
}

@media (max-width: 660px) {
  .wrap { width: calc(100% - 28px); }
  .header-row { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding-block: 11px 4px; }
  .site-nav { grid-column: 1 / -1; grid-row: 2; justify-content: start; gap: 22px; }
  .site-nav a { padding-block: 8px; }
  .brand { font-size: 1.08rem; gap: 8px; }
  .brand img { width: 32px; height: 32px; }
  .intro { padding-block: 34px 25px; }
  .intro h1 { font-size: clamp(2.48rem, 10.35vw, 4.4rem); }
  .intro p { margin-top: 13px; }
  .intro-link { font-size: 0.9rem; }
  .game { border-radius: 20px; }
  .game-header { flex-wrap: wrap; gap: 11px; margin: 2px 0 12px; }
  .game-identity { gap: 9px; padding-inline: 3px; }
  .game-identity img { width: 41px; height: 41px; border-radius: 10px; }
  .mode-control { display: flex; width: 100%; }
  .mode-control button { flex: 1; }
  .board, .guide-steps, .reading-grid, .faq-section { grid-template-columns: minmax(0, 1fr); }
  .board { gap: 10px; }
  .chart, .guess-panel { border-radius: 14px; }
  .chart-list { margin-top: 11px; }
  .chart-list li { padding-inline: 8px; }
  .chart-list .locked { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .chart-scale { margin-inline: 9px; }
  .guess-heading { display: grid; grid-template-columns: minmax(0, 1fr); }
  .guess-heading h3 { text-wrap: wrap; }
  .round-progress { display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: center; }
  .choices button { min-height: 52px; padding-inline: 9px; }
  .faq-section { gap: 12px; padding-bottom: 49px; }
  .guide-steps { margin: 20px 0 29px; }
}
