/* Fargetema: Lyst Winter Christmas (Disney-stil) – isblå bakgrunn med ølflasker, julerødt, gran og gull.
   Bytt verdiene her for å prøve nye temaer – resten av CSS-en bruker bare variablene. */
:root {
  /* Palett: p1 #6B392D  p2 #3F5134  p3 #E8DCC8  p4 #C49A6C  p5 #754C29  p6 #F5EFE6 */
  --bg: #E8DCC8; --bg-a: #F5EFE6; --bg-b: #E8DCC8; --bg-c: #D9C7A8;
  --card: #F5EFE6; --top: #3F5134; --top-text: #E8DCC8; --input: #FBF8F2; --line: #D6C3A5;
  --text: #3a2a22; --muted: #7a6554;
  --amber: #6B392D;      /* primær/aksent (brunrød) */
  --amber-d: #754C29;    /* hover */
  --on-accent: #F5EFE6;  /* tekst på aksent */
  --hl: #E6CFA8;         /* valgt/rekord-bakgrunn */
  --gold: #C49A6C; --ghost-b: #E8DCC8;
  --danger: #8a3326; --ok: #3F5134; --ok-bg: #dfe5d6; --err-bg: #efd9d2;
  --dial-outer: #E8DCC8; --dial-ring: #6B392D; --dial-dark: #3F5134; --dial-handle: #F5EFE6; --dial-text: #F5EFE6;
  --r: 16px;
  --flake: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 240'%3E%3Cdefs%3E%3Cg id='long'%3E%3Cpath d='M-5 -42h10v22c0 8 11 12 11 26v42q0 4-4 4h-24q-4 0-4-4v-42c0-14 11-18 11-26z'/%3E%3Crect x='-6' y='-46' width='12' height='5' rx='1' fill='%23c9a227'/%3E%3Crect x='-11' y='10' width='22' height='22' rx='2' fill='%23fff' opacity='.7'/%3E%3C/g%3E%3Cg id='stubby'%3E%3Cpath d='M-5 -30h10v12c0 6 14 8 14 20v30q0 4-4 4h-26q-4 0-4-4v-30c0-12 14-14 14-20z'/%3E%3Crect x='-6' y='-34' width='12' height='5' rx='1' fill='%23b0b0b0'/%3E%3Crect x='-14' y='6' width='28' height='18' rx='2' fill='%23fff' opacity='.7'/%3E%3C/g%3E%3Cg id='tall'%3E%3Cpath d='M-4 -54h8v34c0 6 9 8 9 20v52q0 4-4 4h-18q-4 0-4-4v-52c0-12 9-14 9-20z'/%3E%3Crect x='-5' y='-58' width='10' height='5' rx='1' fill='%23e0394f'/%3E%3Crect x='-9' y='0' width='18' height='26' rx='2' fill='%23fff' opacity='.7'/%3E%3C/g%3E%3Cg id='belgian'%3E%3Cpath d='M-6 -40h12v16c0 10 18 14 18 32v28q0 6-6 6h-36q-6 0-6-6v-28c0-18 18-22 18-32z'/%3E%3Crect x='-7' y='-45' width='14' height='6' rx='1' fill='%23e5b73b'/%3E%3Crect x='-15' y='12' width='30' height='20' rx='2' fill='%23fff' opacity='.7'/%3E%3C/g%3E%3C/defs%3E%3Cuse href='%23long' transform='translate(40 60) rotate(-18)' fill='%23a8691f'/%3E%3Cuse href='%23stubby' transform='translate(160 50) rotate(14)' fill='%234f8a4a'/%3E%3Cuse href='%23tall' transform='translate(100 150) rotate(-8)' fill='%232f7fb0'/%3E%3Cuse href='%23belgian' transform='translate(200 175) rotate(22)' fill='%238a2f3a'/%3E%3Cuse href='%23long' transform='translate(35 195) rotate(25)' fill='%23d99a2b'/%3E%3C/svg%3E");
}
body { background: linear-gradient(180deg, var(--bg-a) 0%, var(--bg-b) 55%, var(--bg-c) 100%) fixed; }

