/* Typsnitt: Familjen Grotesk (SIL OFL, se fonts/OFL.txt). Bara latin, det räcker för svenska. */
@font-face { font-family: "Familjen Grotesk"; font-style: normal; font-weight: 400 700; font-display: swap;
             src: url("/static/fonts/familjen-grotesk.woff2") format("woff2"); }
@font-face { font-family: "Familjen Grotesk"; font-style: italic; font-weight: 400 700; font-display: swap;
             src: url("/static/fonts/familjen-grotesk-italic.woff2") format("woff2"); }

:root {
  --bg: #f1f2ee; --panel: #fafaf7; --raise: #eceee8; --text: #18201b; --muted: #5b655f;
  --line: #e1e4dd; --line-strong: #cdd2ca; --check: #aeb5ac;
  --accent: #2d5b43; --accent-soft: #dde8e0; --on-accent: #fff; --warn: #9a5b0b; --bad: #b3261e;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #131815; --panel: #1c221e; --raise: #252c27; --text: #e6eae6; --muted: #9aa59e;
          --line: #2a322d; --line-strong: #3a433d; --check: #59635c;
          --accent: #7db896; --accent-soft: #213428; --on-accent: #10160f; --warn: #e0a54a; --bad: #f08a80; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased;
       font: 16px/1.45 "Familjen Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif; }
main { max-width: 640px; margin: 0 auto;
       padding: calc(28px + env(safe-area-inset-top)) 20px calc(110px + env(safe-area-inset-bottom)); }
header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
header a { font-weight: 500; text-decoration: none; }
h1 { font-size: 34px; line-height: 1.08; font-weight: 650; letter-spacing: -0.025em; margin: 0; text-wrap: balance; }
h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; margin: 32px 0 10px; }
a { color: var(--accent); }
.muted { color: var(--muted); }
small { color: var(--muted); font-size: 13px; }
.num, .timer, time { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6;
       stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: middle; }
.ico.sm { width: 18px; height: 18px; }

.flash { background: var(--accent-soft); border-radius: 12px; padding: 12px 16px; margin: 0 0 16px; }
.card, ul.list { background: var(--panel); border-radius: 20px; }
.card { padding: 16px 18px; }
ul.list { list-style: none; margin: 0; padding: 0; overflow: hidden; }
ul.list > li { display: flex; align-items: center; gap: 14px; padding: 6px 14px 6px 16px; min-height: 56px;
               border-bottom: 1px solid var(--line); }
ul.list > li:last-child { border-bottom: 0; }
ul.list details { flex: 1; min-width: 0; }
ul.list summary { list-style: none; cursor: pointer; padding: 8px 0; }
ul.list summary::-webkit-details-marker { display: none; }

input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid var(--check);
                          border-radius: 12px; background: var(--panel); }
input::placeholder, textarea::placeholder { color: var(--muted); }
textarea { min-height: 140px; resize: vertical; }
button { min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-strong);
         background: var(--panel); cursor: pointer; font-weight: 500;
         transition: transform .15s ease, background-color .2s ease, border-color .2s ease; }
button:hover { background: var(--raise); }
button:active { transform: translateY(1px); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
button.primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--text)); }
button.danger { color: var(--bad); }
button.small { min-height: 36px; padding: 0 12px; font-size: 14px; }
button.icon { width: 48px; min-height: 48px; padding: 0; display: grid; place-items: center; flex: none; }
form.confirming button.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
form.confirming button.danger::after { content: ", tryck igen"; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }
.row > button { flex: 0 0 auto; }
.stack { display: grid; gap: 10px; margin-top: 8px; }
label { display: grid; gap: 6px; font-size: 14px; font-weight: 500; }

/* Bockruta */
.check { width: 28px; height: 28px; min-height: 0; border-radius: 50%; border: 1.6px solid var(--check);
         background: transparent; padding: 0; flex: none; display: grid; place-items: center;
         font-size: 12px; font-weight: 600; color: var(--muted); }
