:root {
  --paper: #f4f4ee;
  --ink: #21221f;
  --muted: #50534b;
  --board-paper: #eceee5;
  --open: #edf0e6;
  --covered: #c6cbbd;
  --covered-hover: #dae0d2;
  --accent: #ff5136;
  --deep-accent: #9e2e1d;
  --line: #292c26;
  --slate: #e2e6da;
  --display: "Arial Black", "Arial", sans-serif;
  --body: "Arial", sans-serif;
  --reading: "Georgia", serif;
  --page-margin: clamp(18px, 5.1vw, 82px);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 16px/1.48 var(--body); }
button, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
button, a, select { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--deep-accent); }
:focus-visible { outline: 3px solid #252aff; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
.wrap { width: min(1450px, calc(100% - var(--page-margin) * 2)); margin-inline: auto; }
.skip { position: fixed; inset: 12px auto auto 12px; transform: translateY(-180%); background: white; color: var(--ink); padding: 12px 16px; z-index: 4; }
.skip:focus { transform: none; }
.masthead { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.wordmark { display: inline-flex; align-items: center; gap: 8px; font: 900 28px/.9 var(--display); letter-spacing: -.055em; white-space: nowrap; }
.wordmark-dot { color: var(--deep-accent); }
.wordmark .wordmark-dot { margin-left: -7px; }
.brand-flag, .flag-icon, .calendar-icon { display: inline-block; flex: none; }
.brand-flag { width: 32px; aspect-ratio: 1; background: var(--accent); display: grid; place-items: center; }
.brand-flag::after, .flag-icon { content: ""; background: currentColor; width: 18px; height: 21px; clip-path: polygon(12% 0, 27% 0, 27% 10%, 94% 10%, 72% 39%, 94% 64%, 27% 64%, 27% 100%, 12% 100%); }
.masthead nav { display: flex; gap: clamp(16px, 3vw, 42px); font-weight: 700; }
.masthead nav a { padding-block: 10px; }
.hero { position: relative; overflow: clip; isolation: isolate; }
.hero-layout { display: grid; grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr); align-items: center; min-height: 667px; }
.intro { position: relative; z-index: 1; padding-block: 36px 54px; }
h1 { font: 900 clamp(64px, 7.45vw, 122px)/.81 var(--display); letter-spacing: -.065em; }
h1 .wordmark-dot { margin-left: .04em; }
.tagline { margin-top: clamp(28px, 5vw, 61px); font: 400 clamp(22px, 2.45vw, 40px)/1.19 var(--reading); letter-spacing: -.055em; }
.tagline strong { font-weight: 700; }
.summary { margin-top: 22px; max-width: 31ch; font-size: 17px; line-height: 1.5; color: var(--muted); }
.rules-link { display: inline-flex; background: var(--slate); padding: 10px 13px; margin-top: 22px; font-weight: 700; min-height: 44px; align-items: center; }
.rules-link:hover { background: var(--ink); color: white; }
.stage { position: relative; min-width: 0; padding: 42px 0 42px clamp(0px, 1.2vw, 24px); display: flex; justify-content: center; }
.stage::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -100px -19vw -75px -43px;
  background: var(--accent);
  clip-path: polygon(24% 0, 88% 0, 88% 14%, 100% 14%, 100% 86%, 84% 86%, 84% 100%, 16% 100%, 16% 86%, 0 86%, 0 21%, 12% 21%, 12% 10%, 24% 10%);
}
.game { background: var(--board-paper); border: 2px solid var(--line); width: min(100%, 655px); min-width: 0; padding: clamp(12px, 1.6vw, 25px); scroll-margin-top: 16px; }
.game-top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-weight: 700; }
.level-label { display: none; }
.select-wrap { position: relative; }
.select-wrap::after { content: ""; position: absolute; right: 14px; top: 45%; width: 7px; height: 7px; border-right: 2px solid; border-bottom: 2px solid; transform: rotate(45deg); pointer-events: none; }
.game select, .game-controls button, .daily-pill, #logic-reset {
  background: var(--paper); color: var(--ink); border: 1.5px solid var(--line); min-height: 44px;
  padding: 9px 13px; line-height: 1.2; font-size: 14px; font-weight: 700;
}
.game select { appearance: none; padding-right: 34px; cursor: pointer; }
.daily-pill { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; white-space: nowrap; }
.calendar-icon { width: 14px; height: 13px; border: 2px solid; border-top-width: 4px; }
.daily-pill[aria-pressed="true"], .game-controls button[aria-pressed="true"] { background: var(--accent); }
.scorebar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0 13px; }
.scorebar div { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.scorebar div:nth-child(2) { align-items: center; }
.scorebar div:nth-child(3) { align-items: flex-end; }
.scorebar span { font-size: 14px; color: var(--muted); }
.scorebar strong { font: 800 clamp(24px, 3.06vw, 38px)/1.05 var(--body); font-variant-numeric: tabular-nums; letter-spacing: -.06em; margin-top: 2px; }
.board-scroll { overflow: auto; max-height: min(71vh, 495px); scrollbar-color: #777e70 #e6e9e0; scrollbar-width: thin; }
.board { --cols: 9; --cell-width: clamp(28px, 4.1vw, 46px); width: max-content; margin-inline: auto; border: 2px solid var(--line); background: var(--line); display: grid; gap: 2px; padding: 1px; user-select: none; }
.board-row { display: grid; grid-template-columns: repeat(var(--cols), var(--cell-width)); gap: 2px; }
.board[data-level="medium"] { --cell-width: 30px; }
.board[data-level="expert"] { --cell-width: 28px; }
.cell, .logic-grid button {
  appearance: none; border: 0; border-radius: 0; padding: 0; min-width: 0;
  aspect-ratio: 1; background: var(--covered); color: var(--ink); display: grid; place-items: center;
  font: 800 clamp(15px, 2.1vw, 24px)/1 var(--body); touch-action: manipulation;
}
.cell span { pointer-events: none; }
.cell[data-state="covered"]:hover, .logic-grid button:hover { background: var(--covered-hover); }
.cell[data-state="covered"]:active { background: #aab4a0; }
.cell:focus-visible { position: relative; z-index: 1; outline: 3px solid #252aff; outline-offset: -4px; }
.cell[data-state="open"] { background: var(--open); }
.cell[data-state="flagged"], .logic-grid button[aria-pressed="true"] { background: #f7b096; color: #6b2417; }
.cell[data-state="start"], .cell[data-state="exploded"] { background: var(--accent); color: var(--ink); }
.cell[data-state="mine"], .cell[data-state="wrong"] { background: #e8dfd8; color: #962817; }
.board[data-phase="won"] { border-color: #17633e; }
.cell[data-hint="source"] { outline: 2px solid #334a38; outline-offset: -5px; }
.cell[data-hint="safe"] { background: #b9efb0; color: #164624; box-shadow: inset 0 0 0 3px #17633e; }
.cell[data-hint="mine"] { background: #ffe1a2; color: #5c3200; box-shadow: inset 0 0 0 3px #9c490e; }
.cell[data-hint="safe" i]::after, .cell[data-hint="mine" i]::after { content: ""; grid-area: 1/1; width: 5px; height: 5px; background: currentColor; }
.cell[data-hint="safe" i] span, .cell[data-hint="mine" i] span { grid-area: 1/1; }
.number-1 { color: #1e4db1; } .number-2 { color: #28633b; } .number-3 { color: #a83226; }
.number-4 { color: #50328c; } .number-5 { color: #75362c; } .number-6 { color: #15676a; }
.number-7 { color: #313431; } .number-8 { color: #55554f; }
.cell .flag-icon, .logic-grid .flag-icon { width: 55%; height: 59%; max-width: 19px; max-height: 22px; }
.game-controls { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 7px; margin-top: 15px; }
.game-controls button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding-inline: 6px; }
.game-controls .primary-button { background: var(--ink); color: white; }
.game-controls .primary-button:hover { background: var(--deep-accent); }
.game-controls button:not(.primary-button):not(:disabled):hover, .daily-pill:hover, #logic-reset:hover { background: #d6dbcf; }
.game-controls button[aria-pressed="true"]:hover { background: var(--accent); }
.game-controls .flag-icon, .example-cell .flag-icon { width: 14px; height: 16px; }
.game-voice { margin-top: 13px; }
#status { font-weight: 700; min-height: 25px; font-size: 15px; line-height: 1.38; }
.keys { color: var(--muted); font-size: 13px; margin-top: 3px; }
.touch-keys { display: none; }
.no-js { margin-block: 8px; }
.manual { padding-block: clamp(50px, 8.5vw, 136px) clamp(42px, 7vw, 96px); }
.section-heading { display: grid; grid-template-columns: 1fr .7fr; gap: 20px; align-items: end; margin-bottom: 28px; }
h2 { font: 900 clamp(39px, 6vw, 88px)/.9 var(--display); letter-spacing: -.065em; }
.section-heading > p { max-width: 42ch; justify-self: end; line-height: 1.45; font-size: clamp(16px, 1.6vw, 22px); }
.rules-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.rules-strip > div { min-width: 0; background: var(--slate); padding: clamp(16px, 2vw, 28px); }
.rules-strip > div:nth-child(2) { background: var(--ink); color: white; }
.rules-strip > div:nth-child(3) { background: var(--accent); }
.example-cell { display: inline-grid; place-items: center; background: var(--open); border: 2px solid var(--line); width: 48px; aspect-ratio: 1; font-size: 28px; line-height: 1; font-weight: 900; }
.example-blank { background: var(--covered); }
.example-flag { color: var(--deep-accent); }
.rules-strip h3 { margin: 15px 0 7px; font-weight: 800; font-size: clamp(19px, 2.1vw, 29px); line-height: 1.1; letter-spacing: -.05em; }
.rules-strip p { max-width: 28ch; }
.logic { display: grid; grid-template-columns: 1fr minmax(180px, .55fr); place-items: center start; gap: 24px; background: var(--board-paper); padding: clamp(20px, 4vw, 54px); margin-top: 5px; }
.logic h3 { font-size: clamp(28px, 4vw, 55px); font-weight: 900; line-height: 1; letter-spacing: -.08em; margin-bottom: 13px; }
.logic p { max-width: 39ch; }
#logic-response { font-weight: 700; margin-top: 12px; }
.logic-demo { display: grid; justify-items: center; justify-self: center; gap: 9px; }
.logic-grid { display: grid; grid-template-columns: repeat(3, 45px); gap: 2px; background: var(--line); border: 2px solid var(--line); }
.logic-grid .example-cell { width: 45px; border: 0; font-size: 21px; }
.faq { display: grid; grid-template-columns: minmax(180px, .68fr) minmax(0, 1fr); gap: clamp(20px, 6vw, 75px); align-items: start; padding-bottom: clamp(52px, 9vw, 120px); }
.faq h2 { position: sticky; top: 30px; font-size: clamp(40px, 5.2vw, 76px); }
.faq details { background: var(--slate); margin-bottom: 6px; }
.faq details[open] { background: #ffc2ad; }
.faq summary { list-style: none; cursor: pointer; min-height: 58px; padding: 15px 19px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 750; font-size: 18px; line-height: 1.25; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 24px; }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 19px 18px; max-width: 67ch; }
.footer { background: var(--ink); color: var(--paper); }
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-block: 35px; }
.footer .wordmark-dot { color: var(--accent); }
.footer .brand-flag { color: var(--ink); }
.footer a:hover { color: var(--accent); }
@media (max-width: 1050px) {
  .hero-layout { min-height: 615px; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
  h1 { font-size: clamp(56px, 8.2vw, 88px); }
}
@media (max-width: 760px) {
  .masthead { min-height: 61px; }
  .hero-layout { display: block; }
  .intro { padding-block: 17px 16px; }
  h1 { font-size: clamp(51px, 13.1vw, 94px); line-height: .84; }
  h1 br { display: none; }
  h1 br::after { content: " "; }
  h1 { white-space: normal; }
  .tagline { margin-top: 16px; font-size: 22px; }
  .tagline br { display: none; }
  .summary { margin-top: 8px; font-size: 15px; max-width: 45ch; }
  .rules-link { display: none; }
  .stage { padding: 10px 0 24px; }
  .stage::before { inset: 0 -17vw -33px; clip-path: polygon(17% 0, 86% 0, 86% 9%, 100% 9%, 100% 87%, 85% 87%, 85% 100%, 14% 100%, 14% 92%, 0 92%, 0 11%, 17% 11%); }
  .board { --cell-width: min(43px, calc((100vw - var(--page-margin) * 2 - 54px) / 9)); }
  .board[data-level="medium"], .board[data-level="expert"] { --cell-width: 31px; }
  .section-heading { display: block; margin-bottom: 20px; }
  .section-heading > p { margin-top: 13px; }
  .section-heading br { display: none; }
  .rules-strip { grid-template-columns: 1fr; }
  .rules-strip > div { display: grid; grid-template-columns: 50px 1fr; gap: 4px 12px; align-items: center; }
  .rules-strip h3 { margin: 0; }
  .rules-strip p { grid-column: 2; max-width: 45ch; }
  .example-cell { grid-row: span 2; width: 42px; }
  .faq { display: block; }
  .faq h2 { position: static; margin-bottom: 19px; }
}
@media (max-width: 465px) {
  .masthead .wordmark { font-size: 24px; gap: 6px; }
  .brand-flag { width: 26px; }
  .masthead nav { gap: 15px; font-size: 14px; }
  .masthead nav a:first-child { display: none; }
  h1 { font-size: clamp(44px, 12.85vw, 61px); }
  .tagline { font-size: 20px; }
  .summary { font-size: 16px; }
  .game-controls button, .daily-pill, .game select { font-size: 13px; }
  .game select { padding-left: 7px; padding-right: 25px; }
  .select-wrap::after { right: 9px; }
  .daily-pill { padding-inline: 8px; }
  .scorebar { margin-block: 12px 9px; }
  .game-voice { margin-top: 9px; }
  .logic { grid-template-columns: 1fr; gap: 16px; }
  .logic-demo { justify-self: start; }
}
@media (pointer: coarse) { .mouse-keys { display: none; } .touch-keys { display: inline; } }
@media (prefers-reduced-motion: no-preference) {
  .cell, .game-controls button, .daily-pill, .rules-link { transition: background-color .12s ease, color .12s ease; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
