/* Slide Gecko engine styles. Override the tokens in your deck's own <style> to theme it. */
:root {
  --sg-bg: #f6f7fb;
  --sg-surface: #ffffff;
  --sg-ink: #161a26;
  --sg-ink-2: #4a5164;
  --sg-muted: #6b7285;
  --sg-line: #e3e6ee;
  --sg-accent: #4f46e5;
  --sg-accent-ink: #ffffff;
  --sg-accent-soft: #eef0ff;
  --sg-ok: #14855a;
  --sg-ok-soft: #e4f6ee;
  --sg-bad: #c2412d;
  --sg-bad-soft: #fdecea;
  --sg-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sg-radius: 14px;
  --sg-bar-h: 56px;
  --sg-panel-w: 380px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--sg-bg); color: var(--sg-ink); font-family: var(--sg-font); font-size: 18px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; color: inherit; }

/* ---------- slides ---------- */
.deck { position: fixed; inset: 0 0 var(--sg-bar-h) 0; transition: right .25s ease, bottom .25s ease; }
.slide { position: absolute; inset: 0; overflow: auto; padding: clamp(24px, 5vw, 72px); display: flex; flex-direction: column; }
/* Centre vertically, but never clip the top when a slide is taller than the screen. */
.slide::before { content: ""; margin-top: auto; }
.slide::after { content: ""; margin-bottom: auto; }
.slide[hidden] { display: none; }
.slide > * { max-width: 1100px; width: 100%; margin-left: auto; margin-right: auto; }
.slide h1 { font-size: clamp(34px, 5vw, 64px); line-height: 1.08; letter-spacing: -.02em; margin: 0 0 .35em; }
.slide h2 { font-size: clamp(26px, 3.4vw, 42px); line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .5em; }
.slide h3 { font-size: clamp(19px, 2vw, 24px); margin: 0 0 .4em; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 13px; font-weight: 700; color: var(--sg-accent); margin: 0 0 12px; }
.lead { font-size: clamp(19px, 2vw, 24px); color: var(--sg-ink-2); max-width: 46ch; }
.muted { color: var(--sg-muted); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: clamp(16px, 3vw, 36px); align-items: start; }
.card { background: var(--sg-surface); border: 1px solid var(--sg-line); border-radius: var(--sg-radius); padding: 22px 24px; }
.join-link { display: inline-block; font-weight: 700; font-size: clamp(20px, 2.4vw, 28px); background: var(--sg-surface); border: 2px dashed var(--sg-accent); color: var(--sg-accent); border-radius: 12px; padding: 10px 18px; }
.join-link:empty { display: none; }

/* steps: hidden until the presenter reveals them */
.step { display: none; }
.step.shown { display: block; animation: ld-in .35s ease both; }
.slide[data-steps="replace"] .step.shown { animation: ld-swap .3s ease both; }
@keyframes ld-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes ld-swap { from { opacity: 0; transform: translateX(12px); } }

.notes { display: none; }
body.follow .presenter-only { display: none !important; }
.follow-only { display: none; }
body.follow .follow-only { display: block; }

/* ---------- bar ---------- */
.dk-bar { position: fixed; left: 0; right: 0; bottom: 0; height: var(--sg-bar-h); display: flex; align-items: center; gap: 10px; padding: 0 14px; background: var(--sg-surface); border-top: 1px solid var(--sg-line); z-index: 20; }
.dk-spacer { flex: 1; }
.dk-count { font-variant-numeric: tabular-nums; color: var(--sg-muted); font-size: 15px; min-width: 56px; text-align: center; }
.dk-btn { border: 1px solid var(--sg-line); background: var(--sg-surface); border-radius: 10px; padding: 7px 14px; font-size: 15px; font-weight: 600; cursor: pointer; }
.dk-btn:hover:not(:disabled) { border-color: var(--sg-accent); }
.dk-btn:disabled { opacity: .45; cursor: default; }
.dk-btn[aria-pressed="true"] { background: var(--sg-accent-soft); border-color: var(--sg-accent); }
.dk-primary { background: var(--sg-accent); border-color: var(--sg-accent); color: var(--sg-accent-ink); }
.dk-primary:hover:not(:disabled) { filter: brightness(1.08); }
.dk-big { width: 100%; padding: 13px 18px; font-size: 17px; margin-top: 14px; }
.dk-live, .dk-count-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--sg-ink-2); }
.dk-live[hidden] { display: none; }
.dk-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sg-bad); box-shadow: 0 0 0 0 rgba(194, 65, 45, .5); animation: ld-pulse 1.8s infinite; }
@keyframes ld-pulse { 70% { box-shadow: 0 0 0 7px rgba(194, 65, 45, 0); } 100% { box-shadow: 0 0 0 0 rgba(194, 65, 45, 0); } }
.dk-menu-wrap { position: relative; }
.dk-menu { position: absolute; right: 0; bottom: calc(100% + 8px); background: var(--sg-surface); border: 1px solid var(--sg-line); border-radius: 12px; box-shadow: 0 16px 40px rgba(16, 24, 40, .14); padding: 6px; min-width: 240px; display: flex; flex-direction: column; }
.dk-menu[hidden] { display: none; }
.dk-menu button { text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 15px; }
.dk-menu button:hover { background: var(--sg-accent-soft); }