.check:hover { border-color: var(--accent); background: transparent; }
.done .check { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.done summary, .done .name { text-decoration: line-through; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button, .chip-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; border-radius: 999px;
                           padding: 0 14px; font-size: 14px; background: transparent; }

/* Sysslor */
.due { font-size: 13px; font-weight: 600; white-space: nowrap; }
.due.late { color: var(--bad); }
.due.today { color: var(--warn); }
.due.later { color: var(--muted); font-weight: 400; }

/* Poängställning: två siffror, ledaren i accentfärg */
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.board .card { display: grid; gap: 2px; padding: 16px 18px 18px; background: transparent;
               border: 1px solid var(--line-strong); color: inherit; text-decoration: none; }
.board .card.leader { background: var(--panel); border-color: transparent; }
.board .who { font-size: 15px; font-weight: 600; }
.board .score { font-size: 48px; line-height: 1; font-weight: 650; letter-spacing: -0.03em;
                font-variant-numeric: tabular-nums; color: var(--muted); }
.board .leader .score { color: var(--accent); }
.board small { margin-top: 6px; }

/* Matsedel */
.weeknav { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.weeknav > div { flex: 1; text-align: center; }
.weeknav a { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px;
             border: 1px solid var(--line-strong); color: var(--text); text-decoration: none; }
.weeknav a:hover { background: var(--raise); }
.week-title { font-size: 17px; font-weight: 600; }
.days > li.day { min-height: 68px; }
.day.today { background: color-mix(in srgb, var(--accent) 11%, var(--panel)); }
.date { width: 40px; flex: none; display: grid; align-content: center; }
.date small { font-size: 12px; text-transform: lowercase; }
.date b { font-size: 22px; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.today .date, .today .date small { color: var(--accent); font-weight: 600; }
.dish { font-size: 16px; font-weight: 500; }
.in-list { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500; color: var(--accent); }
.recipe-text { white-space: pre-wrap; }

/* Flikar längst ner */
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: center;
           background: color-mix(in srgb, var(--panel) 94%, transparent); backdrop-filter: blur(12px);
           -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line);
           padding: 6px 4px env(safe-area-inset-bottom); }
nav.tabs a { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 3px;
             padding: 6px 0 10px; font-size: 11px; color: var(--muted); text-decoration: none; }
nav.tabs a .ico { width: 24px; height: 24px; }
nav.tabs a.active { color: var(--accent); font-weight: 600; }

/* Spel */
.game-card { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.game-icon { font-size: 32px; }
.game-card .play { color: var(--accent); font-weight: 600; }
.timer { font-weight: 700; }
.queens-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 22px; }

/* Ordduell */
.ord-board { display: grid; gap: 6px; max-width: 320px; margin: 0 auto 16px; }
.ord-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.tile { aspect-ratio: 1; border: 2px solid var(--line-strong); border-radius: 6px; display: grid; place-items: center;
        font-size: 26px; font-weight: 700; text-transform: uppercase; }
.tile.filled { border-color: var(--muted); }
.tile.g, .kbd .g { background: #538d4e; border-color: #538d4e; color: #fff; }
.tile.y, .kbd .y { background: #b59f3b; border-color: #b59f3b; color: #fff; }
.tile.x, .kbd .x { background: #787c7e; border-color: #787c7e; color: #fff; }
.mini { display: grid; gap: 3px; max-width: 120px; }
.mini .ord-row { gap: 3px; }
.mini .tile { font-size: 11px; border-width: 1px; border-radius: 3px; }
.kbd { display: grid; gap: 6px; user-select: none; }
.kbd-row { display: flex; gap: 4px; justify-content: center; }
.kbd button { flex: 1; max-width: 42px; height: 54px; min-height: 0; padding: 0; border-radius: 6px; font-weight: 600;
              text-transform: uppercase; background: var(--line-strong); border: 0; touch-action: manipulation; }
.kbd button.wide { max-width: 66px; flex: 1.6; font-size: 13px; text-transform: none; }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* Drottningar */
.queens { display: grid; grid-template-columns: repeat(var(--n), 1fr); max-width: 420px; margin: 0 auto 14px;
          border: 3px solid #2b2b2b; border-radius: 6px; overflow: hidden; user-select: none; }
.q { aspect-ratio: 1; min-height: 0; padding: 0; border: 1px solid rgba(0, 0, 0, .18); border-radius: 0; color: #222;
     font-size: clamp(16px, 5.5vw, 26px); line-height: 1; touch-action: manipulation; }
.q:active { transform: none; }
.q.bt { border-top: 3px solid #2b2b2b; } .q.bb { border-bottom: 3px solid #2b2b2b; }
.q.bl { border-left: 3px solid #2b2b2b; } .q.br { border-right: 3px solid #2b2b2b; }
.q.mark { color: rgba(0, 0, 0, .45); font-size: clamp(12px, 4vw, 18px); }
.q.conflict { background-image: repeating-linear-gradient(45deg, rgba(197, 48, 48, .35) 0 6px, transparent 6px 12px); }
.queens.solved .q { cursor: default; }
.reg-0 { background: #f6b8b0; } .reg-1 { background: #fcd59a; } .reg-2 { background: #fdf09a; }
.reg-3 { background: #b9e2b2; } .reg-4 { background: #a9d8f5; } .reg-5 { background: #cdbdf0; }
.reg-6 { background: #f5b9d9; } .reg-7 { background: #d9cdbf; } .reg-8 { background: #b7ece3; }
.reg-9 { background: #e0e0e0; }
.rules { font-size: 14px; }

/* Sol & måne */
.tango { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 0; max-width: 400px; margin: 0 auto 14px;
         border: 2px solid var(--line-strong); border-radius: 8px; overflow: visible; user-select: none; background: var(--panel); }
.t { position: relative; aspect-ratio: 1; min-height: 0; padding: 0; border: 1px solid var(--line); border-radius: 0;
     background: var(--panel); font-size: clamp(20px, 7vw, 32px); touch-action: manipulation; }
.t:active { transform: none; }
.t.given { background: color-mix(in srgb, var(--line-strong) 55%, var(--panel)); }
.t.conflict { background-image: repeating-linear-gradient(45deg, rgba(197, 48, 48, .3) 0 6px, transparent 6px 12px); }
.t .edge { position: absolute; z-index: 1; width: 18px; height: 18px; line-height: 16px; border-radius: 50%;
           background: var(--panel); border: 1px solid var(--muted); font-size: 13px; font-weight: 700; color: var(--text); }
.t .edge.right { right: -10px; top: calc(50% - 9px); }
.t .edge.down { bottom: -10px; left: calc(50% - 9px); }

/* Minisudoku */
.sudoku { display: grid; grid-template-columns: repeat(6, 1fr); max-width: 380px; margin: 0 auto 12px;
          border: 3px solid var(--text); border-radius: 6px; overflow: hidden; user-select: none; }
.s { aspect-ratio: 1; min-height: 0; padding: 0; border: 1px solid var(--line); border-radius: 0; background: var(--panel);
     font-size: clamp(20px, 7vw, 30px); font-weight: 600; color: var(--accent); touch-action: manipulation; }
.s:active { transform: none; }
.s.given { color: var(--text); font-weight: 800; }
.s.box-r { border-right: 3px solid var(--text); }
.s.box-b { border-bottom: 3px solid var(--text); }
.s.peer { background: color-mix(in srgb, var(--accent-soft) 60%, var(--panel)); }
.s.selected { background: var(--accent-soft); box-shadow: inset 0 0 0 3px var(--accent); }
.s.conflict { color: var(--bad); }
.numpad { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; max-width: 380px; margin: 0 auto 12px; }
.numpad button { height: 52px; padding: 0; font-size: 22px; font-weight: 700; touch-action: manipulation; }

/* Slingan */
.zip { position: relative; display: grid; grid-template-columns: repeat(var(--n), 1fr); max-width: 400px; margin: 0 auto 14px;
       border: 2px solid var(--line-strong); border-radius: 8px; overflow: hidden; touch-action: none; user-select: none; background: var(--panel); }
.z { aspect-ratio: 1; border: 1px solid var(--line); display: grid; place-items: center; }
.z.on { background: color-mix(in srgb, var(--accent) 18%, var(--panel)); }
.zip-line { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.zip-line polyline { fill: none; stroke: var(--accent); stroke-width: .38; stroke-linecap: round; stroke-linejoin: round; opacity: .7; }
.z .num { position: relative; z-index: 2; width: 62%; aspect-ratio: 1; border-radius: 50%; background: var(--text); color: var(--bg);
          display: grid; place-items: center; font-weight: 800; font-size: clamp(13px, 4.2vw, 20px); }
.zip.solved .zip-line polyline { opacity: 1; }

/* Ordjakt */
.wsearch { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 3px; max-width: 400px; margin: 0 auto 12px;
           touch-action: none; user-select: none; }
.w { aspect-ratio: 1; display: grid; place-items: center; border-radius: 8px; background: var(--panel);
     border: 1px solid var(--line); font-size: clamp(18px, 6vw, 26px); font-weight: 700; text-transform: uppercase; }
.w.found { background: hsl(var(--hue) 55% 78%); color: #18201b; border-color: transparent; }
.w.sel { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.wordlist { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 10px; }
.wordlist .chip { padding: 4px 12px; border-radius: 999px; background: var(--accent-soft); font-weight: 600; text-transform: uppercase; font-size: 14px; }
.wordlist .chip.done { text-decoration: line-through; opacity: .5; }

/* Bokstavsröra */
.anagram .letters { display: flex; gap: 6px; flex-wrap: wrap; }
.anagram .tile { width: 40px; font-size: 20px; }
.anagram.done { opacity: .85; }

/* Spelöversikt */
.feature { display: grid; gap: 14px; padding: 20px; border-radius: 24px; background: var(--accent);
           color: var(--on-accent); text-decoration: none; margin-top: 24px; }
.feature .peek { display: flex; gap: 6px; }
.feature .peek span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 6px;
                      border: 1.5px solid color-mix(in srgb, var(--on-accent) 50%, transparent); font-weight: 650; font-size: 17px; }
.feature .peek span:first-child { background: var(--on-accent); color: var(--accent); border-color: transparent; }
.feature .glyph { background: color-mix(in srgb, var(--on-accent) 16%, transparent); color: var(--on-accent); }
.feature-title { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.1; }
.feature p { margin: 4px 0 0; opacity: .88; }
.feature .go { justify-self: start; display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
               border-radius: 12px; background: var(--on-accent); color: var(--accent); font-weight: 600; }
ul.list.games > li { padding: 0; }
.games a { flex: 1; display: flex; align-items: center; gap: 14px; min-height: 68px; padding: 10px 16px;
           color: inherit; text-decoration: none; }
.glyph { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 12px;
         background: var(--raise); color: var(--text); }
.games .text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.games .text strong { font-size: 16px; line-height: 1.25; }
.games .res { font-size: 14px; text-align: right; line-height: 1.3; font-variant-numeric: tabular-nums; }
.games .res.go { color: var(--accent); font-weight: 600; }
.games .done .glyph { background: var(--accent-soft); color: var(--accent); }
button.shopped { color: var(--accent); border-color: var(--accent); }

/* Kalender */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-bottom: 8px; }
.cal-head { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.cal-day { aspect-ratio: 1; display: grid; grid-template-rows: 1fr auto; justify-items: center; padding: 4px 0;
           border-radius: 10px; background: var(--panel); color: inherit; text-decoration: none; }
.cal-day .num { font-weight: 600; }
.cal-day.other { opacity: .4; }
.cal-day.today .num { color: var(--accent); font-weight: 800; }
.cal-day.selected { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-day .dots { display: flex; gap: 2px; align-items: center; min-height: 12px; font-size: 9px; }
.cal-day .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.cal-day .dots b { font-weight: 400; }
a.primary-link { display: block; text-align: center; padding: 12px 16px; border-radius: 12px; background: var(--accent);
                 color: var(--on-accent); font-weight: 600; text-decoration: none; }
a.primary-link.secondary { background: var(--accent-soft); color: var(--text); }

/* Inköpslista */
.add label { margin-bottom: 6px; }
.suggest { display: flex; gap: 8px; overflow-x: auto; margin: 14px -20px 0; padding: 0 20px 4px; scrollbar-width: none; }
.suggest form { flex: none; }
.item-note { display: block; font-size: 13px; color: var(--muted); font-style: italic; }
.amount { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.star { min-height: 44px; width: 44px; padding: 0; border: 0; background: none; color: var(--check);
        display: grid; place-items: center; }
.star:hover { background: none; color: var(--accent); }
.star.on { color: var(--accent); }
.star.on .ico { fill: currentColor; }
.important-head { display: flex; align-items: center; gap: 6px; color: var(--accent); }
.important-head .ico { fill: currentColor; stroke: none; }
ul.important-list { box-shadow: inset 0 0 0 1.5px var(--accent); }
.done-row { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.done-row span { flex: 1; }
.check-label { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.check-label input { width: auto; min-height: 0; }

/* Hem */
.today-line { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; }
.today-line a { font-weight: 500; text-decoration: none; }
.home-head h1 { margin-bottom: 18px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 32px 0 12px; }
.section-head h2 { margin: 0; }
.love { display: flex; flex-wrap: wrap; gap: 8px; }
.love select { flex: 1 1 100%; }
.give { margin-top: 10px; }
.give summary { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px;
                border: 1px dashed var(--line-strong); cursor: pointer; font-weight: 500; list-style: none; }
.give summary::-webkit-details-marker { display: none; }
.give[open] summary { margin-bottom: 4px; }
.tidy { margin-top: 32px; display: grid; gap: 16px; padding: 22px 20px 20px; border-radius: 24px;
        background: var(--accent); color: var(--on-accent); }
.tidy h2 { margin: 0; color: inherit; }
.tidy .head { display: flex; justify-content: space-between; align-items: baseline; }
.tidy .head span, .tidy small { color: inherit; opacity: .8; }
.tidy p { margin: 0; opacity: .9; max-width: 32ch; }
.tidy-big { font-size: 64px; line-height: .95; font-weight: 650; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.tidy-clock { font-size: 64px; line-height: 1; font-weight: 650; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.tidy button { border: 0; background: var(--on-accent); color: var(--accent); font-weight: 600; }
.tidy button:hover { background: color-mix(in srgb, var(--on-accent) 88%, var(--accent)); }
.tidy button.danger { background: transparent; color: inherit; border: 1px solid color-mix(in srgb, var(--on-accent) 40%, transparent); }
.minutes { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 4px; border: 0; margin: 0;
           border-radius: 12px; background: color-mix(in srgb, var(--on-accent) 12%, transparent); }
.minutes legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.minutes label { display: block; }
.minutes input { position: absolute; opacity: 0; width: 1px; min-height: 0; }
.minutes span { display: grid; place-items: center; min-height: 40px; border-radius: 9px; font-size: 15px;
                font-weight: 500; cursor: pointer; font-variant-numeric: tabular-nums; }
.minutes input:checked + span { background: var(--on-accent); color: var(--accent); font-weight: 600; }
.minutes input:focus-visible + span { outline: 2px solid var(--on-accent); outline-offset: 1px; }
ul.list.links { margin-top: 32px; }
ul.list.links > li { padding: 0; }
.links a { flex: 1; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 16px 0 18px;
           color: inherit; text-decoration: none; font-weight: 500; }
.links a span:first-child { flex: 1; }
.links .count { font-size: 14px; color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.links .count.hot { color: var(--accent); font-weight: 600; }
.links .ico { color: var(--muted); }
.pill { background: var(--accent); color: var(--on-accent); border-radius: 999px; padding: 0 7px; font-size: 12px; }
.feed { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.feed li { display: flex; gap: 12px; font-size: 15px; line-height: 1.4; }
.feed li span { flex: 1; }
.play-link { font-weight: 600; }
.text-link { display: inline-block; margin-top: 12px; font-weight: 500; text-decoration: none; }
.challenge-banner { background: var(--accent-soft); border-radius: 12px; padding: 12px 16px; margin: 0 0 16px; }

/* Profil */
.chip-link { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px;
             border: 1px solid var(--line-strong); color: inherit; text-decoration: none; }
.chip-link.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.table-wrap { overflow-x: auto; }
table.compare { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: 20px; overflow: hidden; }
.compare th, .compare td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.compare th:first-child, .compare td:first-child { text-align: left; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.badge { display: grid; justify-items: center; text-align: center; gap: 2px; padding: 10px 6px; border-radius: 16px;
         background: var(--panel); opacity: .45; filter: grayscale(1); }
.badge.got { opacity: 1; filter: none; box-shadow: inset 0 0 0 1.5px var(--accent); }
.badge span { font-size: 28px; }
.badge small { font-size: 11px; line-height: 1.2; }
button:disabled { opacity: .5; cursor: not-allowed; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Bildgåta */
.nono { display: grid; grid-template-columns: auto repeat(var(--n), 1fr); max-width: 400px; margin: 0 auto 12px;
        touch-action: none; user-select: none; }
.nono .clue { display: flex; gap: 4px; color: var(--muted); font-size: 13px; font-weight: 600;
              font-variant-numeric: tabular-nums; transition: opacity .2s; }
.nono .clue.col { flex-direction: column; justify-content: flex-end; align-items: center; padding-bottom: 6px; line-height: 1.2; }
.nono .clue.row { justify-content: flex-end; align-items: center; padding-right: 8px; }
.nono .clue.done { opacity: .35; }
.ng { aspect-ratio: 1; background: var(--panel); border: 1px solid var(--line); position: relative; cursor: pointer; }
.ng.box-r { border-right: 2px solid var(--line-strong); }
.ng.box-b { border-bottom: 2px solid var(--line-strong); }
.ng.on { background: var(--accent); border-color: color-mix(in srgb, var(--accent) 70%, var(--panel)); }
.ng.x::after { content: "×"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 18px; }
.nono.solved .ng { cursor: default; }
.nono.solved .ng.on { animation: nono-in .5s both; }
@keyframes nono-in { from { transform: scale(.6); opacity: 0; } }

/* Ordtrappan */
.ladder { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 0 auto 16px; max-width: 320px; }
.rung-tiles { display: flex; gap: 5px; }
.rung-tiles span { width: 46px; height: 50px; display: grid; place-items: center; border-radius: 8px; background: var(--panel);
                   border: 1px solid var(--line); font-size: 24px; font-weight: 700; text-transform: uppercase; }
.rung-tiles.given span { background: var(--accent-soft); border-color: transparent; }
.rung-tiles span.changed { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.ladder .rung { width: 250px; text-align: center; font-size: 24px; font-weight: 700; letter-spacing: .5em;
                padding-left: calc(14px + .5em); text-transform: uppercase; }

/* Målsiffran */
.target-goal { display: flex; flex-direction: column; align-items: center; margin: 0 0 16px; }
.target-goal .num { font-size: 56px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.pool { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 340px; margin: 0 auto 12px; }
.pool .tile { width: 100%; height: 60px; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; touch-action: manipulation; }
.pool .tile.fresh { border-color: var(--accent); }
.pool .tile.picked, .ops button.picked { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pool .tile.hit { background: var(--accent-soft); }
.ops { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; max-width: 340px; margin: 0 auto 12px; }
.ops button { height: 52px; padding: 0; font-size: 24px; font-weight: 600; touch-action: manipulation; }
.calc { max-width: 340px; margin: 0 auto 12px; padding-left: 1.4em; color: var(--muted); }
.calc strong { color: var(--text); }

/* Kärlek: animation när man fått något */
.love-pop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; overflow: hidden; cursor: pointer;
            background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(6px);
            -webkit-backdrop-filter: blur(6px); animation: love-fade .3s both; }
.love-pop.closing { animation: love-fade .35s reverse both; }
@keyframes love-fade { from { opacity: 0; } }
.love-card { text-align: center; padding: 28px 32px; border-radius: 28px; background: var(--panel); max-width: min(340px, 86vw);
             box-shadow: 0 20px 60px rgba(0, 0, 0, .18); animation: love-card .5s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes love-card { from { transform: scale(.7) translateY(20px); opacity: 0; } }
.love-card .big { font-size: 96px; line-height: 1.1; margin-bottom: 8px; display: inline-block; }
.love-card p { margin: 4px 0; font-size: 19px; font-weight: 600; animation: love-line .4s both; }
@keyframes love-line { from { opacity: 0; transform: translateY(8px); } }
.love-card .times { color: var(--accent); }
.love-card small { display: block; margin-top: 14px; }
.big.kiss { animation: kiss 1.1s .2s both; }
@keyframes kiss { 0% { transform: scale(0); } 40% { transform: scale(1.35) rotate(-8deg); } 55% { transform: scale(.95); }
                  70% { transform: scale(1.15) rotate(4deg); } 100% { transform: scale(1); } }
.big.hug { animation: hug 1.4s .2s both; }
@keyframes hug { 0% { transform: scale(0); } 30% { transform: scale(1.1); } 45% { transform: scale(1.3, .85); }
                 60% { transform: scale(.95, 1.08); } 75% { transform: scale(1.2, .9); } 100% { transform: scale(1); } }
.big.wiggle { animation: wiggle 1.2s .2s both; transform-origin: 50% 80%; }
@keyframes wiggle { 0% { transform: scale(0); } 25% { transform: scale(1.2) rotate(0); } 35% { transform: rotate(-18deg); }
                    45% { transform: rotate(16deg) scale(1.1); } 55% { transform: rotate(-12deg); } 65% { transform: rotate(8deg); }
                    100% { transform: rotate(0) scale(1); } }
.big.float { animation: float-in 2.4s .2s both; }
@keyframes float-in { 0% { transform: translateY(30px) scale(.5); opacity: 0; } 40% { transform: translateY(-8px); opacity: 1; }
                      70% { transform: translateY(4px); } 100% { transform: translateY(0); } }
.big.steam { animation: steam 1.6s .2s both; }
@keyframes steam { 0% { transform: scale(0) rotate(-20deg); } 50% { transform: scale(1.2) rotate(6deg); } 100% { transform: scale(1); } }
.love-pop .bit { position: absolute; bottom: -60px; font-size: var(--size); pointer-events: none;
                 animation: bit-rise 3.2s var(--delay) ease-out both; }
@keyframes bit-rise { 0% { transform: translate(0, 0) rotate(0); opacity: 0; } 10% { opacity: 1; }
                      100% { transform: translate(var(--drift), -110vh) rotate(25deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .love-pop .bit { display: none; }
  .love-card, .love-card .big, .love-card p { animation: none; }
}

/* Profil, butik och Mer */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--panel); border-radius: 20px; }
.stat-row > div { display: grid; gap: 2px; padding: 16px 18px; }
.stat-row > div + div { border-left: 1px solid var(--line); }
.big-num { font-size: 36px; line-height: 1; font-weight: 650; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat-row > div:first-child .big-num { color: var(--accent); }
ul.list.kv > li { align-items: baseline; padding: 14px 18px; }
ul.list.kv > li > span:first-child { flex: 1; min-width: 0; }
ul.list.kv > li small { display: block; margin-top: 2px; }
ul.list.kv > li > span.muted { text-align: right; font-size: 14px; }
.card.saldo { display: grid; justify-items: center; gap: 4px; padding: 20px; }
.card.saldo .big-num { font-size: 48px; color: var(--accent); }
.links a > .ico:first-child { color: var(--accent); }
.links a > .ico:first-child + span { flex: 1; }

/* Testspel */
.center { text-align: center; }
.memory { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 360px; margin: 0 auto 8px; perspective: 600px; }
.mem { aspect-ratio: 1; min-height: 0; padding: 0; border-radius: 12px; font-size: 34px; background: var(--accent);
       border-color: var(--accent); transition: transform .25s, background .25s; touch-action: manipulation; }
.mem.up { background: var(--panel); border-color: var(--line-strong); transform: rotateY(180deg); }
.mem.up span { display: inline-block; transform: rotateY(180deg); }
.mem.done { background: var(--accent-soft); border-color: transparent; }

.pyramid { display: grid; gap: 6px; justify-items: center; margin: 0 auto 14px; }
.prow { display: flex; gap: 6px; }
.pc { width: 58px; height: 48px; min-height: 0; padding: 0; border-radius: 10px; text-align: center; font-size: 20px;
      font-weight: 700; font-variant-numeric: tabular-nums; display: grid; place-items: center; background: var(--panel);
      border: 1px solid var(--line-strong); }
.pc.given { background: var(--accent-soft); border-color: transparent; }
.pc.conflict { border-color: var(--bad); color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }
.pyramid.solved .pc:not(.given) { color: var(--accent); }


.slide { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 6px; max-width: 300px; margin: 0 auto 8px;
         padding: 6px; background: var(--raise); border-radius: 16px; }
.st { aspect-ratio: 1; min-height: 0; padding: 0; border-radius: 12px; font-size: 32px; font-weight: 700;
      font-variant-numeric: tabular-nums; background: var(--panel); touch-action: manipulation; }
.st.home { color: var(--accent); }
.st.blank { background: transparent; border-color: transparent; }
.slide.solved .st:not(.blank) { background: var(--accent-soft); border-color: transparent; color: var(--accent); }

.code { display: grid; gap: 6px; max-width: 320px; margin: 0 auto 12px; }
.code-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 10px;
            background: var(--panel); border-radius: 12px; }
.code-row .digits { display: flex; gap: 6px; }
.code-row b { width: 40px; height: 44px; display: grid; place-items: center; border-radius: 8px; background: var(--raise);
              font-size: 22px; font-variant-numeric: tabular-nums; }
.code-row.current { box-shadow: inset 0 0 0 2px var(--accent); }
.code-row.current b.filled { background: var(--accent-soft); }
.fb { display: grid; grid-template-columns: repeat(2, 12px); gap: 4px; }
.fb i, .legend { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: inline-block; }
.fb i.right, .legend.right { background: var(--accent); border-color: var(--accent); }
.fb i.near, .legend.near { background: #e0ad2a; border-color: #e0ad2a; }
.legend { vertical-align: -1px; }
.code-pad { grid-template-columns: repeat(3, 1fr); max-width: 320px; }
.code-pad .primary { grid-column: span 2; font-size: 18px; }
.code-pad button.used { opacity: .35; }

/* Färgfloden – Okabe–Ito-färger, går att skilja åt även vid färgblindhet */
.c0 { background: #e69f00; } .c1 { background: #56b4e9; } .c2 { background: #009e73; }
.c3 { background: #f0e442; } .c4 { background: #0072b2; } .c5 { background: #cc79a7; }
.flood { display: grid; grid-template-columns: repeat(var(--n), 1fr); max-width: 380px; margin: 0 auto 10px;
         border-radius: 12px; overflow: hidden; }
.fc { aspect-ratio: 1; transition: background-color .2s; }
.flood-count { margin: 0 0 12px; }
.flood-pick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; max-width: 380px; margin: 0 auto 12px; }
.flood-pick button { height: 52px; min-height: 0; padding: 0; border: 0; border-radius: 12px; touch-action: manipulation; }
.flood-pick button.current { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--text); }
