/* Stargazer Games — site styles (no external dependencies) */

:root {
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 1180px;

  /* Deep space */
  --bg: #04050d;
  --bg-2: rgba(7, 9, 28, .55);
  --surface: rgba(12, 16, 42, .66);
  --surface-2: rgba(40, 48, 104, .5);
  --line: rgba(150, 170, 255, .16);
  --line-strong: rgba(170, 190, 255, .3);
  --text: #eef1ff;
  --muted: #a5aed6;
  --accent: #86c5ff;
  --accent-strong: #5a6cff;
  --accent-2: #ff7fd1;
  --accent-ink: #050616;
  --glow: rgba(110, 130, 255, .38);
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, .9);
  --star: 255, 255, 255;
  --nebula-filter: none;
  --nebula-opacity: 1;
  --veil: linear-gradient(180deg, rgba(4, 5, 13, 0), rgba(4, 5, 13, .28) 65%, rgba(4, 5, 13, .5));
  color-scheme: dark;
}

:root[data-theme="light"] { 
    --bg: #f1f0fb;
    --bg-2: rgba(255, 255, 255, .5);
    --surface: rgba(255, 255, 255, .74);
    --surface-2: rgba(232, 230, 255, .75);
    --line: rgba(40, 40, 120, .14);
    --line-strong: rgba(40, 40, 120, .28);
    --text: #13143a;
    --muted: #505788;
    --accent: #4b46e5;
    --accent-strong: #4b46e5;
    --accent-2: #c026a8;
    --accent-ink: #ffffff;
    --glow: rgba(90, 80, 230, .22);
    --shadow: 0 24px 50px -28px rgba(40, 30, 120, .4);
    --star: 75, 70, 229;
    --nebula-filter: invert(1) hue-rotate(180deg) saturate(1.5);
    --nebula-opacity: .55;
    --veil: linear-gradient(180deg, rgba(241, 240, 251, .2), rgba(241, 240, 251, .5));
    color-scheme: light;
   }

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) { 
    --bg: #f1f0fb;
    --bg-2: rgba(255, 255, 255, .5);
    --surface: rgba(255, 255, 255, .74);
    --surface-2: rgba(232, 230, 255, .75);
    --line: rgba(40, 40, 120, .14);
    --line-strong: rgba(40, 40, 120, .28);
    --text: #13143a;
    --muted: #505788;
    --accent: #4b46e5;
    --accent-strong: #4b46e5;
    --accent-2: #c026a8;
    --accent-ink: #ffffff;
    --glow: rgba(90, 80, 230, .22);
    --shadow: 0 24px 50px -28px rgba(40, 30, 120, .4);
    --star: 75, 70, 229;
    --nebula-filter: invert(1) hue-rotate(180deg) saturate(1.5);
    --nebula-opacity: .55;
    --veil: linear-gradient(180deg, rgba(241, 240, 251, .2), rgba(241, 240, 251, .5));
    color-scheme: light;
   }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  position: relative;
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
/* nebula backdrop: fixed layer so it works on mobile (no background-attachment: fixed) */
body::before, body::after { content: ""; position: fixed; inset: 0; pointer-events: none; }
body::before { z-index: -2; background: url("space.jpg") center / cover no-repeat; filter: var(--nebula-filter); opacity: var(--nebula-opacity); }
body::after { z-index: -1; background: var(--veil); }
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--text); }
h1, h2, h3, h4, h5, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.icon { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent-strong); color: #fff; padding: 10px 16px; border-radius: 10px; text-decoration: none; transition: top .2s; }
.skip-link:focus { top: 12px; color: #fff; }
.container { width: min(100% - 40px, var(--maxw)); margin-inline: auto; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); font-weight: 700; letter-spacing: -.01em; }
.brand img { width: 40px; height: 40px; object-fit: contain; }
.logo-dark { display: none; }
:root[data-theme="light"] .logo-light { display: none; }
:root[data-theme="light"] .logo-dark { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .logo-light { display: none; }
  :root:not([data-theme]) .logo-dark { display: block; }
}
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a:not(.btn) {
  color: var(--muted); text-decoration: none; font-size: .94rem; font-weight: 500;
  padding: 8px 14px; border-radius: 999px; transition: color .2s, background .2s;
  display: inline-flex; align-items: center; gap: 6px;
}
.nav a:not(.btn):hover, .nav a[aria-current="true"] { color: var(--text); background: var(--surface-2); }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px;
  background: transparent; border: 1px solid var(--line); cursor: pointer; color: var(--text); transition: background .2s, border-color .2s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.icon-btn .icon { width: 18px; height: 18px; }
