/* ===================== THEMES ===================== */
/* decorative layer that stays put while scrolling (iOS ignores background-attachment: fixed) */
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--deco, none); background-size: var(--deco-size, auto); }
body { background: var(--bg); }
.top, .tabbar { background: var(--bar, color-mix(in srgb, var(--bg) 88%, transparent)); }
.top { border-bottom: 0; }
.top::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--stripe, var(--line)); }
.card, .group, .yr-row, .yr-hero, .banner { border: 1px solid var(--card-border, transparent); }

/* ---- Movie Night (default): navy + stars + poster colors ---- */
:root[data-theme="night"] {
  color-scheme: dark;
  --bg: #121a3f; --card: #1d2655; --card-border: #2d3a7a; --text: #f6f7ff; --muted: #aeb4dc; --line: #34407f; --chip: #283370;
  --accent: #ff4f7b; --accent-text: #fff; --ok: #5fe0a0; --ok-bg: #173d3a; --warn: #ffc94d; --warn-bg: #43391a; --bad: #ff7a8a; --bad-bg: #4a1f36;
  --shadow: 0 4px 14px rgba(0,0,0,.25);
  --bar: rgba(18,26,63,.86);
  --stripe: linear-gradient(90deg, #e8345a, #f5b301, #1aa3b5, #8e44c9, #e8345a);
  --deco:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cg fill='%23fff'%3E%3Cpath opacity='.55' d='M30 18l2.2 6.8L39 27l-6.8 2.2L30 36l-2.2-6.8L21 27l6.8-2.2z'/%3E%3Ccircle opacity='.5' cx='120' cy='40' r='1.6'/%3E%3Ccircle opacity='.35' cx='160' cy='120' r='1.2'/%3E%3Ccircle opacity='.45' cx='70' cy='150' r='1.4'/%3E%3C/g%3E%3Cpath fill='%23f5b301' opacity='.6' d='M140 80l3.1 6.4 7 1-5.1 5 1.2 7-6.2-3.3-6.3 3.3 1.2-7-5.1-5 7.1-1z'/%3E%3Cpath fill='%23ff4f7b' opacity='.5' d='M50 95l2.5 5.2 5.7.8-4.1 4 1 5.7-5.1-2.7-5 2.7 1-5.7-4.1-4 5.6-.8z'/%3E%3Cpath fill='%231ac8db' opacity='.4' d='M100 125l1.6 4.9 5.1 1.6-5.1 1.6-1.6 4.9-1.6-4.9-5-1.6 5-1.6z'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at 0% 0%, rgba(232,52,90,.28), transparent 45%),
    radial-gradient(ellipse at 100% 30%, rgba(26,163,181,.25), transparent 45%),
    radial-gradient(ellipse at 20% 100%, rgba(142,68,201,.3), transparent 50%),
    #121a3f;
  --deco-size: 180px 180px, auto, auto, auto, auto;
}
:root[data-theme="night"] h1 { color: #fff; text-shadow: 2px 2px 0 #e8345a, 4px 4px 0 #f5b301; letter-spacing: .01em; font-weight: 900; }
:root[data-theme="night"] .chip.on { background: linear-gradient(135deg, #ff4f7b, #e8345a); }
:root[data-theme="night"] .tabbar .plus-ti,
:root[data-theme="night"] .btn:not(.ghost):not(.danger) { background: linear-gradient(135deg, #ff5f86, #e8345a); }
:root[data-theme="night"] .tabbar button.active { color: #ffc94d; }
:root[data-theme="night"] #sheet .panel { background: #161f4a; }
:root[data-theme="night"] .tile .cover { box-shadow: 0 4px 14px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.06); }
:root[data-theme="night"] #toast { background: #0b1030; border: 1px solid #34407f; }

/* ---- Sakura: pink + petals ---- */
:root[data-theme="sakura"] {
  color-scheme: light;
  --bg: #fff0f5; --card: rgba(255,255,255,.9); --card-border: #ffd3e2; --text: #3b1f2b; --muted: #9a6b7d; --line: #f6c9d8; --chip: #ffe1ec;
  --accent: #e2527f; --accent-text: #fff; --ok: #1f8a4c; --ok-bg: #e2f5e9; --warn: #9a6200; --warn-bg: #fff1d6; --bad: #c62828; --bad-bg: #fde4e4;
  --shadow: 0 3px 12px rgba(226,82,127,.12);
  --bar: rgba(255,240,245,.85);
  --stripe: linear-gradient(90deg, #ffb3cb, #e2527f, #ffd1a8, #ffb3cb);
  --deco:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cg fill='%23f78fb3' opacity='.35'%3E%3Cpath d='M40 30c6-10 18-8 18 2 0 8-10 12-18 18-8-6-18-10-18-18 0-10 12-12 18-2z'/%3E%3Cpath transform='rotate(35 160 120)' d='M160 110c4-7 13-6 13 1 0 6-7 9-13 13-6-4-13-7-13-13 0-7 9-8 13-1z'/%3E%3Cpath transform='rotate(-20 80 170)' d='M80 162c3-5 10-4 10 1 0 4-5 7-10 10-5-3-10-6-10-10 0-5 7-6 10-1z'/%3E%3C/g%3E%3Cg fill='%23ffc2d6' opacity='.5'%3E%3Ccircle cx='190' cy='40' r='3'/%3E%3Ccircle cx='120' cy='60' r='2'/%3E%3Ccircle cx='20' cy='120' r='2.5'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(160deg, #ffe4ee 0%, #fff4f8 45%, #f3e6ff 100%);
  --deco-size: 220px 220px, auto;
}
:root[data-theme="sakura"] h1 { color: #c93d6c; font-weight: 900; }

/* ---- Dreamy: pastel gradient + sparkles ---- */
:root[data-theme="dreamy"] {
  color-scheme: light;
  --bg: #efe9ff; --card: rgba(255,255,255,.82); --card-border: rgba(255,255,255,.95); --text: #241d3d; --muted: #6f6790; --line: #ddd3fb; --chip: rgba(255,255,255,.75);
  --accent: #7b5cff; --accent-text: #fff; --ok: #1f8a4c; --ok-bg: #e2f5e9; --warn: #9a6200; --warn-bg: #fff1d6; --bad: #c62828; --bad-bg: #fde4e4;
  --shadow: 0 4px 16px rgba(90,60,200,.12);
  --bar: rgba(244,240,255,.8);
  --stripe: linear-gradient(90deg, #a78bfa, #f9a8d4, #fcd34d, #67e8f9, #a78bfa);
  --deco:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cg fill='%23fff'%3E%3Cpath opacity='.9' d='M40 20l2.5 7.5L50 30l-7.5 2.5L40 40l-2.5-7.5L30 30l7.5-2.5z'/%3E%3Cpath opacity='.8' d='M150 110l1.8 5.2 5.2 1.8-5.2 1.8-1.8 5.2-1.8-5.2-5.2-1.8 5.2-1.8z'/%3E%3Ccircle opacity='.9' cx='100' cy='170' r='2'/%3E%3Ccircle opacity='.8' cx='170' cy='30' r='1.6'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(circle at 10% 10%, #ffd6ec 0, transparent 40%),
    radial-gradient(circle at 90% 25%, #c7f0ff 0, transparent 40%),
    radial-gradient(circle at 50% 95%, #ffe9b8 0, transparent 45%),
    linear-gradient(180deg, #e9e2ff, #f6efff);
  --deco-size: 200px 200px, auto, auto, auto, auto;
}
:root[data-theme="dreamy"] h1 { background: linear-gradient(90deg, #7b5cff, #e254a8); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 900; }

/* ---- Plain = the original clean look (no data-theme; follows light/dark mode) ---- */

/* decorative bits used in every theme */
.empty .deco-big { font-size: 50px; margin: 0 0 8px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.2)); }
.theme-swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.theme-swatches button { border: 2px solid transparent; border-radius: 12px; height: 64px; font-size: 12px; font-weight: 700; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.5); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; }
.theme-swatches button.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.yr-row { border: 2px dashed color-mix(in srgb, var(--dc, var(--line)) 60%, transparent); }
.yr-row.done { background: color-mix(in srgb, var(--dc, var(--card)) 12%, var(--card)); }
.view-deco { position: absolute; right: 16px; top: calc(env(safe-area-inset-top) + 12px); font-size: 26px; pointer-events: none; }
