/* ==========================================================================
   Noos Sudoku - one stylesheet for the lobby, the variant pages and the board.
   Board sizing is driven by a size-N class on <body> (size-6/9/12/16/21) and a
   type-<slug> class, so no PHP lives in here.
   ========================================================================== */
:root { --bg: #f8fafc; --accent: #88b04b; --dark: #1e293b; --user-text: #6366f1; --clash: #fee2e2; --grid-line: #cbd5e1; --note-color: #475569; --diagonal: #e2e8f0;
        --muted: #64748b; --card: #ffffff; --edge: #e2e8f0; --easy: #88b04b; --medium: #f59e0b; --hard: #ef4444; --extreme: #7c3aed; }
body.sudoku-page { margin: 0; font-family: 'Quicksand', sans-serif; background: var(--bg); color: var(--dark); animation: pageFade 0.4s ease-out; }
@keyframes pageFade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* ---------------------------------------------------------------- LOBBY */
.sdk-wrap { max-width: 960px; margin: 28px auto 60px; padding: 0 18px; }
.sdk-hero { text-align: center; margin-bottom: 26px; }
.sdk-hero h1 { margin: 0 0 6px; font-size: clamp(26px, 5vw, 36px); font-weight: 700; letter-spacing: -0.5px; }
.sdk-hero p { margin: 0 auto; color: var(--muted); max-width: 520px; font-weight: 500; line-height: 1.5; }
.sdk-hero-actions { margin-top: 18px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.sdk-btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 14px; border: 2px solid var(--edge); background: var(--card); color: var(--dark);
           font: 700 14px 'Quicksand', sans-serif; text-decoration: none; cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .15s; }
.sdk-btn:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.05); }
.sdk-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.sdk-btn.primary:hover { box-shadow: 0 8px 20px rgba(136,176,75,.35); }
.sdk-btn.small { padding: 8px 14px; font-size: 13px; border-radius: 11px; }