/* Fallende ølflasker i bakgrunnen */
body::before, body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: var(--flake); background-repeat: repeat; opacity: .22;
  animation: snow 28s linear infinite;
}
body::before { background-size: 190px 190px; background-position: 0 0; }
body::after  { background-size: 310px 310px; background-position: 90px 60px; opacity: .14; animation-duration: 46s; }
@keyframes snow { to { background-position-y: 1200px; } }
@media (prefers-reduced-motion: reduce) { body::before, body::after { animation: none; } }
main { position: relative; z-index: 1; }

/* Topplinje: gran med julelys */
.top { z-index: 6; border-bottom: 0; padding-bottom: 14px;
  background-color: var(--top);
  background-image:
    radial-gradient(circle at 10px 100%, #F5EFE6 3px, transparent 4px),
    radial-gradient(circle at 10px 100%, #C49A6C 3px, transparent 4px),
    radial-gradient(circle at 10px 100%, #E8DCC8 3px, transparent 4px),
    radial-gradient(circle at 10px 100%, #8aa07a 3px, transparent 4px);
  background-size: 80px 10px, 80px 10px, 80px 10px, 80px 10px;
  background-position: 0 100%, 20px 100%, 40px 100%, 60px 100%;
  background-repeat: repeat-x; box-shadow: 0 3px 10px rgba(23,48,79,.25); }
.top .brand { color: #fff; }
.top nav a { color: var(--top-text); } .top nav a:hover { color: var(--gold); }

/* Kort og lister */
.card, .beerlist li { position: relative; box-shadow: 0 2px 12px rgba(23,48,79,.12); border-color: var(--line); }
.card::after { content: "🍺"; position: absolute; top: 4px; right: 9px; color: #b7d6ee; font-size: 1rem; pointer-events: none; }
.card.narrow::before { content: "🎄"; position: absolute; top: -14px; left: 14px; font-size: 1.6rem; }
h1::after { content: " 🍺"; font-size: .8em; }
h2::before { content: "✦ "; color: #e5b73b; font-size: .8em; }
.beerlist li::after { content: "⭐"; position: absolute; top: -7px; left: -5px; font-size: .9rem; opacity: .9; }
.beerlist li.done::after { content: "🎁"; }
.nr { background: var(--amber); color: #fff; }
.btn { box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.btn.ghost { color: var(--text); }
.notice.ok { color: #2f4a2b; } .notice.err { color: #5a2a26; }
.tbl tr.record td { background: var(--hl); }
dialog::backdrop { background: rgba(23,48,79,.45); }

/* Mørkere bakgrunn */
body { background: linear-gradient(180deg, var(--bg-a) 0%, var(--bg-b) 55%, var(--bg-c) 100%) fixed; }

/* Ølskum i bunnen av headeren */
/* Midtstilt i det grønne feltet: julelysene dekker de nederste 4 px */
.top { padding-top: 14px; padding-bottom: 18px; }
@media (max-width: 600px) { .top { padding-top: 15px; padding-bottom: 17px; } } /* menylenkene har egen padding */
.top::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 16px; pointer-events: none;
  background:
    radial-gradient(circle at 12px 0, #fffdf5 11px, transparent 12px) 0 0 / 34px 16px repeat-x,
    radial-gradient(circle at 30px 0, #fff6d9 8px, transparent 9px) 0 0 / 46px 13px repeat-x,
    radial-gradient(circle at 20px 0, #ffffff 10px, transparent 11px) 0 0 / 58px 17px repeat-x;
  filter: drop-shadow(0 2px 2px rgba(23,48,79,.25));
}

/* Footer */
main { padding-bottom: 24px; }
.foot { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; padding: 8px 16px 28px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; font-size: .8rem; color: var(--muted); }

/* Footer med bakgrunn (gran, som topplinjen) */
.foot { max-width: none; margin: 24px 0 0; padding: 14px max(16px, calc((100% - 640px) / 2)) calc(16px + env(safe-area-inset-bottom));
  background: var(--top); color: var(--top-text); border-top: 3px solid var(--gold); box-shadow: 0 -3px 10px rgba(23,48,79,.2); }

/* Footer alltid nederst */
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
main { width: 100%; flex: 1 0 auto; }
.foot { flex: none; margin-top: 24px; }

/* Terning og tall på samme linje/grunnlinje */
.mine { display: flex; align-items: center; gap: 8px; }
.mine .die { font-size: 1.7em; line-height: 1; display: inline-flex; align-items: center; transform: translateY(-1px); }

/* Like knapper med svak gradient */
.btn { min-width: 92px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center;
  background-image: linear-gradient(180deg, rgba(255,255,255,.22), rgba(0,0,0,.10)); }
.btn.small { min-width: 92px; min-height: 36px; }
.btn.big { min-width: 0; min-height: 52px; }
.btn.ghost { background-color: var(--card); background-image: linear-gradient(180deg, #fff, var(--ghost-b)); }
.btn.danger.ghost { background-image: linear-gradient(180deg, #fff, #f6e4e6); }
.btn:hover { background-image: linear-gradient(180deg, rgba(255,255,255,.28), rgba(0,0,0,.06)); }
.beerlist .side .btn, .beerlist .side form { width: 100%; }

/* Nummer på grønt juletre */
.nr { width: 44px; height: 52px; border-radius: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 48'%3E%3Crect x='17' y='39' width='6' height='8' rx='1' fill='%237a4b24'/%3E%3Cpath d='M20 6 33 20h-6l9 12H25l11 9H4l11-9H9l9-12h-6z' fill='%232f8f5b' stroke='%231f5a46' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='M20 1l1.9 3.9 4.3.6-3.1 3 .7 4.3L20 10.8l-3.8 2 .7-4.3-3.1-3 4.3-.6z' fill='%23ffd34d'/%3E%3C/svg%3E") center / contain no-repeat;
  color: #fff; font-size: 1.1rem; font-weight: 800; padding-top: 16px; text-shadow: 0 1px 1px rgba(0,0,0,.45); }

/* Bokser så tekst står frem mot bakgrunnen */
.hero h1 { margin: 0 0 6px; }
.hero::after { display: none; }
.hero .who { justify-content: flex-start; gap: 12px; flex-wrap: wrap; }
p.card.intro { margin: 12px 0; }
main > h1 { background: rgba(255,255,255,.9); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 16px; box-shadow: 0 2px 12px rgba(23,48,79,.12); }
main > p:not(.card) { background: rgba(255,255,255,.85); border-radius: var(--r); padding: 10px 14px; }

/* Forskjellige snøfnugg i bakgrunnen (ligger over ølflaskene) */
:root { --snow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 320' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg transform='translate(50 50) scale(1.3)'%3E%3Cg transform='rotate(0)'%3E%3Cpath d='M0 -18V18'/%3E%3Cpath d='M-5 -12 0 -7 5 -12M-5 12 0 7 5 12'/%3E%3C/g%3E%3Cg transform='rotate(60)'%3E%3Cpath d='M0 -18V18'/%3E%3Cpath d='M-5 -12 0 -7 5 -12M-5 12 0 7 5 12'/%3E%3C/g%3E%3Cg transform='rotate(120)'%3E%3Cpath d='M0 -18V18'/%3E%3Cpath d='M-5 -12 0 -7 5 -12M-5 12 0 7 5 12'/%3E%3C/g%3E%3C/g%3E%3Cg transform='translate(220 70) scale(.8)'%3E%3Cg transform='rotate(0)'%3E%3Cpath d='M0 -18V18'/%3E%3C/g%3E%3Cg transform='rotate(60)'%3E%3Cpath d='M0 -18V18'/%3E%3C/g%3E%3Cg transform='rotate(120)'%3E%3Cpath d='M0 -18V18'/%3E%3C/g%3E%3Ccircle r='4' fill='%23fff'/%3E%3C/g%3E%3Cg transform='translate(130 140) scale(1)'%3E%3Cpath d='M0 -16 4 -4 16 0 4 4 0 16-4 4-16 0-4-4z' fill='%23fff' fill-opacity='.7'/%3E%3C/g%3E%3Cg transform='translate(270 200) scale(1.1)'%3E%3Cg transform='rotate(0)'%3E%3Cpath d='M0 -18V18'/%3E%3Cpath d='M-5 -12 0 -7 5 -12M-5 12 0 7 5 12'/%3E%3C/g%3E%3Cg transform='rotate(60)'%3E%3Cpath d='M0 -18V18'/%3E%3Cpath d='M-5 -12 0 -7 5 -12M-5 12 0 7 5 12'/%3E%3C/g%3E%3Cg transform='rotate(120)'%3E%3Cpath d='M0 -18V18'/%3E%3Cpath d='M-5 -12 0 -7 5 -12M-5 12 0 7 5 12'/%3E%3C/g%3E%3Ccircle r='6'/%3E%3C/g%3E%3Cg transform='translate(60 240) scale(.9)'%3E%3Cpath d='M-14 -8 0 -16 14 -8V8L0 16-14 8z'/%3E%3Cpath d='M0 -16V16M-14 -8 14 8M14 -8-14 8'/%3E%3C/g%3E%3Cg fill='%23fff' stroke='none'%3E%3Ccircle cx='170' cy='250' r='3'/%3E%3Ccircle cx='20' cy='150' r='2.5'/%3E%3Ccircle cx='300' cy='120' r='2.5'/%3E%3Ccircle cx='180' cy='20' r='3'/%3E%3Ccircle cx='110' cy='290' r='2'/%3E%3Ccircle cx='245' cy='290' r='2'/%3E%3C/g%3E%3C/svg%3E"); }
html::before, html::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: var(--snow); background-repeat: repeat; animation: snow 22s linear infinite; }
html::before { background-size: 360px 360px; opacity: .85; }
html::after { background-size: 220px 220px; background-position: 110px 70px; opacity: .55; animation-duration: 34s; }
@media (prefers-reduced-motion: reduce) { html::before, html::after { animation: none; } }

/* Ølstyrt-rad: lik høyde og linje på felt og knapper, ur-ikon på tidsknappen */
.entry { align-items: center; }
.entry input[name^=name_], .entry .btn.btn { height: 48px; min-height: 48px; margin: 0; }
.entry .timebtn { min-width: 118px; gap: 6px; white-space: nowrap; }
.timebtn::before { content: "⏱"; font-size: 1.05em; line-height: 1; }
.entry .btn.btn.danger { min-width: 48px; width: 48px; padding: 0; }

/* Snurrehjul: høyere kontrast */
.d-outer { fill: #F5EFE6; stroke: #3F5134; stroke-width: 3; }
.d-ring { fill: #3a1c14; }
.d-tick { stroke: #F5EFE6; stroke-width: 5; }
.d-center { fill: #3F5134; stroke: #F5EFE6; stroke-width: 3; }
.d-handle { fill: #FFD98A; stroke: #F5EFE6; stroke-width: 4; }
.d-time { fill: #fff; font-weight: 800; } .d-sub { fill: #E8DCC8; }
.fine.step { grid-template-columns: repeat(2, 1fr); gap: 10px; }
.fine.step button { font-size: 1.1rem; font-weight: 700; padding: 14px 0; }

/* Snurrehjul 2: tydelig gult håndtak, tid under navn, Lagre i midten */
.d-handle { fill: #FFD21F; stroke: #3a1c14; stroke-width: 4; filter: drop-shadow(0 0 3px rgba(255,210,31,.9)); }
.d-save { cursor: pointer; } .d-save:hover .d-center, .d-save:focus-visible .d-center { fill: #4d6640; }
.d-save text { pointer-events: none; }
.d-time { font-size: 30px; } .d-sub { font-size: 17px; font-weight: 600; }
dialog h2 { margin: 0; } dialog h2::before { display: none; }
.dial-time { font: 800 2.2rem/1.2 system-ui, sans-serif; font-variant-numeric: tabular-nums; color: var(--amber); margin: 2px 0 6px; white-space: pre; }
