@font-face { font-family: "Space Grotesk"; font-weight: 700; font-style: normal; font-display: swap; src: url("assets/fonts/space-grotesk-latin-700-normal.woff2") format("woff2"); }
:root {
  --bg: #f6f1e7; --bg2: #efe6d6; --card: #fffdf8; --fg: #2a2340; --muted: #776f8a; --line: #2a2340; --thin: #cfc5b3;
  --acc: #6b4ce6; --acc2: #ffb547; --given: #2a2340; --user: #5a3fd6; --sel: #ffe6a6; --area: #efe6ff; --same: #d9ccff;
  --bad: #e5484d; --badbg: #ffe3e3; --hint: #c9f2df; --note: #6d6680; --size: 360px; --fs: 1;
}
:root[data-design="dunkel"] {
  --bg: #17142a; --bg2: #201c38; --card: #241f40; --fg: #efeaff; --muted: #a9a2c4; --line: #cfc6ff; --thin: #4a4470;
  --acc: #9b85ff; --acc2: #ffc35c; --given: #efeaff; --user: #b7a6ff; --sel: #5d4a14; --area: #2e2852; --same: #4a3d8f;
  --bad: #ff6b6f; --badbg: #4a1f2a; --hint: #1f4a3b; --note: #b9b2d6;
}
:root[data-design="kontrast"] {
  --bg: #000; --bg2: #000; --card: #000; --fg: #fff; --muted: #fff; --line: #fff; --thin: #999;
  --acc: #ffe100; --acc2: #ffe100; --given: #fff; --user: #ffe100; --sel: #0050ff; --area: #1a1a1a; --same: #003a99;
  --bad: #ff3b3b; --badbg: #4d0000; --hint: #006b3c; --note: #fff;
}
:root.gross { --fs: 1.15; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); overflow: hidden; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
body { font-family: "Space Grotesk", "Segoe UI", Roboto, Arial, sans-serif; }
#app { position: fixed; inset: 0; }
#ui { position: absolute; inset: 0; }
button { font-family: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- Bildschirme ---------- */
.scr { position: absolute; inset: 0; overflow-y: auto; padding: calc(env(safe-area-inset-top) + 60px) 16px calc(env(safe-area-inset-bottom) + 70px); display: flex; flex-direction: column; align-items: center; gap: 14px; background: radial-gradient(ellipse at 50% -10%, var(--bg2), var(--bg) 60%); }
.scr > * { width: 100%; max-width: 520px; }
.scr.center { justify-content: center; }
.logo { position: relative; display: flex; flex-direction: column; align-items: center; line-height: .9; margin-top: 4px; }
.logo .l1 { font-size: clamp(46px, 13vw, 76px); color: var(--fg); letter-spacing: -.02em; }
.logo .l2 { font-size: clamp(46px, 13vw, 76px); background: linear-gradient(90deg, var(--acc), #ff5d8f 60%, var(--acc2)); -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: -.02em; margin-left: 1.4em; }
.logo .st { position: absolute; font-style: normal; color: var(--acc2); animation: tw 2.4s ease-in-out infinite; }
.logo .s1 { left: 8%; top: 4%; font-size: 26px; } .logo .s2 { right: 10%; top: 18%; font-size: 20px; animation-delay: .8s; } .logo .s3 { right: 22%; bottom: -6%; font-size: 16px; animation-delay: 1.5s; }
@keyframes tw { 50% { transform: scale(.5) rotate(40deg); opacity: .4; } }
.claim { margin: 0; text-align: center; color: var(--muted); font-size: 16px; }
h2 { margin: 0; text-align: center; font-size: 30px; }
h3.sub { margin: 4px 0 -4px; font-size: 16px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.card { background: var(--card); border-radius: 20px; padding: 16px; box-shadow: 0 6px 24px rgba(40, 30, 80, .12); border: 1px solid rgba(120, 100, 160, .15); }
.btn { appearance: none; border: 0; border-radius: 16px; padding: 14px 18px; font-size: 18px; font-weight: 700; background: var(--acc); color: #fff; cursor: pointer; box-shadow: 0 4px 0 rgba(0, 0, 0, .18); touch-action: manipulation; }
:root[data-design="kontrast"] .btn { color: #000; }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0, 0, 0, .18); }
.btn.big { font-size: 22px; padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.btn.big small { font-size: 14px; opacity: .85; font-weight: 700; }
.btn.small { font-size: 15px; padding: 9px 14px; border-radius: 12px; }
.btn.ghost { background: transparent; color: var(--acc); box-shadow: inset 0 0 0 2px var(--acc); }
.link { appearance: none; background: none; border: 0; color: var(--acc); font-size: 16px; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 6px 8px; }
.row { display: flex; gap: 10px; }
.row.links { justify-content: center; flex-wrap: wrap; }
.daily { display: grid; grid-template-columns: 58px 1fr auto; gap: 12px; align-items: center; }
.cal { width: 58px; border-radius: 12px; overflow: hidden; text-align: center; background: var(--bg); box-shadow: inset 0 0 0 2px var(--acc); }
.cal b { display: block; font-size: 26px; padding: 4px 0 0; }
.cal span { display: block; font-size: 12px; background: var(--acc); color: #fff; padding: 2px 0; }
.dt { display: flex; flex-direction: column; gap: 2px; }
.dt span { color: var(--muted); font-size: 14px; }
.dt em { font-style: normal; color: #2e9e6f; font-size: 14px; }
.levels { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lvl { appearance: none; border: 0; border-radius: 16px; padding: 16px 12px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 4px; color: #fff; box-shadow: 0 4px 0 rgba(0, 0, 0, .15); }
.lvl b { font-size: 21px; } .lvl span { font-size: 13px; opacity: .9; }
.lv0 { background: linear-gradient(135deg, #3ec9a7, #2e9e85); } .lv1 { background: linear-gradient(135deg, #5ab0ff, #3f7fe0); }
.lv2 { background: linear-gradient(135deg, #8b6cff, #6b4ce6); } .lv3 { background: linear-gradient(135deg, #ff5d8f, #d63c6c); }
:root[data-design="kontrast"] .lvl { background: #000; box-shadow: inset 0 0 0 3px #ffe100; color: #fff; }
.note { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.note.center { text-align: center; }
.win { text-align: center; }
.win .stars { color: var(--acc2); font-size: 28px; letter-spacing: .3em; }
.sub2 { color: var(--muted); margin: 4px 0; }
.bigtime { font-size: 64px; letter-spacing: -.02em; color: var(--acc); }
.rec { color: #e08a00; font-size: 20px; margin: 6px 0; }
.win .btn { margin-top: 12px; }
table.stats { width: 100%; border-collapse: collapse; font-size: 15px; }
table.stats th, table.stats td { padding: 8px 4px; text-align: right; border-bottom: 1px solid var(--thin); }
table.stats th:first-child { text-align: left; }
.sw { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--thin); cursor: pointer; }
.sw span { display: flex; flex-direction: column; gap: 2px; }
.sw small { color: var(--muted); font-size: 13px; }
.sw input { position: absolute; opacity: 0; pointer-events: none; }
.sw i { flex: none; width: 50px; height: 30px; border-radius: 15px; background: var(--thin); position: relative; transition: background .2s; }
.sw i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.sw input:checked + i { background: var(--acc); }
.sw input:checked + i::after { left: 23px; }
.sw input:focus-visible + i { outline: 3px solid var(--acc2); }
.seg { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; }
.seg div { display: flex; gap: 6px; }
.seg button { flex: 1; appearance: none; border: 2px solid var(--thin); background: transparent; border-radius: 10px; padding: 9px 4px; font-weight: 700; font-size: 15px; cursor: pointer; }
.seg button.on { background: var(--acc); border-color: var(--acc); color: #fff; }
.help p, .help li { line-height: 1.5; font-size: 16px; }
.help ul { padding-left: 20px; }

/* ---------- Spiel ---------- */
.game { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; padding: calc(env(safe-area-inset-top) + 8px) 10px calc(env(safe-area-inset-bottom) + 10px); gap: 6px; }
.top { width: 100%; max-width: calc(var(--size) + 40px); display: flex; align-items: center; gap: 10px; }
.land .top { max-width: calc(var(--size) + min(340px, 38vw) + 22px); }
.ib { appearance: none; width: 44px; height: 44px; border-radius: 14px; border: 0; background: var(--card); box-shadow: 0 2px 8px rgba(40, 30, 80, .12); font-size: 18px; cursor: pointer; flex: none; }
.ttl { flex: 1; display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.ttl b { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ttl span { font-size: 13px; color: var(--muted); }
.clock { font-size: 22px; font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }
.info { width: 100%; max-width: var(--size); display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); min-height: 16px; }
.play { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.land .play { flex-direction: row; align-items: flex-start; gap: 22px; }
.board-wrap { position: relative; }
.board { width: var(--size); height: var(--size); display: grid; grid-template-columns: repeat(9, 1fr); grid-template-rows: repeat(9, 1fr); border: 3px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.cell { position: relative; border-right: 1px solid var(--thin); border-bottom: 1px solid var(--thin); display: grid; place-items: center; cursor: pointer; transition: background .12s; }
.cell:nth-child(9n) { border-right: 0; } .cell:nth-child(n+73) { border-bottom: 0; }
.cell.br { border-right: 2.5px solid var(--line); } .cell.bb { border-bottom: 2.5px solid var(--line); }
.cell .v { font-size: calc(var(--size) / 9 * .62 * var(--fs)); line-height: 1; color: var(--user); font-weight: 700; }
.cell.given .v { color: var(--given); }
.cell .n { position: absolute; inset: 2px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); }
.cell .n i { font-style: normal; font-size: calc(var(--size) / 9 * .27 * var(--fs)); color: var(--note); display: grid; place-items: center; visibility: hidden; line-height: 1; }
.cell .n i.on { visibility: visible; }
.cell .n i.hl { background: var(--same); border-radius: 4px; color: var(--fg); }
.cell .n i.x { color: var(--bad); text-decoration: line-through; }
.cell.area { background: var(--area); }
.cell.same { background: var(--same); }
.cell.sel { background: var(--sel); }
.cell.hint { background: var(--hint); }
.cell.bad .v { color: var(--bad); }
.cell.bad::after { content: ""; position: absolute; inset: 3px; border: 2px solid var(--bad); border-radius: 6px; }
.cell.wrong { background: var(--badbg); }
.cell.wrong .v { color: var(--bad); }
.cell.flash { animation: fl .7s ease; }
@keyframes fl { 30% { background: var(--acc2); } }
.pausecover { position: absolute; inset: 0; background: var(--card); border-radius: 10px; display: grid; place-items: center; text-align: center; border: 3px solid var(--line); }
.pausecover div { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.pausecover b { font-size: 30px; } .pausecover span { color: var(--muted); }
.side { width: var(--size); display: flex; flex-direction: column; gap: 10px; }
.land .side { width: min(340px, 38vw); }
.tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tool { position: relative; appearance: none; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; cursor: pointer; font-size: 13px; color: var(--muted); font-weight: 700; touch-action: manipulation; }
.tool i { font-style: normal; font-size: 24px; width: 48px; height: 40px; border-radius: 14px; display: grid; place-items: center; background: var(--card); color: var(--fg); box-shadow: 0 2px 8px rgba(40, 30, 80, .12); }
.tool em { position: absolute; top: -2px; right: calc(50% - 32px); font-style: normal; font-size: 10px; background: var(--thin); color: var(--fg); border-radius: 8px; padding: 1px 5px; }
.tool.on i { background: var(--acc); color: #fff; }
.tool.on em { background: var(--acc); color: #fff; }
.tool:disabled { opacity: .45; }
.pad { display: grid; grid-template-columns: repeat(9, 1fr); gap: 5px; }
.land .pad { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.num { appearance: none; border: 0; border-radius: 12px; background: var(--card); box-shadow: 0 3px 0 rgba(40, 30, 80, .15); padding: 10px 0 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; touch-action: manipulation; }
.num b { font-size: calc(min(30px, var(--size) / 12) * var(--fs)); color: var(--acc); line-height: 1.1; }
.land .num { padding: 12px 0 8px; } .land .num b { font-size: calc(32px * var(--fs)); }
.num small { font-size: 11px; color: var(--muted); min-height: 13px; }
.num.hl { box-shadow: inset 0 0 0 2px var(--acc), 0 3px 0 rgba(40, 30, 80, .15); }
.num.fertig { opacity: .35; }
.num:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(40, 30, 80, .15); }
.hintbox { background: var(--card); border-radius: 14px; padding: 10px 12px; box-shadow: 0 4px 16px rgba(40, 30, 80, .15); border-left: 5px solid #2e9e6f; font-size: calc(15px * var(--fs)); }
.hintbox p { margin: 6px 0 8px; line-height: 1.4; }
.hb { display: flex; gap: 8px; flex-wrap: wrap; }
#toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 90px); transform: translate(-50%, 20px); background: var(--fg); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 15px; opacity: 0; transition: .25s; pointer-events: none; z-index: 50; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#fx { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 40; }
#fx i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { top: 110vh; transform: rotate(720deg) translateX(40px); } }
@media (prefers-reduced-motion: reduce) { .logo .st { animation: none; } .cell.flash { animation: none; } }