.sdk-resume { background: linear-gradient(135deg, #fffbeb, #fff7ed); border: 2px solid #fde68a; border-radius: 20px; padding: 16px 18px; margin-bottom: 26px; }
.sdk-resume h2 { margin: 0 0 10px; font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: #b45309; }
.sdk-resume-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 2px; }
.sdk-resume-card { flex: 0 0 auto; background: #fff; border: 2px solid #fde68a; border-radius: 14px; padding: 10px 14px; text-decoration: none; color: var(--dark); min-width: 128px; }
.sdk-resume-card:hover { border-color: var(--medium); }
.sdk-resume-card b { display: block; font-size: 14px; }
.sdk-resume-card span { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; }

.sdk-section { margin-bottom: 30px; }
.sdk-section-head { display: flex; align-items: baseline; gap: 10px; margin: 0 4px 12px; }
.sdk-section-head h2 { margin: 0; font-size: 19px; font-weight: 700; }
.sdk-section-head span { color: var(--muted); font-size: 13px; font-weight: 500; }
.sdk-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.sdk-tile { position: relative; display: flex; flex-direction: column; background: var(--card); border: 2px solid transparent; border-radius: 22px; padding: 16px 16px 14px; text-decoration: none; color: inherit;
            box-shadow: 0 4px 14px rgba(15,23,42,.04); transition: transform .18s, border-color .18s, box-shadow .18s; }
.sdk-tile:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 12px 26px rgba(15,23,42,.08); }
.sdk-tile-art { background: #f1f5f9; border-radius: 16px; padding: 8px; margin-bottom: 12px; }
.sdk-tile-art svg { display: block; width: 100%; height: auto; max-height: 118px; }
.sdk-tile-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sdk-tile h3 { margin: 0; font-size: 18px; font-weight: 700; }
.sdk-tag { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); background: #f1f5f9; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.sdk-tile p { margin: 6px 0 12px; font-size: 13px; line-height: 1.45; color: var(--muted); font-weight: 500; flex: 1; }
.sdk-progress { height: 7px; background: #eef2f7; border-radius: 99px; overflow: hidden; }
.sdk-progress i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .6s ease; }
.sdk-count { margin-top: 7px; display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--muted); }

/* ------------------------------------------------------- VARIANT PAGE */
.sdk-crumb { display: inline-block; margin: 0 0 14px 2px; color: #94a3b8; font-size: 13px; font-weight: 600; text-decoration: none; }
.sdk-crumb:hover { color: var(--accent); }
.sdk-variant { display: grid; grid-template-columns: 150px 1fr; gap: 22px; align-items: center; background: var(--card); border-radius: 24px; padding: 20px; box-shadow: 0 4px 14px rgba(15,23,42,.04); margin-bottom: 18px; }
.sdk-variant .sdk-tile-art { margin: 0; }
.sdk-variant h1 { margin: 0 0 4px; font-size: 28px; font-weight: 700; }
.sdk-variant .sdk-rule { margin: 0 0 12px; color: var(--muted); font-weight: 500; line-height: 1.5; font-size: 14px; }
.sdk-variant-stats { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
@media (max-width: 560px) { .sdk-variant { grid-template-columns: 1fr; } .sdk-variant .sdk-tile-art { max-width: 150px; } }

.sdk-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.sdk-tab { flex: 1 1 110px; text-decoration: none; color: inherit; background: var(--card); border: 2px solid var(--edge); border-radius: 16px; padding: 10px 12px 9px; text-align: center; transition: border-color .15s, transform .15s; }
.sdk-tab:hover { transform: translateY(-2px); }
.sdk-tab b { display: block; font-size: 13px; text-transform: capitalize; }
.sdk-tab small { display: block; font-size: 11px; font-weight: 700; color: var(--muted); margin-top: 2px; }
.sdk-tab .sdk-progress { margin-top: 7px; height: 5px; }
.sdk-tab.active { border-color: var(--dark); background: #fff; box-shadow: 0 6px 16px rgba(15,23,42,.07); }
.sdk-tab[data-d="easy"] .sdk-progress i { background: var(--easy); } .sdk-tab[data-d="medium"] .sdk-progress i { background: var(--medium); }
.sdk-tab[data-d="hard"] .sdk-progress i { background: var(--hard); } .sdk-tab[data-d="extreme"] .sdk-progress i { background: var(--extreme); }

.sdk-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.sdk-toolbar .spacer { flex: 1; }
.sdk-select { padding: 9px 12px; border-radius: 11px; border: 2px solid var(--edge); background: var(--card); font: 600 13px 'Quicksand', sans-serif; color: var(--dark); }

.sdk-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 9px; }
.sdk-chip { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 11px 4px 9px; background: var(--card); border: 2px solid var(--edge); border-radius: 14px;
            text-decoration: none; color: var(--dark); font-weight: 700; font-size: 15px; transition: transform .12s, border-color .12s; }
.sdk-chip:hover { transform: translateY(-2px); border-color: var(--accent); }
.sdk-chip em { font-style: normal; width: 22px; height: 4px; border-radius: 3px; background: var(--dc, #94a3b8); }
.sdk-chip.is-completed { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.sdk-chip.is-completed::after { content: '✓'; position: absolute; top: 3px; right: 6px; font-size: 11px; color: #16a34a; }
.sdk-chip.is-progressing { background: #fffbeb; border-color: #fcd34d; }
.sdk-chip.is-progressing::after { content: '…'; position: absolute; top: -2px; right: 7px; font-size: 16px; color: #d97706; font-weight: 800; }
.sdk-empty { text-align: center; color: var(--muted); padding: 40px 10px; font-weight: 600; }

.sdk-pager { display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 26px; }
.sdk-pager a, .sdk-pager span { min-width: 38px; padding: 9px 12px; text-align: center; border-radius: 11px; border: 2px solid var(--edge); background: var(--card); font-weight: 700; font-size: 13px; color: var(--dark); text-decoration: none; }
.sdk-pager a:hover { border-color: var(--accent); }
.sdk-pager .cur { background: var(--dark); border-color: var(--dark); color: #fff; }
.sdk-pager .gap { border: none; background: none; min-width: 0; padding: 9px 2px; color: #94a3b8; }

/* ------------------------------------------------------------ THE BOARD */
.game-nav { background: white; padding: 12px 25px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 10px rgba(0,0,0,0.03); position: sticky; top: 0; z-index: 100; }
.logo { text-decoration: none; color: var(--accent); font-weight: 700; font-size: 18px; display: flex; align-items: center; padding: 10px; }
.header-info { text-align: right; color: #64748b; font-size: 12px; font-weight: 700; }
.back-link { text-decoration: none; color: #94a3b8; font-size: 13px; font-weight: 500; }

body.sudoku-page { --board-cap: min(92vw, 460px, 70vh); --cell-font: clamp(16px, 4.5vw, 22px); --notes-cols: 3; --note-font: clamp(7.5px, 2.2vw, 11px);
    --num-pad: 14px 0; --num-font: 16px; --num-min: 0px;
    --tp-cap: min(90vw, 550px, 72vh); --tp-font: 26px; --tl-cap: min(90vw, 380px, 66vh); --tl-font: 16px; }
body.size-12 { --notes-cols: 4; --note-font: clamp(7px, 2vw, 10px); --num-pad: 10px 0; --num-min: 34px; }
body.size-16 { --board-cap: min(94vw, 560px, 76vh); --cell-font: clamp(11px, 3vw, 16px); --notes-cols: 4; --note-font: clamp(6.5px, 1.6vw, 9px); --num-pad: 10px 0; --num-font: 13px; --num-min: 34px;
    --tp-cap: min(90vw, 620px, 70vh); --tp-font: 20px; --tl-cap: min(90vw, 400px, 64vh); --tl-font: 12px; }
body.size-21 { --board-cap: min(96vw, 680px, 82vh); --cell-font: clamp(9px, 2.2vw, 13px); --notes-cols: 4; --note-font: clamp(6px, 1.3vw, 8px); --num-pad: 10px 0; --num-font: 13px; --num-min: 30px;
    --tp-cap: min(90vw, 620px, 70vh); --tp-font: 16px; --tl-cap: min(90vw, 420px, 62vh); --tl-font: 10px; }

.game-wrapper { max-width: var(--board-cap); margin: 10px auto; padding: 0 10px; box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; }
.sudoku-container { position: relative; display: grid; grid-template-columns: repeat(var(--n), 1fr); width: 100%; aspect-ratio: 1/1; border: 3px solid var(--dark); border-radius: 8px; background: var(--dark); gap: 0;
    max-height: var(--board-cap); box-sizing: border-box; overflow: hidden; }
.cell { overflow: hidden; white-space: nowrap; display: flex; align-items: center; justify-content: center; font-weight: 700; cursor: pointer; position: relative; background: white;
    font-size: var(--cell-font); aspect-ratio: 1 / 1; border-right: 1px solid var(--grid-line); border-bottom: 1px solid var(--grid-line); box-sizing: border-box; z-index: 1; }
.cell[data-r="0"] { border-top: 1px solid var(--grid-line); }
.cell[data-c="0"] { border-left: 1px solid var(--grid-line); }
.cell.corner-tl { border-top-left-radius: 5px; } .cell.corner-tr { border-top-right-radius: 5px; }
.cell.corner-bl { border-bottom-left-radius: 5px; } .cell.corner-br { border-bottom-right-radius: 5px; }
.cell.edge-r { border-right: none !important; }
.cell.void-space { background: transparent !important; border: none !important; pointer-events: none !important; }
.cell.hint-revealed { background-color: #f0fdf4; transition: background-color 0.5s ease; }
.thick-r { border-right: 3px solid var(--dark) !important; z-index: 2; }
.thick-b { border-bottom: 3px solid var(--dark) !important; z-index: 2; }
.cell.hyper-shaded { background-color: #e0f2fe !important; }
.cell.fixed.hyper-shaded { background-color: #bae6fd !important; }
.diag { background-color: var(--diagonal) !important; }
.cell.fixed { background-color: #f8fafc; color: var(--dark); }
.cell.fixed.diag { background-color: var(--diagonal) !important; }
.cell.selected { box-shadow: inset 0 0 0 3px #166534 !important; z-index: 10 !important; transition: all 0.1s ease; }
.cell.clash { background-color: var(--clash) !important; color: #ef4444 !important; }
.cell.user-val { color: var(--user-text); }
.notes-grid span.note-clash { color: #ef4444; font-weight: 800; }
.notes-grid { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: grid; grid-template-columns: repeat(var(--notes-cols), 1fr); padding: 1px; pointer-events: none;
    font-size: var(--note-font); font-weight: 700; color: var(--note-color); text-align: center; }

/* Jigsaw: soft region tints so the odd shapes read at a glance (borders carry the rule, tint is a bonus) */
.cell[data-reg="0"] { --tint: #fef3c7; } .cell[data-reg="1"] { --tint: #dbeafe; } .cell[data-reg="2"] { --tint: #dcfce7; } .cell[data-reg="3"] { --tint: #fee2e2; }
.cell[data-reg="4"] { --tint: #ede9fe; } .cell[data-reg="5"] { --tint: #ffedd5; } .cell[data-reg="6"] { --tint: #ccfbf1; } .cell[data-reg="7"] { --tint: #fce7f3; } .cell[data-reg="8"] { --tint: #ecfccb; }
body.type-sudoku_jigsaw .cell:not(.clash):not(.hint-revealed) { background-color: var(--tint, #fff); }
body.type-sudoku_jigsaw .cell.fixed:not(.clash) { background-color: color-mix(in srgb, var(--tint, #fff) 70%, #cbd5e1); }

/* Killer: dotted cage outline drawn inside each cell edge, total in the cage's first cell */
.board-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }
.board-overlay path { vector-effect: non-scaling-stroke; }
.board-overlay path.ov-box { stroke: var(--dark); stroke-width: 3px; stroke-dasharray: none; }
.ov-jigsaw path { stroke: var(--dark); stroke-width: 3px; stroke-linecap: square; }
.ov-killer path { stroke: #64748b; stroke-width: 1.5px; stroke-dasharray: 4 3; }
.board-overlay path.ov-box { stroke: var(--dark); stroke-width: 3px; stroke-dasharray: none; }
.cell[data-sum]::before { content: attr(data-sum); position: absolute; top: 4px; left: 6px; z-index: 4; font-size: calc(var(--cell-font) * .42); line-height: 1; font-weight: 700; color: #475569; pointer-events: none; }
body.type-sudoku_killer .notes-grid { padding-top: calc(var(--cell-font) * .45); }
.cell.sum-off { box-shadow: inset 0 -3px 0 #f59e0b; }

.completion-seal { position: absolute; top: -10px; right: -10px; width: 35px; height: 35px; background: #88b04b; color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: bold; box-shadow: 0 4px 10px rgba(136,176,75,.4); border: 3px solid #fff; z-index: 30; animation: sealPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes sealPop { 0% { transform: scale(0) rotate(-45deg); opacity: 0; } 100% { transform: scale(1) rotate(0deg); opacity: 1; } }

.controls-panel { margin-top: 12px; display: flex; flex-wrap: nowrap; justify-content: center; align-items: center; gap: 6px; width: 100%; }
body.size-12 .controls-panel { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
body.size-16 .controls-panel { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.num-btn { background: white; border: 1px solid #e2e8f0; padding: var(--num-pad); border-radius: 12px; font-weight: 700; cursor: pointer; font-family: 'Quicksand'; transition: 0.2s;
    font-size: var(--num-font); text-align: center; width: 100%; box-sizing: border-box; min-width: var(--num-min); }
.num-btn.completed { opacity: 0.3; pointer-events: none; background: #f1f5f9; }
.action-bar { display: flex; justify-content: space-around; margin-top: 12px; background: white; padding: 10px; border-radius: 20px; box-shadow: 0 4px 10px rgba(0,0,0,0.02); }
.action-btn { background: none; border: none; cursor: pointer; color: #64748b; font-size: 11px; font-weight: 700; display: flex; flex-direction: column; align-items: center; gap: 5px; font-family: 'Quicksand'; }
.action-btn svg { width: 20px; height: 20px; stroke-width: 2.5; }
.action-btn.active { color: var(--accent); }
.hint-highlight { animation: hintFlash 3s forwards ease-out; }
@keyframes hintFlash { 0% { background-color: rgba(187, 247, 208, 0.7); } 100% { background-color: rgba(187, 247, 208, 0); } }

/* iPad / tablet */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .game-wrapper { max-width: var(--tp-cap); margin: 20px auto; gap: 15px; }
    .sudoku-container { max-height: var(--tp-cap); }
    .cell { font-size: var(--tp-font); }
    .num-btn { padding: 16px 0; font-size: 18px; }
    .action-bar { padding: 15px; }
    .action-btn svg { width: 22px; height: 22px; }
}
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .game-wrapper { max-width: var(--tl-cap); margin: 2px auto; padding: 0 10px; }
    .sudoku-container { max-height: var(--tl-cap); }
    .cell { font-size: var(--tl-font); }
    .controls-panel { margin-top: 4px; gap: 4px; }
    .num-btn { padding: 6px 0; font-size: 13px; border-radius: 8px; }
    .action-bar { margin-top: 4px; padding: 4px 10px; border-radius: 14px; }
    .action-btn { gap: 0; font-size: 9px; line-height: 1; }
    .action-btn svg { width: 14px; height: 14px; }
}

/* Desktop: use the room. Board grows with the window height (header + controls ≈ 290px). */
@media (min-width: 1025px) {
    body.size-9 { --board-cap: clamp(460px, calc(100vh - 290px), 720px); --cell-font: clamp(22px, calc((100vh - 290px) / 17), 40px); --note-font: clamp(10px, calc((100vh - 290px) / 50), 15px); --num-pad: 16px 0; --num-font: 20px; }
    body.size-9 .game-wrapper { margin-top: 18px; }
    body.size-9 .action-bar { padding: 14px 18px; }
    body.size-9 .action-btn svg { width: 24px; height: 24px; }
    body.size-9 .action-btn { font-size: 13px; }
    body.type-sudoku_killer .cell[data-sum]::before, body[class*="type-calcudoku"] .cell[data-sum]::before { top: 4px; left: 6px; font-size: clamp(11px, calc(var(--cell-font) * .4), 15px); }
    body.type-sudoku_killer .notes-grid { padding-top: calc(var(--cell-font) * .5); }
}

@media (min-width: 1025px) {
    body.size-12 { --board-cap: clamp(480px, calc(100vh - 340px), 700px); --cell-font: clamp(20px, calc((100vh - 340px) / 21), 34px); --note-font: clamp(9px, calc((100vh - 340px) / 60), 13px); --num-pad: 14px 0; --num-font: 18px; }
    body.size-16 { --board-cap: clamp(520px, calc(100vh - 340px), 740px); --cell-font: clamp(16px, calc((100vh - 340px) / 29), 26px); --note-font: clamp(8px, calc((100vh - 340px) / 75), 11px); --num-pad: 12px 0; --num-font: 16px; }
    body.size-12 .game-wrapper, body.size-16 .game-wrapper { margin-top: 18px; }
}

@media (min-width: 1025px) {
    body.size-21 { --board-cap: clamp(600px, calc(100vh - 250px), 820px); --cell-font: clamp(14px, calc((100vh - 250px) / 33), 22px); --note-font: clamp(7px, calc((100vh - 250px) / 90), 10px); --num-pad: 12px 0; --num-font: 16px; }
    body.size-21 .game-wrapper { margin-top: 14px; }
}

/* Thermo thermometers and Kropki dots (drawn in the shared board overlay) */
.ov-thermo polyline { stroke: rgba(100, 116, 139, .36); }
.ov-thermo circle { fill: rgba(100, 116, 139, .36); }
.ov-kropki circle { stroke: var(--dark); stroke-width: 1.6px; vector-effect: non-scaling-stroke; }
.ov-kropki .kd-w { fill: #fff; }
.ov-kropki .kd-b { fill: var(--dark); }

/* Even/Odd marks, Arrow overlay, Sandwich clue strips */
.cell[data-par="e"]::after, .cell[data-par="o"]::after { content: ''; position: absolute; inset: 13%; background: #dbe3ee; z-index: -1; pointer-events: none; }
.cell[data-par="e"]::after { border-radius: 50%; }
.cell[data-par="o"]::after { border-radius: 4px; inset: 16%; }
.ov-arrow circle, .ov-arrow polyline { fill: none; stroke: #94a3b8; stroke-width: 2.6px; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.sdw-frame { --sw: clamp(20px, 5vw, 30px); position: relative; padding: var(--sw) var(--sw) 0 0; box-sizing: border-box; width: 100%; }
.sdw-top, .sdw-side { position: absolute; display: grid; font-weight: 800; color: var(--accent, #88b04b); font-size: clamp(11px, 2.6vw, 16px); pointer-events: none; }
.sdw-top { left: 0; right: var(--sw); top: 0; height: var(--sw); grid-template-columns: repeat(9, 1fr); }
.sdw-side { right: 0; top: var(--sw); bottom: 0; width: var(--sw); grid-template-rows: repeat(9, 1fr); }
.sdw-top span, .sdw-side span { display: flex; align-items: center; justify-content: center; transition: color .15s; }
.sdw-top span.off, .sdw-side span.off { color: #dc2626; }
@media (min-width: 900px) { .sdw-frame { --sw: 32px; } .sdw-top, .sdw-side { font-size: 18px; } }

/* Batch 3 */
.ov-gt polyline { fill: none; stroke: var(--dark); stroke-width: 2px; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ov-consec rect { fill: var(--dark); }
.cell.extra-unit { background-color: #e0f2fe !important; }
.cell.fixed.extra-unit { background-color: #bae6fd !important; }
.cell:where([data-dj="0"]) { background-color: #fee2e2; } .cell:where([data-dj="1"]) { background-color: #ffedd5; } .cell:where([data-dj="2"]) { background-color: #fef9c3; }
.cell:where([data-dj="3"]) { background-color: #dcfce7; } .cell:where([data-dj="4"]) { background-color: #ccfbf1; } .cell:where([data-dj="5"]) { background-color: #e0f2fe; }
.cell:where([data-dj="6"]) { background-color: #e0e7ff; } .cell:where([data-dj="7"]) { background-color: #f3e8ff; } .cell:where([data-dj="8"]) { background-color: #fce7f3; }
.cell.fixed[data-dj="0"] { background-color: #fecaca; }
.cell.fixed[data-dj="1"] { background-color: #fed7aa; }
.cell.fixed[data-dj="2"] { background-color: #fde68a; }
.cell.fixed[data-dj="3"] { background-color: #bbf7d0; }
.cell.fixed[data-dj="4"] { background-color: #99f6e4; }
.cell.fixed[data-dj="5"] { background-color: #bae6fd; }
.cell.fixed[data-dj="6"] { background-color: #c7d2fe; }
.cell.fixed[data-dj="7"] { background-color: #e9d5ff; }
.cell.fixed[data-dj="8"] { background-color: #fbcfe8; }

/* ---- Skyscraper / Little Killer: clues in a ring around the board ---- */
.otr-frame { --ow: clamp(22px, 5.4vw, 32px); position: relative; padding: var(--ow); box-sizing: border-box; width: 100%; }
.otr-clue { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; justify-content: center; gap: 1px; font-weight: 800; line-height: 1; color: var(--accent, #88b04b); font-size: clamp(11px, 2.6vw, 16px); pointer-events: none; transition: color .15s; white-space: nowrap; }
.otr-clue.off { color: #dc2626; }
.otr-lk { font-size: clamp(9px, 2.2vw, 13px); flex-direction: row; }
.otr-lk i { font-style: normal; font-size: 1.15em; }
@media (min-width: 900px) { .otr-frame { --ow: 34px; } .otr-clue { font-size: 18px; } .otr-lk { font-size: 14px; } }

/* ---- XV marks ---- */
.ov-xv rect { fill: #fff; stroke: var(--accent, #88b04b); stroke-width: 1.4px; vector-effect: non-scaling-stroke; }
.ov-xv text { fill: var(--dark); font-size: 0.34px; font-weight: 800; text-anchor: middle; font-family: inherit; }

/* ---- Line puzzles ---- */
.ov-lines polyline { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 0.3; }
.ov-whisper polyline { stroke: rgba(22, 163, 74, .45); }
.ov-renban polyline { stroke: rgba(147, 51, 234, .38); }
.ov-palin polyline { stroke: rgba(100, 116, 139, .42); }
.ov-between polyline { stroke: rgba(217, 119, 6, .42); stroke-width: 0.14; }
.ov-between circle { fill: rgba(217, 119, 6, .08); stroke: rgba(217, 119, 6, .75); stroke-width: 0.06; }

/* Calcudoku boards (4-9) borrow the 9x9 sizing so the cage numbers stay readable */
body[class*="type-calcudoku"] .notes-grid { padding-top: calc(var(--cell-font) * .5); }
@media (min-width: 1025px) {
    body[class*="type-calcudoku"] { --board-cap: clamp(460px, calc(100vh - 290px), 720px); --cell-font: clamp(22px, calc((100vh - 290px) / 17), 40px); --note-font: clamp(10px, calc((100vh - 290px) / 50), 15px); --num-pad: 16px 0; --num-font: 20px; }
    body[class*="type-calcudoku"] .game-wrapper { margin-top: 18px; }
}
body[class*="type-calcudoku"] .cell[data-sum]::before { top: 2px; left: 3px; font-size: clamp(9px, calc(var(--cell-font) * .52), 15px); letter-spacing: -.2px; }

/* Picture Sudoku: digits 1-6 drawn as shapes by a tiny custom font; game logic still sees digits */
@font-face { font-family: 'NoosPics'; src: url('../fonts/noos-pics.woff') format('woff'); unicode-range: U+0031-0036; font-display: block; }
body.pics .cell, body.pics .num-btn, body.pics .notes-grid span { font-family: 'NoosPics', 'Quicksand', sans-serif; }
body.pics .cell { font-size: 1.55em; }
body.pics .notes-grid span { font-size: 1.2em; }

/* ---- Voyage: Lighthouse and Compass ---- */
.cell.lh { background-image: radial-gradient(circle at 50% 50%, #aab3c2 0 47%, transparent 48%); }
.cell.lh.fixed { background-image: radial-gradient(circle at 50% 50%, #9aa4b5 0 47%, transparent 48%); }
.cell.lh::before { content: attr(data-lh); position: absolute; top: 2px; right: 2px; z-index: 4; min-width: 1.5em; padding: 1px 3px; border-radius: 4px; background: #1e293b; color: #fbbf24; font-size: calc(var(--cell-font) * .38); line-height: 1.15; font-weight: 800; text-align: center; pointer-events: none; }
.cell.lh.lh-off::before { background: #b91c1c; color: #fff; }
.cell.lit:not(.clash) { background-color: #e9ecf2; }
.cell.fixed.lit:not(.clash) { background-color: #dfe3ec; }
.ov-lh polygon { fill: #fbbf24; opacity: .26; }
.ov-lh polygon.on { opacity: .55; }
.cell.cp { background-image: radial-gradient(circle at 50% 50%, #dfe5ef 0 49%, transparent 50%); }
.cell.cp.fixed { background-image: radial-gradient(circle at 50% 50%, #d3dae7 0 49%, transparent 50%); }
/* Compass: a big, faint arrow fills the whole cell behind the digit (readable on phones and tablets) */
.cell.cp { isolation: isolate; }
.cell.cp::after { content: ""; position: absolute; inset: 7%; z-index: -1; pointer-events: none; opacity: .45;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 4 L90 48 H66 V96 H34 V48 H10 Z' fill='%23334155'/%3E%3C/svg%3E") center / contain no-repeat; }
.cell.cp[data-cpa="45"]::after  { transform: rotate(45deg) scale(.74); }
.cell.cp[data-cpa="90"]::after  { transform: rotate(90deg); }
.cell.cp[data-cpa="135"]::after { transform: rotate(135deg) scale(.74); }
.cell.cp[data-cpa="180"]::after { transform: rotate(180deg); }
.cell.cp[data-cpa="225"]::after { transform: rotate(225deg) scale(.74); }
.cell.cp[data-cpa="270"]::after { transform: rotate(270deg); }
.cell.cp[data-cpa="315"]::after { transform: rotate(315deg) scale(.74); }
.cell.cp.fixed::after { opacity: .46; }
/* a soft white halo keeps the digit crisp where it crosses the arrow */
.cell.cp { text-shadow: 0 0 1px #fff, 0 0 2px #fff, 0 0 3px rgba(255,255,255,.95); font-weight: 800; }
.cell.cp.clash { text-shadow: 0 0 2px #fff, 0 0 5px #fff; }
.cell.cp-target:not(.clash) { background-color: #fbcfe8 !important; }
