/* Cut the Crap v2 — Mood Labs. Built from the Paper design "B – Chalk". */

/* RL Horizon is used for sticker copy when assets/fonts/RLHorizon-Bold.woff2 exists; Arvo Bold otherwise. */
@font-face {
  font-family: "RL Horizon";
  src: url("assets/fonts/RLHorizon-Bold.woff2") format("woff2"),
       url("assets/fonts/RLHorizon-Bold.otf") format("opentype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --chalk: #F2E9DB;
  --ink: #191348;
  --jet: #282828;
  --tang: #F16022;
  --pink: #DD90BE;
  --green: #088846;
  --brick: #711611;
  --pine: #162F19;
  --sticker-edge: #FFF6EC;
  --font: "Poppins", system-ui, sans-serif;
  --font-sticker: "RL Horizon", "Arvo", Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--chalk);
  font-family: var(--font);
  color: var(--ink);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; }
[hidden] { display: none !important; }

/* The design is drawn at 390×844 and scaled to fit any screen (phone, laptop, TV). */
#stage {
  position: absolute;
  left: 50%; top: 50%;
  width: 390px; height: 844px;
  transform-origin: center center;
  transform: translate(-50%, -50%) scale(var(--scale, 1));
}

.screen {
  position: absolute; inset: 0;
  display: none; flex-direction: column;
  background: var(--chalk);
  overflow: hidden;
  padding-top: 20px;
}
.screen.active { display: flex; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.screen.dark { background: var(--ink); color: var(--chalk); }
.screen.brick { background: var(--brick); color: var(--chalk); }
.screen.made { background: var(--pink); color: var(--chalk); }

.sticker-font { font-family: var(--font-sticker); font-weight: 700; }

/* ---------- Buttons ---------- */
.actions { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 0 24px 40px; margin-top: auto; }
.actions.center { align-items: center; }
.btn {
  width: 100%; height: 72px; border-radius: 36px;
  font-weight: 800; font-size: 22px;
  box-shadow: 0 6px 0 rgba(25, 19, 72, .3);
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn:active, .answer:active, .chip:active, .pick:active, .step:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(25, 19, 72, .3); }
.btn-tang { background: var(--tang); color: var(--ink); }
.btn-ink { background: var(--ink); color: var(--chalk); }
.btn-chalk { background: var(--chalk); color: var(--ink); }
.link { font-weight: 600; font-size: 16px; text-decoration: underline; color: var(--ink); }
.link.light { color: var(--chalk); }
.btn-ghost {
  height: 56px; padding: 0 28px; border-radius: 28px;
  border: 2.5px solid rgba(242, 233, 219, .5);
  color: var(--chalk); font-weight: 700; font-size: 17px;
}

/* ---------- 01 Welcome ---------- */
.welcome-hero { padding: 28px 28px 0; display: flex; flex-direction: column; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; }
.wordmark { font-weight: 900; font-size: 22px; letter-spacing: -0.03em; }
.presents { font-weight: 600; font-size: 13px; letter-spacing: .08em; opacity: .7; }
.title { font-weight: 900; font-size: 84px; line-height: 76px; letter-spacing: -0.05em; }
.moody-classic { position: absolute; right: 20px; top: 104px; width: 124px; height: 124px; transform: rotate(-12deg); }
.steps { list-style: none; display: flex; flex-direction: column; gap: 14px; padding: 28px 28px 0; }
.steps li { display: flex; align-items: center; gap: 16px; font-weight: 600; font-size: 20px; }
.num {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 20px;
  background: var(--ink); color: var(--chalk);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px;
}
.sticker-auto { position: absolute; right: 34px; top: 520px; width: 112px; height: 143px; transform: rotate(8deg); }
.sticker-auto img { width: 100%; height: 100%; }
.sticker-auto span {
  position: absolute; left: 18px; top: 22px; width: 76px;
  font-size: 10px; line-height: 12px; color: var(--chalk); text-align: center;
}

/* ---------- Score bar ---------- */
.scorebar { display: flex; align-items: center; gap: 8px; padding: 8px 20px 0; }
.score-pill { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 16px; border-radius: 24px; transition: transform .3s; }
.score-pill .n { font-size: 15px; font-weight: 600; max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-pill .s { font-size: 20px; font-weight: 900; }
.score-pill.a { background: var(--ink); color: var(--chalk); }
.score-pill.b { background: var(--pink); color: var(--ink); }
.scorebar .spacer { flex: 1; }
.menu-btn {
  width: 48px; height: 48px; flex-shrink: 0; border-radius: 24px;
  border: 2.5px solid var(--ink); display: flex; align-items: center; justify-content: center;
}
.menu-btn svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; }

/* ---------- 02 Setup ---------- */
.hello-wrap { display: flex; padding: 14px 24px 0; }
.sticker-hello { position: relative; width: 262px; height: 183px; transform: rotate(-3deg); }
.sticker-hello img { width: 100%; height: 100%; }
.sticker-hello span {
  position: absolute; left: 30px; top: 74px; width: 202px; height: 76px;
  display: flex; align-items: center; justify-content: center;
  font-size: 25px; line-height: 28px; text-align: center; color: var(--ink);
}
.teams { display: flex; flex-direction: column; gap: 14px; padding: 24px 24px 0; }
.team-card {
  position: relative; display: flex; flex-direction: column; justify-content: center;
  height: 96px; padding: 0 60px 0 24px; border-radius: 28px; cursor: text;
}
.team-card.team-a { background: var(--ink); color: var(--chalk); transform: rotate(-1.5deg); }
.team-card.team-b { background: var(--pink); color: var(--ink); transform: rotate(1.5deg); }
.team-label { font-weight: 600; font-size: 12px; letter-spacing: .1em; opacity: .7; }
.team-card input {
  font: inherit; font-weight: 900; font-size: 30px; letter-spacing: -0.03em;
  color: inherit; background: none; border: 0; outline: none; width: 100%; padding: 0;
  user-select: text;
}
.pencil { position: absolute; right: 24px; top: 36px; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.hint { font-weight: 500; font-size: 14px; padding: 4px 4px 0; }
.length { display: flex; flex-direction: column; gap: 12px; padding: 28px 24px 0; }
.label-lg { font-weight: 800; font-size: 20px; padding-left: 4px; }
.chips { display: flex; gap: 10px; }
.chip { flex: 1; height: 64px; border-radius: 20px; border: 2.5px solid var(--ink); font-weight: 800; font-size: 24px; }
.chip.selected { background: var(--ink); color: var(--chalk); font-weight: 900; }

/* ---------- 03 Round start ---------- */
.turn { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: 0 24px; }
.round-label { font-weight: 700; font-size: 16px; letter-spacing: .14em; padding-left: 4px; }
.team-sticker {
  align-self: flex-start; padding: 14px 26px 10px; border-radius: 28px;
  font-weight: 900; font-size: 56px; line-height: 64px; letter-spacing: -0.04em;
  transform: rotate(-3deg); box-shadow: 6px 6px 0 var(--ink);
  max-width: 100%; overflow-wrap: anywhere;
}
.team-sticker.a { background: var(--ink); color: var(--chalk); box-shadow: 6px 6px 0 var(--tang); }
.team-sticker.b { background: var(--pink); color: var(--ink); }
.turn-line { font-weight: 900; font-size: 40px; line-height: 44px; letter-spacing: -0.03em; padding: 6px 4px 0; }

/* ---------- 04 Category ---------- */
.category-area { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 0 24px; }
.category-card {
  width: 100%; height: 340px; border-radius: 36px;
  background: var(--tang); color: var(--chalk);
  transform: rotate(-2deg); box-shadow: 8px 8px 0 var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px;
}
.card-kicker { font-weight: 700; font-size: 14px; letter-spacing: .16em; color: var(--ink); }
.card-category { font-weight: 900; text-align: center; letter-spacing: -0.04em; font-size: 76px; line-height: 1; overflow-wrap: anywhere; }
.card-category.flip { animation: flip .5s ease; }
@keyframes flip { 0% { transform: rotateY(90deg) scale(.9); opacity: 0; } 100% { transform: none; opacity: 1; } }
.bid-hint { font-weight: 600; font-size: 18px; line-height: 26px; text-align: center; }
.sticker-pill {
  display: flex; align-items: center; gap: 8px;
  border: 4px solid var(--sticker-edge); border-radius: 22px;
  box-shadow: 0 3px 0 rgba(25, 19, 72, .15);
}
.sticker-pill img { width: 30px; height: 30px; }
.sticker-pill span { font-size: 15px; line-height: 17px; }
.sticker-pill.pink { background: var(--pink); color: var(--ink); padding: 8px 14px 8px 8px; }
.sticker-pill.tang { background: var(--tang); color: var(--chalk); padding: 10px 18px 10px 10px; }
#slowSticker { position: absolute; left: 14px; top: 50px; z-index: 2; transform: rotate(-7deg); }
.bin-link { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.bin-link img { width: 34px; height: 46px; transform: rotate(-8deg); }

/* ---------- 05 Lock the bid ---------- */
.bid { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 28px 24px 0; }
.q { font-weight: 900; font-size: 30px; letter-spacing: -0.03em; padding-left: 4px; }
.q + .stepper { margin-top: 0; }
.picker { display: flex; gap: 12px; margin-bottom: 12px; }
.pick {
  flex: 1; min-width: 0; height: 84px; border-radius: 26px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 900; font-size: 22px; letter-spacing: -0.02em; padding: 0 8px;
}
.pick.long { font-size: 17px; }
.pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick svg { width: 22px; height: 22px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; display: none; }
.pick-a { background: var(--ink); color: var(--chalk); }
.pick-b { background: var(--pink); color: var(--ink); }
.pick:not(.selected) { opacity: .45; }
.pick.selected { box-shadow: 0 0 0 4px var(--tang); }
.pick.selected svg { display: block; }
.stepper {
  height: 168px; border-radius: 36px; border: 3px solid var(--ink);
  display: flex; align-items: center; justify-content: space-between; padding: 0 18px;
}
#bidValue { font-weight: 900; font-size: 112px; line-height: 112px; letter-spacing: -0.05em; min-width: 140px; text-align: center; }
.step { width: 76px; height: 76px; flex-shrink: 0; border-radius: 38px; background: var(--ink); display: flex; align-items: center; justify-content: center; }
.step svg { width: 30px; height: 30px; fill: none; stroke: var(--chalk); stroke-width: 4; stroke-linecap: round; }
.summary { font-weight: 600; font-size: 17px; text-align: center; padding-top: 4px; }

/* ---------- 06 Ready + 07 Timer ---------- */
.mission { display: flex; flex-direction: column; gap: 4px; padding: 20px 28px 0; }
.team-tag {
  align-self: flex-start; display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 20px;
  background: var(--chalk); color: var(--ink); font-weight: 800; font-size: 16px;
}
.team-tag .dot { width: 10px; height: 10px; border-radius: 5px; background: var(--ink); }
.team-tag.b .dot { background: var(--pink); }
.mission-text { font-weight: 900; font-size: 52px; line-height: 56px; letter-spacing: -0.04em; padding-top: 14px; }
.countdown { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-bottom: 80px; }
#countNum { font-weight: 900; font-size: 280px; line-height: 260px; letter-spacing: -0.05em; color: var(--pink); }
#countNum.pop { animation: pop .9s ease; }
@keyframes pop { 0% { transform: scale(1.5); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 100% { transform: scale(.92); opacity: .85; } }
#countLabel { font-weight: 800; font-size: 18px; letter-spacing: .16em; }

.ring-wrap { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; }
.ring { width: 300px; height: 300px; }
.ring circle { fill: none; stroke-width: 22; }
.ring .track { stroke: rgba(242, 233, 219, .14); }
.ring .progress { stroke: var(--pink); stroke-linecap: round; stroke-dasharray: 816.8; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear; }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
#secs { font-weight: 900; font-size: 120px; line-height: 120px; letter-spacing: -0.05em; }
#secsLabel { font-weight: 600; font-size: 14px; letter-spacing: .16em; opacity: .7; }
#s-timer { transition: background-color .4s ease; }
#s-timer.hurry { background: var(--brick); }
#s-timer.hurry .team-tag .dot { background: var(--brick); }
#s-timer.hurry .ring .track { stroke: rgba(242, 233, 219, .2); }
#s-timer.hurry .ring .progress { stroke: var(--tang); }
#s-timer.hurry #secs { font-size: 160px; line-height: 150px; animation: pulse 1s ease infinite; }
#s-timer.hurry #secsLabel { opacity: 1; font-weight: 800; font-size: 16px; }
#s-timer.hurry .btn-ghost { border-color: var(--chalk); }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }

/* ---------- 08 Verdict ---------- */
.question { flex: 1; display: flex; flex-direction: column; gap: 20px; padding: 40px 28px 0; }
.moody-q { width: 104px; height: 104px; transform: rotate(8deg); }
.q-text { font-weight: 900; font-size: 46px; line-height: 50px; letter-spacing: -0.04em; overflow-wrap: anywhere; }
.question .sticker-pill { align-self: flex-end; transform: rotate(4deg); margin-top: 6px; }
.question .sticker-pill img { width: 34px; height: 34px; }
.question .sticker-pill span { font-size: 16px; line-height: 19px; }
.answers { display: flex; flex-direction: column; gap: 14px; padding: 0 24px 40px; }
.answer {
  height: 104px; border-radius: 36px; display: flex; align-items: center; justify-content: center; gap: 14px;
  font-weight: 900; font-size: 38px; letter-spacing: -0.02em;
  box-shadow: 0 6px 0 rgba(25, 19, 72, .35); transition: transform .08s ease, box-shadow .08s ease;
}
.answer svg { width: 34px; height: 34px; fill: none; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; }
.answer.yes { background: var(--pink); color: var(--ink); }
.answer.yes svg { stroke: var(--ink); }
.answer.no { background: var(--ink); color: var(--chalk); }
.answer.no svg { stroke: var(--chalk); width: 30px; height: 30px; }

/* ---------- 09 Results ---------- */
.celebrate { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 0 24px; }
.moody-big { width: 150px; height: 150px; transform: rotate(-8deg); animation: bounce 1.2s ease infinite; }
@keyframes bounce { 0%, 100% { transform: rotate(-8deg) translateY(0); } 50% { transform: rotate(-4deg) translateY(-10px); } }
.big-word { font-weight: 900; font-size: 72px; line-height: 78px; letter-spacing: -0.02em; text-align: center; }
#s-missed .big-word { font-size: 96px; line-height: 96px; }
.sub { font-weight: 700; font-size: 20px; text-align: center; }
.points { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 0 24px 36px; }
.points-sticker { display: flex; align-items: center; gap: 10px; padding: 12px 24px; border-radius: 24px; }
.points-sticker b { font-weight: 900; font-size: 34px; }
.points-sticker span { font-weight: 700; font-size: 22px; }
.points-sticker.ink { background: var(--ink); color: var(--chalk); transform: rotate(-2deg); }
.points-sticker.pink { background: var(--pink); color: var(--ink); transform: rotate(2deg); }
.mini-score { font-weight: 600; font-size: 17px; }

.sticker-tomb { position: relative; width: 168px; height: 230px; transform: rotate(-5deg); }
.sticker-tomb > img:first-child { width: 100%; height: 100%; }
.tomb-moody { position: absolute; left: 70px; top: 44px; width: 28px; height: 28px; }
.sticker-tomb span { position: absolute; left: 32px; top: 100px; width: 104px; max-height: 90px; overflow: hidden; font-size: 13px; line-height: 17px; color: var(--ink); text-align: center; overflow-wrap: anywhere; }

/* ---------- 10 Winner ---------- */
.champion { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 0 24px; }
.sticker-trophy { position: relative; width: 187px; height: 220px; transform: rotate(-6deg); animation: bounce 1.6s ease infinite; }
.sticker-trophy img { width: 100%; height: 100%; }
.sticker-trophy span { position: absolute; left: 50px; top: 38px; width: 88px; font-size: 12px; line-height: 14px; color: var(--ink); text-align: center; }
.winner-kicker { font-weight: 700; font-size: 16px; letter-spacing: .16em; color: var(--tang); }
.winner-sticker {
  padding: 12px 30px 8px; border-radius: 30px; background: var(--chalk); color: var(--ink);
  transform: rotate(-3deg); box-shadow: 6px 6px 0 var(--tang);
  font-weight: 900; font-size: 64px; line-height: 76px; letter-spacing: -0.04em;
  max-width: 100%; text-align: center; overflow-wrap: anywhere;
}
.final-score { font-weight: 700; font-size: 22px; padding-top: 14px; }
.footer-mark { font-weight: 900; font-size: 18px; letter-spacing: -0.03em; opacity: .6; }

/* ---------- Sheets ---------- */
.overlay { position: absolute; inset: 0; z-index: 50; background: rgba(25, 19, 72, .6); display: flex; align-items: flex-end; }
.sheet {
  width: 100%; background: var(--chalk); border-radius: 32px 32px 0 0;
  padding: 14px 24px 40px; display: flex; flex-direction: column; gap: 6px;
  animation: slideUp .25s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }
.grabber { align-self: center; width: 44px; height: 5px; border-radius: 3px; background: rgba(25, 19, 72, .25); }
.sheet-title { font-weight: 900; font-size: 26px; letter-spacing: -0.02em; padding: 14px 0 8px; }
.row { display: flex; align-items: center; gap: 16px; height: 68px; font-weight: 700; font-size: 19px; text-align: left; border-bottom: 1.5px solid rgba(25, 19, 72, .12); }
.row:last-child { border-bottom: 0; }
.row svg { width: 26px; height: 26px; flex-shrink: 0; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.row.danger { color: var(--tang); }
.row.danger svg { stroke: var(--tang); }
.toggle { margin-left: auto; width: 56px; height: 32px; border-radius: 16px; background: rgba(25, 19, 72, .25); display: flex; align-items: center; padding: 0 4px; transition: background .2s; }
.toggle span { width: 24px; height: 24px; border-radius: 12px; background: var(--chalk); transition: transform .2s; }
.toggle.on { background: var(--green); }
.toggle.on span { transform: translateX(24px); }
.rules-list { padding: 4px 0 18px 22px; display: flex; flex-direction: column; gap: 12px; font-weight: 500; font-size: 17px; line-height: 24px; }
.rules-list b { font-weight: 800; }

/* ---------- Confetti ---------- */
#confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 60; }
.confetti { position: absolute; top: -20px; width: 10px; height: 18px; border-radius: 3px; animation: fall 1.6s ease-in forwards; }
@keyframes fall { to { transform: translateY(900px) rotate(540deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
