/* cooked.fun — gedeelde stijl.
   Eén donkere look, bewust: nacht-basis, gloed in vuurkleuren, "liquid glass"-panelen.
   Layout: één kolom van max 480px (app-gevoel), ook op desktop, met de gloed over het hele scherm. */

:root {
  --night: #05060a;
  --ink: #f4f1ec;
  --mute: rgba(244, 241, 236, .66);
  --faint: rgba(244, 241, 236, .42);
  --line: rgba(255, 255, 255, .09);
  --ember: #ff6a2b;
  --flame: #ffb02e;
  --blood: #ff3b4e;
  --clean: #35e0a1;
  --violet: #b4a6ff;
  --display: "Bricolage Grotesque", "Inter Tight", system-ui, sans-serif;
  --body: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --spring: cubic-bezier(.2, .9, .25, 1.15);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --r-lg: 26px;
  --r-md: 20px;
  --r-sm: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--night); }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--night); color: var(--ink);
  font-family: var(--body); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { text-wrap: balance; }

/* ---------- Achtergrond ---------- */
.aura { position: fixed; inset: -20%; z-index: -2; filter: blur(70px) saturate(130%); pointer-events: none; }
.aura i { position: absolute; border-radius: 50%; mix-blend-mode: screen; }
.aura .b1 { width: 70%; height: 45%; left: 5%; top: 4%; background: radial-gradient(circle, rgba(255,106,43,.5), transparent 65%); animation: drift1 18s ease-in-out infinite alternate; }
.aura .b2 { width: 60%; height: 40%; right: 0; top: 24%; background: radial-gradient(circle, rgba(255,59,78,.34), transparent 65%); animation: drift2 22s ease-in-out infinite alternate; }
.aura .b3 { width: 70%; height: 45%; left: 15%; bottom: 0; background: radial-gradient(circle, rgba(53,224,161,.14), transparent 65%); animation: drift3 26s ease-in-out infinite alternate; }
.aura.calm .b1 { opacity: .55; } .aura.calm .b2 { opacity: .5; }
@keyframes drift1 { to { transform: translate(18%, 10%) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-20%, 14%) scale(.9); } }
@keyframes drift3 { to { transform: translate(10%, -18%) scale(1.1); } }
.grain { position: fixed; inset: 0; z-index: -1; opacity: .06; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ---------- Pagina-opbouw ---------- */
.wrap {
  max-width: 480px; margin: 0 auto;
  padding-block: calc(14px + env(safe-area-inset-top, 0px)) calc(40px + env(safe-area-inset-bottom, 0px));
  padding-left: max(18px, env(safe-area-inset-left, 0px));
  padding-right: max(18px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 14px;
}
.wrap > * { flex: none; }
.wrap.has-tabs { padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px)); }
.topbar { display: flex; justify-content: space-between; align-items: center; min-height: 48px; }
.logo { font: 800 20px var(--display); letter-spacing: -0.03em; text-decoration: none; }
.logo span { background: linear-gradient(90deg, var(--flame), var(--ember)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.quiet { color: var(--mute); font-size: 14px; font-weight: 600; text-decoration: none; padding: 10px 2px; }
.quiet:hover { color: var(--ink); }

/* ---------- Glas ---------- */
.glass {
  position: relative; border-radius: var(--r-lg);
  background: linear-gradient(160deg, rgba(255,255,255,.09), rgba(255,255,255,.025));
  backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), inset 0 0 0 1px rgba(255,255,255,.06), 0 10px 30px rgba(0,0,0,.35);
}
.glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, rgba(255,255,255,.35), rgba(255,255,255,0) 35%, rgba(255,255,255,0) 70%, rgba(255,176,46,.25));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.panel { padding: 18px; }

