/* Raffle homepage + commands page. Quiet and clean: warm off-white, hairline borders, soft shadows,
   one typeface, gold only as an accent. Light only. Same tokens as the dashboard (theme.css). */
:root {
  color-scheme: light;
  --bg: #fbfaf7;
  --surface: #fff;
  --soft: #f4f1ea;
  --line: #ebe6dc;
  --ink: #1c1917;
  --muted: #6b645c;
  --dim: #a29a90;
  --gold: #ffb020;
  --accent: #d97a06;
  --radius: 16px;
  --shadow: 0 1px 2px rgb(28 25 23 / .04), 0 8px 24px rgb(28 25 23 / .06);
  --shadow-lg: 0 2px 4px rgb(28 25 23 / .04), 0 24px 60px rgb(28 25 23 / .10);
  --wrap: min(1120px, calc(100% - 40px));
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; overflow-x: clip; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; }
p { margin: 0; }
a { color: inherit; }
code { font: 500 .88em var(--mono); background: var(--soft); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: #ffe2a8; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 15px var(--font); text-decoration: none; cursor: pointer;
  box-shadow: 0 1px 2px rgb(28 25 23 / .05); transition: background .15s, border-color .15s, transform .15s; white-space: nowrap;
}
.btn:hover { border-color: #d9d2c5; background: #fffdf9; }
.btn:active { transform: translateY(1px); }
.btn--hot { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn--hot:hover { background: #33302c; border-color: #33302c; }
.btn--lg { height: 50px; padding: 0 24px; font-size: 16px; border-radius: 14px; }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 40; background: rgb(251 250 247 / .85); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.top.scrolled { border-bottom-color: var(--line); }
.top__in { width: var(--wrap); margin: 0 auto; display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: -.02em; text-decoration: none; }
.brand img { width: 34px; }
.top__links { display: flex; gap: 4px; list-style: none; margin: 0 0 0 auto; padding: 0; }
.top__links a { display: block; padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; font-size: 15px; text-decoration: none; transition: color .15s, background .15s; }
.top__links a:hover, .top__links a[aria-current] { color: var(--ink); background: var(--soft); }
.top__dash { color: var(--muted); font-weight: 500; font-size: 15px; text-decoration: none; }
.top__dash:hover { color: var(--ink); }
.top__in > .btn { height: 38px; padding: 0 16px; font-size: 14px; border-radius: 10px; }
@media (max-width: 820px) { .top__links, .top__dash { display: none; } .top__in > .btn { margin-left: auto; } }

/* logged-in profile button (nav.js) */
.nav__user { position: relative; }
.nav__me { display: flex; align-items: center; gap: 8px; padding: 3px 12px 3px 3px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font: 600 14px var(--font); color: var(--ink); cursor: pointer; }
.nav__me img { width: 30px; height: 30px; border-radius: 50%; }
.nav__menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 50; }
.nav__menu p { padding: 8px 10px 4px; font-size: 12px; color: var(--dim); }
.nav__menu a { display: block; padding: 8px 10px; border-radius: 8px; font-weight: 500; font-size: 14px; text-decoration: none; }
.nav__menu a:hover { background: var(--soft); }

/* ---------- hero ---------- */
.hero { width: var(--wrap); margin: 0 auto; padding: 88px 0 0; text-align: center; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13.5px; font-weight: 500; color: var(--muted); }
.pill img { width: 22px; }
.hero h1 { font-size: clamp(42px, 7vw, 76px); letter-spacing: -.045em; margin: 22px auto 0; max-width: 13ch; line-height: 1.02; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede { margin: 20px auto 0; max-width: 540px; font-size: 18.5px; color: var(--muted); }
.hero__cta { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.err { display: inline-block; margin-bottom: 18px; padding: 8px 14px; border-radius: 10px; background: #fdecea; color: #a12b1f; font-weight: 600; font-size: 14px; }

/* the live preview */
.stage { position: relative; width: min(720px, 100%); margin: 64px auto 0; padding: 28px; border-radius: 24px; background: linear-gradient(180deg, #fff7e6, var(--bg)); border: 1px solid var(--line); text-align: left; }
.screen { background: #313338; color: #dbdee1; border-radius: 14px; padding: 18px 18px 16px; font: 15px/1.45 var(--font); box-shadow: var(--shadow-lg); }
.screen__bar { display: flex; align-items: center; gap: 6px; margin: -2px 0 14px; padding-bottom: 12px; border-bottom: 1px solid rgb(255 255 255 / .06); color: #949ba4; font-weight: 600; font-size: 14px; }
.screen__bar b { color: #f2f3f5; }
.dmsg { display: flex; gap: 12px; }
.dmsg__av { width: 40px; height: 40px; border-radius: 50%; flex: none; background: #2b2d31 url(/img/logo.svg) center / 88% no-repeat; }
.dmsg__who { font-weight: 600; color: #f2f3f5; font-size: 15px; }
.dmsg__who .app { margin-left: 6px; background: #5865f2; color: #fff; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; vertical-align: 2px; }
.dembed { margin-top: 6px; max-width: 460px; background: #2b2d31; border-left: 4px solid var(--gold); border-radius: 4px; padding: 12px 16px 14px; transition: border-color .3s; }
.dembed h3 { font: 700 16px var(--font); letter-spacing: 0; color: #f2f3f5; margin-bottom: 6px; }
.dembed .ts { background: rgb(255 255 255 / .08); border-radius: 3px; padding: 0 3px; }
.dembed .mention { background: rgb(88 101 242 / .3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; }
.dembed .dfoot { margin-top: 10px; font-size: 12px; color: #949ba4; }
.dbtns { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.dbtn { border: 0; height: 32px; padding: 0 16px; border-radius: 8px; font: 600 14px var(--font); color: #fff; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: filter .15s; }
.dbtn:hover { filter: brightness(1.1); }
.dbtn[disabled] { opacity: .5; cursor: default; }
.dbtn--success { background: #248046; } .dbtn--primary { background: #5865f2; } .dbtn--secondary { background: #4e5058; } .dbtn--danger { background: #da373c; }
.winner { margin: 12px 0 0 52px; min-height: 22px; font-size: 14px; color: #b5bac1; }
.winner .slot { font-weight: 700; color: #f2f3f5; }
.winner .slot.done { color: var(--gold); }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.controls__label { font-size: 13px; color: var(--muted); font-weight: 500; margin-right: 2px; }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; transition: transform .15s, box-shadow .15s; }
.swatch:hover { transform: scale(1.12); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.draw { margin-left: auto; height: 38px; font-size: 14px; }

/* ---------- sections ---------- */
.section { width: var(--wrap); margin: 0 auto; padding: 120px 0 0; }
.section__head { text-align: center; max-width: 620px; margin: 0 auto 48px; }
.kicker { font-size: 13px; font-weight: 600; color: var(--accent); letter-spacing: .02em; }
.section h2 { font-size: clamp(30px, 4vw, 42px); margin-top: 10px; }
.section .sub { margin-top: 14px; color: var(--muted); font-size: 17px; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .features { grid-template-columns: 1fr; } }
.feature { padding: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgb(28 25 23 / .03); transition: box-shadow .2s, transform .2s; }
.feature:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.feature__icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; background: #fff4dc; color: var(--accent); margin-bottom: 18px; }
.feature__icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { font-size: 17px; letter-spacing: -.01em; }
.feature p { margin-top: 6px; color: var(--muted); font-size: 15px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step; }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding: 28px 26px; border-radius: var(--radius); background: var(--soft); }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 14px; font-weight: 700; margin-bottom: 18px; }
.step h3 { font-size: 17px; }
.step p { margin-top: 6px; color: var(--muted); font-size: 15px; }

.cmds { max-width: 720px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cmds div { display: grid; grid-template-columns: 220px 1fr; gap: 16px; padding: 16px 22px; border-bottom: 1px solid var(--line); align-items: baseline; }
.cmds div:last-child { border-bottom: 0; }
.cmds dt { font: 500 14px var(--mono); }
.cmds dd { margin: 0; color: var(--muted); font-size: 15px; }
@media (max-width: 600px) { .cmds div { grid-template-columns: 1fr; gap: 2px; } }
.center { text-align: center; margin-top: 24px; }
.link { color: var(--ink); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.link:hover { border-color: var(--ink); }

.finale { width: var(--wrap); margin: 120px auto 0; padding: 64px 24px; text-align: center; border-radius: 24px; background: var(--ink); color: #fff; }
.finale img { width: 64px; margin-bottom: 18px; }
.finale h2 { font-size: clamp(30px, 4vw, 44px); }
.finale p { margin: 12px auto 30px; color: #c8c1b8; font-size: 17px; }
.finale .btn { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.finale .btn:hover { background: #ffc04d; border-color: #ffc04d; }

.foot { width: var(--wrap); margin: 0 auto; padding: 40px 0 48px; display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; color: var(--muted); font-size: 14px; }
.foot nav { display: flex; gap: 22px; }
.foot a { text-decoration: none; } .foot a:hover { color: var(--ink); }

/* ---------- commands page ---------- */
.cmdpage { width: var(--wrap); margin: 0 auto; padding: 72px 0 40px; }
.cmdpage h1 { font-size: clamp(36px, 5vw, 52px); letter-spacing: -.04em; }
.cmdpage .lead { margin-top: 14px; color: var(--muted); max-width: 620px; font-size: 17px; }
.cmdbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 36px 0 8px; }
.cmdbar input { flex: 1 1 260px; max-width: 380px; height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; outline: none; transition: border-color .15s, box-shadow .15s; }
.cmdbar input:focus { border-color: #d9a54a; box-shadow: 0 0 0 4px #fff1d4; }
#filters { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--soft); }
.cmdbar button { height: 34px; padding: 0 14px; border-radius: 9px; border: 0; background: none; color: var(--muted); font: 500 14px var(--font); cursor: pointer; }
.cmdbar button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(28 25 23 / .08); }
.cmdgroup { margin-top: 40px; }
.cmdgroup h2 { font-size: 15px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-bottom: 14px; }
.cmdlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.cmd { padding: 20px 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.cmd code.use { display: block; border: 0; padding: 0; background: none; font: 500 15px var(--mono); color: var(--ink); overflow-wrap: anywhere; }
.cmd code.use .opt { color: var(--dim); }
.cmd p { margin-top: 6px; color: var(--muted); font-size: 15px; }
.cmd .ex { margin-top: 12px; font-size: 13px; color: var(--dim); }
.cmd .perm { display: inline-block; margin-top: 12px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: #fff4dc; color: #8a4f00; }
.none { color: var(--muted); padding: 40px 0; }
@media (max-width: 520px) { .cmdlist { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } html { scroll-behavior: auto; } }
