/* ==========================================================================
   LARPiverse world skins. Each block re-skins the base (style.css) via variables
   plus a few decorations. Fixed palettes: worlds ignore OS dark mode on purpose.
   Background art: see CREDITS.md. Textures are inline SVG noise (no downloads).
   ========================================================================== */

/* ============================== 🚀 SCI-FI ============================== */
body[data-theme="scifi"] {
  --bg: #000;
  --card: rgba(0, 14, 5, .84);
  --text: #3dff74;
  --muted: #22b04e;
  --accent: #3dff74;
  --accent-text: #001a07;
  --border: #1d7a3b;
  --up: #c8ff3d;
  --down: #ff5a5a;
  --warn: #ffd23d;
  --error: #ff5a5a;
  --input-bg: #000;
  --topbar-bg: rgba(0, 0, 0, .88);
  --topbar-muted: #22b04e;
  --font-body: "Share Tech Mono", ui-monospace, monospace;
  --font-head: "VT323", ui-monospace, monospace;
  --font-ui: "VT323", ui-monospace, monospace;
  --radius: 2px;
  --btn-radius: 0;
  --tip-bg: #3dff74;
  --tip-text: #001a07;
  text-shadow: 0 0 5px rgba(61, 255, 116, .45);
}
/* star field: three tiling layers of tiny stars + a faint nebula */
body[data-theme="scifi"] .backdrop {
  background:
    radial-gradient(1px 1px at 25px 35px, #fff, transparent),
    radial-gradient(1px 1px at 140px 90px, #bdf, transparent),
    radial-gradient(1.5px 1.5px at 75px 160px, #fff, transparent),
    radial-gradient(1px 1px at 190px 140px, #dfe, transparent),
    radial-gradient(1px 1px at 230px 40px, #fff, transparent),
    radial-gradient(ellipse 60% 40% at 80% 20%, rgba(40, 90, 160, .18), transparent 70%),
    radial-gradient(ellipse 50% 35% at 15% 80%, rgba(20, 140, 70, .14), transparent 70%),
    #000;
  background-size: 260px 200px, 260px 200px, 260px 200px, 260px 200px, 260px 200px, 100% 100%, 100% 100%, auto;
}
body[data-theme="scifi"] .backdrop::before { content: ""; position: absolute; inset: 0; }
body[data-theme="scifi"] .backdrop::before { /* second, sparser star layer that twinkles */
  background:
    radial-gradient(2px 2px at 60px 60px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 310px 240px, #cff, transparent),
    radial-gradient(2px 2px at 420px 110px, #fff, transparent);
  background-size: 480px 360px;
  animation: scifi-twinkle 4s ease-in-out infinite alternate;
}
body[data-theme="scifi"]::after { /* CRT scanlines over everything (on body: the backdrop's stacking context is behind content) */
  content: ""; position: fixed; inset: 0; z-index: 1000; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .22) 0 1px, transparent 1px 3px);
}
@keyframes scifi-twinkle { from { opacity: .25; } to { opacity: 1; } }
@keyframes scifi-blink { 50% { opacity: 0; } }
body[data-theme="scifi"] .topbar { border-bottom: 1px solid var(--border); }
body[data-theme="scifi"] .brand { font-size: 1.8rem; letter-spacing: 2px; text-transform: uppercase; }
body[data-theme="scifi"] .brand-name::after { content: "█"; margin-left: 2px; animation: scifi-blink 1.1s steps(1) infinite; }
body[data-theme="scifi"] nav,
body[data-theme="scifi"] .sortbar,
body[data-theme="scifi"] .votebox { font-size: 1.3rem; letter-spacing: 1px; }
body[data-theme="scifi"] .card { border: 1px solid var(--border); box-shadow: 0 0 12px rgba(61, 255, 116, .15), inset 0 0 20px rgba(61, 255, 116, .05); }
body[data-theme="scifi"] .card h1 { font-size: 2rem; text-transform: uppercase; letter-spacing: 1px; }
body[data-theme="scifi"] .post-title { font-size: 1.45rem; }
body[data-theme="scifi"] .post-title::before,
body[data-theme="scifi"] .post-full h1::before { content: "> "; color: var(--muted); }
body[data-theme="scifi"] .meta { font-size: 1.1rem; }
body[data-theme="scifi"] details summary { font-size: 1.15rem; letter-spacing: 1px; }
body[data-theme="scifi"] .btn { background: transparent; color: var(--accent); border: 1px solid var(--accent); font-size: 1.3rem; padding: 2px 10px; text-transform: uppercase; }
body[data-theme="scifi"] .btn::before { content: "[ "; }
body[data-theme="scifi"] .btn::after { content: " ]"; }
body[data-theme="scifi"] .btn:hover { background: var(--accent); color: var(--accent-text); text-shadow: none; filter: none; }
body[data-theme="scifi"] .sortbar a.active { color: var(--accent-text); background: var(--accent); border: 0; padding: 0 6px; text-shadow: none; }
body[data-theme="scifi"] input,
body[data-theme="scifi"] textarea { caret-color: var(--accent); border-color: var(--border); }
body[data-theme="scifi"] input:focus,
body[data-theme="scifi"] textarea:focus { outline: 1px solid var(--accent); box-shadow: 0 0 10px rgba(61, 255, 116, .35); }
body[data-theme="scifi"] .comments { border-left: 1px dashed var(--border); }
body[data-theme="scifi"] .ui-tip,
body[data-theme="scifi"] .ui[data-en]:hover::after { text-shadow: none; }
@media (prefers-reduced-motion: reduce) {
  body[data-theme="scifi"] .backdrop::before,
  body[data-theme="scifi"] .brand-name::after { animation: none; }
}

/* ============================== 🏴‍☠️ PIRATE ============================== */
body[data-theme="pirate"] {
  --bg: #1d2a33;
  --card: #ecd6a6;
  --text: #3a2210;
  --muted: #6f4a22;
  --accent: #9e2219;
  --accent-text: #fbefd2;
  --border: #9c7442;
  --up: #2d6a1e;
  --down: #9e2219;
  --warn: #8a4b00;
  --error: #9e2219;
  --input-bg: rgba(255, 248, 225, .55);
  --topbar-bg: rgba(43, 25, 10, .9);
  --topbar-text: #f3dfae;
  --topbar-link: #f3dfae;
  --topbar-muted: #d0b27a;
  --font-body: "Kalam", "Segoe Print", cursive;
  --font-head: "Pirata One", "Kalam", cursive;
  --font-ui: "Pirata One", "Kalam", cursive;
  --radius: 4px;
  --btn-radius: 3px;
  --tip-bg: #2b190a;
  --tip-text: #f3dfae;
  font-size: 17px;
}
body[data-theme="pirate"] .backdrop {
  background: url("/static/themes/pirate-sea.jpg") center / cover no-repeat, #1d2a33;
  filter: blur(5px) brightness(.62) saturate(1.1);
  transform: scale(1.08); /* hide the blurred edges */
}
/* treasure-map parchment: aged gradient + noise + burnt edges + irregular outline */
body[data-theme="pirate"] .card,
body[data-theme="pirate"] .sortbar,
body[data-theme="pirate"] .banner {
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35 0 0 0 0 .2 0 0 0 0 .05 0 0 0 .22 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>"),
    radial-gradient(ellipse at 50% 45%, #f6e5bd 0%, #e9cf98 55%, #cfa564 100%);
  border: 0;
  border-radius: 6px 18px 8px 22px / 20px 6px 18px 8px;
  box-shadow: inset 0 0 28px rgba(110, 55, 10, .55), inset 0 0 4px rgba(70, 30, 5, .6), 0 8px 22px rgba(0, 0, 0, .55);
}
body[data-theme="pirate"] .card:nth-child(even) { border-radius: 20px 6px 22px 9px / 7px 19px 8px 20px; }
body[data-theme="pirate"] .topbar { border-bottom: 3px double #b68a4c; }
body[data-theme="pirate"] .brand { font-size: 1.7rem; letter-spacing: .5px; display: inline-flex; align-items: center; gap: 6px; }
/* compass rose before the logo */
body[data-theme="pirate"] .brand::before {
  content: ""; width: 30px; height: 30px; flex: none;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-50 -50 100 100'><circle r='46' fill='none' stroke='%23f3dfae' stroke-width='3'/><circle r='38' fill='none' stroke='%23f3dfae' stroke-width='1.5' stroke-dasharray='3 4'/><polygon points='0,-46 8,-8 46,0 8,8 0,46 -8,8 -46,0 -8,-8' fill='%23f3dfae'/><polygon points='0,-46 8,-8 0,0' fill='%23b8402f'/><polygon points='28,-28 6,-4 4,-6' fill='%23f3dfae'/><polygon points='-28,28 -6,4 -4,6' fill='%23f3dfae'/><polygon points='28,28 4,6 6,4' fill='%23f3dfae'/><polygon points='-28,-28 -4,-6 -6,-4' fill='%23f3dfae'/><circle r='4' fill='%232b190a'/></svg>") center / contain no-repeat;
}
body[data-theme="pirate"] nav { font-size: 1.15rem; }
body[data-theme="pirate"] .card h1 { font-size: 2rem; color: #4a240c; }
body[data-theme="pirate"] .post-title { font-size: 1.4rem; color: #4a240c; }
body[data-theme="pirate"] .sortbar { font-size: 1.2rem; }
body[data-theme="pirate"] .sortbar a.active { border-bottom: 2px dashed var(--accent); color: var(--accent); }
/* the red dashed "treasure trail" under titles, and X marks the spot */
body[data-theme="pirate"] .post-full .post-main > .meta { padding-bottom: 8px; border-bottom: 2px dashed var(--accent); margin-bottom: 8px; }
body[data-theme="pirate"] .post-full h1::after { content: " ✕"; color: var(--accent); font-family: "Kalam", cursive; font-weight: 700; }
body[data-theme="pirate"] .btn { font-size: 1.15rem; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .25), 0 2px 4px rgba(0, 0, 0, .35); }
body[data-theme="pirate"] .comments { border-left: 2px dashed var(--border); }
body[data-theme="pirate"] input,
body[data-theme="pirate"] textarea { border: 1px solid #b08a55; font-size: 1.05rem; }
body[data-theme="pirate"] .text { font-size: 1.05rem; line-height: 1.55; }

/* ============================== 🎩 VICTORIAN ============================== */
body[data-theme="victorian"] {
  --bg: #1f140c;
  --card: #f4ecd8;
  --text: #2a1a10;
  --muted: #6b5040;
  --accent: #7a1f1f;
  --accent-text: #f7efdc;
  --border: #b89b6e;
  --up: #3d5a2a;
  --down: #7a1f1f;
  --warn: #7a4a00;
  --error: #8b1a1a;
  --input-bg: #fbf6ea;
  --topbar-bg: rgba(33, 17, 9, .94);
  --topbar-text: #ecdcb8;
  --topbar-link: #e3c98f;
  --topbar-muted: #b99c6c;
  --font-body: "EB Garamond", Georgia, serif;
  --font-head: "IM Fell English SC", "EB Garamond", Georgia, serif;
  --font-ui: "IM Fell English", "EB Garamond", Georgia, serif;
  --radius: 2px;
  --btn-radius: 2px;
  --tip-bg: #2a1a10;
  --tip-text: #f4ecd8;
  font-size: 18px;
}
body[data-theme="victorian"] .backdrop {
  background: url("/static/themes/victorian-hall.jpg") center / cover no-repeat, #1f140c;
  filter: blur(3px) sepia(.85) brightness(.42) contrast(1.15);
  transform: scale(1.06);
}
body[data-theme="victorian"] .backdrop::after { /* candle-lit vignette */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 30%, rgba(255, 190, 110, .18), transparent 55%), radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, .7));
}
/* pages of an old book: cream paper, faint foxing, a spine shadow, ruled double border */
body[data-theme="victorian"] .card,
body[data-theme="victorian"] .sortbar,
body[data-theme="victorian"] .banner {
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .4 0 0 0 0 .3 0 0 0 0 .15 0 0 0 .1 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>"),
    linear-gradient(90deg, rgba(80, 50, 20, .16), transparent 5%, transparent 95%, rgba(80, 50, 20, .1)),
    #f4ecd8;
  border: 0;
  box-shadow: inset 0 0 0 1px #b89b6e, inset 0 0 0 5px #f4ecd8, inset 0 0 0 6px #b89b6e, 0 10px 24px rgba(0, 0, 0, .6);
  padding: 18px 22px;
}
body[data-theme="victorian"] .sortbar { padding: 6px 18px; }
body[data-theme="victorian"] .topbar { border-bottom: 3px double #b8925a; }
body[data-theme="victorian"] .brand { font-size: 1.6rem; letter-spacing: 1px; }
body[data-theme="victorian"] .card h1 { font-size: 1.8rem; text-align: center; font-weight: 400; }
body[data-theme="victorian"] .card h1::after { content: "— ❦ —"; display: block; font-size: 1rem; color: var(--border); margin-top: 4px; }
body[data-theme="victorian"] .post-full h1 { text-align: left; }
body[data-theme="victorian"] .post-full h1::after { text-align: left; }
body[data-theme="victorian"] .post-title { font-family: "IM Fell English", serif; font-size: 1.3rem; font-weight: 400; }
body[data-theme="victorian"] .meta { font-style: italic; font-size: .9rem; }
body[data-theme="victorian"] .post-body::first-letter { float: left; font-family: "IM Fell English SC", serif; font-size: 3.3em; line-height: .85; padding: 4px 6px 0 0; color: var(--accent); }
body[data-theme="victorian"] .sortbar a { font-variant: small-caps; letter-spacing: .5px; }
body[data-theme="victorian"] .sortbar a.active { border-bottom: 1px solid var(--accent); color: var(--accent); }
body[data-theme="victorian"] .btn { font-weight: 400; letter-spacing: .5px; border: 1px solid #4d1212; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .15); }
body[data-theme="victorian"] .comments { border-left: 1px solid var(--border); }
body[data-theme="victorian"] .text { line-height: 1.6; }

/* ============================== 🐉 HIGH FANTASY ============================== */
body[data-theme="fantasy"] {
  --bg: #08130c;
  --card: #ead9ae;
  --text: #2e1f0e;
  --muted: #6b5230;
  --accent: #7a1d12;
  --accent-text: #f6e7bf;
  --border: #9c7a3a;
  --gold: #c9a24a;
  --up: #3f6b25;
  --down: #7a1d12;
  --warn: #7a4a00;
  --error: #8b1a1a;
  --input-bg: rgba(255, 250, 230, .6);
  --topbar-bg: rgba(6, 18, 10, .9);
  --topbar-text: #e3c46e;
  --topbar-link: #e3c46e;
  --topbar-muted: #a88c4c;
  --font-body: "EB Garamond", Georgia, serif;
  --font-head: "Cinzel", "EB Garamond", serif;
  --font-ui: "Cinzel", "EB Garamond", serif;
  --radius: 4px;
  --btn-radius: 3px;
  --tip-bg: #1a120a;
  --tip-text: #ecd9a0;
  font-size: 18px;
}
/* twilight forest sky with distant mountains (original SVG silhouette) */
body[data-theme="fantasy"] .backdrop {
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 300' preserveAspectRatio='none'><path d='M0 300 L0 190 L90 120 L150 165 L240 60 L330 150 L400 110 L470 170 L560 40 L650 140 L720 100 L800 160 L880 70 L960 150 L1040 95 L1120 160 L1200 120 L1200 300 Z' fill='%23050c07' opacity='.9'/><path d='M0 300 L0 230 L120 180 L220 225 L320 170 L430 230 L540 190 L640 240 L760 185 L860 235 L980 190 L1090 230 L1200 200 L1200 300 Z' fill='%23030805'/></svg>") bottom / 100% 38% no-repeat,
    radial-gradient(1px 1px at 40px 50px, rgba(255, 240, 200, .7), transparent),
    radial-gradient(1px 1px at 180px 120px, rgba(255, 240, 200, .5), transparent),
    radial-gradient(ellipse 70% 50% at 50% 0%, #2c4a36 0%, transparent 70%),
    linear-gradient(#10261a, #08130c 70%);
  background-size: 100% 38%, 300px 220px, 300px 220px, 100% 100%, 100% 100%;
}
body[data-theme="fantasy"] .card,
body[data-theme="fantasy"] .sortbar,
body[data-theme="fantasy"] .banner {
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.55' numOctaves='4' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .4 0 0 0 0 .27 0 0 0 0 .08 0 0 0 .28 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>"),
    radial-gradient(ellipse at center, #f3e5be 0%, #e6d2a0 60%, #c9a965 100%);
  border: 1px solid var(--border);
  box-shadow: inset 0 0 45px rgba(110, 70, 15, .45), 0 0 0 1px rgba(201, 162, 74, .35), 0 10px 26px rgba(0, 0, 0, .65);
}
body[data-theme="fantasy"] .topbar { border-bottom: 1px solid var(--gold); box-shadow: 0 1px 0 rgba(201, 162, 74, .3), 0 4px 12px rgba(0, 0, 0, .5); }
body[data-theme="fantasy"] .brand { font-family: "Cinzel Decorative", "Cinzel", serif; font-size: 1.5rem; letter-spacing: 1px; text-shadow: 0 0 10px rgba(227, 196, 110, .35); }
body[data-theme="fantasy"] nav { font-size: .95rem; letter-spacing: .5px; }
body[data-theme="fantasy"] .card h1 { font-size: 1.6rem; color: #5a160c; text-align: center; letter-spacing: .5px; }
body[data-theme="fantasy"] .card h1::after { content: "✦ ❖ ✦"; display: block; font-size: .8rem; color: var(--border); margin-top: 6px; letter-spacing: 6px; }
body[data-theme="fantasy"] .post-full h1 { text-align: left; }
body[data-theme="fantasy"] .post-title { color: #4d140a; font-size: 1.15rem; letter-spacing: .3px; }
body[data-theme="fantasy"] .meta { font-family: "EB Garamond", serif; font-style: italic; font-size: .95rem; }
/* illuminated first letter */
body[data-theme="fantasy"] .post-body::first-letter {
  float: left; font-family: "Cinzel Decorative", serif; font-size: 3.2em; line-height: .9; padding: 6px 8px 2px; margin: 2px 8px 0 0;
  color: #f6e7bf; background: radial-gradient(circle, #8c2414, #5a1209); border: 2px solid var(--gold); border-radius: 3px;
  text-shadow: 0 0 6px rgba(201, 162, 74, .9);
}
body[data-theme="fantasy"] .sortbar a { letter-spacing: .5px; }
body[data-theme="fantasy"] .sortbar a.active { color: var(--accent); border-bottom: 2px solid var(--gold); }
body[data-theme="fantasy"] .btn { border: 1px solid var(--gold); letter-spacing: .5px; box-shadow: inset 0 0 0 1px rgba(255, 220, 140, .25), 0 2px 6px rgba(0, 0, 0, .4); }
body[data-theme="fantasy"] .comments { border-left: 2px solid rgba(156, 122, 58, .5); }
body[data-theme="fantasy"] .text { line-height: 1.6; }

/* ============================== 🦴 CAVEMAN ============================== */
body[data-theme="caveman"] {
  --bg: #1b140e;
  --card: #8c8680;
  --text: #221c17;
  --muted: #3d352e;
  --accent: #b4501b;
  --accent-text: #fff1dc;
  --border: #5e5750;
  --up: #3f5e12;
  --down: #8e2410;
  --warn: #5a2a00;
  --error: #7a1500;
  --input-bg: #b3ada6;
  --topbar-bg: rgba(30, 22, 16, .94);
  --topbar-text: #e9dcc6;
  --topbar-link: #f0a76a;
  --topbar-muted: #b8a68c;
  --font-body: "Rubik", system-ui, sans-serif;
  --font-head: "Rubik Dirt", "Rubik", sans-serif;
  --font-ui: "Rubik Dirt", "Rubik", sans-serif;
  --radius: 16px;
  --btn-radius: 12px 6px 14px 8px;
  --tip-bg: #e9dcc6;
  --tip-text: #221c17;
  font-size: 17px;
  font-weight: 500;
}
/* dark cave wall with torchlight */
body[data-theme="caveman"] .backdrop {
  background:
    radial-gradient(ellipse 45% 35% at 12% 18%, rgba(255, 140, 50, .22), transparent 70%),
    radial-gradient(ellipse 45% 35% at 90% 70%, rgba(255, 120, 40, .15), transparent 70%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='1600' height='1000' preserveAspectRatio='none'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.006 .01' numOctaves='5' seed='3'/><feColorMatrix values='0 0 0 0 .35 0 0 0 0 .26 0 0 0 0 .18 0 0 0 .55 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>") center / cover no-repeat,
    #1b140e;
}
/* stone tablets: grainy grey rock, chiselled bevel, irregular slab shape */
body[data-theme="caveman"] .card,
body[data-theme="caveman"] .sortbar,
body[data-theme="caveman"] .banner {
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .1 0 0 0 0 .09 0 0 0 0 .08 0 0 0 .35 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='m'><feTurbulence type='fractalNoise' baseFrequency='.035' numOctaves='3' seed='9' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .62 0 0 0 0 .6 0 0 0 0 .57 0 0 0 .5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23m)'/></svg>"),
    #8c8680;
  border: 0;
  border-radius: 22px 12px 26px 10px / 14px 24px 12px 22px;
  box-shadow: inset 4px 4px 0 rgba(255, 255, 255, .22), inset -5px -5px 0 rgba(0, 0, 0, .32), 0 10px 18px rgba(0, 0, 0, .7);
}
body[data-theme="caveman"] .card:nth-child(odd) { border-radius: 12px 26px 10px 24px / 24px 12px 22px 14px; }
/* carved-into-stone text */
body[data-theme="caveman"] .card,
body[data-theme="caveman"] .sortbar,
body[data-theme="caveman"] .banner { text-shadow: 0 1px 0 rgba(255, 255, 255, .22); }
body[data-theme="caveman"] .card h1 { font-weight: 400; color: var(--text); }
body[data-theme="caveman"] .topbar { border-bottom: 4px solid #3a2d22; }
body[data-theme="caveman"] .brand { font-size: 1.8rem; letter-spacing: 1px; color: #f0a76a !important; }
body[data-theme="caveman"] nav { font-size: 1.1rem; }
body[data-theme="caveman"] .card h1 { font-size: 2rem; }
body[data-theme="caveman"] .post-title { font-family: "Rubik Dirt", "Rubik", sans-serif; font-weight: 400; font-size: 1.45rem; letter-spacing: .5px; color: var(--text) !important; }
body[data-theme="caveman"] .sortbar { font-size: 1.15rem; }
body[data-theme="caveman"] .sortbar a { color: var(--muted); }
body[data-theme="caveman"] .sortbar a.active { color: var(--accent); border-bottom: 3px solid var(--accent); }
body[data-theme="caveman"] .meta { font-weight: 500; }
body[data-theme="caveman"] .btn { font-family: "Rubik Dirt", sans-serif; font-size: 1.15rem; font-weight: 400; text-shadow: none;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .25), inset -3px -3px 0 rgba(0, 0, 0, .3); }
body[data-theme="caveman"] .vote .arrow { display: inline-block; transform: scaleX(1.4); }
body[data-theme="caveman"] input,
body[data-theme="caveman"] textarea { border: 2px solid #5e5750; box-shadow: inset 2px 2px 3px rgba(0, 0, 0, .3); }
body[data-theme="caveman"] .comments { border-left: 4px solid rgba(60, 50, 40, .5); }
body[data-theme="caveman"] a:not(.btn) { color: #8a3305; }
body[data-theme="caveman"] .topbar a:not(.btn) { color: var(--topbar-link); }

/* ---- profile touches per world ---- */
body[data-theme="scifi"] .profile-kicker { color: var(--accent); font-size: 1.1rem; }
body[data-theme="scifi"] .profile-kicker::before { content: "// "; }
body[data-theme="scifi"] .card h1.profile-name { text-transform: none; }
body[data-theme="scifi"] .profile-bio { border-top-style: dashed; border-bottom-style: dashed; }
body[data-theme="scifi"] .text { hyphens: manual; }
body[data-theme="scifi"] .section-heading { font-size: 1.6rem; text-transform: uppercase; }
body[data-theme="pirate"] .profile-kicker { font-family: "Pirata One", cursive; font-size: 1.1rem; letter-spacing: 1px; text-transform: none; color: var(--accent); }
body[data-theme="pirate"] .profile-bio { border-top: 2px dashed var(--accent); border-bottom: 2px dashed var(--accent); }
body[data-theme="pirate"] .section-heading { font-size: 1.5rem; }
body[data-theme="victorian"] .profile { text-align: center; }
body[data-theme="victorian"] .profile-stats { justify-content: center; }
body[data-theme="victorian"] .card h1.profile-name { font-size: 2.2rem; }
body[data-theme="victorian"] .card h1.profile-name::after { content: "— ❦ —"; display: block; font-size: 1rem; color: var(--border); }
body[data-theme="victorian"] .profile-bio .text { font-style: italic; }
body[data-theme="fantasy"] .profile { text-align: center; }
body[data-theme="fantasy"] .profile-stats { justify-content: center; }
body[data-theme="fantasy"] .card h1.profile-name::after { content: "✦ ❖ ✦"; display: block; font-size: .8rem; color: var(--border); letter-spacing: 6px; margin-top: 4px; }
body[data-theme="fantasy"] .profile-kicker { color: var(--accent); }
body[data-theme="caveman"] .profile-kicker { font-family: "Rubik Dirt", sans-serif; font-size: 1.1rem; letter-spacing: 1px; color: var(--accent); }
body[data-theme="caveman"] .profile-bio { border-width: 3px; border-color: rgba(60, 50, 40, .45); }
body[data-theme="caveman"] .section-heading { font-family: "Rubik Dirt", sans-serif; font-weight: 400; font-size: 1.5rem; color: #e9dcc6; }

/* ---- chat touches per world ---- */
body[data-theme="scifi"] .bubble { border-radius: 2px !important; font-size: .95rem; }
body[data-theme="scifi"] .msg.mine .bubble { background: rgba(61, 255, 116, .14); color: var(--text); border: 1px solid var(--accent); }
body[data-theme="scifi"] .msg.theirs .bubble { background: rgba(120, 200, 255, .08); border-color: #2f6f8f; color: #bfe9ff; text-shadow: 0 0 4px rgba(120, 200, 255, .4); }
body[data-theme="scifi"] .msg.theirs:not(.grouped) .bubble-text::before { content: "> "; color: var(--muted); }
body[data-theme="scifi"] .composer textarea { border-radius: 0; }
body[data-theme="scifi"] .chat-name { font-size: 1.6rem; }
body[data-theme="scifi"] .badge, body[data-theme="scifi"] .new-pill { border-radius: 2px; }
body[data-theme="pirate"] .msg.theirs .bubble { background: rgba(255, 248, 225, .7); border: 1px solid #b08a55; }
body[data-theme="pirate"] .bubble { font-size: 1.02rem; }
body[data-theme="pirate"] .day-sep span { border-style: dashed; border-color: var(--accent); color: var(--accent); }
body[data-theme="victorian"] .bubble { border-radius: 3px !important; font-size: 1rem; }
body[data-theme="victorian"] .msg.theirs .bubble { background: #fbf6ea; box-shadow: inset 0 0 0 3px #fbf6ea, inset 0 0 0 4px #d8c4a0; }
body[data-theme="victorian"] .msg.mine .bubble { box-shadow: inset 0 0 0 3px var(--accent), inset 0 0 0 4px rgba(255, 255, 255, .35); }
body[data-theme="victorian"] .day-sep span { border: 0; font-style: italic; font-variant: small-caps; }
body[data-theme="fantasy"] .msg.theirs .bubble { background: rgba(255, 250, 230, .65); border-color: var(--border); }
body[data-theme="fantasy"] .msg.mine .bubble { border: 1px solid var(--gold); }
body[data-theme="fantasy"] .day-sep span { border-color: var(--gold); }
body[data-theme="caveman"] .bubble { border-radius: 18px 10px 20px 8px !important; }
body[data-theme="caveman"] .msg.theirs .bubble { background: #a39e98; border: 0; box-shadow: inset 2px 2px 0 rgba(255,255,255,.25), inset -2px -2px 0 rgba(0,0,0,.25); }
body[data-theme="caveman"] .msg.mine .bubble { box-shadow: inset 2px 2px 0 rgba(255,255,255,.25), inset -2px -2px 0 rgba(0,0,0,.3); text-shadow: none; }

/* ============================== 💘 ROM-COM ============================== */
body[data-theme="romcom"] {
  --bg: #ff8fab;
  --card: #fff7f3;
  --text: #4a1426;
  --muted: #9b4d66;
  --accent: #d6204e;
  --accent-text: #ffffff;
  --border: #f4a6bb;
  --up: #e11d48;
  --down: #7c6f75;
  --warn: #b4235a;
  --error: #b00030;
  --input-bg: #fff0f4;
  --topbar-bg: linear-gradient(90deg, #b3123d, #e0335f 55%, #ff6b8b);
  --topbar-text: #ffffff;
  --topbar-link: #ffe4ec;
  --topbar-muted: #ffd1dc;
  --font-body: "Nunito", system-ui, sans-serif;
  --font-head: "Pacifico", cursive;
  --font-ui: "Nunito", system-ui, sans-serif;
  --radius: 18px;
  --btn-radius: 999px;
  --tip-bg: #7a0f2e;
  --tip-text: #ffffff;
  font-size: 17px;
}
/* backdrop: pink-to-red glow with two layers of hearts floating upwards */
body[data-theme="romcom"] .backdrop {
  background: radial-gradient(ellipse at 30% 10%, #ffd1dc 0%, transparent 55%),
              radial-gradient(ellipse at 80% 90%, #ff4d7d 0%, transparent 60%),
              linear-gradient(160deg, #ffb3c6, #ff7096 55%, #e0335f);
}
body[data-theme="romcom"] .backdrop::before,
body[data-theme="romcom"] .backdrop::after { content: ""; position: absolute; inset: 0; }
body[data-theme="romcom"] .backdrop::before { background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='640'><path d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z' fill='%23ffffff' opacity='0.55' transform='translate(20 40) scale(1.2) rotate(-15 12 12)'/><path d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z' fill='%23ffd1dc' opacity='0.7' transform='translate(210 150) scale(0.8) rotate(12 12 12)'/><path d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z' fill='%23ffffff' opacity='0.4' transform='translate(90 300) scale(1.6) rotate(8 12 12)'/><path d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z' fill='%23ffb3c6' opacity='0.6' transform='translate(250 430) scale(1.0) rotate(-20 12 12)'/><path d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z' fill='%23ffffff' opacity='0.6' transform='translate(40 560) scale(0.7) rotate(18 12 12)'/><path d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z' fill='%23ffd1dc' opacity='0.45' transform='translate(160 520) scale(1.3) rotate(-6 12 12)'/></svg>"); background-size: 320px 640px; animation: romcom-float 38s linear infinite; }
body[data-theme="romcom"] .backdrop::after { background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='520'><path d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z' fill='%23ffffff' opacity='0.5' transform='translate(60 90) scale(0.5) rotate(10 12 12)'/><path d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z' fill='%23ffffff' opacity='0.45' transform='translate(200 260) scale(0.6) rotate(-12 12 12)'/><path d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z' fill='%23ffe4ec' opacity='0.6' transform='translate(120 420) scale(0.45) rotate(5 12 12)'/></svg>"); background-size: 260px 520px; animation: romcom-float-2 24s linear infinite; }
@keyframes romcom-float { from { background-position: 0 0; } to { background-position: 0 -640px; } }
@keyframes romcom-float-2 { from { background-position: 40px 0; } to { background-position: 40px -520px; } }
@keyframes romcom-pulse { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }
@keyframes romcom-wink { 0%, 92%, 100% { opacity: 1; } 95% { opacity: .2; } }

body[data-theme="romcom"] .topbar { background: var(--topbar-bg); border-bottom: 0; box-shadow: 0 4px 18px rgba(179, 18, 61, .35); }
body[data-theme="romcom"] .brand { font-size: 1.7rem; font-weight: 400; text-shadow: 0 2px 0 rgba(122, 15, 46, .35); }
body[data-theme="romcom"] .brand-name::after { content: " 😉"; font-size: .8em; display: inline-block; animation: romcom-wink 5s infinite; }
body[data-theme="romcom"] nav { font-weight: 800; }
body[data-theme="romcom"] .topbar .btn { background: #ffffff; color: var(--accent); }

/* cards: love letters with a dotted lace edge, a heart seal, and a cheeky tilt */
body[data-theme="romcom"] .card,
body[data-theme="romcom"] .sortbar,
body[data-theme="romcom"] .banner {
  background: radial-gradient(circle at 100% 0, rgba(255, 179, 198, .35), transparent 40%), var(--card);
  border: 3px dotted var(--border);
  box-shadow: 0 0 0 4px var(--card), 0 10px 24px rgba(122, 15, 46, .28);
}
body[data-theme="romcom"] .card { position: relative; }
body[data-theme="romcom"] .feed > .card:nth-child(odd) { transform: rotate(-.5deg); }
body[data-theme="romcom"] .feed > .card:nth-child(even) { transform: rotate(.5deg); }
body[data-theme="romcom"] .feed > .card::after,
body[data-theme="romcom"] .post-full::after,
body[data-theme="romcom"] .profile::after {
  content: ""; position: absolute; top: -10px; right: 14px; width: 26px; height: 26px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z' fill='%23e11d48'/><path d='M8 8.5c0-1 .8-1.8 1.8-1.8' stroke='%23ffffff' stroke-width='1.2' fill='none' stroke-linecap='round' opacity='.8'/></svg>") center / contain no-repeat; filter: drop-shadow(0 2px 2px rgba(122, 15, 46, .35)); transform: rotate(14deg);
}
body[data-theme="romcom"] .card h1 { font-weight: 400; color: #b3123d; font-size: 1.8rem; }
body[data-theme="romcom"] .post-title { font-family: "Nunito", sans-serif; font-weight: 800; color: #7a0f2e; font-size: 1.12rem; }
body[data-theme="romcom"] .post-title:hover { text-decoration: none; }
body[data-theme="romcom"] .post-title:hover::after { content: " 😳"; }
body[data-theme="romcom"] .meta { color: var(--muted); }
body[data-theme="romcom"] .text { line-height: 1.6; }
body[data-theme="romcom"] .sortbar a { font-weight: 800; }
body[data-theme="romcom"] .sortbar a.active { color: var(--accent); border-bottom: 2px dotted var(--accent); }
body[data-theme="romcom"] .sortbar a.active::after { content: " ♥"; }

/* buttons: pink pills */
body[data-theme="romcom"] .btn { background: linear-gradient(180deg, #ff5c85, #d6204e); font-weight: 800; box-shadow: 0 3px 0 #9e1238, 0 6px 12px rgba(158, 18, 56, .3); }
body[data-theme="romcom"] .btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #9e1238; }

/* votes: heart up, broken heart down; a heartbeat when you swoon */
body[data-theme="romcom"] .vote .arrow { font-size: 0; }
body[data-theme="romcom"] .vote.up .arrow::before { content: "♥"; font-size: 1.25rem; }
body[data-theme="romcom"] .vote.down .arrow::before { content: "💔"; font-size: .95rem; filter: grayscale(1); opacity: .55; }
body[data-theme="romcom"] .vote.down.active .arrow::before { filter: none; opacity: 1; }
body[data-theme="romcom"] .vote.up { color: #f4a6bb; }
body[data-theme="romcom"] .vote.up.active { color: var(--up); }
body[data-theme="romcom"] .vote.up.active .arrow::before { display: inline-block; animation: romcom-pulse .5s ease-out; }
body[data-theme="romcom"] .comments { border-left: 2px dotted var(--border); }
body[data-theme="romcom"] input, body[data-theme="romcom"] textarea { border: 2px solid #f9c4d2; }
body[data-theme="romcom"] input:focus, body[data-theme="romcom"] textarea:focus { outline: 2px solid #ff8fab; }

/* profile + chat */
body[data-theme="romcom"] .profile { text-align: center; }
body[data-theme="romcom"] .profile-stats { justify-content: center; }
body[data-theme="romcom"] .profile-kicker { color: var(--accent); font-weight: 800; }
body[data-theme="romcom"] .profile-bio { border-top: 2px dotted var(--border); border-bottom: 2px dotted var(--border); }
body[data-theme="romcom"] .profile-bio .text { font-style: italic; }
body[data-theme="romcom"] .section-heading { font-family: "Pacifico", cursive; font-weight: 400; color: #ffffff; font-size: 1.5rem; text-shadow: 0 2px 6px rgba(122, 15, 46, .5); }
body[data-theme="romcom"] .msg.mine .bubble { background: linear-gradient(135deg, #ff5c85, #d6204e); border-radius: 20px 20px 6px 20px; }
body[data-theme="romcom"] .msg.theirs .bubble { background: #ffe4ec; border: 0; border-radius: 20px 20px 20px 6px; }
body[data-theme="romcom"] .day-sep span { border: 2px dotted var(--border); color: var(--accent); }
body[data-theme="romcom"] .composer textarea { border-radius: 999px; }
body[data-theme="romcom"] .badge { background: #ffffff; color: #d6204e; }
body[data-theme="romcom"] .inbox-link .badge { box-shadow: 0 0 0 2px #d6204e; }

@media (prefers-reduced-motion: reduce) {
  body[data-theme="romcom"] .backdrop::before, body[data-theme="romcom"] .backdrop::after,
  body[data-theme="romcom"] .brand-name::after, body[data-theme="romcom"] .vote.up.active .arrow::before { animation: none; }
}

/* ---- word game colours per world (hit / near / miss), chosen to stay distinguishable ---- */
body[data-theme="scifi"] { --w-hit: #1fbf55; --w-near: #e0a100; --w-miss: #2a3a30; --w-tile-text: #021a08; }
body[data-theme="scifi"] .tile { border-radius: 0; text-shadow: none; }
body[data-theme="scifi"] .tile.miss { color: #8fb79a; }
body[data-theme="scifi"] .kb-key { border-radius: 0; border: 1px solid var(--border); background: #000; color: var(--accent); }
body[data-theme="scifi"] .kb-key.miss { color: #8fb79a; }
body[data-theme="pirate"] { --w-hit: #2e8b6e; --w-near: #d4a017; --w-miss: #7a5a3a; --w-tile-text: #fff8e6; }
body[data-theme="pirate"] .tile:not(.filled) { border-color: #a88454; background: rgba(255, 248, 225, .5); }
body[data-theme="victorian"] { --w-hit: #2f5d3a; --w-near: #b08d3c; --w-miss: #8a8174; --w-tile-text: #fbf6ea; }
body[data-theme="victorian"] .tile { font-family: "IM Fell English SC", serif; border-radius: 2px; }
body[data-theme="fantasy"] { --w-hit: #2e7d4f; --w-near: #c9a24a; --w-miss: #6e6a62; --w-tile-text: #fff8e1; }
body[data-theme="fantasy"] .tile { font-family: "Cinzel", serif; }
body[data-theme="fantasy"] .tile:not(.filled) { border-color: var(--border); }
body[data-theme="caveman"] { --w-hit: #5b7d2a; --w-near: #c06a1d; --w-miss: #5e5750; --w-tile-text: #fff4e0; }
body[data-theme="caveman"] .tile { border-radius: 12px 6px 14px 5px; font-family: "Rubik Dirt", sans-serif; font-weight: 400; }
body[data-theme="romcom"] { --w-hit: #e0335f; --w-near: #f2a541; --w-miss: #b8a3aa; --w-tile-text: #ffffff; }
body[data-theme="romcom"] .tile { border-radius: 12px; }
body[data-theme="romcom"] .tile:not(.filled) { border-color: #f4a6bb; background: #fff; }

body[data-theme="victorian"] .profile-friend-actions, body[data-theme="fantasy"] .profile-friend-actions,
body[data-theme="romcom"] .profile-friend-actions { justify-content: center; }

/* ============================== 📱 PHONES ==============================
   Same specificity as the theme rules above, so these (later) win on small screens. */
@media (max-width: 560px) {
  body[data-theme] .card h1 { font-size: 1.45rem; }
  body[data-theme] .post-title { font-size: 1.12rem; }
  body[data-theme="scifi"] .card h1 { font-size: 1.7rem; }
  body[data-theme="scifi"] .post-title { font-size: 1.3rem; }
  body[data-theme="scifi"] .brand { font-size: 1.45rem; letter-spacing: 1px; }
  body[data-theme="scifi"] nav .btn { font-size: 1.15rem; padding: 2px 8px; }
  body[data-theme="scifi"] .sortbar a.active { padding: 2px 4px; }
  body[data-theme="pirate"] .card h1 { font-size: 1.6rem; }
  body[data-theme="pirate"] .post-title { font-size: 1.25rem; }
  body[data-theme="pirate"] .brand { font-size: 1.35rem; }
  body[data-theme="pirate"] .brand::before { width: 24px; height: 24px; }
  body[data-theme="pirate"] .sortbar { font-size: 1.05rem; }
  body[data-theme="victorian"] .card h1 { font-size: 1.35rem; }
  body[data-theme="victorian"] .card { padding: 14px 14px; }
  body[data-theme="victorian"] .sortbar { font-size: .9rem; }
  body[data-theme="victorian"] .brand { font-size: 1.3rem; }
  body[data-theme="fantasy"] .card h1 { font-size: 1.3rem; }
  body[data-theme="fantasy"] .sortbar { font-size: .85rem; }
  body[data-theme="fantasy"] .brand { font-size: 1.2rem; }
  body[data-theme="caveman"] .card h1 { font-size: 1.55rem; }
  body[data-theme="caveman"] .post-title { font-size: 1.25rem; }
  body[data-theme="caveman"] .brand { font-size: 1.4rem; }
  body[data-theme="caveman"] .sortbar { font-size: 1rem; }
  body[data-theme="romcom"] .card h1 { font-size: 1.45rem; }
  body[data-theme="romcom"] .brand { font-size: 1.3rem; }
  body[data-theme="romcom"] .post-title { font-size: 1.05rem; }
  body[data-theme="romcom"] .feed > .card:nth-child(odd), body[data-theme="romcom"] .feed > .card:nth-child(even) { transform: none; }
  body[data-theme="victorian"] .post-body::first-letter,
  body[data-theme="fantasy"] .post-body::first-letter { font-size: 2.6em; }
}

/* -illion tracks: each world's journey (top->bottom of the gradient) */
body[data-theme="pirate"]    { --track-a: #7fd3e6; --track-b: #061a33; }
body[data-theme="scifi"]     { --track-a: #0b3d2a; --track-b: #000; }
body[data-theme="victorian"] { --track-a: #c9b28a; --track-b: #7fa6c9; }
body[data-theme="fantasy"]   { --track-a: #8a6a3a; --track-b: #e8c97a; }
body[data-theme="caveman"]   { --track-a: #a08b6c; --track-b: #1b140e; }
body[data-theme="romcom"]    { --track-a: #ffd6e5; --track-b: #e0245e; }
