/* ============================================================
   Spin Party — felt-tip markers on cardboard
   ============================================================ */
:root {
  --card: #c99a64;          /* cardboard */
  --card-dark: #a77a49;
  --paper: #f6ecd8;         /* poster paper */
  --ink: #2a1f1a;
  --muted: #6d5a4b;
  --red: #ff595e;
  --yellow: #ffca3a;
  --green: #52a675;
  --blue: #1982c4;
  --purple: #8a5bd6;
  --pink: #f7a1b5;
  --marker: 'Permanent Marker', 'Comic Sans MS', cursive;
  --hand: 'Patrick Hand', 'Comic Sans MS', cursive;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--hand); font-size: 18px; color: var(--ink);
  background: var(--card);
  background-image:
    repeating-linear-gradient(90deg, rgba(0,0,0,0.035) 0 2px, transparent 2px 9px),
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.18), transparent 60%);
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; cursor: pointer; }

.screen { display: none; min-height: 100vh; min-height: 100dvh; }
body[data-screen="home"] #home { display: flex; }
body[data-screen="game"] #game { display: flex; }

/* ---------- home ---------- */
#home { flex-direction: column; align-items: center; padding: 34px 16px 40px; position: relative; }
.home-link { position: absolute; top: 12px; left: 14px; font-size: 22px; color: var(--ink); text-decoration: none; opacity: 0.6; }
.title { font-family: var(--marker); font-size: clamp(48px, 15vw, 88px); margin: 10px 0 0; line-height: 1; text-align: center; letter-spacing: 0.02em;
  color: var(--paper); -webkit-text-stroke: 2px var(--ink); text-shadow: 4px 4px 0 var(--ink); transform: rotate(-3deg); }