/* notes drawer (presenter only) */
.dk-notes { position: fixed; left: 14px; bottom: calc(var(--sg-bar-h) + 12px); width: min(460px, calc(100vw - 28px)); max-height: 46vh; overflow: auto; background: #161a26; color: #e9ecf3; border-radius: 14px; padding: 16px 20px; font-size: 15px; z-index: 19; box-shadow: 0 18px 50px rgba(0, 0, 0, .25); }
.dk-notes[hidden] { display: none; }
.dk-notes-title { font-weight: 700; color: #fff; margin: 0 0 8px; }
.dk-notes .dk-muted { color: #aab1c3; }

/* ---------- live results on slides ---------- */
.live-results { margin-top: 18px; }
.live-results:empty { display: none; }
.lr-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; margin-bottom: 12px; }
.lr-bars { display: grid; gap: 8px; }
.lr-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.lr-bar { position: relative; background: var(--sg-surface); border: 1px solid var(--sg-line); border-radius: 10px; overflow: hidden; min-height: 44px; display: flex; align-items: center; }
.lr-bar i { position: absolute; inset: 0 auto 0 0; background: var(--sg-accent-soft); transition: width .5s cubic-bezier(.22, 1, .36, 1); }
.lr-bar span { position: relative; padding: 8px 14px; font-size: 16px; }
.lr-row b { font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }
.lr-row.ok .lr-bar { border-color: var(--sg-ok); }
.lr-row.ok .lr-bar i { background: var(--sg-ok-soft); }
.lr-row.ok .lr-bar span { font-weight: 700; color: var(--sg-ok); }
.lr-row.dim { opacity: .55; }
.lr-why { background: var(--sg-ok-soft); border-radius: 10px; padding: 12px 14px; margin: 12px 0 0; font-size: 16px; }
.lr-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; max-height: 46vh; overflow: auto; }
.lr-wall div { background: var(--sg-surface); border: 1px solid var(--sg-line); border-radius: 12px; padding: 12px 14px; font-size: 16px; animation: ld-in .3s ease both; }
.lr-empty { color: var(--sg-muted); font-size: 16px; margin: 0; }
.lr-board { margin: 0; padding: 0; list-style: none; counter-reset: lr; display: grid; gap: 8px; max-width: 560px; }
.lr-board li { counter-increment: lr; display: flex; gap: 12px; align-items: center; background: var(--sg-surface); border: 1px solid var(--sg-line); border-radius: 10px; padding: 10px 14px; }
.lr-board li::before { content: counter(lr); font-weight: 700; color: var(--sg-accent); min-width: 2ch; }
.lr-board li span { flex: 1; }
body:not(.is-live) .live-results { display: none; }

/* ---------- attendees ---------- */
body.is-attendee .dk-bar, body.is-attendee .dk-notes { display: none; }
body.is-attendee .deck { bottom: 0; }
@media (min-width: 900px) {
  body.panel-open .deck { right: var(--sg-panel-w); }
  .dk-panel { position: fixed; top: 0; right: 0; bottom: 0; width: var(--sg-panel-w); border-left: 1px solid var(--sg-line); }
}
@media (max-width: 899px) {
  body.panel-open .deck { bottom: 52vh; }
  .dk-panel { position: fixed; left: 0; right: 0; bottom: 0; height: 52vh; border-top: 1px solid var(--sg-line); border-radius: 18px 18px 0 0; box-shadow: 0 -12px 30px rgba(16, 24, 40, .1); }
}
.dk-panel { background: var(--sg-surface); overflow: auto; z-index: 15; animation: ld-in .3s ease both; }
.dk-panel[hidden] { display: none; }
.dk-panel-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--sg-line); font-size: 14px; position: sticky; top: 0; background: var(--sg-surface); }
.dk-panel-body { padding: 18px 20px 28px; }
.dk-brand { font-weight: 800; margin: 0; }
.dk-brand em { font-style: normal; font-size: 11px; letter-spacing: .1em; background: var(--sg-bad); color: #fff; border-radius: 5px; padding: 2px 6px; margin-left: 4px; vertical-align: 2px; }
.dk-eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: 12px; font-weight: 700; color: var(--sg-accent); margin: 0 0 6px; }
.dk-q { font-size: 22px; line-height: 1.25; margin: 0 0 14px; }
.dk-muted { color: var(--sg-muted); font-size: 15px; }
.dk-link { border: 0; background: none; padding: 0; color: var(--sg-accent); font-weight: 600; cursor: pointer; text-decoration: underline; }
.dk-choices { display: grid; gap: 8px; }
.dk-choice { text-align: left; border: 1.5px solid var(--sg-line); background: var(--sg-surface); border-radius: 12px; padding: 12px 14px; font-size: 16px; cursor: pointer; }
.dk-choice:hover:not(:disabled) { border-color: var(--sg-accent); }
.dk-choice:disabled { cursor: default; }
.dk-choice.mine { border-color: var(--sg-accent); background: var(--sg-accent-soft); font-weight: 600; }
.dk-choice.right { border-color: var(--sg-ok); background: var(--sg-ok-soft); font-weight: 700; color: var(--sg-ok); }
.dk-choice.miss { border-color: var(--sg-bad); background: var(--sg-bad-soft); }
.dk-result { border-radius: 10px; padding: 10px 12px; margin-top: 12px; font-weight: 700; }
.dk-result.good { background: var(--sg-ok-soft); color: var(--sg-ok); }
.dk-result.meh { background: var(--sg-bad-soft); color: var(--sg-bad); }
.dk-score { font-size: 48px; font-weight: 800; margin: 0; }
.dk-panel textarea, .dk-join input { width: 100%; border: 1.5px solid var(--sg-line); border-radius: 12px; padding: 12px 14px; font-size: 16px; background: var(--sg-surface); }
.dk-panel textarea { min-height: 120px; resize: vertical; }
.dk-panel textarea:focus, .dk-join input:focus { outline: none; border-color: var(--sg-accent); box-shadow: 0 0 0 3px var(--sg-accent-soft); }
.dk-mine { background: var(--sg-accent-soft); border-radius: 10px; padding: 10px 12px; }

/* join + lobby */
.dk-join { position: fixed; inset: 0; z-index: 30; background: var(--sg-bg); display: flex; align-items: center; justify-content: center; padding: 16px; overflow: auto; }
.dk-join[hidden] { display: none; }
.dk-join-card { width: 100%; max-width: 480px; background: var(--sg-surface); border: 1px solid var(--sg-line); border-radius: 20px; padding: clamp(24px, 5vw, 40px); box-shadow: 0 20px 50px rgba(16, 24, 40, .08); }
.dk-join-card h1 { font-size: clamp(26px, 6vw, 36px); line-height: 1.15; margin: 18px 0 10px; }
.dk-lead { font-size: 18px; color: var(--sg-ink-2); }
.dk-count-pill { background: var(--sg-bg); border-radius: 999px; padding: 6px 14px; }

/* toast */
.dk-toast { position: fixed; left: 50%; bottom: calc(var(--sg-bar-h) + 16px); transform: translate(-50%, 20px); background: #161a26; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 40; max-width: calc(100vw - 32px); }
.dk-toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 600px) {
  body { font-size: 16px; }
  .dk-count { display: none; }
  .dk-bar { gap: 6px; padding: 0 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