.theme-sun { display: none; }
:root[data-theme="light"] .theme-sun { display: block; }
:root[data-theme="light"] .theme-moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .theme-sun { display: block; }
  :root:not([data-theme]) .theme-moon { display: none; }
}
.menu-btn { display: none; }
@media (max-width: 820px) {
  .menu-btn { display: inline-grid; margin-left: auto; }
  .js .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch;
    padding: 12px 20px 20px; background: var(--bg); border-bottom: 1px solid var(--line); margin: 0;
  }
  .js .nav.open { display: flex; }
  .nav a:not(.btn) { padding: 12px 14px; }
  .nav { flex-wrap: wrap; justify-content: flex-end; }
  .nav-theme { align-self: flex-end; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; font-weight: 600; font-size: .95rem; line-height: 1.2;
  text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: transform .15s, background .2s, border-color .2s, box-shadow .2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, #6c5cff, #2f9bff); color: #fff; box-shadow: 0 8px 26px -8px rgba(90, 108, 255, .7); }
.btn-primary:hover { filter: brightness(1.12) saturate(1.1); color: #fff; box-shadow: 0 12px 34px -8px rgba(90, 108, 255, .85); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 8px 14px; font-size: .86rem; }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero { position: relative; isolation: isolate; padding: clamp(72px, 12vw, 150px) 0 clamp(64px, 9vw, 110px); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: radial-gradient(55% 60% at 28% 42%, rgba(4, 5, 13, .5), transparent 75%);
}
:root[data-theme="light"] .hero::before { background: radial-gradient(70% 70% at 30% 40%, rgba(241, 240, 251, .6), transparent 75%); }
.stars, .stars::after {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 22%, rgba(var(--star), .9), transparent),
    radial-gradient(1px 1px at 28% 68%, rgba(var(--star), .7), transparent),
    radial-gradient(1.6px 1.6px at 44% 14%, rgba(var(--star), .9), transparent),
    radial-gradient(1px 1px at 61% 48%, rgba(var(--star), .6), transparent),
    radial-gradient(1.4px 1.4px at 77% 80%, rgba(var(--star), .8), transparent),
    radial-gradient(1px 1px at 88% 30%, rgba(var(--star), .7), transparent),
    radial-gradient(1.2px 1.2px at 95% 62%, rgba(var(--star), .6), transparent),
    radial-gradient(1px 1px at 6% 86%, rgba(var(--star), .6), transparent);
  background-size: 520px 420px;
  mask-image: linear-gradient(#000 40%, transparent);
  -webkit-mask-image: linear-gradient(#000 40%, transparent);
}
.stars::after { content: ""; background-size: 340px 300px; background-position: 120px 60px; animation: twinkle 6s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

.hero-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 56px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  font-size: .82rem; font-weight: 600; letter-spacing: .02em; color: var(--accent);
}
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 12px var(--accent-2); }
.hero h1 { font-size: clamp(2.6rem, 7vw, 5.2rem); line-height: 1.02; letter-spacing: -.035em; font-weight: 800; margin: 22px 0 22px; }
.hero h1 em {
  font-family: var(--font-display); font-weight: 600; letter-spacing: -.02em;
  background: linear-gradient(100deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--muted); max-width: 40em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.stats { display: flex; flex-wrap: wrap; gap: 14px 40px; margin-top: 52px; padding-top: 28px; border-top: 1px solid var(--line); }
.stat b { display: block; font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stat span { font-size: .85rem; color: var(--muted); }

.hero-art { position: relative; aspect-ratio: 1; display: grid; place-items: center; }
.hero-art .d20 { position: relative; z-index: 1; }
.hero-art .d20 { width: 88%; height: 88%; cursor: grab; touch-action: pan-y; filter: drop-shadow(0 0 3px rgba(4, 5, 13, .9)) drop-shadow(0 0 30px var(--glow)); }
.hero-art .d20:active { cursor: grabbing; }
.hero-art .orbit { position: absolute; inset: 4%; border: 1px dashed var(--line-strong); border-radius: 50%; animation: spin 60s linear infinite; }
.hero-art .orbit::after { content: ""; position: absolute; top: 8%; left: 50%; width: 12px; height: 12px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 18px var(--accent-2); }
.hero-art .orbit.two { inset: 16%; animation-duration: 40s; animation-direction: reverse; }
.hero-art .orbit.two::after { background: var(--accent); box-shadow: 0 0 18px var(--accent); width: 9px; height: 9px; top: auto; bottom: 10%; left: 20%; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { display: none; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 9vw, 110px) 0; }
.section.alt { background: var(--bg-2); border-block: 1px solid var(--line); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 20px 40px; margin-bottom: 40px; }
.kicker { color: var(--accent); font-size: .82rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 10px; }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.1; letter-spacing: -.03em; font-weight: 800; }
.section-head p { color: var(--muted); max-width: 36em; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  transition: transform .25s, border-color .25s, box-shadow .25s;
}

/* ---------- News ---------- */
.news-list { display: grid; gap: 12px; }
.news-item { display: grid; grid-template-columns: 150px 1fr auto; gap: 8px 24px; align-items: center; padding: 18px 22px; }
.news-item:hover { border-color: var(--line-strong); }
.news-item time { font-size: .85rem; font-weight: 600; color: var(--accent-2); font-variant-numeric: tabular-nums; }
.news-item p { color: var(--text); }
@media (max-width: 720px) { .news-item { grid-template-columns: 1fr; } .news-item .btn { justify-self: start; } }

/* ---------- Featured system ---------- */
.feature { display: grid; grid-template-columns: .95fr 1.05fr; gap: 24px; align-items: start; }
@media (max-width: 960px) { .feature { grid-template-columns: minmax(0, 1fr); } }
.feature-main {
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 32px; align-items: center;
  padding: clamp(24px, 4vw, 40px); position: relative; overflow: hidden;
  background:
    radial-gradient(80% 70% at 0% 0%, var(--glow), transparent 70%),
    radial-gradient(60% 60% at 100% 100%, color-mix(in srgb, var(--accent-2) 18%, transparent), transparent 70%),
    var(--surface);
}
.chip {
  display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: .75rem; font-weight: 600; letter-spacing: .02em;
  color: var(--muted); border: 1px solid var(--line-strong); background: transparent;
}
.feature-main h3 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); line-height: 1.1; letter-spacing: -.03em; font-weight: 800; margin: 14px 0 6px; }
.byline { color: var(--muted); font-size: .9rem; margin-bottom: 18px; }
.feature-main p + p { margin-top: 14px; }
.feature-main .note { color: var(--muted); }
.feature-main strong { color: var(--text); }
.download-hero {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; gap: 6px 18px; align-items: center; padding: 20px;
  border-radius: var(--radius-sm); background: color-mix(in srgb, var(--bg) 55%, transparent); border: 1px solid var(--line-strong);
}
.download-hero h4 { font-size: 1.1rem; font-weight: 700; }
.download-hero .meta { color: var(--muted); font-size: .85rem; }
.download-hero p.desc { grid-column: 1 / -1; color: var(--muted); font-size: .92rem; margin-top: 10px; }
.download-hero .btn { grid-column: 1 / -1; margin-top: 10px; }