.title span { color: var(--red); }
.tag { text-align: center; max-width: 420px; margin: 18px 0 26px; font-size: 20px; }
.modes { display: grid; gap: 14px; width: 100%; max-width: 460px; }
.mode { display: grid; grid-template-columns: 58px 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 12px; text-align: left;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 18px; padding: 14px 16px; box-shadow: 5px 5px 0 var(--ink); transition: transform 0.1s; }
.mode:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }
.mode .mi { grid-row: span 2; font-size: 40px; text-align: center; }
.mode b { font-family: var(--marker); font-size: 24px; font-weight: normal; }
.mode small { font-size: 16px; color: var(--muted); line-height: 1.25; }
.m-tod { background: linear-gradient(100deg, #ffd3d4, var(--paper) 60%); }
.m-quiz { background: linear-gradient(100deg, #cfe7fb, var(--paper) 60%); }
.m-bottle { background: linear-gradient(100deg, #d6f0dc, var(--paper) 60%); }
.link { margin-top: 24px; background: none; border: none; text-decoration: underline; font-size: 18px; }

/* ---------- game ---------- */
#game { flex-direction: column; align-items: center; padding-bottom: env(safe-area-inset-bottom); }
.gbar { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 0; }
.gbar h2 { font-family: var(--marker); font-weight: normal; margin: 0; font-size: 24px; }
.icon { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--ink); background: var(--paper); font-size: 20px; display: grid; place-items: center; box-shadow: 2px 2px 0 var(--ink); }
.dial-wrap { width: min(100vw, 72vh, 620px); aspect-ratio: 1; touch-action: none; user-select: none; -webkit-user-select: none; margin-top: 4px; }
#dial { width: 100%; height: 100%; overflow: visible; }
#dial .lbl { font-family: var(--hand); fill: var(--ink); }
#dial .seat text { font-family: var(--hand); }
#dial .hub-t { font-family: var(--marker); fill: var(--ink); }
.sector { transition: filter 0.3s; }
.sector.win { filter: brightness(1.12) drop-shadow(0 0 6px rgba(255,255,255,0.9)); }
.seat rect { transition: fill 0.3s; }
.seat.win rect { fill: var(--yellow); }
.seat.win { animation: bump 0.6s ease 2; }
@keyframes bump { 50% { transform: scale(1.15); } }
#ptr { cursor: grab; }

.panel { width: 100%; max-width: 560px; padding: 6px 16px 22px; text-align: center; }
.say { font-size: 22px; line-height: 1.3; margin: 6px 0 12px; }
.big { font-family: var(--marker); font-size: clamp(26px, 7vw, 38px); line-height: 1.1; margin: 4px 0 8px; }
.big .who { color: var(--red); }
.hint { color: var(--muted); font-size: 17px; margin: 4px 0; }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 10px 0; }
.btn { font-family: var(--marker); font-size: 20px; border: 3px solid var(--ink); border-radius: 14px; padding: 10px 18px; background: var(--paper); box-shadow: 4px 4px 0 var(--ink); min-width: 120px; }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn.truth { background: #9fd3ff; }
.btn.dare { background: #ff9fa2; }
.btn.go { background: var(--yellow); }
.btn.soft { font-family: var(--hand); font-size: 18px; min-width: 0; padding: 7px 14px; box-shadow: 2px 2px 0 var(--ink); border-width: 2px; }
.card { background: var(--paper); border: 3px solid var(--ink); border-radius: 16px; padding: 14px 16px; box-shadow: 4px 4px 0 var(--ink); margin: 10px auto; max-width: 480px; animation: pop 0.35s cubic-bezier(.3,1.6,.6,1) both; }
@keyframes pop { from { transform: scale(0.85) rotate(-2deg); opacity: 0; } }
.card .ct { font-family: var(--marker); font-size: 26px; margin-bottom: 4px; }
.card p { margin: 4px 0; font-size: 20px; line-height: 1.3; }
.card .ans { color: var(--green); font-weight: bold; }
.pill { display: inline-block; font-size: 14px; border: 2px solid var(--ink); border-radius: 20px; padding: 0 10px; background: #fff; margin-bottom: 6px; }
.pill.adult { background: #ffb3c1; }

/* ---------- settings sheet ---------- */
.sheet-wrap { position: fixed; inset: 0; background: rgba(42,31,26,0.55); display: none; align-items: flex-end; justify-content: center; z-index: 20; }
.sheet-wrap.open { display: flex; }
.sheet { width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; background: var(--paper); border: 3px solid var(--ink); border-bottom: none; border-radius: 22px 22px 0 0; padding: 18px 18px calc(24px + env(safe-area-inset-bottom)); animation: up 0.25s ease both; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet h3 { font-family: var(--marker); font-weight: normal; font-size: 24px; margin: 18px 0 6px; }
.sheet h3:first-of-type { margin-top: 0; }
.sheet .top { display: flex; justify-content: space-between; align-items: center; }
.sw { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: 19px; }
.sw input { width: 22px; height: 22px; accent-color: var(--red); }
.names { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin: 8px 0; }
.names input, .add-row input { font: inherit; border: 2px solid var(--ink); border-radius: 10px; padding: 6px 10px; background: #fff; width: 100%; }
.stepper { display: inline-flex; align-items: center; gap: 10px; }
.stepper button { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--ink); background: #fff; font-size: 22px; }
.stepper b { font-family: var(--marker); font-size: 24px; min-width: 32px; text-align: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chip { border: 2px solid var(--ink); border-radius: 20px; padding: 3px 10px; background: #fff; font-size: 16px; display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: #d6f0dc; }
.chip.ad { background: #ffd6de; }
.chip .x { font-weight: bold; }
.add-row { display: flex; gap: 8px; margin: 8px 0; }
.add-row button { white-space: nowrap; }
.note { font-size: 15px; color: var(--muted); }
.warn { background: #ffe1e6; border: 2px dashed #c0394f; border-radius: 12px; padding: 10px 12px; margin: 8px 0; font-size: 17px; }
.seg { display: inline-flex; border: 2px solid var(--ink); border-radius: 12px; overflow: hidden; }
.seg button { border: none; background: #fff; padding: 6px 14px; font-size: 17px; }
.seg button.on { background: var(--yellow); }
