/* ── Spin the Wheel — tool page styles ─────────────────────────────
   Layout: wheel stage + manage-items panel. Game feel (spotlight,
   pointer flap, confetti) lives inside the card; the page itself
   stays in the LK Forge cool-light family. */

main { max-width: 1020px; margin: 0 auto; padding: 20px; }

/* Hero */
.tool-hero { max-width: 1020px; margin: 0 auto; padding: 36px 20px 4px; }
.tool-hero .hero-head { display: flex; align-items: center; gap: 16px; }
.tool-hero .hero-icon { flex-shrink: 0; width: 56px; height: 56px; border-radius: 14px; background: #0f0e0d; display: flex; align-items: center; justify-content: center; }
.tool-hero .hero-icon svg { width: 30px; height: 30px; stroke: var(--accent); fill: none; }
.tool-hero .subtitle { color: var(--muted); font-size: 1.02rem; margin-top: 12px; max-width: 680px; }

/* Card */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 24px; margin-top: 24px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 11px 20px; border: none; border-radius: var(--radius); background: var(--accent); color: #fff; font-family: 'Outfit', system-ui, sans-serif; font-size: .95rem; font-weight: 700; cursor: pointer; transition: background .18s, transform .1s; }
.btn:hover { background: var(--accent-h); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; }
.btn-ghost { background: var(--surface); color: var(--text); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: var(--surface2); border-color: var(--muted); }
.btn-sm { min-height: 38px; padding: 7px 14px; font-size: .85rem; }

/* ── Two-column tool layout ── */
.wheel-layout { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 900px) { .wheel-layout { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; } }

/* ── Wheel stage ── */
.wheel-stage { position: relative; background: radial-gradient(circle at 50% 42%, #ffffff 0%, var(--surface2) 62%, #e2e5fb 100%); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 34px 18px 22px; text-align: center; }
.wheel-wrap { position: relative; display: inline-block; max-width: 100%; }
#wheelCanvas { display: block; width: 100%; height: auto; border-radius: 50%; box-shadow: 0 10px 34px rgba(15, 15, 46, .22); cursor: pointer; }
.wheel-wrap:focus-within #wheelCanvas, #wheelCanvas:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }

/* Pointer flap (top) */
.wheel-pointer { position: absolute; top: -16px; left: 50%; width: 34px; height: 40px; transform: translateX(-50%); transform-origin: 50% 22%; z-index: 3; filter: drop-shadow(0 2px 3px rgba(0,0,0,.3)); transition: transform .07s ease-out; pointer-events: none; }
.wheel-pointer.tick { transform: translateX(-50%) rotate(-16deg); }
.wheel-pointer svg { width: 100%; height: 100%; display: block; }

/* Center hub button */
.wheel-hub { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 21%; aspect-ratio: 1; min-width: 58px; border-radius: 50%; border: 4px solid #fff; background: #0f0e0d; color: #fff; font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: clamp(.7rem, 2.2vw, .95rem); letter-spacing: .05em; cursor: pointer; box-shadow: 0 3px 14px rgba(0,0,0,.35); transition: transform .12s, background .18s; z-index: 2; }
.wheel-hub:hover { background: var(--accent); transform: translate(-50%, -50%) scale(1.06); }
.wheel-hub:active { transform: translate(-50%, -50%) scale(.96); }
.wheel-hub:disabled { cursor: not-allowed; background: #3c3c4e; transform: translate(-50%, -50%); }

.stage-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }
.stage-hint { margin-top: 12px; font-size: .85rem; color: var(--muted); min-height: 1.3em; }

/* ── Manage items panel ── */
.items-panel h2 { font-size: 1.05rem; font-weight: 800; margin-bottom: 14px; }
.add-row { display: flex; gap: 10px; margin-bottom: 14px; }
.add-row input { flex: 1; min-width: 0; min-height: 44px; padding: 10px 14px; font-family: 'Outfit', system-ui, sans-serif; font-size: .95rem; color: var(--text); background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); }
.add-row input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.add-row input.shake { animation: shake .3s; border-color: var(--accent); }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.item-count { font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.item-list { list-style: none; max-height: 330px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.item-list:empty { display: none; }
.item-row { display: flex; align-items: center; gap: 10px; padding: 9px 8px 9px 14px; border-bottom: 1px solid var(--border); font-size: .95rem; }
.item-row:last-child { border-bottom: none; }
.item-dot { flex-shrink: 0; width: 12px; height: 12px; border-radius: 50%; }
.item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-weight { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 30px; padding: 0 8px; border: 1.5px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--muted); font-family: var(--mono); font-size: .78rem; font-weight: 600; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.item-weight:hover { border-color: var(--accent); color: var(--accent-fg); }
.item-weight.on { background: var(--accent-bg); border-color: var(--accent); color: var(--accent-fg); }
.item-del { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: none; border-radius: var(--radius); background: transparent; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.item-del:hover { background: var(--accent-bg); color: var(--accent-fg); }
.item-del svg { width: 16px; height: 16px; stroke: currentColor; fill: none; }

.panel-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.panel-note { font-size: .8rem; color: var(--muted); margin-top: 12px; }

/* Learn links under the card */
.learn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.learn-row a { font-size: .84rem; font-weight: 600; color: var(--accent-fg); background: var(--accent-bg); border-radius: 999px; padding: 6px 14px; text-decoration: none; }
.learn-row a:hover { background: var(--accent); color: #fff; }

/* Trust row */
.trust-row { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.trust-item { display: inline-flex; align-items: center; gap: 7px; font-size: .88rem; font-weight: 600; color: var(--muted); }
.trust-item svg { width: 16px; height: 16px; stroke: var(--accent); fill: none; flex-shrink: 0; }

/* ── Sections ── */
.section { max-width: 1020px; margin: 16px auto; padding: 24px 20px; }
.section > .section-sub { color: var(--muted); margin-bottom: 20px; }
.steps { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 760px) { .steps { grid-template-columns: 1fr 1fr 1fr; } }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step-num { flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-bg); color: var(--accent-fg); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.step-body h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.step-body p { font-size: .92rem; color: var(--muted); line-height: 1.6; }

/* Use-case chips */
.usecase-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 6px; }
@media (min-width: 760px) { .usecase-grid { grid-template-columns: 1fr 1fr; } }
.usecase { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 18px 20px; }
.usecase h3 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.usecase p { font-size: .9rem; color: var(--muted); line-height: 1.6; }

/* FAQ */
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.faq summary { cursor: pointer; padding: 16px 18px; font-weight: 700; font-size: .98rem; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; float: right; color: var(--accent); font-weight: 700; }
.faq details[open] summary::after { content: '\2013'; }
.faq .faq-body { padding: 0 18px 16px; font-size: .92rem; color: var(--muted); line-height: 1.7; }
.faq .faq-body code { font-family: var(--mono); font-size: .85em; background: var(--surface2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; }

/* ── Winner dialog ── */
dialog { border: none; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 0; max-width: min(430px, calc(100vw - 40px)); }
dialog::backdrop { background: rgba(15, 15, 46, .55); }
.dlg-inner { padding: 30px 28px 26px; text-align: center; }
.dlg-inner .dlg-label { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.dlg-inner .dlg-winner { font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: clamp(1.4rem, 5vw, 2rem); line-height: 1.25; color: var(--text); margin-bottom: 22px; overflow-wrap: anywhere; }
.dlg-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* Paste-list dialog */
.dlg-paste { padding: 26px 26px 22px; text-align: left; }
.dlg-paste h2 { font-size: 1.05rem; font-weight: 800; margin-bottom: 6px; }
.dlg-paste p { font-size: .86rem; color: var(--muted); margin-bottom: 12px; }
.dlg-paste textarea { width: 100%; min-height: 180px; resize: vertical; font-family: var(--mono); font-size: .88rem; line-height: 1.6; color: var(--text); background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; }
.dlg-paste textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Confetti canvas — fixed, under the sticky nav (nav z-index 100 stays highest) */
#confettiCanvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 90; }

/* Toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px); background: #0f0f2e; color: #fff; font-size: .88rem; font-weight: 600; border-radius: 999px; padding: 10px 22px; opacity: 0; transition: transform .25s, opacity .25s; z-index: 95; pointer-events: none; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .wheel-pointer { transition: none; }
  .wheel-pointer.tick { transform: translateX(-50%); }
  .add-row input.shake { animation: none; }
  .toast { transition: opacity .25s; }
}
