/* ==========================================================
   THEMES: picked from the "theme" menu in the header, per visitor.
   Each theme sets the colour/font settings from styles.css (:root),
   plus a few touches of its own. "scrapbook" is the default
   (no rules needed: it's just styles.css).

   Themes: aero · midnight · vaporwave · retro · garden · terminal
   To add one: copy a block, rename it, and add an <option> to
   #theme-select in index.html.
   ========================================================== */


/* ==========================================================
   Y2K AERO: glossy sky, frosted glass, gel buttons, bubbles
   ========================================================== */
html[data-theme="aero"] {
  --paper: #e6f7ff;
  --card: rgba(255, 255, 255, 0.62);
  --ink: #0b3d66;
  --muted: #3d6d93;
  --pink: #ffcdea; --yellow: #fff3b5; --blue: #c3e9ff; --green: #ccf5c2; --lilac: #ddd9ff; --peach: #ffe2cc; --red: #e0455b;
  --line: 1px solid rgba(255, 255, 255, 0.95);
  --shadow: 0 10px 30px rgba(0, 90, 170, 0.22), inset 0 1px 0 #fff;
  --shadow-sm: 0 4px 14px rgba(0, 90, 170, 0.2), inset 0 1px 0 #fff;
  --shadow-xs: 0 2px 8px rgba(0, 90, 170, 0.18);
  --radius: 22px;
  --hand: "Nunito", system-ui, sans-serif;
  --field: rgba(255, 255, 255, 0.88);
  --note: rgba(255, 249, 205, 0.9);
  --letter: rgba(255, 255, 255, 0.92);
  --card-alt: rgba(255, 255, 255, 0.7);
  --shelf: rgba(255, 255, 255, 0.78);
  --store-wall: linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(200, 236, 255, 0.25));
  --dots: transparent;
}
html[data-theme="aero"] body {
  background:
    radial-gradient(ellipse 60% 40% at 15% 0%, rgba(255, 255, 255, 0.95) 0%, transparent 70%),
    radial-gradient(ellipse 70% 45% at 85% 100%, rgba(120, 225, 130, 0.75) 0%, transparent 70%),
    radial-gradient(ellipse 50% 35% at 0% 100%, rgba(60, 200, 160, 0.45) 0%, transparent 70%),
    linear-gradient(180deg, #5cc4ff 0%, #a8e4ff 38%, #e6faff 66%, #c9f3c0 100%);
  background-attachment: fixed;
}
html[data-theme="aero"] body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.95) 0 6%, rgba(255, 255, 255, 0.25) 7% 34%, rgba(255, 255, 255, 0.55) 35%, transparent 37%) 8% 72% / 90px 90px no-repeat,
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.95) 0 6%, rgba(255, 255, 255, 0.2) 7% 34%, rgba(255, 255, 255, 0.5) 35%, transparent 37%) 92% 40% / 140px 140px no-repeat,
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9) 0 6%, rgba(255, 255, 255, 0.2) 7% 34%, rgba(255, 255, 255, 0.5) 35%, transparent 37%) 70% 85% / 60px 60px no-repeat,
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9) 0 6%, rgba(255, 255, 255, 0.2) 7% 34%, rgba(255, 255, 255, 0.5) 35%, transparent 37%) 22% 18% / 46px 46px no-repeat,
    radial-gradient(circle at 78% 8%, rgba(255, 255, 255, 0.9) 0, rgba(255, 255, 255, 0) 18%);
  animation: aero-float 14s ease-in-out infinite alternate;
}
@keyframes aero-float { to { transform: translateY(-18px); } }
html[data-theme="aero"] .logo .hl {
  font-family: "Michroma", var(--body); font-size: 0.72em; letter-spacing: 0.04em;
  background: linear-gradient(180deg, #ffffff 0%, #bfe6ff 40%, #0f5aa3 50%, #2f8fd6 72%, #d6f2ff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 1px rgba(8, 50, 95, 0.35);
  filter: drop-shadow(0 2px 0 rgba(255, 255, 255, 0.9)) drop-shadow(0 6px 14px rgba(0, 70, 140, 0.45));
}
html[data-theme="aero"] .logo-sub { font-family: var(--body); font-weight: 600; font-size: 0.32em; letter-spacing: 0.08em; }
html[data-theme="aero"] h1, html[data-theme="aero"] h2, html[data-theme="aero"] h3, html[data-theme="aero"] h4 { font-weight: 800; letter-spacing: -0.01em; color: #0a4f8a; text-shadow: 0 1px 0 #fff; }
/* gel buttons: tabs, buttons, chips */
html[data-theme="aero"] :is(.tabs a, .btn, .chip, .tab-btn) {
  --r: 0deg;
  font-family: var(--body); font-weight: 700; color: #053a63; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
  border: 1px solid #2a86c7; border-radius: 999px;
  background: linear-gradient(180deg, #f2fbff 0%, #b5e4ff 48%, #5bbcf3 52%, #a8e6ff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -2px 6px rgba(0, 90, 170, 0.25), 0 3px 10px rgba(0, 90, 170, 0.3);
}
html[data-theme="aero"] .tabs a { font-size: 0.95rem; padding: 6px 18px; }
html[data-theme="aero"] :is(.tabs a[aria-current="page"], .btn.big, .chip[aria-pressed="true"], .tab-btn[aria-pressed="true"]) {
  transform: none; text-decoration: none; color: #0f3d0f; border-color: #3a9a3a;
  background: linear-gradient(180deg, #f4fff0 0%, #c4f2b0 48%, #6fcf4f 52%, #b6f29a 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -2px 6px rgba(40, 120, 40, 0.3), 0 3px 10px rgba(40, 140, 40, 0.35);
}
html[data-theme="aero"] .btn.ghost { background: linear-gradient(180deg, #ffffff 0%, #eef7ff 50%, #d6ecfb 51%, #f4fbff 100%); }
/* frosted glass panels everywhere */
html[data-theme="aero"] :is(.card, .qa, .fish-card, .me-item, .door, .unit, .store, .store-dialog, .edit-bar) {
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
}
html[data-theme="aero"] :is(.card, .door, .unit) { transform: none !important; }
html[data-theme="aero"] .card { border-radius: 24px; }
html[data-theme="aero"] .tape { display: none; }
html[data-theme="aero"] .door { background: linear-gradient(180deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.25) 50%, rgba(255, 255, 255, 0) 51%), var(--bg); border-radius: 22px; }
html[data-theme="aero"] .door:hover { transform: translateY(-4px) scale(1.02) !important; }
html[data-theme="aero"] :is(.door b, .polaroid b, .unit-sign, .ask-label, .me-hello, .excuse, .speed-box b, .arena-overlay p, .sig, .note-lead) { font-family: var(--body); font-weight: 800; }
html[data-theme="aero"] .marquee { transform: none; border: 0; border-radius: 999px; margin-inline: 0; background: linear-gradient(180deg, #8fdcff 0%, #2f9be0 50%, #1b7fc8 51%, #5ec2f5 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 6px 18px rgba(0, 90, 170, 0.3); }
html[data-theme="aero"] .marquee-track { font-family: var(--body); font-weight: 800; font-size: 1rem; color: #fff; text-shadow: 0 1px 2px rgba(0, 50, 100, 0.5); }
html[data-theme="aero"] .mini-stats dd { font-family: "Michroma", var(--body); font-size: 1.05rem; color: #0a4f8a; }
html[data-theme="aero"] .dot { background: #4fd34f; border-color: #1f7a1f; box-shadow: 0 0 10px #6dff6d; }
html[data-theme="aero"] .unit-sign { border-bottom: 1px solid rgba(255, 255, 255, 0.9); }
html[data-theme="aero"] .store-title { color: #0a4f8a; }
html[data-theme="aero"] .phone { border-color: #2a86c7; box-shadow: 0 14px 40px rgba(0, 90, 170, 0.3); }
html[data-theme="aero"] .edit-bar, html[data-theme="aero"] .edit-fab { background: linear-gradient(180deg, #2f9be0, #0f5f9e); color: #fff; }


/* ==========================================================
   MIDNIGHT: dark mode with neon edges
   ========================================================== */
html[data-theme="midnight"] {
  color-scheme: dark;
  --paper: #0f0c1a;
  --card: #1c1730;
  --ink: #efe8ff;
  --muted: #a99cc9;
  --pink: #8c2a6c; --yellow: #7a5d00; --blue: #1f4c88; --green: #1c6542; --lilac: #4a3a92; --peach: #8f4423; --red: #ff6b8a;
  --line: 2px solid #efe8ff;
  --shadow: 4px 4px 0 #ff4fd8;
  --shadow-sm: 3px 3px 0 #ff4fd8;
  --shadow-xs: 2px 2px 0 #ff4fd8;
  --field: #141024;
  --note: #3a3112;
  --letter: #241f38;
  --card-alt: #241a36;
  --shelf: #191427;
  --store-wall: repeating-linear-gradient(90deg, #15112a 0 44px, #19142f 44px 88px);
  --dots: rgba(255, 255, 255, 0.08);
}
html[data-theme="midnight"] body {
  background:
    radial-gradient(1px 1px at 20% 30%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 70% 20%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 40% 80%, #c9b8ff 50%, transparent 51%),
    radial-gradient(1px 1px at 85% 65%, #fff 50%, transparent 51%),
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(120, 60, 255, 0.25), transparent 70%),
    #0f0c1a;
  background-size: 240px 240px, 300px 300px, 360px 360px, 280px 280px, 100% 100%, auto;
  background-attachment: fixed;
}
html[data-theme="midnight"] .logo .hl { text-shadow: 0 0 12px rgba(255, 79, 216, 0.7); }
html[data-theme="midnight"] :is(h1, h2, h3) { text-shadow: 0 0 14px rgba(150, 120, 255, 0.45); }
html[data-theme="midnight"] .marquee { background: #000; border-color: #ff4fd8; }
html[data-theme="midnight"] .marquee-track { color: #8ef6ff; text-shadow: 0 0 8px #8ef6ff; }
html[data-theme="midnight"] .tabs a[aria-current="page"] { box-shadow: 0 0 0 2px #ff4fd8, 0 0 14px #ff4fd8; }
html[data-theme="midnight"] .dvd { box-shadow: 0 0 12px rgba(142, 246, 255, 0.25); }


/* ==========================================================
   VAPORWAVE: sunset gradient, grid floor, neon pastels
   ========================================================== */
html[data-theme="vaporwave"] {
  --paper: #fbe9ff;   /* small inner surfaces (the sky behind everything is set on body) */
  --card: #fff0fd;
  --ink: #2b0f4c;
  --muted: #6b4f8f;
  --pink: #ff9ff3; --yellow: #fffb96; --blue: #8ef6ff; --green: #a6ffcb; --lilac: #c9a7ff; --peach: #ffb8a3; --red: #ff3d7f;
  --line: 2px solid #2b0f4c;
  --shadow: 5px 5px 0 #01cdfe;
  --shadow-sm: 3px 3px 0 #ff71ce;
  --shadow-xs: 2px 2px 0 #ff71ce;
  --hand: "Righteous", "Nunito", sans-serif;
  --field: #ffffff;
  --note: #fffb96;
  --letter: #fff6ff;
  --card-alt: #fff6ff;
  --shelf: #fff6ff;
  --store-wall: linear-gradient(180deg, #ffd6f5, #d9c9ff);
  --dots: transparent;
}
html[data-theme="vaporwave"] body {
  background:
    linear-gradient(transparent 0 calc(100% - 1px), rgba(255, 113, 206, 0.55) calc(100% - 1px)) 0 0 / 100% 46px,
    linear-gradient(90deg, transparent 0 calc(100% - 1px), rgba(255, 113, 206, 0.55) calc(100% - 1px)) 0 0 / 46px 100%,
    linear-gradient(180deg, #1b0b3b 0%, #4a1a8a 30%, #b43aa8 55%, #ff7fb0 75%, #ffb86b 100%);
  background-attachment: fixed;
}
/* text that sits straight on the dark sky needs to be light */
html[data-theme="vaporwave"] :is(.site-head, .page-head, .section-title, .site-foot, .registry-bar, .store-count) { color: #fff; }
html[data-theme="vaporwave"] :is(.page-head p, .logo-sub, .site-foot) { color: #ffe0fa; }
html[data-theme="vaporwave"] :is(.logo, .page-head h2, .section-title) { text-shadow: 3px 3px 0 #ff71ce, 6px 6px 0 #01cdfe; }
html[data-theme="vaporwave"] .logo .hl { background: none; }
html[data-theme="vaporwave"] .theme-pick { color: #ffe0fa; }
html[data-theme="vaporwave"] .marquee { background: linear-gradient(90deg, #ff71ce, #b967ff, #01cdfe); border-color: #fff; }
html[data-theme="vaporwave"] .marquee-track { color: #fff; text-shadow: 2px 2px 0 #2b0f4c; }
html[data-theme="vaporwave"] .tabs a { border-radius: 0; transform: skewX(-8deg); }
html[data-theme="vaporwave"] .card { border-radius: 4px; }
html[data-theme="vaporwave"] .page-head .hint, html[data-theme="vaporwave"] .answers .section-title { color: #fff; }


/* ==========================================================
   RETRO DESKTOP: grey bevels, title bars, teal desktop
   ========================================================== */
html[data-theme="retro"] {
  --paper: #008080;
  --card: #c0c0c0;
  --ink: #000000;
  --muted: #3a3a3a;
  --pink: #e0c0e0; --yellow: #ffff9c; --blue: #c0d8f0; --green: #c0e0c0; --lilac: #d0c8e8; --peach: #f0d8c0; --red: #c00000;
  --line: 0 solid transparent;
  --bevel: inset -1px -1px #0a0a0a, inset 1px 1px #ffffff, inset -2px -2px #808080, inset 2px 2px #dfdfdf;
  --sunken: inset -1px -1px #ffffff, inset 1px 1px #0a0a0a, inset -2px -2px #dfdfdf, inset 2px 2px #808080;
  --shadow: var(--bevel), 2px 2px 0 rgba(0, 0, 0, 0.35);
  --shadow-sm: var(--bevel);
  --shadow-xs: var(--bevel);
  --radius: 0;
  --hand: "Pixelify Sans", "Tahoma", sans-serif;
  --body: "Tahoma", "Verdana", "Segoe UI", sans-serif;
  --mono: "VT323", "Courier New", monospace;
  --field: #ffffff;
  --note: #ffffe1;
  --letter: #ffffff;
  --card-alt: #c0c0c0;
  --shelf: #d4d0c8;
  --store-wall: #c0c0c0;
  --dots: transparent;
}
html[data-theme="retro"] body { background: #008080; font-size: 15px; }
html[data-theme="retro"] :is(.card, .btn, .tabs a, .chip, .door, .qa, .fish-card, .me-item, .polaroid, .unit, .store, .store-dialog, .tank-wrap, .arena, .speed-box, .account-pill, .theme-pick select, .edit-bar, .edit-fab, .result, .tool, .size, .tag, .badge, .mini-stats div, .tab-btn, .phone, .marquee, .ping, .fish-thumb, .podium .block, .settlement, .rec-note, .speech, .desk-top, .desk-front, .desk-sign) {
  border-radius: 0 !important;
}
html[data-theme="retro"] :is(.card, .btn, .tabs a, .chip, .door, .qa, .fish-card, .me-item, .unit, .store, .store-dialog, .account-pill, .tab-btn, .tool, .size) {
  border: 0 !important; box-shadow: var(--bevel) !important; transform: none !important;
}
html[data-theme="retro"] :is(input, textarea, select, .result) { border: 0; box-shadow: var(--sunken); border-radius: 0; }
html[data-theme="retro"] :is(.btn:active, .tabs a[aria-current="page"], .chip[aria-pressed="true"], .tab-btn[aria-pressed="true"]) { box-shadow: var(--sunken) !important; background: #b0b0b0; color: #000; text-decoration: none; }
html[data-theme="retro"] .tabs a { font-family: var(--body); font-size: 0.95rem; background: #c0c0c0; }
html[data-theme="retro"] .btn { background: #c0c0c0; }
/* window title bars on panels */
html[data-theme="retro"] :is(.card > h2:first-of-type, .card > h3:first-of-type) {
  margin: -22px -22px 14px; padding: 4px 8px;
  font: 700 1rem var(--body); color: #fff;
  background: linear-gradient(90deg, #000080, #1084d0);
}
html[data-theme="retro"] .card > h3:first-of-type::after { content: " ▢"; float: right; }
html[data-theme="retro"] .tape { display: none; }
html[data-theme="retro"] .site-head, html[data-theme="retro"] .page-head, html[data-theme="retro"] .section-title, html[data-theme="retro"] .site-foot { color: #fff; }
html[data-theme="retro"] .page-head p, html[data-theme="retro"] .logo-sub { color: #e8ffff; }
html[data-theme="retro"] .logo .hl { background: none; text-shadow: 2px 2px 0 #000; }
html[data-theme="retro"] .marquee { background: #000080; border: 0; transform: none; }
html[data-theme="retro"] .marquee-track { font-family: var(--mono); font-size: 1.4rem; color: #fff; }
html[data-theme="retro"] .door { background: #c0c0c0; }
html[data-theme="retro"] .unit-sign { background: #000080 !important; color: #fff; border: 0; font-family: var(--body); font-size: 1rem; }
html[data-theme="retro"] .theme-pick { color: #fff; }


/* ==========================================================
   GARDEN: soft sage + cream, serif headings, gentle shadows
   ========================================================== */
html[data-theme="garden"] {
  --paper: #f3eedc;
  --card: #fffaf0;
  --ink: #3a3a26;
  --muted: #7a7458;
  --pink: #f2c6c6; --yellow: #f3e3a2; --blue: #cbe2ea; --green: #cfe2bf; --lilac: #ddd2ec; --peach: #f3d0b5; --red: #b5483d;
  --line: 1.5px solid #3a3a26;
  --shadow: 0 8px 22px rgba(70, 60, 20, 0.16);
  --shadow-sm: 0 4px 12px rgba(70, 60, 20, 0.14);
  --shadow-xs: 0 2px 6px rgba(70, 60, 20, 0.12);
  --radius: 18px;
  --hand: "Fraunces", Georgia, serif;
  --field: #fffdf7;
  --note: #f8efc6;
  --letter: #fffdf4;
  --card-alt: #fdf6f0;
  --shelf: #fffaf0;
  --store-wall: repeating-linear-gradient(90deg, #efe8d2 0 44px, #ebe3ca 44px 88px);
  --dots: rgba(90, 110, 60, 0.12);
}
html[data-theme="garden"] body {
  background:
    radial-gradient(ellipse 50% 40% at 0% 0%, rgba(160, 200, 140, 0.35), transparent 70%),
    radial-gradient(ellipse 45% 35% at 100% 100%, rgba(240, 180, 180, 0.3), transparent 70%),
    radial-gradient(var(--dots) 1.2px, transparent 1.3px) 0 0 / 22px 22px,
    #f3eedc;
  background-attachment: fixed;
}
html[data-theme="garden"] :is(h1, h2, h3, h4, .tabs a, .door b, .ask-label) { font-style: italic; font-weight: 600; }
html[data-theme="garden"] .tabs a { --r: 0deg; border-radius: 999px; }
html[data-theme="garden"] .card { transform: none; }
html[data-theme="garden"] .tape { background: repeating-linear-gradient(45deg, rgba(207, 226, 191, 0.9) 0 8px, rgba(242, 198, 198, 0.9) 8px 16px); }
html[data-theme="garden"] .marquee { background: #5d6b3d; border-color: #3a3a26; }
html[data-theme="garden"] .marquee-track { font-family: var(--hand); font-style: italic; color: #fffaf0; }
html[data-theme="garden"] .marquee-track span::after { content: "❀"; color: #f2c6c6; }
html[data-theme="garden"] .logo .hl { background: linear-gradient(transparent 58%, var(--green) 58%, var(--green) 90%, transparent 90%); }


/* ==========================================================
   TERMINAL: green on black, monospace, scanlines
   ========================================================== */
html[data-theme="terminal"] {
  color-scheme: dark;
  --paper: #030603;
  --card: #071007;
  --ink: #39ff6a;
  --muted: #1fa344;
  --pink: #0d2a14; --yellow: #14331a; --blue: #0b2618; --green: #10361a; --lilac: #0e2c16; --peach: #12301a; --red: #ff5f56;
  --line: 1px solid #39ff6a;
  --shadow: 0 0 12px rgba(57, 255, 106, 0.25);
  --shadow-sm: 0 0 8px rgba(57, 255, 106, 0.2);
  --shadow-xs: none;
  --radius: 2px;
  --hand: "VT323", "Space Mono", monospace;
  --body: "Space Mono", ui-monospace, monospace;
  --field: #020502;
  --note: #0b1d0e;
  --letter: #061006;
  --card-alt: #061206;
  --shelf: #061006;
  --store-wall: #040904;
  --dots: transparent;
}
html[data-theme="terminal"] body { background: #030603; font-size: 15px; text-shadow: 0 0 4px rgba(57, 255, 106, 0.45); }
html[data-theme="terminal"] body::after {
  content: ""; position: fixed; inset: 0; z-index: 100; pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(0, 0, 0, 0) 0 2px, rgba(0, 0, 0, 0.22) 2px 3px);
}
html[data-theme="terminal"] :is(h1, h2, h3, .tabs a, .door b) { text-transform: lowercase; letter-spacing: 0.02em; }
html[data-theme="terminal"] h2::before, html[data-theme="terminal"] h3::before { content: "> "; color: var(--muted); }
html[data-theme="terminal"] .tabs a { --r: 0deg; font-size: 1.4rem; }
html[data-theme="terminal"] .tabs a[aria-current="page"] { background: #39ff6a; color: #030603; text-shadow: none; }
html[data-theme="terminal"] :is(.card, .door, .unit) { transform: none !important; }
html[data-theme="terminal"] .tape { display: none; }
html[data-theme="terminal"] .logo .hl { background: none; }
html[data-theme="terminal"] .logo .hl::after { content: "_"; animation: blink 1s steps(1) infinite; }
html[data-theme="terminal"] .marquee { background: #000; transform: none; }
html[data-theme="terminal"] .marquee-track { color: #39ff6a; font-family: var(--hand); font-size: 1.5rem; }
html[data-theme="terminal"] .btn.big, html[data-theme="terminal"] .chip[aria-pressed="true"] { background: #39ff6a; color: #030603; text-shadow: none; }
html[data-theme="terminal"] :is(.phone, .polaroid, .speech, .fish-pop, .ping, .tank-label) { text-shadow: none; }
html[data-theme="terminal"] .dvd, html[data-theme="terminal"] .fish-thumb img, html[data-theme="terminal"] .polaroid-img { filter: saturate(0.6) sepia(0.2) hue-rotate(60deg); }


@media (prefers-reduced-motion: reduce) {
  html[data-theme="aero"] body::before { animation: none; }
}