.sub-head { font-size: .82rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 4px 14px; }
.rows { display: grid; gap: 10px; }
.row { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 16px; align-items: center; padding: 16px 18px; }
@media (max-width: 560px) { .row { grid-template-columns: auto 1fr; } .row > .btn { grid-column: 1 / -1; } }
.row:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); transform: translateX(3px); }
.row h5 { font-size: 1rem; font-weight: 700; line-height: 1.3; }
.row .meta { font-size: .8rem; color: var(--accent-2); font-weight: 500; margin: 2px 0 4px; }
.row p { font-size: .9rem; color: var(--muted); line-height: 1.5; }

@media (max-width: 860px) { .feature-main { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Covers ---------- */
.thumb { display: block; width: 58px; flex: none; }
.thumb .cover-img { width: 100%; height: auto; border-radius: 4px; border: 1px solid var(--line-strong); box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .6); background: var(--surface-2); }
.thumb-fb { aspect-ratio: 440 / 570; border-radius: 4px; border: 1px solid var(--line-strong); display: grid; place-items: center; text-align: center;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 30%, var(--surface)), color-mix(in srgb, var(--accent-2) 22%, var(--surface))); }
.thumb-fb b { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; padding: 0 4px; color: var(--text); }
.big-cover { grid-row: span 3; width: 150px; }
.big-cover .cover-img { width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--line-strong); box-shadow: 0 14px 28px -10px rgba(0, 0, 0, .7); transform: rotate(-2deg); transition: transform .3s; }
.download-hero:hover .big-cover .cover-img { transform: rotate(0) scale(1.03); }
.banner { position: relative; margin: -24px -24px 20px; height: 210px; overflow: hidden; background: var(--surface-2); }
.banner .cover-img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .5s; }
.game:hover .banner .cover-img { transform: scale(1.05); }
.banner::after { content: ""; position: absolute; inset: auto 0 0 0; height: 60px; background: linear-gradient(transparent, var(--surface)); }
.banner-fb { display: grid; place-items: center; background:
  radial-gradient(70% 90% at 50% 0%, hsl(var(--h) 80% 55% / .35), transparent 80%),
  linear-gradient(160deg, hsl(var(--h) 55% 22%), hsl(calc(var(--h) + 40) 50% 12%)); }
