/* Infinity Sudoku Focus: shared foundations for marketing, guides, and play. */
:root,
.game-body {
  color-scheme: light;
  --bg: #f7f9f8;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --text: #142127;
  --muted: #53656d;
  --border: #d6e1e4;
  --primary: #0f8fb8;
  --primary-dark: #0c4051;
  --cream: #f3f2df;
  --gold: #d7a94f;
  --action: #086f90;
  --on-action: #ffffff;
  --accent-soft: #e7f3f7;
  --focus: #086f90;
  --board-cell: #ffffff;
  --board-peer: #f0f6f8;
  --board-selected: #dceff6;
  --board-rule: #203d49;
  --board-line: #718995;
  --error: #a34029;
  --error-bg: #fff0e9;
  --shadow: 0 16px 48px rgba(12, 64, 81, .08);
  --stat-bg: #edf5f7;
  --stat-text: #0c4051;
  --font-sans: "Avenir Next", Avenir, "Trebuchet MS", "Segoe UI", sans-serif;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --space-6: 64px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 24px;
}

@media (prefers-color-scheme: dark) {
  :root,
  .game-body {
    color-scheme: dark;
    --bg: #0d1e25;
    --surface: #142a34;
    --surface-strong: #19343f;
    --text: #edf7f5;
    --muted: #b7c8c4;
    --border: #36515d;
    --action: #9adcf0;
    --on-action: #0d1e25;
    --accent-soft: #193b48;
    --focus: #9adcf0;
    --board-cell: #142a34;
    --board-peer: #1b3a46;
    --board-selected: #254e5f;
    --board-rule: #c4dbe3;
    --board-line: #628390;
    --error: #ffc3a5;
    --error-bg: #4a2b28;
    --shadow: 0 16px 48px rgba(0, 0, 0, .18);
    --stat-bg: #193b48;
    --stat-text: #bce7f2;
  }
}

