/* Paper Witches themes for the phone controller and the landing page.
   Each theme is one set of color tokens on <html data-theme="...">. Classic is the default.
   The pop-up spellbook stays in every theme: thick outlines, offset shadows, Lilita One shouting. */
:root {
  --bg: #2a1f3d; --edge: #fffaf0; --cream: #f6ead2; --ink: #2b2233; --line: #2b2233; --field: #fff;
  --label: #5a2d6e; --muted: #6e6275; --bad: #c0392b; --gold: #f5c542; --on-gold: #2b2233; --sky: #8fd3ff; --on-sky: #2b2233;
  --hi: #fff3c4; --accent: #9b5be0; --title: #f5c542; --title-line: #2b2233; --shadow: rgba(0,0,0,.35);
  --pad-bg: rgba(255,255,255,.06); --pad-line: rgba(255,255,255,.25); --preview: #fff3c4; --bw: 3px;
}
:root[data-theme="midnight"] {
  --bg: #0f1226; --edge: #ece9ff; --cream: #1e2244; --ink: #f1ecff; --line: #9a94e0; --field: #13162f;
  --label: #c3b2ff; --muted: #b0acd2; --bad: #ff9a9a; --gold: #f5c542; --on-gold: #1b1530; --sky: #86ccff; --on-sky: #0f1530;
  --hi: #34386e; --accent: #c39cf5; --title: #f5c542; --title-line: #05060f; --shadow: rgba(0,0,0,.6);
  --pad-bg: rgba(255,255,255,.05); --pad-line: rgba(200,190,255,.35); --preview: #e9e2ff;
}
:root[data-theme="parchment"] {
  --bg: #efe3c8; --edge: #3b2a1a; --cream: #fff8e8; --ink: #3b2a1a; --line: #3b2a1a; --field: #fffdf6;
  --label: #7a3b12; --muted: #6a5640; --bad: #a8281c; --gold: #e8b23a; --on-gold: #3b2a1a; --sky: #a6d6cf; --on-sky: #2a2a1a;
  --hi: #ffe9b0; --accent: #8a4fc0; --title: #c4521f; --title-line: #3b2a1a; --shadow: rgba(59,42,26,.3);
  --pad-bg: rgba(59,42,26,.06); --pad-line: rgba(59,42,26,.4); --preview: #fff1c9;
}
:root[data-theme="neon"] {
  --bg: #07050f; --edge: #f4f1ff; --cream: #160f2b; --ink: #f4f1ff; --line: #ff3fd0; --field: #0c0818;
  --label: #5ff6ff; --muted: #c0b6e6; --bad: #ff7b98; --gold: #ffe94a; --on-gold: #140b00; --sky: #3ff3ff; --on-sky: #04121a;
  --hi: #2e1856; --accent: #ff3fd0; --title: #3ff3ff; --title-line: #ff3fd0; --shadow: rgba(255,63,208,.4);
  --pad-bg: rgba(63,243,255,.05); --pad-line: rgba(63,243,255,.5); --preview: #efe6ff;
}
:root[data-theme="forest"] {
  --bg: #1f3324; --edge: #f2efd8; --cream: #efe6c9; --ink: #2a2418; --line: #2a2418; --field: #fffbea;
  --label: #3b6329; --muted: #635d48; --bad: #a33520; --gold: #f0b84a; --on-gold: #2a2418; --sky: #a9d98f; --on-sky: #1d2a16;
  --hi: #fbe9b5; --accent: #5f9c3e; --title: #f0b84a; --title-line: #14200f; --shadow: rgba(0,0,0,.38);
  --pad-bg: rgba(255,255,255,.06); --pad-line: rgba(242,239,216,.32); --preview: #f6edcc;
}
:root[data-theme="pastel"] {
  --bg: #efe4ff; --edge: #463a5e; --cream: #ffffff; --ink: #463a5e; --line: #463a5e; --field: #fff;
  --label: #7b4fb8; --muted: #6c617c; --bad: #b72d50; --gold: #ffd6a5; --on-gold: #463a5e; --sky: #bde0fe; --on-sky: #463a5e;
  --hi: #fdf0d5; --accent: #b07de8; --title: #ff9fc8; --title-line: #463a5e; --shadow: rgba(70,58,94,.22);
  --pad-bg: rgba(70,58,94,.05); --pad-line: rgba(70,58,94,.32); --preview: #fdf0d5;
}
:root[data-theme="contrast"] {
  --bg: #000; --edge: #fff; --cream: #fff; --ink: #000; --line: #000; --field: #fff;
  --label: #000; --muted: #1a1a1a; --bad: #a00000; --gold: #ffd400; --on-gold: #000; --sky: #00e5ff; --on-sky: #000;
  --hi: #ffd400; --accent: #000; --title: #ffd400; --title-line: #000; --shadow: rgba(255,255,255,0);
  --pad-bg: #000; --pad-line: #fff; --preview: #fff; --bw: 4px;
}
:root[data-theme="contrast"] .card, :root[data-theme="contrast"] button { outline: 2px solid #fff; }

input::placeholder { color: var(--muted); opacity: .85; }

/* The theme picker: a palette button and a sheet of swatches. */
.themebtn { font-family: "Lilita One", sans-serif; font-size: 18px; min-width: 44px; min-height: 44px; padding: 4px 12px; border: var(--bw) solid var(--line); border-radius: 12px;
  background: var(--cream); color: var(--ink); box-shadow: 3px 5px 0 var(--shadow); cursor: pointer; touch-action: manipulation; }
.themesheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.55); touch-action: pan-y; }
.themesheet[hidden] { display: none; }
.themesheet .card { width: 100%; max-width: 420px; max-height: 100%; overflow-y: auto; }
.themesheet h2 { font-family: "Lilita One", sans-serif; font-weight: 400; margin: 0 0 10px; font-size: 24px; text-align: center; color: var(--ink); }
.themesheet .opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.themesheet .opt { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 10px; text-align: left; font-size: 17px; }
.themesheet .opt.on { outline: 3px solid var(--accent); outline-offset: 2px; }
.themesheet .sw { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 2px solid #000; box-shadow: inset 0 0 0 2px #fff; }
.themesheet .close { width: 100%; margin-top: 12px; padding: 10px; font-size: 20px; background: var(--gold); color: var(--on-gold); }
