/* Wheel Spin Now: shared styles */
/* Self-hosted fonts (latin subset, variable weight, SIL Open Font License) */
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 700 800; font-display: swap; src: url("/assets/fonts/bricolage-grotesque-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("/assets/fonts/plus-jakarta-sans-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bg: #f6f4fb;
  --surface: #ffffff;
  --surface-2: #f1edfa;
  --text: #1b1736;
  --muted: #4f4a69;
  --border: #e2ddf0;
  --link: #5b21b6;
  --accent: #6d28d9;
  --accent-ink: #ffffff;
  --focus: #6d28d9;
  --shadow: 0 1px 2px rgba(27, 23, 54, .06), 0 10px 30px rgba(27, 23, 54, .08);
  --gold: #ffd166;
  --radius: 20px;
  --hdr-h: 100px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0a1d;
    --surface: #16132e;
    --surface-2: #1d1940;
    --text: #eeeaff;
    --muted: #bdb7da;
    --border: #2e2955;
    --link: #c4b5fd;
    --accent: #7c3aed;
    --focus: #ffd166;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .35);
  }
}
@media (min-width: 900px) { :root { --hdr-h: 72px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; letter-spacing: -.01em; margin: 0 0 .5em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 50; background: #fff; color: #1b1736; padding: 8px 14px; border-radius: 10px; font-weight: 700; }
.skip:focus { top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Header (floats over the hero) ---------- */
.site-header { position: absolute; top: 0; left: 0; right: 0; z-index: 10; color: #fff; }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; min-height: 56px; padding-top: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; letter-spacing: -.01em; }
.brand svg { width: 34px; height: 34px; flex: none; animation: brandspin 14s linear infinite; }
@keyframes brandspin { to { transform: rotate(360deg); } }
.brand:hover svg { animation-duration: 1.4s; }
.site-header .wrap { position: relative; }
.site-header .brand { margin-right: auto; }
.site-nav { flex: 1 1 100%; min-width: 0; order: 3; }
.site-nav ul { list-style: none; margin: 0; padding: 4px 0 8px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.site-nav ul::-webkit-scrollbar { display: none; }
.site-nav a { display: block; white-space: nowrap; color: #fff; text-decoration: none; font-size: .875rem; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); transition: background .2s, transform .2s; }
.site-nav a:hover { background: rgba(255, 255, 255, .18); transform: translateY(-1px); }
.site-nav a[aria-current="page"] { background: #fff; color: #2a1460; border-color: #fff; }
.site-header :focus-visible { outline-color: var(--gold); }
@media (min-width: 900px) {
  .site-header .wrap { flex-wrap: nowrap; min-height: 72px; padding-top: 0; }
  .site-header .brand { margin-right: 0; }
  .site-nav { flex: 1 1 auto; order: 0; }
  .site-nav ul { justify-content: flex-end; flex-wrap: wrap; padding: 0; -webkit-mask-image: none; mask-image: none; overflow: visible; }
  .site-nav a { font-size: .84rem; padding: 6px 11px; }
}

/* ---------- Cinematic hero ---------- */
.hero {
  --focus: #ffd166;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #fff;
  padding: calc(var(--hdr-h) + 10px) 0 44px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 115%, rgba(255, 138, 91, .45), transparent 70%),
    linear-gradient(180deg, rgba(10, 8, 32, .86) 0%, rgba(26, 16, 74, .80) 40%, rgba(80, 22, 104, .80) 78%, rgba(150, 40, 100, .82) 100%),
    var(--hero-img, none) center / cover no-repeat,
    linear-gradient(165deg, #0a0820 0%, #241257 45%, #6a1f72 78%, #d9466f 100%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .7;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff, transparent),
    radial-gradient(1px 1px at 27% 62%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 41% 12%, #fff, transparent),
    radial-gradient(1px 1px at 58% 34%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 73% 9%, #fff, transparent),
    radial-gradient(1px 1px at 86% 48%, #fff, transparent),
    radial-gradient(1px 1px at 93% 22%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 6% 78%, #fff, transparent),
    radial-gradient(1px 1px at 67% 82%, #fff, transparent);
  animation: twinkle 6s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .35; } to { opacity: .85; } }
.orbs { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.orbs span { position: absolute; border-radius: 50%; filter: blur(48px); opacity: .5; will-change: transform; animation: drift 22s ease-in-out infinite alternate; }
.orbs span:nth-child(1) { width: 380px; height: 380px; left: -120px; top: 10%; background: #7c3aed; }
.orbs span:nth-child(2) { width: 300px; height: 300px; right: -80px; top: -60px; background: #ec4899; animation-duration: 26s; animation-delay: -6s; }
.orbs span:nth-child(3) { width: 260px; height: 260px; left: 40%; bottom: -120px; background: #f59e0b; opacity: .35; animation-duration: 30s; animation-delay: -12s; }
.orbs span:nth-child(4) { width: 220px; height: 220px; right: 18%; bottom: 20%; background: #06b6d4; opacity: .28; animation-duration: 24s; animation-delay: -3s; }
@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(60px, -40px, 0) scale(1.15); }
  100% { transform: translate3d(-40px, 50px, 0) scale(.95); }
}
.hero-head { text-align: center; max-width: 820px; margin: 0 auto 14px; }
.hero h1 { font-size: clamp(2.1rem, 7.2vw, 4.6rem); font-weight: 800; letter-spacing: -.025em; margin: 0 0 .2em; text-shadow: 0 4px 30px rgba(0, 0, 0, .35); }
.hero h1 .glow { background: linear-gradient(92deg, #ffe08a, #ff9f5a 45%, #ff6fa8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { font-size: clamp(.95rem, 2.2vw, 1.15rem); color: rgba(255, 255, 255, .88); margin: 0 auto; max-width: 640px; line-height: 1.5; }

/* ---------- Tool layout ---------- */
.tool { display: grid; gap: 18px; align-items: start; }
@media (min-width: 960px) {
  .tool.tool-wheel { grid-template-columns: minmax(0, 1fr) minmax(330px, 410px); gap: 32px; }
}
.wheel-col { display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: 0; }
.wheel-wrap { position: relative; width: min(100%, 540px, 58vh); aspect-ratio: 1 / 1; }
@supports (height: 1svh) { .wheel-wrap { width: min(100%, 540px, 58svh); } }
@media (min-width: 960px) {
  .wheel-wrap { width: min(100%, 560px, max(320px, calc(100vh - 330px))); }
  .hero h1 { font-size: clamp(2.6rem, 5vw, 4.2rem); }
  .lede { max-width: 760px; }
}
.wheel-wrap::before { content: ""; position: absolute; inset: 4%; border-radius: 50%; background: radial-gradient(circle, rgba(255, 209, 102, .55), rgba(236, 72, 153, .25) 55%, transparent 72%); filter: blur(26px); z-index: -1; animation: halo 4s ease-in-out infinite alternate; }
@keyframes halo { from { transform: scale(.96); opacity: .7; } to { transform: scale(1.06); opacity: 1; } }
.wheel-wrap canvas { width: 100%; height: 100%; cursor: pointer; border-radius: 50%; touch-action: manipulation; }
.wheel-wrap canvas:focus-visible { outline: 4px solid var(--gold); outline-offset: 4px; border-radius: 50%; }
.spinning .wheel-wrap::before { animation-duration: .6s; }

/* buttons */
.btn {
  -webkit-appearance: none; appearance: none; font: inherit; font-weight: 700; font-size: .92rem; line-height: 1.2;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 14px; border-radius: 999px; cursor: pointer;
  color: #fff; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .24);
  transition: transform .15s ease, background .2s, box-shadow .2s; text-decoration: none;
}
.btn:hover { background: rgba(255, 255, 255, .2); transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.95); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-big {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: 56px; min-width: 210px; padding: 12px 36px; font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; letter-spacing: .01em;
  color: #2a0a1e; border: 0; background: linear-gradient(135deg, #ffd666, #ff9a3d 50%, #ff5f93);
  box-shadow: 0 10px 30px rgba(255, 95, 147, .45), inset 0 -3px 0 rgba(0, 0, 0, .15);
}
.btn-big::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; z-index: -1; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .6), transparent); transform: skewX(-20deg); animation: shine 3.2s ease-in-out infinite; }
@keyframes shine { 0%, 60% { left: -60%; } 100% { left: 130%; } }
.btn-big:hover { background: linear-gradient(135deg, #ffe08a, #ffad5c 50%, #ff79a6); box-shadow: 0 14px 36px rgba(255, 95, 147, .6), inset 0 -3px 0 rgba(0, 0, 0, .15); }
.btn-big[aria-disabled="true"] { filter: saturate(.6); cursor: progress; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* result card */
.result {
  width: 100%; max-width: 540px; min-height: 5.4rem; padding: 12px 18px; text-align: center;
  border-radius: 18px; background: rgba(12, 8, 40, .55); border: 1px solid rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  display: flex; flex-direction: column; justify-content: center;
}
.result-label { font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .75); }
.result-text { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.45rem, 5.4vw, 2.3rem); line-height: 1.15; overflow-wrap: anywhere; }
.result-sub { font-size: .92rem; color: rgba(255, 255, 255, .82); overflow-wrap: anywhere; }
.result-sub:empty { display: none; }
.result.win { animation: pop .7s cubic-bezier(.2, 1.5, .4, 1); border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255, 209, 102, .55), 0 0 46px rgba(255, 209, 102, .4); }
.result.win .result-text { background: linear-gradient(92deg, #fff3c4, #ffd166 40%, #ff9fc4); -webkit-background-clip: text; background-clip: text; color: transparent; }
@keyframes pop { 0% { transform: scale(.82); opacity: .4; } 60% { transform: scale(1.05); opacity: 1; } 100% { transform: scale(1); } }
.result-list { margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.result-list li { background: rgba(255, 255, 255, .14); border-radius: 999px; padding: 3px 12px; font-weight: 700; overflow-wrap: anywhere; }
.result-list:empty { display: none; }
.kbd-hint { font-size: .82rem; color: rgba(255, 255, 255, .72); margin: 0; text-align: center; }
kbd { font-family: inherit; font-size: .8em; padding: 1px 6px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .08); }

/* glass panel */
.panel {
  min-width: 0; padding: 18px; border-radius: var(--radius);
  background: rgba(14, 10, 44, .58); border: 1px solid rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.panel h2 { font-size: 1.15rem; margin: 0; }
.stack > * + * { margin-top: 14px; }
.panel.ask { max-width: 520px; padding: 12px 14px; }
.panel.ask label { display: block; margin-bottom: 6px; }
.panel label, .panel legend { font-weight: 700; font-size: .92rem; }
.panel textarea, .panel input[type="text"], .panel input[type="number"], .panel select {
  width: 100%; font: inherit; font-size: 1rem; color: #fff; background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .26); border-radius: 12px; padding: 10px 12px;
}
.panel textarea { min-height: 200px; resize: vertical; line-height: 1.5; margin-top: 6px; }
.panel select option { color: #111; }
.panel ::placeholder { color: rgba(255, 255, 255, .6); }
.panel textarea:focus-visible, .panel input:focus-visible, .panel select:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }
.meta-row { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: .88rem; color: rgba(255, 255, 255, .82); margin: 6px 0 10px; }
.count { font-weight: 700; color: #fff; }
.opts { border: 0; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.opts legend { margin-bottom: 6px; padding: 0; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600 !important; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: #ff9a3d; flex: none; margin: 0; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.field label { display: block; margin-bottom: 4px; }
.status { min-height: 1.3em; font-size: .88rem; color: #ffe08a; margin: 8px 0 0; }
.sublist { margin-top: 14px; font-size: .9rem; color: rgba(255, 255, 255, .85); }
.sublist[hidden] { display: none; }
.sublist ol, .sublist ul { margin: 6px 0 8px; padding-left: 1.3em; max-height: 9.5em; overflow: auto; }
.panel details { margin-top: 14px; border-top: 1px solid rgba(255, 255, 255, .14); padding-top: 10px; }
.panel summary { cursor: pointer; font-weight: 700; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg .btn[aria-pressed="true"] { background: #fff; color: #2a1460; border-color: #fff; }
.tally { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; }
.tally li { background: rgba(255, 255, 255, .1); border-radius: 12px; padding: 6px 12px; font-weight: 700; }
.tally li span { font-family: var(--font-display); font-size: 1.2rem; margin-left: 6px; }

/* ---------- Centered tool card (coin, dice, 8 ball) ---------- */
.tool-solo { max-width: 760px; margin: 0 auto; display: grid; gap: 16px; justify-items: center; }
.tool-solo .panel { width: 100%; }
.controls { display: flex; flex-wrap: wrap; align-items: end; justify-content: center; gap: 12px; }
.controls .field { min-width: 110px; }

/* coin */
.coin-stage { width: 100%; min-height: 230px; display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 18px; perspective: 900px; cursor: pointer; padding: 8px 0; border-radius: 20px; }
.coin-slot { position: relative; width: var(--coin, 170px); height: var(--coin, 170px); }
.coin-slot::after { content: ""; position: absolute; left: 15%; right: 15%; bottom: -16px; height: 12px; border-radius: 50%; background: rgba(0, 0, 0, .45); filter: blur(6px); transition: transform .5s; }
.coin-slot.toss::after { animation: shadow 1.2s ease-in-out; }
.coin-slot.toss .coin-lift { animation: toss 1.2s cubic-bezier(.3, .6, .4, 1); }
@keyframes toss { 0% { transform: translateY(0); } 45% { transform: translateY(-110px); } 100% { transform: translateY(0); } }
@keyframes shadow { 45% { transform: scale(.45); opacity: .4; } }
.coin-lift { width: 100%; height: 100%; transform-style: preserve-3d; }
.coin { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 1.2s cubic-bezier(.25, .7, .3, 1); }
.coin .face { position: absolute; inset: 0; border-radius: 50%; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: grid; place-items: center; text-align: center; font-family: var(--font-display); font-weight: 800; }
.coin .heads { background: radial-gradient(circle at 32% 28%, #fff6c8, #ffd34d 35%, #e0a21b 70%, #a86a0a); color: #3d2600; box-shadow: inset 0 0 0 6px #c88a15, inset 0 0 0 9px #ffe58a, 0 8px 24px rgba(0, 0, 0, .35); }
.coin .tails { background: radial-gradient(circle at 32% 28%, #ffffff, #dfe4ee 35%, #a9b2c4 70%, #6f7a90); color: #1d2333; transform: rotateX(180deg); box-shadow: inset 0 0 0 6px #8e98ad, inset 0 0 0 9px #eef1f7, 0 8px 24px rgba(0, 0, 0, .35); }
.coin .face b { display: block; font-size: calc(var(--coin, 170px) * .36); line-height: 1; }
.coin .face small { display: block; font-size: calc(var(--coin, 170px) * .1); letter-spacing: .12em; margin-top: 2px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; width: 100%; }
.stat { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); border-radius: 14px; padding: 10px 12px; text-align: center; }
.stat b { display: block; font-family: var(--font-display); font-size: 1.5rem; line-height: 1.1; }
.stat span { font-size: .8rem; color: rgba(255, 255, 255, .8); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; list-style: none; margin: 8px 0 0; padding: 0; }
.chips li { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .8rem; }
.chips .h { background: #ffd34d; color: #3d2600; }
.chips .t { background: #cfd6e4; color: #1d2333; }

/* dice */
.dice-tray { width: 100%; min-height: 150px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-content: center; perspective: 700px; padding: 8px 0; }
.die { position: relative; width: 70px; height: 70px; border-radius: 16px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 1.8rem; color: #1b1736; background: linear-gradient(145deg, #ffffff, #e7e2f7); box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .12), 0 10px 22px rgba(0, 0, 0, .35); }
.die small { position: absolute; bottom: 4px; right: 8px; font-family: var(--font-body); font-size: .62rem; font-weight: 700; color: #5b5675; }
.die.d4 { background: linear-gradient(145deg, #fff, #d8f3ff); } .die.d8 { background: linear-gradient(145deg, #fff, #ffe3ef); }
.die.d10 { background: linear-gradient(145deg, #fff, #e3ffe6); } .die.d12 { background: linear-gradient(145deg, #fff, #fff2c9); }
.die.d20 { background: linear-gradient(145deg, #fff3d6, #ffc96b); } .die.d100 { background: linear-gradient(145deg, #fff, #e2dcff); }
.die.max { box-shadow: 0 0 0 3px #ffd166, 0 0 26px rgba(255, 209, 102, .7); }
.die.drop { opacity: .4; text-decoration: line-through; }
.die.tumble { animation: tumble .55s cubic-bezier(.3, .7, .4, 1); }
@keyframes tumble { 0% { transform: translateY(-40px) rotateX(200deg) rotateY(120deg) scale(.8); } 70% { transform: translateY(6px) rotateX(-10deg) rotateY(-8deg); } 100% { transform: none; } }
.dice-total { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.4rem, 9vw, 3.6rem); line-height: 1; }
.die-pick { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; border: 0; padding: 0; margin: 0; }
.die-pick legend { width: 100%; text-align: center; margin-bottom: 6px; }
.die-pick label { position: relative; }
.die-pick input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.die-pick span { display: inline-flex; min-width: 52px; min-height: 40px; align-items: center; justify-content: center; padding: 6px 10px; border-radius: 12px; font-weight: 800; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .24); transition: transform .15s; }
.die-pick input:checked + span { background: #fff; color: #2a1460; }
.die-pick input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.die-pick label:hover span { transform: translateY(-2px); }
.notation { display: flex; gap: 8px; width: 100%; }
.notation input { flex: 1; min-width: 0; }

/* magic 8 ball */
.ball-stage { display: grid; place-items: center; padding: 6px 0; }
.ball { position: relative; width: min(290px, 74vw); aspect-ratio: 1 / 1; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: radial-gradient(circle at 34% 26%, #6b6b80 0%, #24232e 22%, #07070b 62%, #000 100%); box-shadow: 0 30px 60px rgba(0, 0, 0, .55), inset -18px -24px 50px rgba(0, 0, 0, .8), 0 0 80px rgba(124, 58, 237, .35); }
.ball::before { content: ""; position: absolute; top: 9%; left: 22%; width: 26%; height: 14%; border-radius: 50%; background: radial-gradient(ellipse, rgba(255, 255, 255, .55), transparent 70%); transform: rotate(-25deg); }
.ball .window { position: absolute; inset: 24%; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #13235a, #050a24 75%); box-shadow: inset 0 0 0 5px #1d1d29, inset 0 6px 22px rgba(0, 0, 0, .9); display: grid; place-items: center; overflow: hidden; }
.ball .tri { width: 88%; height: 80%; clip-path: polygon(50% 100%, 0 8%, 100% 8%); background: linear-gradient(180deg, #2b4fd6, #1a36a8); display: flex; align-items: flex-start; justify-content: center; padding: 18% 22% 0; transition: opacity .7s ease, transform .9s ease, filter .9s ease; }
.ball .tri span { color: #fff; font-weight: 800; font-size: clamp(.62rem, 2.6vw, .8rem); line-height: 1.2; text-align: center; text-transform: uppercase; letter-spacing: .03em; max-height: 4.9em; overflow: hidden; }
.ball .tri.hide { opacity: 0; transform: translateY(18px) scale(.9); filter: blur(4px); transition-duration: .2s; }
.ball.shake { animation: shake .9s cubic-bezier(.36, .07, .19, .97); }
@keyframes shake { 10%, 90% { transform: translate(-3px, 1px) rotate(-2deg); } 20%, 80% { transform: translate(6px, -3px) rotate(4deg); } 30%, 50%, 70% { transform: translate(-10px, 4px) rotate(-6deg); } 40%, 60% { transform: translate(10px, -4px) rotate(6deg); } }

/* ---------- Content sections ---------- */
.content { padding: 56px 0 24px; }
.section { margin: 0 0 56px; }
.section > p, .section-intro { max-width: 760px; }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
@media (prefers-color-scheme: dark) { .eyebrow { color: #c4b5fd; } }
.steps { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; counter-reset: step; }
.steps li { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 20px 18px; box-shadow: var(--shadow); counter-increment: step; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 12px; border-radius: 12px; font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; color: #2a0a1e; background: linear-gradient(135deg, #ffd666, #ff9a3d 55%, #ff5f93); }
.steps li strong { display: block; font-family: var(--font-display); font-size: 1.1rem; margin-bottom: 4px; }
.steps li p { margin: 0; color: var(--muted); font-size: .98rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 18px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 20px; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); }
.card h3 { margin: 12px 0 6px; }
.card p { margin: 0; color: var(--muted); font-size: .98rem; }
.icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #7c3aed, #db2777); box-shadow: 0 8px 18px rgba(124, 58, 237, .3); }
.icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cards > :nth-child(3n+2) .icon { background: linear-gradient(135deg, #f59e0b, #db2777); }
.cards > :nth-child(3n+3) .icon { background: linear-gradient(135deg, #0891b2, #7c3aed); }
.prose-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 24px; box-shadow: var(--shadow); max-width: 860px; }
.prose-card p:last-child, .prose-card ul:last-child { margin-bottom: 0; }
.prose-card ul { padding-left: 1.2em; }
.prose-card li { margin-bottom: .4em; }
.answers { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-top: 18px; }
.answers .card ol { margin: 8px 0 0; padding-left: 1.3em; color: var(--text); }
.answers .card li { margin-bottom: 2px; }
.tag { display: inline-block; font-size: .78rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.tag-pos { background: #dcfce7; color: #14532d; } .tag-neu { background: #fef3c7; color: #713f12; } .tag-neg { background: #fee2e2; color: #7f1d1d; }
.faq { display: grid; gap: 12px; margin-top: 18px; max-width: 860px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.faq summary { cursor: pointer; list-style: none; padding: 16px 52px 16px 20px; position: relative; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-weight: 800; transition: transform .25s; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details > div { padding: 0 20px 16px; color: var(--muted); }
.faq details > div p:last-child { margin: 0; }
.related { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-top: 18px; }
.related a { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow); font-weight: 700; transition: transform .2s, border-color .2s; }
.related a:hover { transform: translateY(-3px); border-color: var(--accent); }
.related .icon { width: 40px; height: 40px; border-radius: 12px; }
.related small { display: block; font-weight: 500; color: var(--muted); font-size: .85rem; }
.note { font-size: .88rem; color: var(--muted); }
.page-body { max-width: 820px; }
.page-body h2 { font-size: 1.5rem; margin-top: 1.6em; }
.cta-mail { display: inline-flex; align-items: center; gap: 10px; font-size: 1.2rem; font-weight: 800; padding: 14px 22px; border-radius: 999px; color: #fff; background: linear-gradient(135deg, #7c3aed, #db2777); text-decoration: none; box-shadow: 0 10px 26px rgba(124, 58, 237, .35); transition: transform .15s; overflow-wrap: anywhere; }
.cta-mail:hover { transform: translateY(-2px); }
.cta-mail svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; flex: none; }
.hero-simple { padding-bottom: 56px; }
.hero-simple .lede { margin-bottom: 0; }

/* ---------- Footer ---------- */
.site-footer { color: #e9e5ff; background: linear-gradient(180deg, #120d33, #0a0820); padding: 44px 0 28px; margin-top: 24px; font-size: .95rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer :focus-visible { outline-color: var(--gold); }
.foot-grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.site-footer h2 { font-size: 1rem; letter-spacing: .08em; text-transform: uppercase; color: #ffd166; margin-bottom: 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer p { color: #c9c3e8; }
.foot-bottom { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 28px; padding-top: 16px; font-size: .85rem; color: #b9b3d6; }

/* ---------- All tools menu ---------- */
.all-tools { order: 2; }
.all-tools summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; white-space: nowrap; font-size: .875rem; font-weight: 700; padding: 6px 14px; border-radius: 999px; color: #2a1460; background: var(--gold); border: 1px solid var(--gold); }
.all-tools summary::-webkit-details-marker { display: none; }
.all-tools summary svg { width: 16px; height: 16px; }
.all-tools[open] summary { background: #fff; border-color: #fff; }
.all-tools .menu { position: absolute; z-index: 30; left: 16px; right: 16px; top: calc(100% + 6px); padding: 14px; border-radius: 18px; background: #160f3d; border: 1px solid rgba(255, 255, 255, .18); box-shadow: 0 24px 60px rgba(0, 0, 0, .5); max-height: min(70vh, 560px); overflow: auto; }
.all-tools .menu h2 { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin: 4px 6px 8px; }
.all-tools .menu ul { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 4px; }
.all-tools .menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; color: #fff; text-decoration: none; font-weight: 700; font-size: .92rem; line-height: 1.25; }
.all-tools .menu a:hover, .all-tools .menu a[aria-current="page"] { background: rgba(255, 255, 255, .12); }
.all-tools .menu a small { display: block; font-weight: 500; font-size: .78rem; color: rgba(255, 255, 255, .75); }
.all-tools .menu svg { width: 20px; height: 20px; flex: none; color: var(--gold); }
@media (max-width: 420px) {
  .site-header .wrap { column-gap: 10px; }
  .site-header .brand { font-size: 1.05rem; gap: 8px; }
  .site-header .brand svg { width: 30px; height: 30px; }
  .all-tools summary { padding: 5px 11px; font-size: .84rem; }
}
@media (min-width: 900px) { .all-tools { order: 0; } .all-tools .menu { left: auto; width: min(720px, calc(100vw - 32px)); } }

/* ---------- Presets and color swatch ---------- */
.preset-label { display: block; font-weight: 700; font-size: .92rem; margin-bottom: 6px; }
.swatch { display: inline-block; width: 1em; height: 1em; border-radius: 4px; margin-right: 8px; vertical-align: -2px; border: 1px solid rgba(255, 255, 255, .7); }

/* ---------- Embed dialog ---------- */
.embed-dlg { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; padding: 22px; border-radius: 20px; color: #fff; background: #160f3d; border: 1px solid rgba(255, 255, 255, .2); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.embed-dlg::backdrop { background: rgba(6, 4, 20, .72); }
.embed-dlg h2 { font-size: 1.4rem; margin: 0 48px 6px 0; }
.embed-dlg p { font-size: .95rem; color: rgba(255, 255, 255, .85); margin: 0 0 .6em; }
.embed-dlg label { display: block; font-weight: 700; font-size: .92rem; margin: 14px 0 6px; }
.embed-dlg textarea { width: 100%; font: .82rem/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; color: #fff; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .26); border-radius: 12px; padding: 10px 12px; resize: vertical; word-break: break-all; }
.embed-dlg textarea:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }
.embed-dlg .btn { margin-top: 8px; }
.embed-dlg .x { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; padding: 0; }
.embed-dlg .x svg { width: 20px; height: 20px; }

/* ---------- Team generator ---------- */
.tool-teams { display: grid; gap: 18px; align-items: start; }
@media (min-width: 960px) { .tool-teams { grid-template-columns: minmax(330px, 410px) minmax(0, 1fr); gap: 28px; } }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px 18px; border: 0; padding: 0; margin: 0; }
.radio-row legend { font-weight: 700; font-size: .92rem; margin-bottom: 6px; padding: 0; }
.radio-row label { display: flex; align-items: center; gap: 8px; font-weight: 600 !important; cursor: pointer; }
.radio-row input { width: 20px; height: 20px; accent-color: #ff9a3d; margin: 0; }
.team-summary { font-size: .9rem; color: rgba(255, 255, 255, .85); margin: 0; min-height: 1.4em; }
.team-board { min-width: 0; display: grid; gap: 14px; justify-items: center; }
.team-board > * { width: 100%; }
.team-board .btn-big { width: auto; }
.team-board h2 { font-size: 1.15rem; margin: 0; }
.team-board h2[hidden] { display: none; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.team-grid[hidden] { display: none; }
.team-card { --t0: #1d4ed8; --t1: #be185d; --t2: #15803d; --t3: #c2410c; --t4: #7c3aed; --t5: #0f766e; --t6: #b45309; --t7: #64748b;
  border-radius: 18px; padding: 14px 16px; background: rgba(14, 10, 44, .62); border: 1px solid rgba(255, 255, 255, .16); border-top: 6px solid var(--team); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.team-card h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 1.15rem; margin: 0 0 8px; overflow-wrap: anywhere; }
.team-n { font-family: var(--font-body); font-size: .78rem; font-weight: 600; color: rgba(255, 255, 255, .78); white-space: nowrap; }
.team-card ol { margin: 0; padding-left: 1.4em; }
.team-card li { margin: 2px 0; font-weight: 600; overflow-wrap: anywhere; }
.cap { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #2a1460; background: var(--gold); }
.team-card.deal { animation: deal .5s cubic-bezier(.2, 1.3, .4, 1) both; animation-delay: calc(var(--i) * 70ms); }
@keyframes deal { from { opacity: 0; transform: translateY(18px) scale(.94); } to { opacity: 1; transform: none; } }

/* ---------- Embedded wheel page ---------- */
.embed-body { min-height: 100vh; color: #fff; background: radial-gradient(ellipse 90% 60% at 50% 110%, rgba(255, 138, 91, .35), transparent 70%), linear-gradient(165deg, #0a0820 0%, #241257 55%, #6a1f72 100%); }
.embed-main { --focus: #ffd166; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.embed-main .wheel-wrap { width: min(100%, 520px, calc(100vh - 220px)); min-width: 200px; }
.embed-main .btn-big { min-height: 48px; min-width: 170px; padding: 8px 28px; font-size: 1.15rem; }
.embed-main .result { min-height: 4.2rem; padding: 8px 14px; }
.embed-main .result-text { font-size: clamp(1.15rem, 5vw, 1.8rem); }
.embed-credit { font-size: .82rem; margin: 0; color: rgba(255, 255, 255, .8); }
.embed-credit a { color: #ffe08a; font-weight: 700; }

/* confetti layer */
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 100; }

@media (max-width: 420px) {
  .hero { padding-bottom: 32px; }
  .lede { font-size: .92rem; }
  .btn-big { min-width: 180px; font-size: 1.2rem; }
  .panel { padding: 14px; }
  .die { width: 58px; height: 58px; font-size: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .orbs span, .hero::after, .brand svg, .btn-big::after, .wheel-wrap::before, .team-card.deal { animation: none !important; }
}