html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body,
.game-body { background: var(--bg); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
body { line-height: 1.65; }
button, select, input { font-family: inherit; }
a { text-underline-offset: 5px; }
a:focus-visible, button:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}
::selection { background: var(--board-selected); color: var(--text); }
.page, .game-page { padding: 0 0 32px; }
.container, .game-page .container { width: min(1200px, calc(100% - 64px)); }
.skip-link { position: absolute; inset-inline-start: 16px; top: -80px; z-index: 10; padding: 12px 20px; background: var(--action); color: var(--on-action); border-radius: var(--radius-sm); }
.skip-link:focus { top: 12px; }
.topbar { display: grid; grid-template-columns: 1fr auto auto; gap: 24px; align-items: center; min-height: 104px; margin: 0; border-bottom: 1px solid var(--border); }
.brand { width: fit-content; min-width: 0; gap: 12px; letter-spacing: -.4px; font-size: 17px; }
.brand:hover { text-decoration: none; }
.brand img { width: 44px; height: 44px; border-radius: var(--radius-sm); }
.brand span { max-width: 230px; }
.nav { gap: 4px; justify-content: center; flex-wrap: nowrap; }
.nav a { min-height: 44px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; }
.nav a:hover { color: var(--text); background: var(--accent-soft); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--action); background: var(--accent-soft); font-weight: 800; }
.language-switch { min-width: 0; }
.language-switch > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.language-switch select { max-width: 150px; min-height: 44px; padding-inline: 12px 30px; border-color: var(--border); border-radius: var(--radius-sm); background: transparent; color: var(--text); font-size: 13px; }
.hero { grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr); min-height: 700px; gap: 72px; padding-block: 64px 80px; }
.hero-copy { min-width: 0; }
.kicker { display: flex; align-items: center; gap: 9px; padding: 0; margin-block-end: 24px; border: 0; border-radius: 0; background: none; color: var(--action); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.kicker::before { width: 8px; height: 8px; border: 2px solid currentColor; border-radius: 2px; content: ""; }
h1, h2, h3 { color: var(--text); text-wrap: balance; }
h1, h2, h3, p, li { overflow-wrap: anywhere; }
h1 { font-size: clamp(44px, 5.2vw, 74px); font-weight: 700; line-height: 1.08; letter-spacing: -.055em; }
.hero h1 { margin-block-end: 26px; }
.hero h1 span { display: block; }
.hero h1 span:last-child { color: var(--action); }
.lead { max-width: 530px; color: var(--muted); font-size: 17px; line-height: 1.8; }
.actions { gap: 12px; margin-top: 32px; }
.button { min-height: 52px; gap: 10px; padding: 12px 22px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 700; line-height: 1.5; box-shadow: none; transition: background-color 150ms ease, border-color 150ms ease; }
.button.primary, .button.web-play, .new-game-button { border-color: var(--action); background: var(--action); color: var(--on-action); box-shadow: none; }
.button:hover { text-decoration: none; border-color: var(--action); }
.button.primary:hover, .button.web-play:hover, .new-game-button:hover { filter: brightness(.94); }
.button.secondary { background: transparent; color: var(--text); border-color: var(--border); }
.button svg { width: 20px; height: 20px; flex: none; }
.button.store .store-icon { width: 20px; height: 20px; }
.platforms { margin: 24px 0 0; color: var(--muted); font-size: 12px; letter-spacing: .04em; }
.product-panel { position: relative; padding: 28px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); }
.preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-block-end: 20px; }
.preview-heading strong { font-size: 17px; letter-spacing: -.4px; }
.preview-heading .preview-mark { display: grid; grid-template-columns: repeat(3, 5px); gap: 3px; }
.preview-mark i { width: 5px; height: 5px; background: var(--primary); border-radius: 1px; }
.sudoku-card { padding: 0; border-radius: 0; background: transparent; }
.sudoku-grid { overflow: hidden; direction: ltr; gap: 0; border: 2px solid var(--board-rule); background: var(--board-rule); }
.sudoku-grid span { border-right: 1px solid var(--board-line); border-bottom: 1px solid var(--board-line); background: var(--board-cell); color: var(--text); font-size: clamp(18px, 2.3vw, 28px); font-weight: 600; }
.sudoku-grid span:nth-child(3n) { border-right: 2px solid var(--board-rule); }
.sudoku-grid span:nth-child(9n) { border-right: 0; }
.sudoku-grid span:nth-child(n+19):nth-child(-n+27), .sudoku-grid span:nth-child(n+46):nth-child(-n+54) { border-bottom: 2px solid var(--board-rule); }
.sudoku-grid span:nth-child(n+73) { border-bottom: 0; }
.sudoku-grid span:nth-child(41), .sudoku-grid span:nth-child(42), .sudoku-grid span:nth-child(43) { background: var(--board-peer); }
.sudoku-grid span:nth-child(41) { color: var(--action); background: var(--board-selected); }
.stats { gap: 8px; margin-top: 20px; }
.stats span { padding: 7px 3px; color: var(--stat-text); background: var(--stat-bg); box-shadow: none; font-size: 12px; font-weight: 600; }
.preview-caption { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 16px 0 0; padding-top: 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.preview-caption a { display: inline-flex; gap: 8px; align-items: center; min-height: 44px; font-size: 13px; font-weight: 800; color: var(--action); }
.section { margin-top: 0; padding: 48px 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: transparent; }
.section h2, .play-copy h2 { max-width: 740px; margin-bottom: 28px; font-size: clamp(26px, 3vw, 34px); font-weight: 650; line-height: 1.25; letter-spacing: -.035em; }
.section-index { display: block; margin-bottom: 12px; color: var(--action); font-size: 12px; letter-spacing: .1em; font-weight: 800; }
.feature-grid, .feature-grid.two { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.feature { padding: 0; border: 0; border-radius: 0; background: transparent; }
.feature strong { margin-bottom: 12px; color: var(--text); font-size: 17px; font-weight: 700; }
.feature p { font-size: 15px; line-height: 1.8; }
.guide-card a { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; min-height: 44px; color: var(--action); }
.guide-card a::after { content: "↗"; }
.article { max-width: 860px; margin: 64px auto 0; }
.article > h1 { margin-bottom: 24px; font-size: clamp(38px, 5vw, 60px); }
.article > .lead { max-width: 760px; margin-bottom: 48px; }
.article .section { padding: 32px 0; }
.article .section h2 { margin-bottom: 16px; }
.article p, .article li { color: var(--muted); line-height: 1.85; }
.article a:not(.button) { color: var(--action); text-decoration: underline; }
.app-cta { gap: 32px; padding: 32px; margin-block: 24px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--accent-soft); }
.app-cta h2 { margin-bottom: 12px; }
.app-cta .button { flex-shrink: 0; }
.footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 28px; margin-top: 24px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.footer a { min-height: 44px; display: inline-flex; align-items: center; color: var(--action); font-weight: 700; }

/* Keep the actual playable board and its controls on the same visual system. */
.game-layout { grid-template-columns: minmax(0, 650px) minmax(0, 1fr); gap: 64px; padding-top: 48px; }
.game-controls { top: 24px; padding: 0; }
.game-controls h1 { font-size: 42px; letter-spacing: -.04em; }
.game-intro { margin-bottom: 16px; font-size: 15px; }
.board-frame { padding: 20px; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.board-frame::before, .board-frame::after { display: none; }
.game-board { border: 2px solid var(--board-rule); background: var(--board-rule); box-shadow: none; }
.sudoku-cell { background: var(--board-cell); color: var(--text); border-color: var(--board-line); font-family: var(--font-sans); font-size: clamp(22px, 3vw, 36px); font-weight: 500; }
.sudoku-cell:nth-child(3n):not(:nth-child(9n)) { border-right: 2px solid var(--board-rule); }
.sudoku-cell:nth-child(n+19):nth-child(-n+27), .sudoku-cell:nth-child(n+46):nth-child(-n+54) { border-bottom: 2px solid var(--board-rule); }
.sudoku-cell.is-fixed { color: var(--text); font-weight: 700; }
.sudoku-cell.is-user { color: var(--action); }
.sudoku-cell:hover, .sudoku-cell.is-peer { background: var(--board-peer); }
.sudoku-cell.is-same { background: var(--accent-soft); }
.sudoku-cell.is-selected { background: var(--board-selected); box-shadow: inset 0 0 0 3px var(--action); }
.sudoku-cell.is-wrong { color: var(--error); background: var(--error-bg); text-decoration: underline; text-underline-offset: 5px; }
.sudoku-cell:focus-visible { outline-color: var(--focus); outline-offset: -4px; }
.cell-notes { color: var(--action); }
.game-status { margin-bottom: 12px; color: var(--muted); font-size: 14px; }
.status-icon { color: var(--action); width: 18px; height: 18px; }
.difficulty-control { border-radius: var(--radius-sm); background: var(--surface); }
.difficulty-button { font-family: var(--font-sans); font-weight: 650; font-size: 14px; min-height: 44px; line-height: 1.3; }
.difficulty-button[aria-pressed="true"] { background: var(--action); color: var(--on-action); }
.number-pad { gap: 8px; }
.number-button { min-height: 56px; border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-family: var(--font-sans); font-size: 25px; font-weight: 600; box-shadow: none; }
.number-button:hover, .number-button.is-active, .tool-button[aria-pressed="true"] { color: var(--action); border-color: var(--action); background: var(--accent-soft); }
.tool-row { gap: 8px; }
.tool-button { border-radius: var(--radius-sm); background: var(--surface); font-family: var(--font-sans); min-height: 64px; font-size: 12px; }
.mode-dot { background: var(--action); }
.new-game-button { border-radius: var(--radius-sm); min-height: 48px; font-family: var(--font-sans); font-size: 14px; }
.native-promo { margin-top: 24px; gap: 12px; }
.native-promo strong { font-size: 14px; }
.native-promo p { font-size: 12px; }
.native-promo .button { min-height: 44px; font-size: 12px; }
.game-message { color: var(--muted); font-size: 13px; }
.completion-panel { background: var(--accent-soft); color: var(--text); border-color: var(--action); }
.play-copy { max-width: none; margin-top: 64px; padding-top: 48px; }
.play-feature-grid { gap: 32px; }
.play-feature-grid article { padding: 0; border: 0; background: transparent; }
.play-feature-grid h3 { font-size: 17px; }
.play-faq { max-width: 900px; }
.play-faq details { padding: 18px 0; border-bottom: 1px solid var(--border); }
.play-faq summary { min-height: 44px; display: list-item; align-content: center; font-weight: 650; }
.play-faq p { padding: 6px 0 12px; }
[dir="rtl"] .guide-card a::after { content: "↖"; }
[dir="rtl"] .web-play svg { transform: scaleX(-1); }
[dir="rtl"] h1 { letter-spacing: 0; }
@media (max-width: 1100px) {
  .topbar { grid-template-columns: 1fr auto; gap: 0 20px; padding: 20px 0 12px; }
  .topbar > .nav { grid-row: 2; grid-column: 1 / -1; justify-content: flex-start; margin-top: 12px; }
  .topbar > .language-switch { grid-column: 2; grid-row: 1; }
  .hero { gap: 40px; min-height: 620px; }
  .hero h1 { font-size: clamp(44px, 5.5vw, 62px); }
}
@media (max-width: 980px) {
  .game-layout { display: flex; flex-direction: column; max-width: 660px; margin: auto; gap: 0; padding-top: 32px; }
  .game-controls { display: contents; }
  .game-controls h1 { order: 0; width: 100%; margin-bottom: 12px; }
  .game-intro { order: 1; max-width: none; }
  .game-status { order: 2; width: 100%; }
  .difficulty-control { order: 3; width: 100%; margin-bottom: 16px; }
  .game-stage { order: 4; width: 100%; margin-bottom: 20px; }
  .number-pad { order: 5; width: 100%; grid-template-columns: repeat(9, minmax(0, 1fr)); }
  .tool-row { order: 6; width: 100%; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 12px; }
  .new-game-button { order: 7; }
  .game-message { order: 8; }
  .completion-panel { order: 9; }
  .native-promo { order: 10; width: 100%; }
}
@media (max-width: 760px) {
  .container, .game-page .container { width: min(600px, calc(100% - 40px)); }
  .hero { grid-template-columns: minmax(0, 1fr); min-height: auto; gap: 40px; padding-block: 44px 48px; }
  .hero h1 { font-size: clamp(40px, 8.5vw, 60px); letter-spacing: -.045em; }
  .hero-copy { order: 0; }
  .product-panel { order: 1; width: min(100%, 460px); justify-self: center; padding: 22px; }
  .sudoku-grid span { font-size: 25px; }
  .kicker { margin-bottom: 20px; }
  .lead { font-size: 16px; line-height: 1.75; }
  .feature-grid, .feature-grid.two, .play-feature-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .section { padding-block: 36px; }
  .section h2 { margin-bottom: 24px; }
  .app-cta { padding: 24px; flex-direction: column; align-items: stretch; }
  .app-cta .button { width: 100%; }
  .article { margin-top: 40px; }
  .board-frame { padding: 10px; border-radius: var(--radius-md); }
}
@media (max-width: 480px) {
  .container, .game-page .container { width: calc(100% - 32px); }
  .brand { gap: 8px; font-size: 14px; }
  .brand img { width: 38px; height: 38px; }
  .brand span { max-width: 160px; }
  .language-switch select { max-width: 106px; font-size: 12px; }
  .topbar > .nav { max-width: 100%; flex-wrap: wrap; justify-content: flex-start; padding-bottom: 3px; }
  .nav a { padding-inline: 10px; font-size: 13px; }
  .hero { padding-top: 36px; }
  .actions { flex-direction: column; align-items: stretch; gap: 10px; margin-top: 24px; }
  .platforms { font-size: 11px; }
  .product-panel { padding: 18px; }
  .sudoku-grid span { font-size: 22px; }
  .preview-caption { font-size: 11px; }
  .game-controls h1 { font-size: 34px; }
  .game-layout { padding-top: 24px; }
  .sudoku-cell { font-size: clamp(18px, 6vw, 26px); }
  .number-pad { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .number-button { min-height: 50px; }
  .tool-button { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