.banner-fb span { font-size: 4.2rem; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .5)); }

/* ---------- Game cards ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filter {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent;
  color: var(--muted); font-size: .88rem; font-weight: 600; cursor: pointer; transition: all .2s;
}
.filter:hover { color: var(--text); background: var(--surface-2); }
.filter[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.game {
  --h: 260;
  display: flex; flex-direction: column; padding: 24px; position: relative; overflow: hidden;
}
.game::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, hsl(var(--h) 85% 62%), hsl(calc(var(--h) + 40) 90% 65%));
}
.game:hover { transform: translateY(-5px); border-color: hsl(var(--h) 70% 60% / .6); box-shadow: var(--shadow); }
.game-top { display: flex; justify-content: space-between; align-items: start; gap: 14px; margin-bottom: 12px; }
.game h3 { font-size: 1.28rem; line-height: 1.2; letter-spacing: -.02em; font-weight: 750; }
.emoji {
  flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem;
  background: hsl(var(--h) 80% 60% / .16); border: 1px solid hsl(var(--h) 80% 60% / .3);
}
.game .byline { margin-bottom: 12px; }
.game p.desc { color: var(--muted); font-size: .95rem; flex: 1; margin-bottom: 18px; }
.game .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.game .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.game .actions .btn { flex: 1 1 auto; }
.game-top { margin-top: 0; }
.game[hidden] { display: none; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 1.3fr .7fr; gap: 56px; align-items: center; }
.about .prose { display: grid; gap: 18px; color: var(--muted); font-size: 1.05rem; }
.about .prose strong { color: var(--text); }
.portrait { position: relative; justify-self: center; width: min(100%, 320px); }
.portrait::before { content: ""; position: absolute; inset: -14px; border-radius: 28px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); opacity: .5; filter: blur(30px); }
.portrait img { position: relative; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 24px; border: 1px solid var(--line-strong); }
.portrait figcaption { position: relative; margin-top: 14px; text-align: center; font-size: .9rem; color: var(--muted); }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; gap: 36px; } }

/* ---------- Tools / community ---------- */
.tools { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
@media (max-width: 900px) { .tools { grid-template-columns: minmax(0, 1fr); } }
.tools > *, .feature > *, .about > *, .hero-grid > * { min-width: 0; }
.panel { padding: clamp(24px, 3.5vw, 36px); }
.panel h3 { font-size: 1.5rem; letter-spacing: -.02em; font-weight: 800; margin-bottom: 6px; }
.panel > p { color: var(--muted); margin-bottom: 20px; }
.dice-form { display: flex; gap: 10px; }
.dice-form input {
  flex: 1; min-width: 0; padding: 12px 18px; border-radius: 999px; background: color-mix(in srgb, var(--bg) 65%, transparent); border: 1px solid var(--line-strong);
  font-family: var(--font-mono); font-size: 1.05rem;
}
.dice-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--glow); }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.preset { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--muted); font-family: var(--font-mono); font-size: .82rem; cursor: pointer; transition: all .15s; }
.preset:hover { color: var(--text); border-color: var(--accent); }
.dice-out { margin-top: 22px; min-height: 96px; display: flex; align-items: center; gap: 22px; padding: 18px 22px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--bg) 60%, transparent); border: 1px dashed var(--line-strong); }
.dice-out .icon-die { width: 48px; height: 48px; color: var(--accent); flex: none; }
.dice-out.rolling .icon-die { animation: shake .3s ease-in-out infinite; }
@keyframes shake { 25% { transform: rotate(16deg) scale(1.1); } 75% { transform: rotate(-16deg) scale(1.1); } }
.dice-total { font-size: 3rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; transition: transform .15s; }
.dice-total.pop { transform: scale(1.2); }
.dice-detail { color: var(--muted); font-family: var(--font-mono); font-size: .9rem; word-break: break-word; }
.dice-hint { color: var(--muted); }
.dice-error { color: #ff8a8a; font-weight: 500; }
:root[data-theme="light"] .dice-error { color: #b42318; }
.history { margin-top: 12px; font-family: var(--font-mono); font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.discord { text-align: center; display: flex; flex-direction: column; justify-content: center; align-items: center; background: radial-gradient(90% 70% at 50% 0%, rgba(88, 101, 242, .35), transparent 70%), var(--surface); }
.discord .icon-discord { width: 64px; fill: #8c97ff; margin-bottom: 18px; }
:root[data-theme="light"] .discord .icon-discord { fill: #5865f2; }
.discord .btn { background: #5865f2; color: #fff; }
.discord .btn:hover { background: #6d79ff; color: #fff; }

/* ---------- Footer ---------- */
.site-footer { background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(6px); border-top: 1px solid var(--line); padding: 64px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand img { width: 72px; height: auto; margin-bottom: 16px; }
.footer-brand p { color: var(--muted); max-width: 26em; }
.site-footer h4 { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.site-footer li + li { margin-top: 10px; }
.site-footer li a { color: var(--text); text-decoration: none; }
.site-footer li a:hover { color: var(--accent); }
.legal { margin-top: 44px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.legal summary { cursor: pointer; padding: 16px 22px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.legal summary::-webkit-details-marker { display: none; }
.legal summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--accent); transition: transform .2s; }
.legal[open] summary::after { transform: rotate(45deg); }
.legal-body { padding: 4px 22px 24px; color: var(--muted); display: grid; gap: 12px; font-size: .94rem; }
.legal-body h5 { color: var(--text); font-size: .95rem; margin-top: 10px; }
.legal address { font-style: normal; color: var(--text); padding-left: 14px; border-left: 2px solid var(--accent); }
.copyright { margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; color: var(--muted); font-size: .88rem; }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
@media print { .site-header, .stars, .hero-art { display: none; } }
