.sudoku-main { align-items: flex-start; min-height: 0; }
.mobile-orientation-notice { display: none; }
.sudoku-layout { width: 100%; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,800px) minmax(0,1fr); gap: 16px; padding: 12px 20px; }
.game-frame { padding: 12px 18px; border: 1px solid #d7deec; border-radius: 20px; background: #fff; box-shadow: 0 8px 28px #2636500b; color: #263650; }
.game-heading,.game-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.game-heading h1 { font-size: 24px; letter-spacing: .3px; }
.game-heading { display: grid; grid-template-columns: auto minmax(0,1fr) auto; margin-bottom: 10px; }
.game-heading-center { position: relative; min-width: 0; min-height: 34px; }
.game-time-controls { display: flex; align-items: center; justify-content: center; gap: 8px; }
.game-timer { min-width: 76px; font-size: 18px; font-weight: 800; color: #344f78; font-variant-numeric: tabular-nums; text-align: center; }
.game-heading .game-pause { display: grid; place-items: center; width: 34px; min-height: 34px; padding: 4px; border-radius: 50%; }
.game-pause svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.game-pause .play-icon { display: none; fill: currentColor; stroke: currentColor; }
.game-pause[aria-pressed="true"] { border-color: #b51c30; background: #fff0f1; color: #a0182b; box-shadow: 0 0 0 3px #b51c3025; }
.game-pause[aria-pressed="true"] .pause-icon { display: none; }
.game-pause[aria-pressed="true"] .play-icon { display: block; }
.game-difficulty { margin-left: auto; font-size: 14px; font-weight: 600; text-align: right; color: #435c82; }
.game-workspace { display: grid; grid-template-columns: 90px minmax(0,1fr); gap: 12px; align-items: start; }
.game-workspace { position: relative; }
.game-pause-overlay { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 3px solid #b51c30; border-radius: 16px; background: #fff9f2f2; color: #94182a; text-align: center; box-shadow: 0 8px 28px #26365035; }
.game-pause-overlay[hidden] { display: none; }
.game-pause-overlay strong { font-size: clamp(24px,4vw,42px); letter-spacing: .06em; }
.game-pause-overlay span { font-size: clamp(14px,2vw,19px); font-weight: 700; }
.game-sidebar { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.game-sidebar button { display: grid; grid-template-columns: 18px minmax(0,1fr); align-items: center; gap: 4px; min-height: 44px; padding: 7px 5px; text-align: center; font-size: 12px !important; }
.game-sidebar button svg { width: 18px; height: 18px; }
.game-sidebar button span { min-width: 0; }
.game-sidebar .game-fullscreen { margin-top: 6px; }
.game-fullscreen .collapse-icon { display: none; }
.game-fullscreen[aria-pressed="true"] .expand-icon { display: none; }
.game-fullscreen[aria-pressed="true"] .collapse-icon { display: block; }
.fullscreen-notice { font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; color: #94182a; }
.notebook-tools { position: relative; display: flex; align-items: center; justify-content: center; gap: 4px; width: 90px; min-height: 62px; margin: 4px auto 0; padding: 16px 0 2px; border: 2px solid transparent; border-radius: 10px; transition: background .25s,border-color .25s,box-shadow .25s; }
.notebook-mode-label { position: absolute; top: 3px; left: 0; right: 0; color: #315b9d; font-size: 10px; font-weight: 900; letter-spacing: .12em; text-align: center; opacity: .65; }
.game-sidebar .notebook-button { flex: 0 0 40px; width: 40px; min-height: 40px; align-self: center; justify-self: center; grid-template-columns: 1fr; justify-items: center; padding: 5px; }
.game-sidebar .notebook-button[aria-pressed="true"] { background: #eaf0ff; border-color: #123ee8; outline: 2px solid #123ee8; }
.game-sidebar .notebook-button svg { width: 22px; height: 22px; }
.pencil-active .notebook-tools { border-color: #123ee8; box-shadow: 0 0 0 3px #123ee830,0 6px 18px #244b8730; animation: notebook-mode-colors 3.2s ease-in-out infinite; }
.pencil-active .notebook-mode-label { color: #102f93; opacity: 1; }
.confirm-notes-button:not(:disabled) { border-color: #448556 !important; background: #e8f7e9 !important; }
.game-sidebar .confirm-notes-button svg { width: 28px; height: 28px; overflow: visible; }
.confirm-notes-button .note-checkmark { stroke: #187337; }
@keyframes notebook-mode-colors { 0%,100% { background: #dfe9ff; } 33% { background: #fff0b8; } 66% { background: #d9f5df; } }
.game-circle .game-cell.has-notes { font-size: clamp(9px,1.35vh,13px); font-weight: 500; white-space: pre-line; line-height: 1.05; word-spacing: .12em; }
.game-circle .game-cell.note-error { border: 3px solid #c51f37; box-shadow: 0 0 0 2px #fff inset; color: #8e1024 !important; }
.game-trackers { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 8px; padding-top: 8px; border-top: 1px solid #d7deec; }
.layer-tracker { position: relative; display: grid; grid-template-columns: auto 76px; grid-template-rows: 1fr 1fr; column-gap: 8px; text-align: center; }
.layer-tracker h2 { align-self: end; margin: 0; font-size: 12px; font-weight: 600; }
.layer-circle { position: relative; width: 132px; aspect-ratio: 1; margin: auto; border: 2px solid #647898; border-radius: 50%; background: #fafcff; }
.layer-cell { position: absolute; display: grid; place-items: center; width: 28%; height: 28%; transform: translate(-50%,-50%); border: 1px solid #647898; border-radius: 50%; font-size: 17px; font-weight: 800; color: #162b49; line-height: 1; }
.layer-cell.complete { font-size: 26px; }
.layer-cell.complete { border: 2px solid #263650; }
.layer-tracker .layer-circle { grid-column: 2; grid-row: 1 / 3; width: 76px; }
.layer-tracker .layer-cell { font-size: 12px; }
.layer-tracker .layer-cell.complete { font-size: 16px; }
#layerStatus { grid-column: 1; grid-row: 2; margin-top: 3px; font-size: 11px; font-weight: 600; }
.layer-help { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.line-tracker { display: flex; align-items: center; gap: 8px; text-align: center; }
.line-tracker h2 { max-width: 76px; margin: 0; font-size: 12px; font-weight: 500; color: #596d87; }
.line-grid { display: block; flex: 0 0 auto; width: 64px; height: 64px; margin: auto; }
.line-grid-guide { fill: none; stroke: #c2ccda; stroke-width: 1.5; }
.completion-line { stroke: #435c82; stroke-width: 4; stroke-linecap: round; opacity: 0; }
.completion-line.complete { opacity: 1; }
.game-play-area { min-width: 0; }
.game-input-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 7px; }
.game-input-row > button { font-size: 13px !important; padding: 8px 7px !important; }
.game-input-row .game-numbers { width: 100%; gap: 4px; }
.game-input-row .hint-button { background: #fff3ce; border-color: #e2bd5d; }
.hint-button > span:first-child { display: inline-block; animation: hint-spark 3s ease-in-out infinite; }
@keyframes hint-spark { 0%,70%,100% { transform: rotate(0) scale(1); } 80% { transform: rotate(20deg) scale(1.3); } 90% { transform: rotate(-15deg) scale(1.15); } }
.sudoku-layout dialog p { line-height: 1.6; margin: 16px 0; }
.sudoku-layout dialog button:focus-visible { outline: 3px solid #123ee8; outline-offset: 2px; }
.sudoku-layout dialog form { margin-top: 20px; text-align: right; }
.difficulty-options { display: grid; gap: 10px; margin: 20px 0; }
.difficulty-options button { text-align: center; padding: 12px; }
.difficulty-options button[aria-pressed="true"] { border-color: #123ee8; background: #eaf0ff; }
.level-check { display: inline-block; width: 28px; color: #123ee8; font-weight: bold; }
.settings-options { display: grid; gap: 10px; }
#settingsDialog h2 { margin: 0 0 12px; }
#settingsDialog p { margin: 8px 0; line-height: 1.4; }
#settingsDialog .color-settings > p:first-of-type { font-size: 14px; }
.sum-tooltip-setting { margin-top: 12px; padding-top: 10px; border-top: 1px solid #d7deec; font-size: 13px; line-height: 1.3; }
.sum-tooltip-setting input { flex: 0 0 auto; width: 19px; height: 19px; accent-color: #1646b8; }
#settingsDialog form { margin-top: 12px; }
.settings-options label { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.settings-options input[type="range"] { width: 120px; }
.settings-options button:disabled { cursor: default; opacity: .65; }
.settings-options h3 { font-size: 16px; margin: 0 0 8px; }
.settings-circle { margin: 10px auto; width: 140px; }
.sudoku-layout dialog .settings-circle button { padding: 0; border-radius: 50%; font: inherit; }
.settings-circle button[aria-pressed="true"] { outline: 3px solid #123ee8; outline-offset: 3px; }
.sound-settings { border-top: 1px solid #d7deec; padding-top: 10px; }
.sound-settings label { margin: 8px 0; }
.sound-settings input[type="checkbox"] { width: 19px; height: 19px; accent-color: #1646b8; }
.sound-settings input:disabled { opacity: .4; }
.sound-settings output { min-width: 40px; text-align: right; font-size: 13px; }
.sound-settings .volume-control { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.volume-control > span { grid-column: 1 / -1; }
.settings-options .volume-control input { width: 100%; }
.settings-feedback { color: #b51c30; font-size: 13px; }
.settings-feedback:empty { display: none; }
.settings-note { font-size: 12px; color: #596d87; }
#musicNotice { color: #c91926; font-size: 16px; font-weight: 600; line-height: 1.4; text-align: center; margin: 8px 0 0; }
#gameFireworks { display: none; position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 110; }
#gameFireworks.active { display: block; }
#gameVictory { position: absolute; inset: 0; display: flex; align-items: center; overflow: hidden; visibility: hidden; border-radius: 7px; background: #c91926; color: #ffeb3b; }
#gameVictory.active { visibility: visible; }
#gameVictory.active ~ .game-time-controls { visibility: hidden; }
#gameVictory span { flex: 0 0 auto; padding-left: 100%; white-space: nowrap; color: #ffeb3b; font-size: 20px; font-weight: 900; letter-spacing: .025em; line-height: 1.15; }
#gameVictory.active span { animation: victory-scroll 10s linear infinite; }
#gameVictory.intro span { animation: none; padding: 2px 4px; white-space: normal; overflow-wrap: anywhere; font-size: clamp(10px,1.5vw,18px); text-align: center; flex: 1 1 auto; }
@keyframes victory-scroll { to { transform: translateX(-100%); } }
@media(prefers-reduced-motion: reduce) {
 #gameVictory.active span { animation: none; padding: 2px 4px; white-space: normal; overflow-wrap: anywhere; font-size: clamp(10px,1.5vw,18px); text-align: center; flex: 1 1 auto; }
}
@media(prefers-reduced-motion: reduce) { .pencil-active .notebook-tools { animation: none; background: #dfe9ff; } }
@media(prefers-reduced-motion: reduce) { .hint-button > span:first-child { animation: none; } }
@media(max-width: 620px) {
 .game-workspace { grid-template-columns: minmax(0,1fr); gap: 12px; }
 .game-sidebar { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; }
 .game-sidebar button { grid-template-columns: minmax(0,1fr); justify-items: center; text-align: center; min-height: 36px; font-size: 12px !important; padding: 6px !important; }
 .notebook-tools { grid-column: 1 / -1; width: 132px; min-height: 44px; margin-top: 0; padding: 0 0 0 42px; }
 .notebook-mode-label { top: 50%; right: auto; width: 40px; transform: translateY(-50%); }
 .game-sidebar .game-fullscreen { grid-column: 1 / -1; width: 100px; justify-self: center; margin-top: 0; grid-template-columns: 18px minmax(0,1fr); }
 .fullscreen-notice { grid-column: 1 / -1; text-align: center; }
 .game-sidebar .notebook-button { justify-content: center; }
 .game-input-row { gap: 4px; }
 .game-input-row > button { font-size: 11px !important; padding: 8px 4px !important; }
 .game-heading { margin-bottom: 10px; }
}
.game-frame button, .sudoku-layout dialog button { cursor: pointer; border: 1px solid #c9d4e8; border-radius: 8px; background: #f3f6fd; color: #263650; padding: 7px 10px; font: inherit; }
.game-sidebar > button { padding-inline: 5px; }
.game-frame button:focus-visible { outline: 3px solid #123ee8; outline-offset: 2px; }
.game-frame button:disabled { cursor: default; opacity: .5; }
.sudoku-layout dialog button:disabled { cursor: default; opacity: .38; color: #6d7788; }
.game-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 13px; font-size: 12px; margin: 10px 0; }
.game-legend > span { display: flex; align-items: center; gap: 4px; }
.game-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.position-S { background: var(--color-S, #80caff) !important; color: var(--ink-S, #162b49) !important; }
.position-I { background: var(--color-I, #ffda68) !important; color: var(--ink-I, #162b49) !important; }
.position-L { background: var(--color-L, #c49ae8) !important; color: var(--ink-L, #162b49) !important; }
.position-D { background: var(--color-D, #d9dfe8) !important; color: var(--ink-D, #162b49) !important; }
.position-C { background: var(--color-C, #7ed49a) !important; color: var(--ink-C, #162b49) !important; }
.game-board { width: min(100%, var(--board-size, 400px)); aspect-ratio: 1; margin: 0 auto 8px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); grid-template-rows: repeat(3,minmax(0,1fr)); gap: 8px; }
.game-circle { position: relative; min-width: 0; border: 2px solid #647898; border-radius: 50%; background: #fafcff; }
.game-circle .game-cell { position: absolute; width: 28%; height: 28%; padding: 0; border-radius: 50%; border: 1px solid #647898; font-size: clamp(14px,2.3vh,23px); color: #162b49; font-weight: 600; transform: translate(-50%,-50%); }
.game-cell.position-S, .layer-cell.position-S { left: 50%; top: 20%; }
.game-cell.position-I, .layer-cell.position-I { left: 50%; top: 80%; }
.game-cell.position-L, .layer-cell.position-L { left: 20%; top: 50%; }
.game-cell.position-D, .layer-cell.position-D { left: 80%; top: 50%; }
.game-cell.position-C, .layer-cell.position-C { left: 50%; top: 50%; }
.game-circle .game-cell.given { opacity: 1; text-decoration: underline; text-underline-offset: 3px; font-weight: 800; }
.game-circle .game-cell.hinted { box-shadow: inset 0 0 0 3px #d39416; font-weight: 800; }
.game-circle .game-cell.selected { outline: 3px solid #123ee8; outline-offset: 2px; z-index: 1; }
.circle-sum { position: absolute; bottom: -4px; right: 0; padding: 2px 4px; background: #fff; border-radius: 5px; border: 1px solid #d7deec; font-size: clamp(12px,1.5vh + 2px,15px); font-weight: bold; }
.game-numbers { display: grid; grid-template-columns: repeat(9,minmax(0,1fr)); gap: 5px; max-width: 470px; margin: auto; }
.game-numbers button { font-size: 19px; padding: 5px 0; font-weight: bold; }
.game-footer { margin-top: 8px; font-size: 13px; align-items: baseline; }
#gameProgress { flex: 0 0 auto; }
#gameStatus { flex: 1; min-width: 0; text-align: right; font-size: 13px; line-height: 1.4; min-height: 19px; margin: 0; overflow-wrap: anywhere; }
#gameStatus.error { color: #b51c30; }
.sudoku-layout dialog { margin: auto; width: min(560px,92vw); max-height: 85dvh; border: 1px solid #c9d4e8; border-radius: 16px; padding: 24px; color: #263650; }
.sudoku-layout dialog::backdrop { background: #162b4980; }
.hint-dialog { width: min(470px,92vw) !important; }
.note-check-dialog { width: min(390px,90vw) !important; text-align: center; }
.note-check-dialog h2 { margin-top: 0; }
.note-check-results { padding: 18px; border-radius: 12px; background: #eef4ff; font-size: 22px; font-weight: 800; }
.note-check-dialog form { text-align: center !important; }
.hint-reward { padding: 10px 12px; border-left: 4px solid #d39416; border-radius: 5px; background: #fff7dc; font-weight: 700; }
.hint-demo-note { color: #596d87; font-size: 12px; }
.hint-ad-status { min-height: 44px; padding: 11px; border-radius: 8px; background: #eaf0ff; color: #23467c; font-weight: 700; text-align: center; }
.hint-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.sudoku-layout .hint-actions form { margin: 0; }
.sudoku-layout .rules-dialog { width: min(760px,94vw); padding: 20px; overflow-x: hidden; }
.rules-heading,.rules-footer,.rules-navigation { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.rules-heading h2 { margin: 0; font-size: clamp(21px,3vw,28px); }
.rules-kicker { margin: 0 0 3px !important; color: #315b9d; font-size: 12px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.rules-step-status { flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; background: #eaf0ff; color: #23467c; font-weight: 700; }
.rules-stage { position: relative; min-height: 330px; margin: 14px 0 10px; border: 1px solid #d7deec; border-radius: 14px; overflow: hidden; background: linear-gradient(145deg,#f8fbff,#eef4ff); }
.rules-screen-map { position: absolute; inset: 18px; display: grid; grid-template: "menu board" 1fr "menu numbers" 44px "menu layers" 44px / 20% 1fr; gap: 10px; opacity: 0; pointer-events: none; }
.screen-part { display: grid; place-items: center; padding: 9px; border: 2px solid #6680aa; border-radius: 12px; background: #fff; color: #263650; font-size: 13px; font-weight: 700; text-align: center; animation: rules-float 2.8s ease-in-out infinite; }
.screen-menu { grid-area: menu; }.screen-board { grid-area: board; font-size: 18px; }.screen-layers { grid-area: layers; }.screen-numbers { grid-area: numbers; }
.screen-pause { position: absolute; top: -9px; left: 50%; z-index: 3; transform: translateX(-50%); padding: 5px 10px; border: 2px solid #b51c30; border-radius: 999px; background: #fff0f1; color: #94182a; font-size: 12px; font-weight: 900; white-space: nowrap; }
.rules-demo-board { position: absolute; inset: 42px 60px 28px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); grid-template-rows: repeat(3,minmax(0,1fr)); gap: 8px; opacity: 0; pointer-events: none; }
.rules-demo-circle { position: relative; min-width: 0; height: 100%; aspect-ratio: 1; justify-self: center; border: 2px solid #7185a4; border-radius: 50%; background: #fff; }
.rules-demo-circle .demo-cell { position: absolute; display: grid; place-items: center; width: 27%; aspect-ratio: 1; transform: translate(-50%,-50%); border: 1px solid #607593; border-radius: 50%; font-size: clamp(9px,1.6vw,14px); font-weight: 800; transition: transform .25s,filter .25s,opacity .25s,box-shadow .25s; }
.rules-demo-circle .position-S { left: 50%; top: 20%; }.rules-demo-circle .position-I { left: 50%; top: 80%; }.rules-demo-circle .position-L { left: 20%; top: 50%; }.rules-demo-circle .position-D { left: 80%; top: 50%; }.rules-demo-circle .position-C { left: 50%; top: 50%; }
.demo-sum { position: absolute; right: -3px; bottom: -4px; padding: 1px 4px; border: 1px solid #ccd6e6; border-radius: 5px; background: white; font-size: 10px; font-weight: 800; }
.demo-given { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 2px; }
.rule-callout { position: absolute; z-index: 5; display: none; padding: 4px 8px; border-radius: 7px; background: #173d77; color: white; font-size: 12px; font-weight: 700; box-shadow: 0 3px 10px #26365035; }
.callout-circle { top: -30px; left: 3%; }.callout-layer { top: -30px; left: 29%; }.callout-row { left: 23%; top: 47%; }.callout-column { left: 38%; top: -32px; }
.rules-pencil-demo { position: absolute; inset: 34px 28px 26px; display: flex; align-items: center; justify-content: center; gap: clamp(10px,2.5vw,24px); opacity: 0; }
.rules-pencil-example { display: grid; justify-items: center; align-items: center; gap: 7px; min-width: 130px; }
.rules-pencil-example small { max-width: 165px; color: #315b5d; font-size: 11px; font-weight: 800; line-height: 1.25; text-align: center; }
.rules-pencil-icon { font-size: 54px; color: #244b87; animation: pencil-write 1.8s ease-in-out infinite; }
.rules-confirm-icon { position: relative; color: #244b87; font-size: 42px; line-height: 1; }
.rules-confirm-icon b { position: absolute; right: -17px; bottom: -7px; color: #187337; font-size: 32px; }
.rules-pencil-results { display: flex; gap: 10px; }
.rules-pencil-cell { display: grid; place-items: center; width: 92px; aspect-ratio: 1; border: 4px solid #123ee8; border-radius: 50%; background: var(--color-C,#7ed49a); font-size: 23px; font-weight: 700; line-height: 1.3; text-align: center; }
.rules-pencil-cell.confirmed { width: 70px; font-size: 38px; }.rules-pencil-cell.rejected { width: 70px; border-color: #c51f37; color: #8e1024; font-size: 17px; }.rules-pencil-arrow { color: #315b9d; font-size: 34px; }
.rules-double-click { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); padding: 5px 10px; border-radius: 8px; background: #eef4ff; color: #23467c; font-size: 11px; font-weight: 800; white-space: nowrap; }
.rules-dialog[data-step="0"] .rules-screen-map,.rules-dialog[data-step="1"] .rules-demo-board,.rules-dialog[data-step="2"] .rules-demo-board,.rules-dialog[data-step="3"] .rules-demo-board,.rules-dialog[data-step="4"] .rules-demo-board,.rules-dialog[data-step="5"] .rules-pencil-demo { opacity: 1; animation: rules-arrive .35s ease-out both; }
.rules-dialog[data-step="1"] .rules-demo-circle:not(:first-of-type) { opacity: .18; }
.rules-dialog[data-step="1"] .rules-demo-circle:first-of-type { z-index: 3; box-shadow: 0 0 0 4px #123ee8,0 0 18px #123ee860; }
.rules-dialog[data-step="1"] .callout-circle,.rules-dialog[data-step="2"] .callout-layer,.rules-dialog[data-step="3"] .callout-row,.rules-dialog[data-step="4"] .callout-column { display: block; }
.rules-dialog[data-step="2"] .demo-cell:not(.position-S),.rules-dialog[data-step="3"] .demo-cell,.rules-dialog[data-step="4"] .demo-cell { opacity: .22; filter: grayscale(.7); }
.rules-dialog[data-step="2"] .demo-cell.position-S,.rules-dialog[data-step="3"] .rules-demo-circle[data-demo-row="1"] .demo-cell.position-L,.rules-dialog[data-step="3"] .rules-demo-circle[data-demo-row="1"] .demo-cell.position-C,.rules-dialog[data-step="3"] .rules-demo-circle[data-demo-row="1"] .demo-cell.position-D,.rules-dialog[data-step="4"] .rules-demo-circle[data-demo-column="1"] .demo-cell.position-S,.rules-dialog[data-step="4"] .rules-demo-circle[data-demo-column="1"] .demo-cell.position-C,.rules-dialog[data-step="4"] .rules-demo-circle[data-demo-column="1"] .demo-cell.position-I { opacity: 1; filter: none; transform: translate(-50%,-50%) scale(1.18); box-shadow: 0 0 0 3px #123ee8,0 0 14px #123ee870; animation: rules-pulse 1.5s ease-in-out infinite; }
.rules-copy { min-height: 170px; }.rule-step h3 { margin: 0 0 7px; font-size: 18px; }.rule-step p { margin: 0 !important; font-size: 14px; }.rules-help-list { display: grid; gap: 5px; padding-left: 19px; color: #263650; font-size: 13px; line-height: 1.35; }
.rules-navigation { margin-top: 12px; }.rules-navigation > button { min-width: 96px; }.rules-dots { display: flex; gap: 7px; }.rules-dots span { width: 9px; height: 9px; border-radius: 50%; background: #bdc9da; }.rules-dots span.active { background: #123ee8; transform: scale(1.25); }
.rules-footer { margin-top: 14px; padding-top: 12px; border-top: 1px solid #d7deec; }.rules-footer label { display: flex; align-items: center; gap: 7px; font-size: 14px; }.rules-footer input { width: 18px; height: 18px; accent-color: #1646b8; }.sudoku-layout .rules-footer form { margin: 0; }
@keyframes rules-arrive { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes rules-pulse { 50% { box-shadow: 0 0 0 5px #123ee8,0 0 22px #123ee895; } }
@keyframes rules-float { 50% { transform: translateY(-4px); } }
@keyframes pencil-write { 50% { transform: rotate(-10deg) translateY(5px); } }
@media(prefers-reduced-motion: reduce) { .rules-dialog * { animation: none !important; transition: none !important; } }
@media(max-width: 560px) { .rules-stage { min-height: 270px; }.rules-demo-board { inset: 44px 28px 26px; gap: 5px; }.rules-pencil-demo { inset: 26px 8px 22px; gap: 7px; }.rules-pencil-example { min-width: 92px; }.rules-pencil-cell { width: 58px; }.rules-pencil-cell.confirmed,.rules-pencil-cell.rejected { width: 52px; }.rules-pencil-arrow { font-size: 25px; }.rules-pencil-example small,.rules-double-click { font-size: 9px; }.rule-callout { font-size: 10px; }.rules-copy { min-height: 210px; }.rules-footer { align-items: flex-end; }.rules-footer label { max-width: 180px; } }
@media(max-width: 800px) {
 .sudoku-layout { grid-template-columns: minmax(0,1fr); padding: 8px; }
 .future-ad { display: none; }
 .game-frame { max-width: 780px; width: 100%; margin: auto; padding: 10px; }
 .game-heading h1 { font-size: 21px; }
}
@media(max-width: 440px) {
 .game-trackers { gap: 10px; }
 .layer-tracker { grid-template-columns: auto 64px; column-gap: 5px; }
 .layer-tracker .layer-circle { width: 64px; }
 .layer-tracker .layer-cell { font-size: 11px; }
 .layer-tracker .layer-cell.complete { font-size: 14px; }
 .line-tracker { gap: 5px; }
 .line-tracker h2 { max-width: 65px; font-size: 11px; }
 .line-grid { width: 56px; height: 56px; }
 .game-heading { grid-template-columns: auto minmax(0,1fr) auto; gap: 5px; }
 .game-heading h1 { font-size: 14px; letter-spacing: 0; }
 .game-difficulty { max-width: 78px; font-size: 10px; }
 .game-time-controls { gap: 3px; min-height: 34px; }
 .game-timer { min-width: 0; font-size: 12px; }
 .game-heading .game-pause { width: 24px; min-height: 26px; padding: 2px; }
 #gameVictory span { font-size: 16px; }
 .game-footer { gap: 8px; font-size: 11px; }
 #gameStatus { font-size: 11px; }
}
@media(max-width: 620px) and (orientation: portrait) {
 .mobile-orientation-notice { grid-column: 1 / -1; position: sticky; top: 5px; z-index: 30; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 12px; border: 1px solid #d39416; border-radius: 10px; background: #fff7dcf2; color: #6e4b08; text-align: center; box-shadow: 0 4px 14px #26365024; }
 .mobile-orientation-notice strong { font-size: 14px; }
 .mobile-orientation-notice span { font-size: 11px; }
}

/* Prepared games stay behind a veil until the player explicitly starts them. */
.game-play-area { position: relative; }
.game-start-overlay { position: absolute; inset: 0; z-index: 19; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; border: 1px solid #ccd9ed; border-radius: 14px; background: #f4f8fff2; color: #263650; text-align: center; }
.game-start-overlay[hidden] { display: none; }
.game-start-overlay strong { font-size: clamp(21px, 3vw, 32px); }
.game-start-overlay p { max-width: 310px; font-size: 15px; line-height: 1.6; }
.learning-link:disabled { cursor: wait; opacity: .6; }
.game-start-overlay .learning-link { min-width: 120px; font-size: 17px; }

/* Keep tutorial headings and navigation visible while longer help scrolls. */
.sudoku-layout .rules-dialog[open] { display: flex; flex-direction: column; height: min(800px,92dvh); max-height: 92dvh; overflow: hidden; }
.rules-dialog .rules-heading, .rules-dialog .rules-navigation, .rules-dialog .rules-footer { flex: 0 0 auto; }
.rules-dialog .rules-stage { flex: 0 0 clamp(130px,26dvh,270px); min-height: 0; }
.rules-dialog .rules-copy { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; }
.rules-copy:focus-visible { outline: 2px solid #123ee8; outline-offset: 2px; }
@media(max-width: 560px) {
    .rules-dialog .rules-navigation > button { min-width: 0; padding: 7px 9px; }
    .rules-dialog .rules-dots { gap: 5px; }
    .rules-dialog .rules-dots span { width: 7px; height: 7px; }
}

.rules-dialog .rules-screen-map { inset: 12px; grid-template: "menu board" minmax(0,1fr) "menu numbers" minmax(0,.65fr) "menu layers" minmax(0,.65fr) / 24% minmax(0,1fr); gap: 6px; }
.rules-dialog .screen-part { min-width: 0; min-height: 0; padding: 4px; font-size: clamp(9px,1.4vw,13px); }
@media(max-height: 500px) { .rules-dialog .rules-stage { flex-basis: 90px; } }
