/* sudokukostenlos.de – Seitenrahmen. Das Spiel bringt zusätzlich game.css mit (gleiche Farbwerte). */
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/figtree-400.woff2') format('woff2'); }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 600; font-display: swap; src: url('/assets/fonts/figtree-600.woff2') format('woff2'); }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 700; font-display: swap; src: url('/assets/fonts/figtree-700.woff2') format('woff2'); }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 800; font-display: swap; src: url('/assets/fonts/figtree-800.woff2') format('woff2'); }
@font-face { font-family: 'DM Serif Display'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/dm-serif-display-400.woff2') format('woff2'); }

:root {
  --bg: #f6f4ef; --surface: #fffefa; --ink: #17202e; --muted: #585d68; --line: #cfcabd; --line-soft: #e2ded2;
  --brand: #172a46; --brand-2: #22406a; --on-brand: #f6f4ef; --on-brand-muted: #c3cee0;
  --accent: #f0b429; --on-accent: #172a46; --link: #22406a; --peer: #e8edf4; --key-border: #d8d3c6;
  --font-display: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Figtree', 'Segoe UI', system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1625; --surface: #16223a; --ink: #e8ecf3; --muted: #a3adbd; --line: #2e3c58; --line-soft: #26344f;
    --brand: #0a1220; --brand-2: #1d2b47; --on-brand: #e8ecf3; --on-brand-muted: #a3adbd;
    --link: #8fc4ff; --peer: #1d2b47; --key-border: #2e3c58; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1625; --surface: #16223a; --ink: #e8ecf3; --muted: #a3adbd; --line: #2e3c58; --line-soft: #26344f;
  --brand: #0a1220; --brand-2: #1d2b47; --on-brand: #e8ecf3; --on-brand-muted: #a3adbd;
  --link: #8fc4ff; --peer: #1d2b47; --key-border: #2e3c58; color-scheme: dark;
}


:root { --z: 1; }
:root[data-size="gross"] { --z: 1.2; }
:root[data-size="sehr-gross"] { --z: 1.4; }
@media (prefers-color-scheme: light) { :root[data-contrast="hoch"]:not([data-theme="dark"]) {
  --ink: #000; --muted: #2b2f36; --line: #5d594e; --line-soft: #8a8473; --link: #0b3d91; --peer: #dbe3ef; --key-border: #5d594e; } }
:root[data-contrast="hoch"][data-theme="light"] {
  --ink: #000; --muted: #2b2f36; --line: #5d594e; --line-soft: #8a8473; --link: #0b3d91; --peer: #dbe3ef; --key-border: #5d594e; }
@media (prefers-color-scheme: dark) { :root[data-contrast="hoch"]:not([data-theme="light"]) {
  --bg: #000; --surface: #0b1220; --ink: #fff; --muted: #e2e8f0; --line: #8da2c6; --line-soft: #6f81a6; --link: #b9dcff; --peer: #1f2f50; --key-border: #8da2c6; } }
:root[data-contrast="hoch"][data-theme="dark"] {
  --bg: #000; --surface: #0b1220; --ink: #fff; --muted: #e2e8f0; --line: #8da2c6; --line-soft: #6f81a6; --link: #b9dcff; --peer: #1f2f50; --key-border: #8da2c6; }
:root[data-contrast="hoch"] a { text-decoration-thickness: 2px; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: calc(16px * var(--z))/1.5 var(--font-body); }
a { color: var(--link); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
img { max-width: 100%; }
.wrap { max-width: calc(1040px * var(--z)); margin: 0 auto; padding-inline: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--on-accent); padding: 8px 12px; border-radius: 8px; z-index: 20; }
.skip:focus { left: 8px; }

/* Kopf */
.site-head { background: var(--brand); color: var(--on-brand); }
.head-row { display: flex; align-items: center; gap: 12px 20px; min-height: calc(64px * var(--z)); flex-wrap: wrap; padding-block: 8px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--on-brand); text-decoration: none; font-family: var(--font-display); font-size: calc(22px * var(--z)); }
.logo b { font-weight: 400; color: var(--accent); }
.main-nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.main-nav a { color: var(--on-brand); text-decoration: none; padding: 10px 12px; border-radius: 8px; font-weight: 600; font-size: calc(15px * var(--z)); }
.main-nav a:hover, .main-nav a[aria-current="page"] { background: var(--brand-2); }
.head-tools { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.head-btn { display: inline-flex; align-items: center; gap: 8px; min-height: calc(40px * var(--z)); padding: 0 14px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--on-brand) 30%, transparent); background: transparent; color: var(--on-brand); font: 700 calc(14px * var(--z)) var(--font-body); cursor: pointer; }
@media (max-width: 620px) {
  .head-row { gap: calc(4px * var(--z)) calc(8px * var(--z)); }
  .logo { flex: 1; font-size: calc(20px * var(--z)); }
  .main-nav { order: 3; flex: 1 1 100%; flex-wrap: wrap; margin-inline: -8px; row-gap: 2px; }
  .main-nav a { white-space: nowrap; padding: 8px 10px; font-size: calc(14px * var(--z)); }
  .head-btn span { display: none; }
  .head-btn { padding: 0 10px; min-height: calc(44px * var(--z)); min-width: calc(44px * var(--z)); justify-content: center; }
}

/* Inhalt */
.site-main { padding-bottom: 40px; }
.crumbs { display: flex; gap: 8px; flex-wrap: wrap; font-size: calc(14px * var(--z)); color: var(--muted); padding-top: 14px; }
.page-intro { padding-top: 14px; }
.page-intro h1 { margin: 0; font: 400 clamp(calc(28px * var(--z)), calc(6vw * var(--z)), calc(38px * var(--z)))/1.15 var(--font-display); text-wrap: balance; }
.page-intro .lead { margin: 6px 0 0; color: var(--muted); max-width: 68ch; }
/* Spielseiten: Kopf immer gleich hoch, damit das Spielfeld beim Stufenwechsel nicht springt.
   Titel und Zeile dürfen umbrechen; reserviert wird der Platz für zwei Zeilen Titel und zwei Zeilen Text. */
.game-head h1 { min-height: calc(2 * 1.15em); display: flex; align-items: flex-end; }
.game-head .lead { min-height: 1.5em; }
:root[data-size] .game-head .lead { min-height: calc(2 * 1.5em); }
@media (min-width: 861px) { .game-head h1 { min-height: 0; } .game-head .lead { min-height: 1.5em; white-space: nowrap; } }
.badge { display: inline-block; vertical-align: middle; font: 800 calc(11px * var(--z))/1 var(--font-body); letter-spacing: .4px; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; background: var(--brand); color: var(--on-brand); }
.block { margin-top: 36px; }
.block h2, .prose h2, .faq h2 { font: 400 calc(26px * var(--z))/1.2 var(--font-display); margin: 0 0 14px; text-wrap: balance; }
.note { font-size: calc(14px * var(--z)); color: var(--muted); }

.game-host .game-wrap { padding-top: 12px; padding-bottom: 8px; }

.level-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.level-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-soft); color: var(--ink); text-decoration: none; min-width: 0; }
.level-card:hover { border-color: var(--link); }
.level-card.is-current { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.level-card b { font: 400 calc(24px * var(--z))/1.1 var(--font-display); }
.level-card span:last-child { font-size: calc(14px * var(--z)); color: var(--muted); }
.pips { display: flex; gap: 4px; }
.pips i { width: 20px; height: 7px; border-radius: 4px; background: var(--line-soft); }
.pips i.on { background: var(--accent); }

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-soft); color: var(--ink); text-decoration: none; min-width: 0; }
.tile:hover { border-color: var(--link); }
.tile b { font-size: calc(17px * var(--z)); }
.tile span { font-size: calc(14px * var(--z)); color: var(--muted); }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px; margin-top: 44px; align-items: start; }
.prose { max-width: 68ch; }
.prose h2 { margin-top: 28px; }
.prose h2:first-child { margin-top: 0; }
.prose p { margin: 0 0 12px; line-height: 1.7; }
.faq details { border-top: 1px solid var(--line-soft); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details p { margin: 8px 0 0; line-height: 1.6; }
.legal { margin-top: 12px; }
.legal h2 { font-family: var(--font-body); font-weight: 700; font-size: calc(18px * var(--z)); }

@media (max-width: 860px) {
  .level-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles, .content-grid { grid-template-columns: minmax(0, 1fr); }
  .content-grid { gap: 28px; }
}

/* Werbung: feste Höhe, damit nichts springt; nie neben dem Spielfeld */
.ad { margin: 28px auto 0; max-width: calc(970px * var(--z)); min-height: calc(100px * var(--z)); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ad-label { font-size: calc(11px * var(--z)); color: var(--muted); letter-spacing: .5px; text-transform: uppercase; align-self: flex-start; }
.ad ins { width: 100%; }
.ad-placeholder { border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); font-size: calc(12px * var(--z)); letter-spacing: .5px; text-transform: uppercase; }

/* Altes Spiel */
.legacy-frame { margin-top: 16px; aspect-ratio: 4 / 3; max-height: 80vh; width: 100%; max-width: 100%; border-radius: 12px; background: var(--peer); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.legacy-frame iframe { width: 100%; height: 100%; border: 0; }

/* Knöpfe */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: calc(48px * var(--z)); padding: 0 20px; border-radius: 12px; border: 0; background: var(--accent); color: var(--on-accent); font: 800 calc(16px * var(--z)) var(--font-body); cursor: pointer; text-decoration: none; }
.btn.secondary { background: transparent; color: var(--ink); border: 1px solid var(--key-border); }
.btn:disabled { opacity: .45; cursor: default; }
.linklike { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }

/* Fuß */
.site-foot { background: var(--brand); color: var(--on-brand-muted); padding-block: 26px; }
.foot-row { display: flex; flex-wrap: wrap; gap: 14px 28px; justify-content: space-between; font-size: calc(14px * var(--z)); }
.foot-nav { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.foot-nav a, .foot-nav .linklike { color: var(--on-brand); }
.foot-nav.muted a { color: var(--on-brand-muted); }


/* Ansicht-Menü in der Kopfzeile */
.view { position: relative; }
.view-btn { display: inline-flex; align-items: center; gap: 8px; min-height: calc(44px * var(--z)); padding: 0 12px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--on-brand) 30%, transparent); background: transparent; color: var(--on-brand); font: 700 calc(14px * var(--z)) var(--font-body); cursor: pointer; }
.view-btn .aa { font: 800 calc(15px * var(--z))/1 var(--font-body); letter-spacing: -.5px; }
.view-btn .aa small { font-size: .7em; }
.view-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: min(320px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: 0 16px 40px rgba(10, 18, 32, .3); display: flex; flex-direction: column; gap: 14px; }
.view-panel fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.view-panel legend { font-weight: 800; margin-bottom: 4px; padding: 0; }
.view-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.view-opts.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.view-opts label { position: relative; }
.view-opts input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.view-opts span { display: flex; align-items: center; justify-content: center; min-height: calc(44px * var(--z)); padding: 0 6px; border-radius: 10px; border: 1px solid var(--key-border); background: var(--bg); font-weight: 700; text-align: center; line-height: 1.1; }
.view-opts input:checked + span { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.view-opts input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.view-panel .note { margin: 0; }
@media (max-width: 620px) { .view-btn .lbl { display: none; } .view-btn { min-width: 44px; justify-content: center; padding: 0 10px; } }
/* Druckbogen-Generator */
.print-form { display: flex; flex-direction: column; gap: 16px; margin-top: 18px; padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-soft); }
.seg { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.seg legend { font-weight: 700; margin-bottom: 6px; padding: 0; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; justify-content: center; min-height: calc(44px * var(--z)); min-width: calc(52px * var(--z)); padding: 0 14px; border-radius: 10px; border: 1px solid var(--key-border); background: var(--bg); font-weight: 700; }
.seg input:checked + span { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.seg input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.print-form .row { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
.field { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.field input { width: calc(76px * var(--z)); min-height: calc(44px * var(--z)); padding: 0 10px; border-radius: 10px; border: 1px solid var(--key-border); background: var(--bg); color: var(--ink); font: 700 calc(16px * var(--z)) var(--font-body); }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: calc(44px * var(--z)); }
.check input { width: calc(20px * var(--z)); height: 20px; }

.print-preview { margin-top: 24px; overflow-x: auto; padding-inline: 16px; }
#print-sheets { display: flex; flex-direction: column; align-items: center; gap: 24px; }
#print-sheets:empty { display: none; }
.sheet { width: 210mm; max-width: 100%; aspect-ratio: 210 / 297; background: #fff; color: #000; box-shadow: 0 6px 24px rgba(0, 0, 0, .15); padding: 12mm; display: flex; flex-direction: column; gap: 6mm; font-family: var(--font-body); }
.sheet-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1.5px solid #000; padding-bottom: 2mm; font-size: 12pt; }
.sheet-head span { font-size: 10pt; color: #444; }
.sheet-body { flex: 1; display: grid; gap: 8mm 10mm; align-content: center; justify-items: center; }
.sheet.per-1 .sheet-body { grid-template-columns: 1fr; }
.sheet.per-2 .sheet-body { grid-template-columns: 1fr; }
.sheet.per-4 .sheet-body { grid-template-columns: 1fr 1fr; }
.sheet.per-6 .sheet-body { grid-template-columns: 1fr 1fr; }
.pitem { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 2mm; width: 100%; }
.pitem figcaption { font-size: 9pt; color: #444; }
.pgrid { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); grid-template-rows: repeat(9, minmax(0, 1fr)); border: 2px solid #000; width: 100%; aspect-ratio: 1; }
.sheet.per-1 .pgrid { max-width: 165mm; }
.sheet.per-2 .pgrid { max-width: 108mm; }
.sheet.per-4 .pgrid { max-width: 82mm; }
.sheet.per-6 .pgrid { max-width: 70mm; }
.pc { display: flex; align-items: center; justify-content: center; border-right: 1px solid #888; border-bottom: 1px solid #888; font-weight: 700; color: #000; font-size: 13pt; line-height: 1; }
.pc:nth-child(9n) { border-right: 0; }
.pc:nth-last-child(-n + 9) { border-bottom: 0; }
.pc.br { border-right: 2px solid #000; }
.pc.bb { border-bottom: 2px solid #000; }
.sheet.per-1 .pc { font-size: 26pt; }
.sheet.per-2 .pc { font-size: 18pt; }
.sheet.per-6 .pc { font-size: 11pt; }
.sheet.large.per-1 .pc { font-size: 32pt; }
.sheet.large.per-2 .pc { font-size: 22pt; }

@media print {
  @page { size: A4 portrait; margin: 0; }
  body { background: #fff; }
  .site-head, .site-foot, .crumbs, .no-print, .ad, .skip { display: none !important; }
  .site-main { padding: 0; }
  .print-preview { margin: 0; padding: 0; overflow: visible; }
  #print-sheets { gap: 0; display: block; }
  .sheet { box-shadow: none; width: 210mm; height: 297mm; max-width: none; aspect-ratio: auto; break-after: page; page-break-after: always; }
  .sheet:last-child { break-after: auto; page-break-after: auto; }
}

/* Lange deutsche Wörter dürfen bei großer Schrift umbrechen */
h1, h2, h3, .prose, .lead, .tile, .level-card, .faq, .note { overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
code { overflow-wrap: anywhere; }
@media (max-width: 620px) {
  :root[data-size="sehr-gross"] .level-cards, :root[data-size="sehr-gross"] .view-opts { grid-template-columns: minmax(0, 1fr); }
  :root[data-size] .head-row .logo { font-size: calc(19px * var(--z)); }
}

/* Lernbereich */
.learn-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; margin-top: 24px; align-items: start; }
.learn-examples { display: flex; flex-direction: column; gap: 32px; }
@media (max-width: 860px) { .learn-grid { grid-template-columns: minmax(0, 1fr); } }
.ex { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.ex figcaption { font-weight: 800; }
.ex-board-wrap { display: flex; flex-direction: column; max-width: 520px; width: 100%; }
.ex-cols { display: grid; grid-template-columns: 24px repeat(9, minmax(0, 1fr)); font-size: calc(11px * var(--z)); color: var(--muted); text-align: center; }
.ex-rowwrap { display: flex; }
.ex-rows { display: grid; grid-template-rows: repeat(9, minmax(0, 1fr)); width: 24px; flex-shrink: 0; font-size: calc(11px * var(--z)); color: var(--muted); align-items: center; }
.ex-board { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); grid-template-rows: repeat(9, minmax(0, 1fr)); aspect-ratio: 1; border: 2px solid var(--ink); background: var(--surface); }
.xc { position: relative; display: flex; align-items: center; justify-content: center; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: clamp(16px, 4.6vw, calc(24px * var(--z))); font-weight: 600; color: #2a5d94; min-width: 0; min-height: 0; overflow: hidden; }
.xc.g { color: var(--ink); font-weight: 800; }
.xc:nth-child(9n) { border-right: 0; }
.xc:nth-last-child(-n + 9) { border-bottom: 0; }
.xc.br { border-right: 2px solid var(--ink); }
.xc.bb { border-bottom: 2px solid var(--ink); }
.cands { position: absolute; inset: 1px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); font-style: normal; font-size: clamp(8px, 2.2vw, calc(11px * var(--z))); font-weight: 600; color: var(--muted); line-height: 1; }
.cands i { font-style: normal; display: flex; align-items: center; justify-content: center; border-radius: 3px; }
.pv { display: none; color: #2f8f5b; font-size: 1.1em; }
.ex[data-step="2"] .unit, .ex[data-step="3"] .unit { background: var(--peer); }
.ex[data-step="2"] .pat, .ex[data-step="3"] .pat { box-shadow: inset 0 0 0 3px #2f8f5b; background: #dff1e6; }
.ex[data-step="2"] .cands .hl, .ex[data-step="3"] .cands .hl { background: #2f8f5b; color: #fff; }
.ex[data-step="2"] .cands .x { background: #fbe3a6; color: #17202e; }
.ex[data-step="3"] .cands .x { color: #b42318; text-decoration: line-through 2px; background: #f9dcd7; }
.ex[data-step="3"] .place .pv { display: block; }
.ex[data-step="3"] .place .cands { display: none; }
.ex-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.ex-steps button { min-height: calc(44px * var(--z)); padding: 0 12px; border-radius: 10px; border: 1px solid var(--key-border); background: var(--surface); color: var(--ink); font: 700 calc(14px * var(--z)) var(--font-body); cursor: pointer; }
.ex-steps button[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.ex-steps .ex-prev, .ex-steps .ex-next { min-width: calc(44px * var(--z)); font-size: calc(20px * var(--z)); }
.ex-text { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-soft); line-height: 1.55; }
.pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line-soft); font-weight: 700; }
.pager a { min-height: 44px; display: inline-flex; align-items: center; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .xc { color: #8fc4ff; } :root:not([data-theme="light"]) .ex[data-step] .pat { background: #173a2a; } }

/* Sudoku Solver */
.sv { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; margin-top: 20px; align-items: start; }
@media (max-width: 860px) { .sv { grid-template-columns: minmax(0, 1fr); gap: 16px; } }
.sv-play { display: flex; flex-direction: column; gap: 12px; max-width: calc(560px * var(--z)); width: 100%; }
.sv-board { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); grid-template-rows: repeat(9, minmax(0, 1fr)); aspect-ratio: 1; width: 100%; border: 2px solid var(--ink); background: var(--surface); user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.sc { position: relative; display: flex; align-items: center; justify-content: center; padding: 0; margin: 0; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); color: #2a5d94; font: 600 clamp(18px, 5.4vw, calc(28px * var(--z))) / 1 var(--font-body); min-width: 0; min-height: 0; overflow: hidden; cursor: default; }
.sv-board.editing .sc { cursor: pointer; }
.sc:nth-child(9n) { border-right: 0; }
.sc:nth-last-child(-n + 9) { border-bottom: 0; }
.sc.br { border-right: 2px solid var(--ink); }
.sc.bb { border-bottom: 2px solid var(--ink); }
.sc.g { color: var(--ink); font-weight: 800; }
.sc.sel { background: #f5c84f; }
.sc.bad { background: #f9dcd7; color: #b42318; }
.sc:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--brand); }
.sc.unit { background: var(--peer); }
.sc.pat { box-shadow: inset 0 0 0 3px #2f8f5b; background: #dff1e6; }
.sc.place { box-shadow: inset 0 0 0 3px #2f8f5b; background: #dff1e6; }
.sc .pv { display: block; color: #2f8f5b; font-weight: 800; }
.sc .cands { position: absolute; inset: 1px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); font-style: normal; font-size: clamp(8px, 2.3vw, calc(12px * var(--z))); font-weight: 600; color: var(--muted); line-height: 1; }
.sc .cands i { font-style: normal; display: flex; align-items: center; justify-content: center; border-radius: 3px; }
.sc .cands .hl { background: #2f8f5b; color: #fff; }
.sc .cands .x { color: #b42318; background: #f9dcd7; text-decoration: line-through 2px; }
.sv-pad { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.sv-pad button { min-height: calc(52px * var(--z)); border-radius: 12px; border: 1px solid var(--key-border); background: var(--surface); color: #2a5d94; font: 700 calc(24px * var(--z)) var(--font-body); cursor: pointer; }
.sv-pad .erase { color: var(--ink); font-size: calc(14px * var(--z)); overflow: hidden; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; padding: 0 2px; line-height: 1.1; }
.sv-panel { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sv-msg { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-soft); line-height: 1.5; }
.sv-msg.err { border-color: #b42318; background: #fbeae7; color: #7a1a10; }
.sv-msg.ok { border-color: #2f8f5b; background: #e6f4ec; color: #17402b; }
.sv-group { display: flex; flex-direction: column; gap: 10px; }
.sv-group > .btn { width: 100%; }
.sv-row { display: flex; gap: 8px; flex-wrap: wrap; }
.sv-row .btn { flex: 1 1 140px; }
.sv-step { padding: 14px; border-radius: 12px; background: #e6f4ec; border: 1px solid #2f8f5b; color: #17202e; display: flex; flex-direction: column; gap: 8px; }
.sv-step p { margin: 0; line-height: 1.55; }
.sv-step-label { font-weight: 800; }
.sv-learn { font-weight: 700; color: #1f6a42; }
.sv-paste { padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--surface); }
.sv-paste summary { cursor: pointer; font-weight: 700; min-height: 32px; display: flex; align-items: center; }
.sv-paste[open] { display: flex; flex-direction: column; gap: 8px; }
.sv-paste textarea { width: 100%; font: 600 calc(16px * var(--z)) / 1.4 ui-monospace, monospace; padding: 8px; border-radius: 8px; border: 1px solid var(--key-border); background: var(--bg); color: var(--ink); overflow-wrap: anywhere; }
.sv-example { align-self: flex-start; min-height: 44px; color: var(--link); font-weight: 600; }
.sv-summary p { margin: 0 0 6px; }
.sv-summary ul { margin: 0; padding-left: 20px; }
.sv-sum-h { font-weight: 700; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sc, :root:not([data-theme="light"]) .sv-pad button { color: #8fc4ff; }
  :root:not([data-theme="light"]) .sc.g { color: var(--ink); }
  :root:not([data-theme="light"]) .sc.sel { background: #6e5612; } :root:not([data-theme="light"]) .sc.pat, :root:not([data-theme="light"]) .sc.place { background: #173a2a; } :root:not([data-theme="light"]) .sc .pv { color: #7fd6a4; } }
:root[data-contrast="hoch"] .sc.g { font-weight: 900; }

/* CalcuDoku */
.calc-config { display: flex; flex-direction: column; gap: 6px; }
.calc .levels.sizes { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.calc-row { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 6px; }
.calc #clevels { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.calc #cops { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 359px) { .calc-row { grid-template-columns: minmax(0, 1fr); } }
:root[data-size="sehr-gross"] .calc-row { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 420px) { :root[data-size] .calc .levels.sizes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cboard { --n: 6; position: relative; container-type: inline-size; width: 100%; aspect-ratio: 1; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); grid-template-rows: repeat(var(--n), minmax(0, 1fr)); background: var(--surface); border: 3px solid var(--line-strong); border-radius: 6px; overflow: hidden; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.cc { position: relative; margin: 0; padding: 0; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); color: var(--user); font-family: var(--font-body); cursor: pointer; min-width: 0; min-height: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.cc[data-edges~="er"] { border-right: 3px solid var(--line-strong); }
.cc[data-edges~="eb"] { border-bottom: 3px solid var(--line-strong); }
.cc[data-edges~="lc"] { border-right: 0; }
.cc[data-edges~="lr"] { border-bottom: 0; }
.cc .v { font-size: calc(100cqw / var(--n) * 0.5); font-weight: 600; line-height: 1; padding-top: 12%; font-variant-numeric: tabular-nums; }
.cc .cl { position: absolute; top: 2px; left: 3px; font-size: max(10px, calc(100cqw / var(--n) * 0.2)); font-weight: 800; color: var(--ink); line-height: 1; white-space: nowrap; pointer-events: none; }
.cc .notes { position: absolute; inset: 30% 3px 3px 3px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); font-size: max(8px, calc(100cqw / var(--n) * 0.19)); font-weight: 600; color: var(--note); line-height: 1; }
.cboard[data-size="4"] .cc .notes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cc .notes i { font-style: normal; display: flex; align-items: center; justify-content: center; }
.cc .notes i.match { color: var(--ink); background: var(--same); border-radius: 3px; }
.cc.peer { background: var(--peer); }
.cc.incage { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.calc .status > span { white-space: nowrap; }
.cc.same { background: var(--same); }
.cc.selected { background: var(--sel); }
.cc.wrong .v { color: var(--error); }
.cc.conflict { background: var(--error-bg); }
.cc.cagebad .cl { color: var(--error); text-decoration: underline wavy; }
.cc.hinted { box-shadow: inset 0 0 0 3px var(--hint); }
.cc.hint-target { background: var(--hint-bg); box-shadow: inset 0 0 0 3px var(--hint); }
.cc:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--brand); }
.cboard.busy .cc > *, .cboard.paused .cc > * { visibility: hidden !important; }
.cboard.won .cc { cursor: default; }
.calc .pad[data-n="5"] { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.calc .pad[data-n="6"], .calc .pad[data-n="7"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.calc-stat-list { display: flex; flex-direction: column; gap: 12px; }
.calc-stats { width: 100%; border-collapse: collapse; font-size: calc(13px * var(--z)); font-variant-numeric: tabular-nums; }
.calc-stats th, .calc-stats td { padding: 4px 6px; text-align: left; border-bottom: 1px solid var(--line-soft); }
.calc-stats thead th { color: var(--muted); font-weight: 700; }

/* CalcuDoku-Druckbogen */
.cgrid { --n: 6; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); grid-template-rows: repeat(var(--n), minmax(0, 1fr)); border: 2.5px solid #000; width: 100%; aspect-ratio: 1; container-type: inline-size; background: #fff; }
.cpc { position: relative; display: flex; align-items: center; justify-content: center; border-right: 0.5px solid #999; border-bottom: 0.5px solid #999; color: #000; min-width: 0; min-height: 0; }
.cpc.er { border-right: 2.5px solid #000; }
.cpc.eb { border-bottom: 2.5px solid #000; }
.cpc.lc { border-right: 0; }
.cpc.lr { border-bottom: 0; }
.cpc i { position: absolute; top: 1px; left: 2px; font-style: normal; font-weight: 800; font-size: max(6.5pt, calc(100cqw / var(--n) * 0.21)); line-height: 1; white-space: nowrap; }
.cpc b { font-weight: 700; font-size: calc(100cqw / var(--n) * 0.48); padding-top: 14%; }
.sheet.per-1 .cgrid { max-width: 165mm; }
.sheet.per-2 .cgrid { max-width: 108mm; }
.sheet.per-4 .cgrid { max-width: 82mm; }
.sheet.per-6 .cgrid { max-width: 70mm; }
.sheet.large .cpc i { font-size: max(9pt, calc(100cqw / var(--n) * 0.24)); }
