/* ============================================================
   Loopy — cream paper, pastel critters, soft chunky buttons
   ============================================================ */
:root {
  --bg: #f8efe0;
  --card: #fffaf2;
  --ink: #4a3a33;
  --muted: #8b7a6f;
  --line: #ead9c3;
  --peach: #ffb38a;
  --pink: #ff8fab;
  --mint: #8fd6b4;
  --lilac: #b9a3ef;
  --sky: #8ec5ef;
  --gold: #f6c453;
  --red: #ef6f6c;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: 'Fredoka', system-ui, sans-serif; color: var(--ink); background: var(--bg);
  background-image: radial-gradient(circle at 15% 10%, rgba(255,179,138,0.18), transparent 40%), radial-gradient(circle at 90% 80%, rgba(185,163,239,0.16), transparent 45%);
  min-height: 100vh; min-height: 100dvh;
}
button { font: inherit; color: inherit; cursor: pointer; }
#app { max-width: 560px; margin: 0 auto; padding: 18px 16px calc(28px + env(safe-area-inset-bottom)); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.screen { animation: in 0.35s ease both; display: flex; flex-direction: column; flex: 1; }
@keyframes in { from { opacity: 0; transform: translateY(10px); } }

h1, h2, h3 { margin: 0; line-height: 1.1; }
.logo { font-size: clamp(54px, 16vw, 84px); font-weight: 700; text-align: center; letter-spacing: 0.02em; color: var(--pink); text-shadow: 3px 3px 0 #fff, 6px 6px 0 rgba(74,58,51,0.12); margin-top: 6px; }
.logo span { color: var(--sky); }
.tagline { text-align: center; color: var(--muted); font-size: 18px; margin: 6px 0 14px; }
.hero { width: 100%; border-radius: 26px; display: block; box-shadow: 0 10px 30px rgba(74,58,51,0.12); }
.art { width: min(240px, 60vw); border-radius: 50%; display: block; margin: 0 auto 8px; box-shadow: 0 8px 24px rgba(74,58,51,0.12); }

.card { background: var(--card); border-radius: 22px; padding: 16px 18px; box-shadow: 0 4px 0 var(--line), 0 10px 26px rgba(74,58,51,0.07); margin: 12px 0; }
.card h3 { font-size: 20px; margin-bottom: 8px; }
.hint { color: var(--muted); font-size: 15px; line-height: 1.4; }
.center { text-align: center; }
.big { font-size: clamp(28px, 8vw, 40px); font-weight: 700; text-align: center; }
.say { font-size: 20px; text-align: center; line-height: 1.35; margin: 8px 0; }
.spacer { flex: 1; }

.btn { display: block; width: 100%; border: none; border-radius: 18px; padding: 15px 18px; font-size: 21px; font-weight: 600; background: var(--pink); color: #fff;
  box-shadow: 0 5px 0 #d96c88; margin-top: 10px; transition: transform 0.08s, box-shadow 0.08s; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #d96c88; }
.btn.mint { background: var(--mint); box-shadow: 0 5px 0 #5fae8b; color: #234; }
.btn.mint:active { box-shadow: 0 1px 0 #5fae8b; }
.btn.sky { background: var(--sky); box-shadow: 0 5px 0 #5d9ccc; color: #123; }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: 0 5px 0 var(--line); }
.btn.ghost:active { box-shadow: 0 1px 0 var(--line); }
.btn:disabled { opacity: 0.45; }
.row { display: flex; gap: 10px; }
.row .btn { flex: 1; }

/* players */
.players { display: flex; flex-direction: column; gap: 8px; }
.prow { display: flex; align-items: center; gap: 10px; }
.av { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; flex-shrink: 0; box-shadow: inset 0 -3px 0 rgba(0,0,0,0.06); }
.av.lg { width: 84px; height: 84px; font-size: 52px; margin: 0 auto; }
.prow input { flex: 1; min-width: 0; border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; font: inherit; font-size: 18px; background: #fff; color: var(--ink); }
.prow input:focus { outline: none; border-color: var(--sky); }
.x { border: none; background: none; font-size: 22px; color: var(--muted); padding: 6px; }
.add { border: 2px dashed var(--line); background: none; border-radius: 14px; padding: 10px; font-size: 17px; color: var(--muted); width: 100%; margin-top: 4px; }

.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.cat { border: 2px solid var(--line); border-radius: 16px; padding: 10px 8px; background: #fff; font-size: 16px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cat b { font-size: 28px; }
.cat.on { border-color: var(--pink); background: #fff0f4; box-shadow: 0 3px 0 var(--pink); }

/* pass the phone */
.pass { text-align: center; margin-top: 10vh; }
.pass .who { font-size: 34px; font-weight: 700; margin: 10px 0 2px; }
.secret { border-radius: 28px; padding: 26px 18px; text-align: center; margin: 14px 0; }
.secret.in { background: linear-gradient(160deg, #e9f9f0, #fffaf2); box-shadow: 0 5px 0 #bfe6d2; }
.secret.out { background: linear-gradient(160deg, #fff0e6, #fffaf2); box-shadow: 0 5px 0 #f3cfb7; }
.secret .w { font-size: clamp(36px, 11vw, 54px); font-weight: 700; color: #2f8f67; margin: 6px 0; }
.secret.out .w { color: var(--red); }
.chip { display: inline-block; background: #fff; border: 2px solid var(--line); border-radius: 20px; padding: 3px 12px; font-size: 15px; }

/* questions */
.qpair { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 10px 0 4px; }
.qpair .arrow { font-size: 30px; color: var(--muted); }
.qname { text-align: center; font-weight: 600; font-size: 17px; margin-top: 4px; }
.question { font-size: clamp(22px, 6vw, 28px); text-align: center; font-weight: 600; line-height: 1.25; padding: 20px 16px; background: #fff; border-radius: 22px; box-shadow: 0 5px 0 var(--line); margin: 12px 0; }
.progress { display: flex; gap: 5px; justify-content: center; margin: 4px 0 8px; flex-wrap: wrap; }
.progress i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.progress i.done { background: var(--mint); }
.progress i.now { background: var(--pink); }

/* voting / results */
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.vote { border: 2px solid var(--line); background: #fff; border-radius: 18px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 18px; font-weight: 600; }
.vote.on { border-color: var(--pink); background: #fff0f4; box-shadow: 0 4px 0 var(--pink); }
.tally { display: flex; flex-direction: column; gap: 8px; }
.trow { display: flex; align-items: center; gap: 10px; }
.trow .bar { flex: 1; height: 16px; border-radius: 10px; background: var(--line); overflow: hidden; }
.trow .bar i { display: block; height: 100%; background: var(--pink); border-radius: 10px; width: 0; transition: width 0.8s cubic-bezier(.2,.8,.2,1); }
.trow .n { width: 22px; text-align: right; font-weight: 600; }
.guess { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.guess button { border: 2px solid var(--line); background: #fff; border-radius: 16px; padding: 12px 6px; font-size: 18px; font-weight: 500; }
.guess button.right { background: #dcf5e7; border-color: var(--mint); }
.guess button.wrong { background: #ffe1e1; border-color: var(--red); }
.score { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 2px dashed var(--line); font-size: 19px; }
.score:last-child { border-bottom: none; }
.score .pts { margin-left: auto; font-weight: 700; font-size: 22px; }
.score .gain { color: #2f8f67; font-size: 15px; font-weight: 600; }
.crown { font-size: 18px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.tiny { border: none; background: #fff; border-radius: 12px; padding: 7px 12px; font-size: 15px; color: var(--muted); box-shadow: 0 3px 0 var(--line); }
.confetti { position: fixed; top: -20px; font-size: 22px; pointer-events: none; animation: fall linear forwards; z-index: 5; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }
.holdbtn { position: relative; overflow: hidden; }