/* ---------- Typografie ---------- */
.display { font-family: var(--display); font-weight: 800; letter-spacing: -0.045em; line-height: .98; margin: 0; }
h1.display { font-size: clamp(42px, 12vw, 58px); }
.heat { background: linear-gradient(180deg, #fff 30%, #ffcf9f); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fire { background: linear-gradient(90deg, var(--flame), var(--ember) 55%, var(--blood)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bloody { background: linear-gradient(180deg, #ff9a9a, var(--blood)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { color: var(--mute); font-size: 17px; margin: 0; max-width: 40ch; }
.fine { color: var(--faint); font-size: 13.5px; margin: 0; }
.fine b { color: var(--mute); }
.eyebrow { color: var(--faint); font-size: 13px; font-weight: 700; margin: 8px 4px -4px; }
.error { color: #ff8a8a; font-weight: 600; font-size: 14.5px; margin: 0; }

/* ---------- Iconen ---------- */
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.sm { width: 16px; height: 16px; }
svg.i.lg { width: 24px; height: 24px; }

/* ---------- Knoppen ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 22px; border: 0; border-radius: 18px; cursor: pointer; text-decoration: none;
  font: 700 16px var(--body); letter-spacing: -0.01em; transition: transform .18s var(--ease), filter .18s, opacity .18s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.block { width: 100%; }
.btn.fire-btn { color: #1a0a03; background: linear-gradient(120deg, var(--flame), var(--ember)); box-shadow: 0 12px 30px rgba(255,106,43,.35), inset 0 1px 0 rgba(255,255,255,.45); }
.btn.fire-btn:hover { filter: brightness(1.06); }
.btn.clean-btn { color: #04150d; background: linear-gradient(120deg, #35e0a1, #1fbf86); box-shadow: 0 10px 26px rgba(53,224,161,.3), inset 0 1px 0 rgba(255,255,255,.4); }
.btn.glass { color: var(--ink); }
.btn.glass:hover { background: linear-gradient(160deg, rgba(255,255,255,.13), rgba(255,255,255,.04)); }
.btn.danger { color: #fff; background: linear-gradient(120deg, #ff3b4e, #ff6a2b 55%, #ff3b4e); background-size: 200% 100%; box-shadow: 0 12px 30px rgba(255,59,78,.4), inset 0 1px 0 rgba(255,255,255,.35); }
.linkbtn { background: none; border: 0; padding: 10px 0; color: var(--mute); font-size: 14.5px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkbtn:hover { color: var(--ink); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > .btn { flex: 1 1 140px; }

/* Paniekknop */
.panic { position: relative; height: 64px; width: 100%; border: 0; border-radius: 20px; cursor: pointer; color: #fff; font: 700 17.5px var(--body);
  display: flex; align-items: center; justify-content: center; gap: 10px; overflow: visible;
  background: linear-gradient(120deg, #ff3b4e, #ff6a2b 55%, #ff3b4e); background-size: 200% 100%; animation: sheen 6s linear infinite;
  box-shadow: 0 12px 30px rgba(255,59,78,.4), inset 0 1px 0 rgba(255,255,255,.35); transition: transform .18s var(--ease); }
.panic::after { content: ""; position: absolute; inset: 0; border-radius: inherit; animation: pulse 2.6s ease-out infinite; pointer-events: none; }
.panic:active { transform: scale(.97); }
@keyframes sheen { to { background-position: -200% 0; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,59,78,.5); } 70%, 100% { box-shadow: 0 0 0 16px rgba(255,59,78,0); } }

/* ---------- Invoer ---------- */
.field { min-width: 0; max-width: 100%; display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 16px; border-radius: 20px; }
.field input { flex: 1 1 0; width: 0; min-width: 0; height: 48px; border: 0; background: transparent; color: var(--ink); font: 500 16px var(--body); outline: none; }
.field input::placeholder { color: var(--faint); }
.field .btn { min-height: 48px; border-radius: 15px; padding: 0 18px; }
.field:focus-within { box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 0 0 2px rgba(255,176,46,.55), 0 10px 30px rgba(0,0,0,.35); }
label.lbl { display: block; font-size: 13px; font-weight: 700; color: var(--mute); margin: 0 4px 8px; }

/* ---------- Chips & opties ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 0; padding: 11px 15px; border-radius: 99px; font-size: 14.5px; font-weight: 600; cursor: pointer; min-height: 44px; transition: transform .15s var(--ease); }
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"] { color: #1a0a03; background: linear-gradient(120deg, var(--flame), var(--ember)); box-shadow: 0 6px 18px rgba(255,106,43,.35); }
.chip[aria-pressed="true"]::before { display: none; }
.opts { display: grid; gap: 10px; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; border: 0; padding: 18px; border-radius: 20px; cursor: pointer; font-size: 17px; font-weight: 600; min-height: 60px; transition: transform .15s var(--ease); }
.opt:active { transform: scale(.98); }
.opt .tick { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--faint); display: grid; place-items: center; flex: none; }
.opt[aria-pressed="true"] { background: linear-gradient(160deg, rgba(255,140,60,.28), rgba(255,80,60,.12)); }
.opt[aria-pressed="true"] .tick { border-color: var(--flame); background: var(--flame); color: #1a0a03; }

/* ---------- Statistieken ---------- */
.stats { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 10px; }
.stat { padding: 14px 14px 12px; border-radius: var(--r-md); min-width: 0; }
.stat b { display: block; font: 800 22px var(--display); letter-spacing: -0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat b.clean { color: var(--clean); }
.stat b.red { color: #ff7a7a; }
.stat span { color: var(--mute); font-size: 12.5px; font-weight: 600; }
.stats.two { grid-template-columns: 1fr 1fr; }

/* Lijst-rijen */
.list { display: grid; }
.list > * + * { border-top: 1px solid var(--line); }
.li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 0; min-height: 50px; }
.li > span:first-child { color: var(--mute); }
.li > span:last-child { font-weight: 700; text-align: right; }
.neg { color: #ff7a7a; }
.pos { color: var(--clean); }

/* Kaart-rij (knop) */
.rowcard { display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center; padding: 14px; border: 0; width: 100%; text-align: left; cursor: pointer; transition: transform .2s var(--ease); }
.rowcard:active { transform: scale(.98); }
.badge { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; }
.badge.learn { background: linear-gradient(140deg, rgba(53,224,161,.35), rgba(53,224,161,.08)); color: #7af0c3; }
.badge.sponsor { background: linear-gradient(140deg, rgba(160,140,255,.38), rgba(160,140,255,.08)); color: #c6bbff; }
.badge.fire { background: linear-gradient(140deg, rgba(255,140,60,.4), rgba(255,80,60,.1)); color: #ffc58a; }
.badge.red { background: linear-gradient(140deg, rgba(255,59,78,.4), rgba(255,59,78,.1)); color: #ff9a9a; }
.rowcard .t { font-weight: 700; font-size: 15.5px; }
.rowcard .s { color: var(--mute); font-size: 13px; }
.chev { color: var(--faint); }

/* ---------- Ring ---------- */
.ringbox { display: grid; place-items: center; gap: 10px; }
.ring { position: relative; width: min(250px, 70vw); aspect-ratio: 1; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ring .track { fill: none; stroke: rgba(255,255,255,.07); stroke-width: 16; }
.ring .fill { fill: none; stroke-width: 16; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset 1.6s var(--ease) .2s; filter: drop-shadow(0 0 10px rgba(255,120,40,.65)); }
.ring .spark { fill: #fff; filter: drop-shadow(0 0 8px #ffb02e); opacity: 0; transition: opacity .3s 1.6s; }
.ring .center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .big { font: 800 clamp(72px, 22vw, 96px)/.9 var(--display); letter-spacing: -0.06em; }
.ring .lbl { color: var(--mute); font-weight: 600; font-size: 15px; margin-top: 4px; }
.pill { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; font-weight: 700; padding: 6px 11px; border-radius: 99px; }
.pill.fire { color: var(--flame); background: rgba(255,176,46,.12); border: 1px solid rgba(255,176,46,.25); }
.pill.clean { color: var(--clean); background: rgba(53,224,161,.12); border: 1px solid rgba(53,224,161,.25); }
.pill.red { color: #ff8a8a; background: rgba(255,59,78,.12); border: 1px solid rgba(255,59,78,.28); }

/* Week */
.week { padding: 14px; display: grid; gap: 10px; }
.week .h { display: flex; justify-content: space-between; font-size: 13px; color: var(--mute); font-weight: 600; }
.week .h b { color: var(--ink); }
.dots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.dot { aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--faint); background: rgba(255,255,255,.05); }
.dot.on { color: #1a0a03; background: linear-gradient(160deg, var(--flame), var(--ember)); box-shadow: 0 4px 14px rgba(255,106,43,.35); }
.dot.slip { color: #fff; background: linear-gradient(160deg, #ff6b7a, var(--blood)); }
.dot.today { outline: 2px solid rgba(255,176,46,.6); outline-offset: 2px; }

/* ---------- Tabbalk ---------- */
.tabbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); width: min(452px, calc(100% - 28px)); height: 70px; border-radius: 26px;
  display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px; z-index: 30; }
.tab { border: 0; background: none; color: var(--faint); display: grid; place-items: center; align-content: center; gap: 3px; font: 600 11.5px var(--body); cursor: pointer; border-radius: 20px; position: relative; transition: color .2s; }
.tab svg.i { width: 23px; height: 23px; }
.tab[aria-selected="true"] { color: var(--ink); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; inset: 4px 6px; border-radius: 18px; background: rgba(255,255,255,.08); box-shadow: inset 0 1px 0 rgba(255,255,255,.12); z-index: -1; }
.view[hidden] { display: none !important; }
.view { display: flex; flex-direction: column; gap: 14px; }
.view > * { flex: none; }

/* ---------- Sheets ---------- */
.scrim { position: fixed; inset: 0; background: rgba(5,6,10,.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: opacity .35s var(--ease); z-index: 40; }
.scrim.show { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; left: 50%; bottom: 0; width: min(480px, 100%); max-height: 92vh; max-height: 92dvh; z-index: 50; overflow-y: auto;
  transform: translate(-50%, 105%); transition: transform .55s var(--spring); border-radius: 34px 34px 0 0;
  background: linear-gradient(180deg, rgba(30,14,10,.86), rgba(8,9,14,.95)); backdrop-filter: blur(30px) saturate(140%); -webkit-backdrop-filter: blur(30px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 -20px 60px rgba(0,0,0,.5);
  padding: 10px 22px calc(26px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 12px; }
.sheet.show { transform: translate(-50%, 0); }
.sheet .grab { width: 40px; height: 5px; border-radius: 9px; background: rgba(255,255,255,.25); margin: 4px auto 6px; flex: none; }
.sheet h2 { font: 800 30px/1.05 var(--display); letter-spacing: -0.03em; margin: 0; text-align: center; }
.sheet .sub { color: var(--mute); text-align: center; font-size: 15px; margin: 0 auto; max-width: 32ch; }
.sheet.small h2 { font-size: 24px; }

.orb { position: relative; width: 200px; height: 200px; margin: 10px auto; display: grid; place-items: center; flex: none; }
.orb i { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffd59a, #ff6a2b 45%, #a3122a 85%); box-shadow: 0 0 60px rgba(255,106,43,.55); transform: scale(.6); animation: breathe 10s ease-in-out infinite; }
.orb i:nth-child(2) { background: none; border: 1px solid rgba(255,176,46,.35); box-shadow: none; animation-delay: -.4s; transform: scale(.75); }
.orb span { position: relative; font: 700 17px var(--body); text-shadow: 0 1px 12px rgba(0,0,0,.4); }
@keyframes breathe { 0%, 100% { transform: scale(.6); } 40%, 60% { transform: scale(1); } }
.cost { text-align: center; }
.cost p { margin: 0; color: var(--mute); font-size: 14px; }
.cost b { display: block; font: 800 48px/1 var(--display); letter-spacing: -0.04em; margin-top: 4px; }
.msg { min-height: 20px; text-align: center; color: var(--clean); font-size: 14px; font-weight: 600; margin: 0; }

/* Toast */
.toast { position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top, 0px)); transform: translate(-50%, -20px); opacity: 0; padding: 12px 18px; border-radius: 18px;
  font-size: 14.5px; font-weight: 600; z-index: 60; transition: all .35s var(--spring); max-width: calc(100% - 32px); pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Kaart-preview */
.cardimg { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; border-radius: 18px; background: rgba(255,255,255,.04); }

/* Binnenkomst */
.rise { opacity: 0; transform: translateY(14px); animation: rise .7s var(--ease) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
.pop { animation: popin .6s var(--spring); }
@keyframes popin { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }

/* Focus */
.btn:focus-visible, .chip:focus-visible, .opt:focus-visible, .tab:focus-visible, .rowcard:focus-visible, .linkbtn:focus-visible, .panic:focus-visible, a:focus-visible { outline: 2px solid var(--flame); outline-offset: 3px; }

.footer { color: var(--faint); font-size: 13px; text-align: center; padding: 18px 8px 0; }
.footer a { color: var(--mute); }

@media (prefers-reduced-motion: reduce) {
  .aura i, .panic, .panic::after, .orb i { animation: none !important; }
  .rise, .pop { animation: none; opacity: 1; transform: none; }
  .ring .fill, .sheet, .toast { transition: none; }
}

form, .walletcard, .walletcard > * { min-width: 0; }
.walletcard { overflow: hidden; }

[hidden] { display: none !important; }

/* "Zet op beginscherm"-balkje */
.a2hs { position: fixed; left: 50%; width: min(452px, calc(100% - 28px)); z-index: 40; display: grid; grid-template-columns: 54px 1fr 36px; gap: 14px; align-items: center;
  padding: 14px; border-radius: 24px; transform: translate(-50%, 30px); opacity: 0; transition: all .45s var(--spring); }
.a2hs.show { transform: translate(-50%, 0); opacity: 1; }
.a2hs img { width: 54px; height: 54px; border-radius: 14px; box-shadow: 0 6px 18px rgba(255,106,43,.25); }
.a2hs .t { display: block; font: 800 17px var(--display); letter-spacing: -0.01em; margin-bottom: 2px; }
.a2hs p { margin: 0; color: var(--mute); font-size: 14px; line-height: 1.45; }
.a2hs p b { color: var(--ink); }
.a2hs p .i { width: 16px; height: 16px; vertical-align: -3px; color: var(--flame); }
.a2hs .btn { min-height: 38px; padding: 0 16px; margin-top: 8px; font-size: 14px; }
.a2hs .x { width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.08); color: var(--mute); display: grid; place-items: center; cursor: pointer; align-self: start; }
@media (prefers-reduced-motion: reduce) { .a2hs { transition: none; } }
