/* Rose Drop. Linen, blush and rose, plum ink. Fredoka for the game, Cormorant
   Garamond italic for the boutique's voice. Big targets and big type: the
   players are four and the buyers are seventy. */

@font-face {
  font-family: 'Fredoka';
  src: url('./fonts/fredoka-latin.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: 'Cormorant Garamond';
  src: url('./fonts/cormorant-italic-latin.woff2') format('woff2');
  font-style: italic;
  font-weight: 600;
  font-display: swap;
}

:root {
  --linen: #fff8f1;
  --blush: #fce4ec;
  --rose: #f293b7;
  --deep: #d4548a;
  --ink: #b03a6f;
  --ink-dark: #8e2c58;
  --plum: #4a2c3a;
  --plum-soft: rgba(74, 44, 58, 0.62);
  --sage: #a8c3a0;
  --butter: #f6d98b;
  --gold: #c9a15b;
  --card: #fffdfb;
  --font: 'Fredoka', ui-rounded, 'SF Pro Rounded', system-ui, sans-serif;
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: var(--font);
  color: var(--plum);
  background-color: var(--linen);
  /* Wallpaper: a whisper of rose pinstripe with tiny dots between. */
  background-image:
    radial-gradient(circle at 50% 50%, rgba(242, 147, 183, 0.18) 1.4px, transparent 1.8px),
    repeating-linear-gradient(90deg, rgba(242, 147, 183, 0.09) 0 2px, transparent 2px 30px);
  background-size: 30px 30px, auto;
  background-position: 15px 0, 0 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
body.lining-picnic { background-color: #f4f9ff; }
body.lining-nursery { background-color: #f7f4ff; }
body.lining-golden { background-color: #fffaf0; }

#stage, #overlay { position: fixed; inset: 0; display: block; }
#overlay { pointer-events: none; }
#aim { position: fixed; inset: 0; touch-action: none; }

button { font-family: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- HUD --- */
#hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: calc(var(--safe-top) + 10px) 14px 0;
  display: grid;
  grid-template-columns: 56px 1fr 72px;
  align-items: center;
  pointer-events: none;
  z-index: 2;
}
#hud > * { pointer-events: auto; }
.score-block { text-align: center; line-height: 1; }
.score {
  font-size: 40px;
  font-weight: 600;
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 #fff, 0 0 12px var(--linen);
}
.score.bump { animation: bump 0.22s ease-out; }
@keyframes bump { 40% { transform: scale(1.14); } }
.best { font-size: 16px; font-weight: 500; color: var(--plum-soft); margin-top: 4px; }
.next-block {
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: rgba(255, 253, 251, 0.85);
  border: 2px solid rgba(74, 44, 58, 0.12);
  border-radius: 18px;
  padding: 4px 8px 6px;
}
.next-block .label { font-size: 13px; font-weight: 600; color: var(--plum-soft); text-transform: uppercase; letter-spacing: 1px; }
#next { width: 52px; height: 52px; }

.round {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 2px solid rgba(74, 44, 58, 0.14);
  background: rgba(255, 253, 251, 0.9);
  display: grid; place-items: center;
  box-shadow: 0 3px 0 rgba(74, 44, 58, 0.12);
  padding: 0;
}
.round svg { width: 24px; height: 24px; fill: var(--plum); stroke: var(--plum); stroke-width: 0; }
.round.back svg { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.round:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(74, 44, 58, 0.12); }

/* ------------------------------------------------------------ Buttons --- */
.btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  border-radius: 999px;
  border: 0;
  font-size: 21px;
  font-weight: 600;
  padding: 10px 22px;
  text-decoration: none;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.btn.primary {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 5px 0 var(--ink-dark), 0 8px 18px rgba(176, 58, 111, 0.28);
}
.btn.primary:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink-dark); }
.btn.big { min-height: 72px; font-size: 30px; letter-spacing: 0.5px; }
.btn.secondary {
  background: var(--card);
  color: var(--plum);
  border: 2px solid rgba(74, 44, 58, 0.16);
  box-shadow: 0 4px 0 rgba(74, 44, 58, 0.13);
}
.btn.secondary:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(74, 44, 58, 0.13); }
.btn-title { font-size: 18px; line-height: 1.15; white-space: nowrap; }
.btn-sub { font-size: 14px; white-space: nowrap; font-weight: 500; color: var(--plum-soft); margin-top: 2px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn:focus-visible, .round:focus-visible, .icon-btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* -------------------------------------------------------------- Title --- */
#title {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 3;
  pointer-events: none;
}
#title > * { pointer-events: auto; }
.title-top {
  padding: calc(var(--safe-top) + 14px) 16px 6px;
}
.lockup { text-align: center; }
.lockup .logo {
  display: block;
  width: min(94vw, 440px, calc((100vh - 470px) * 1.82));
  min-width: 250px;
  height: auto;
  margin: -6px auto -4px;
  filter: drop-shadow(0 6px 10px rgba(176, 58, 111, 0.22));
  animation: logo-in 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
@keyframes logo-in { from { transform: scale(0.85) translateY(-10px); opacity: 0; } }
.title-bottom {
  padding: 8px 18px calc(var(--safe-bottom) + 10px);
  display: grid;
  gap: 10px;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}
.title-best { margin: 0; text-align: center; font-size: 18px; font-weight: 500; color: var(--plum-soft); min-height: 22px; }
.iconrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 4px; }
.icon-btn {
  border: 0;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 15px;
  font-weight: 500;
  padding: 2px 0;
  min-height: 68px;
  border-radius: 16px;
}
.icon-btn .ico { width: 46px; height: 46px; display: block; }
.icon-btn .ico canvas { width: 46px; height: 46px; }
.icon-btn:active .ico { transform: scale(0.92); }

/* ------------------------------------------------------ Modal + pages --- */
.screen.modal {
  position: fixed; inset: 0; z-index: 10;
  display: grid; place-items: center;
  background: rgba(74, 44, 58, 0.32);
  padding: 20px;
  animation: fade 0.18s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border-radius: 28px;
  padding: 24px 20px 20px;
  display: grid;
  gap: 12px;
  text-align: center;
  box-shadow: 0 18px 40px rgba(74, 44, 58, 0.25);
  border: 2px solid rgba(74, 44, 58, 0.08);
  position: relative;
  animation: pop 0.24s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.card::before {
  /* A stitched border inside the card, like the patches. */
  content: '';
  position: absolute; inset: 7px;
  border: 2px dashed rgba(242, 147, 183, 0.55);
  border-radius: 22px;
  pointer-events: none;
}
@keyframes pop { from { transform: scale(0.9); opacity: 0; } }
h2 { margin: 0 0 4px; font-size: 28px; font-weight: 600; }
.pause-mark { width: 200px; height: auto; margin: 0 auto -2px; display: block; filter: drop-shadow(0 3px 6px rgba(176, 58, 111, 0.2)); }
h3 { font-size: 20px; font-weight: 600; margin: 22px 0 10px; }
.lede { margin: 0; font-size: 18px; color: var(--plum-soft); }

.screen.page {
  position: fixed; inset: 0; z-index: 10;
  background: var(--linen);
  display: flex; flex-direction: column;
  animation: slide 0.22s ease-out;
}
@keyframes slide { from { transform: translateY(24px); opacity: 0; } }
.page-head {
  display: flex; align-items: center; gap: 12px;
  padding: calc(var(--safe-top) + 10px) 16px 10px;
  border-bottom: 2px dashed rgba(242, 147, 183, 0.5);
}
.page-head h2 { margin: 0; }
.page-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 18px calc(var(--safe-bottom) + 28px);
  max-width: 560px; width: 100%; margin: 0 auto;
  user-select: text;
}
.fine { font-size: 16px; color: var(--plum-soft); }
.fine a { color: var(--ink); }
.center { text-align: center; }

/* ------------------------------------------------------------- Toggles --- */
.toggles { display: grid; gap: 10px; margin-top: 8px; }
.toggles.compact { grid-template-columns: 1fr 1fr; margin-top: 4px; }
.toggle {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 8px 16px;
  background: var(--card);
  border: 2px solid rgba(74, 44, 58, 0.1);
  border-radius: 18px;
  font-size: 19px; font-weight: 500; text-align: left;
}
.toggles.compact .toggle { font-size: 17px; padding: 6px 12px; }
.toggle input {
  appearance: none; -webkit-appearance: none;
  width: 52px; height: 32px; flex: none;
  border-radius: 999px;
  background: rgba(74, 44, 58, 0.18);
  position: relative; margin: 0;
  transition: background 0.15s;
}
.toggle input::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 26px; height: 26px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s;
}
.toggle input:checked { background: var(--ink); }
.toggle input:checked::after { transform: translateX(20px); }
.toggle input:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.howto { padding-left: 24px; font-size: 18px; line-height: 1.5; margin: 0; }

/* ----------------------------------------------------------- End sheet --- */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9;
  display: flex; justify-content: center;
  animation: rise 0.36s cubic-bezier(0.2, 1.2, 0.4, 1);
}
@keyframes rise { from { transform: translateY(100%); } }
.sheet-inner {
  width: 100%; max-width: 480px;
  background: var(--card);
  border-radius: 30px 30px 0 0;
  padding: 18px 18px calc(var(--safe-bottom) + 16px);
  box-shadow: 0 -12px 40px rgba(74, 44, 58, 0.22);
  display: grid; gap: 10px;
  position: relative;
  max-height: 86vh;
  overflow-y: auto;
}
.sheet-inner::before {
  content: ''; position: absolute; inset: 7px 7px 0;
  border: 2px dashed rgba(242, 147, 183, 0.55); border-bottom: 0;
  border-radius: 24px 24px 0 0; pointer-events: none;
}
.sheet h2 { text-align: center; font-size: 26px; }
.result { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 0 8px; }
.big-num { font-size: 58px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.result .sub { font-size: 17px; color: var(--plum-soft); margin-top: 4px; }
.result-top { text-align: center; }
#over-top { width: 84px; height: 84px; }
.ribbon-tag {
  display: inline-block; margin-top: 6px;
  background: var(--ink); color: #fff;
  font-size: 16px; font-weight: 600;
  padding: 4px 14px 4px 12px;
  border-radius: 6px;
  clip-path: polygon(0 0, 100% 0, 92% 50%, 100% 100%, 0 100%);
  animation: pop 0.3s 0.3s both cubic-bezier(0.2, 1.6, 0.4, 1);
}
.near { margin: 0; text-align: center; font-size: 18px; color: var(--ink); }
.near:empty, .rank:empty { display: none; }
.rank { margin: 0; text-align: center; font-size: 17px; color: var(--plum-soft); }
.new-things { background: var(--blush); border-radius: 20px; padding: 8px 10px 10px; text-align: center; display: grid; gap: 6px; }
.new-things:empty { display: none; }
.new-label { font-size: 18px; font-weight: 600; color: var(--ink); }
.new-label.small { font-size: 15px; font-weight: 500; color: var(--plum); }
.new-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.new-row canvas { width: 40px; height: 40px; animation: pop 0.35s both cubic-bezier(0.2, 1.6, 0.4, 1); }
.boutique-card {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  background: #fff;
  border: 2px solid rgba(242, 147, 183, 0.6);
  border-radius: 20px;
  padding: 10px 14px;
  text-align: left;
  font-size: 16px;
  min-height: 64px;
}
.boutique-card .tag { font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--ink); }
.boutique-card .serif { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 19px; line-height: 1.2; }
.boutique-card canvas { width: 44px; height: 44px; flex: none; }

/* ------------------------------------------------------------ Stickers --- */
.sticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px; }
.sticker {
  background: var(--card);
  border-radius: 20px;
  border: 2px solid rgba(74, 44, 58, 0.08);
  padding: 10px 6px 8px;
  text-align: center;
  font-size: 15px; font-weight: 500;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.sticker canvas { width: 64px; height: 64px; }
.sticker.locked { color: var(--plum-soft); }
.sticker .count { font-size: 13px; color: var(--plum-soft); }
.garden {
  min-height: 90px;
  background: linear-gradient(#fdfbf3, #eef5e6);
  border-radius: 20px;
  border: 2px solid rgba(74, 44, 58, 0.08);
  padding: 10px;
  display: flex; flex-wrap: wrap; gap: 4px; align-items: flex-end;
  font-size: 17px; color: var(--plum-soft);
}
.garden canvas { width: 38px; height: 52px; }
.linings { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lining {
  border-radius: 18px; border: 3px solid transparent;
  background: var(--card); padding: 8px; text-align: center;
  font-size: 15px; font-weight: 500; min-height: 110px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.lining canvas { width: 100%; height: 64px; border-radius: 10px; }
.lining[aria-pressed='true'] { border-color: var(--ink); }
.lining.locked { color: var(--plum-soft); }
.lining.locked canvas { filter: grayscale(0.8) opacity(0.45); }

/* -------------------------------------------------------------- Scores --- */
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: rgba(74, 44, 58, 0.06); padding: 5px; border-radius: 999px; margin: 8px 0 12px; }
.tabs button { border: 0; background: none; border-radius: 999px; min-height: 48px; font-size: 16px; font-weight: 600; }
.tabs button[aria-selected='true'] { background: var(--card); box-shadow: 0 2px 6px rgba(74, 44, 58, 0.14); color: var(--ink); }
.you { text-align: center; font-size: 17px; color: var(--plum-soft); margin: 0 0 8px; }
.board { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 6px; }
.board li {
  display: grid; grid-template-columns: 40px 36px 1fr auto; align-items: center; gap: 8px;
  background: var(--card); border-radius: 16px; padding: 8px 14px;
  font-size: 18px; min-height: 54px;
  border: 2px solid transparent;
}
.board li.me { border-color: var(--ink); background: #fff5f9; }
.board .pos { font-weight: 600; color: var(--plum-soft); text-align: center; }
.board li:nth-child(1) .pos { color: var(--gold); }
.board .pts { font-weight: 600; font-variant-numeric: tabular-nums; }
.board canvas { width: 34px; height: 34px; }
.board .empty { display: block; text-align: center; color: var(--plum-soft); background: none; }

/* ----------------------------------------------------------- Nicknames --- */
.name-preview { font-size: 30px; font-weight: 600; color: var(--ink); min-height: 40px; }
.pickers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.picker {
  height: 200px; overflow-y: auto; border-radius: 18px;
  background: var(--linen); border: 2px solid rgba(74, 44, 58, 0.1);
  padding: 6px; display: grid; gap: 4px; align-content: start;
  scroll-snap-type: y proximity;
}
.picker button {
  border: 0; background: none; border-radius: 12px;
  min-height: 44px; font-size: 18px; font-weight: 500;
  scroll-snap-align: center;
}
.picker button[aria-selected='true'] { background: var(--ink); color: #fff; }

/* ---------------------------------------------------------------- Gate --- */
.gate-rose { width: 44px; height: 56px; margin: 0 auto; }
.gate h2 { font-size: 23px; }
.gate-q { margin: 0; font-size: 22px; font-weight: 500; }
.gate-answer {
  font-size: 36px; font-weight: 600; min-height: 52px;
  border-bottom: 3px dashed rgba(242, 147, 183, 0.8);
  width: 120px; margin: 0 auto;
}
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button {
  min-height: 60px; font-size: 26px; font-weight: 600;
  border-radius: 18px; border: 2px solid rgba(74, 44, 58, 0.12);
  background: var(--linen);
}
.keypad button:active { background: var(--blush); }
.keypad .ok { background: var(--ink); color: #fff; border-color: var(--ink); }
.gate-msg { margin: 0; min-height: 22px; font-size: 17px; color: var(--ink); }

/* ------------------------------------------------------------ Grown-ups --- */
.boutique-hero { display: flex; gap: 14px; align-items: center; margin: 10px 0 4px; }
.boutique-hero .mark { width: 52px; height: 66px; flex: none; }
.serif { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 21px; line-height: 1.3; margin: 0; }
.shop-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; margin-top: 10px; }
.shop-row h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 19px; font-weight: 600; }
.shop-row h4 canvas { width: 36px; height: 36px; }
.shop-row h4 a { margin-left: auto; font-size: 15px; font-weight: 500; color: var(--ink); }
.shop-scroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.product {
  flex: none; width: 138px; text-decoration: none; color: var(--plum);
  background: var(--card); border-radius: 16px; overflow: hidden;
  border: 2px solid rgba(74, 44, 58, 0.08); scroll-snap-align: start;
}
.product img { width: 138px; height: 138px; object-fit: cover; display: block; background: var(--blush); }
.product .p-title { font-size: 14px; line-height: 1.25; padding: 6px 8px 0; height: 42px; overflow: hidden; }
.product .p-price { font-size: 15px; font-weight: 600; padding: 2px 8px 8px; }
.visit { text-align: center; margin-top: 18px; }
.visit p { font-size: 18px; margin: 0 0 12px; }

/* --------------------------------------------------------- Hint, toast --- */
.hint {
  position: fixed; z-index: 4; left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border: 2px solid rgba(242, 147, 183, 0.7);
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 19px; font-weight: 600;
  box-shadow: 0 6px 18px rgba(74, 44, 58, 0.16);
  pointer-events: none;
  white-space: nowrap;
  animation: bob 1.6s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translate(-50%, -5px); } }
.toast {
  position: fixed; z-index: 20; left: 50%; top: calc(var(--safe-top) + 92px);
  transform: translateX(-50%);
  background: var(--plum); color: #fff;
  border-radius: 999px; padding: 12px 22px;
  font-size: 18px; font-weight: 500;
  box-shadow: 0 8px 20px rgba(74, 44, 58, 0.3);
  animation: pop 0.2s ease-out;
  max-width: calc(100vw - 32px);
  text-align: center;
}
.noscript { padding: 40px; font-size: 20px; text-align: center; }

/* ------------------------------------------------------------ Mission --- */
.mission {
  position: fixed; z-index: 3; left: 50%;
  top: calc(var(--safe-top) + 84px);
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 4px 14px 4px 6px;
  background: var(--card);
  border: 2.5px solid rgba(242, 147, 183, 0.8);
  border-radius: 999px;
  box-shadow: 0 4px 0 rgba(212, 84, 138, 0.18), 0 6px 16px rgba(74, 44, 58, 0.12);
  font: inherit; color: var(--plum);
  white-space: nowrap;
}
.mission .m-icon { width: 38px; height: 38px; display: grid; place-items: center; }
.mission .m-icon canvas, .mission .m-icon svg { width: 38px; height: 38px; }
.mission .m-count { font-size: 24px; font-weight: 700; color: var(--ink); }
.mission .m-dots { display: flex; gap: 4px; }
.mission .m-dots i { width: 12px; height: 12px; border-radius: 50%; background: rgba(74, 44, 58, 0.12); border: 2px solid rgba(74, 44, 58, 0.18); }
.mission .m-dots i.on { background: #ffd65a; border-color: #d9a520; animation: dotpop 0.3s cubic-bezier(0.2, 1.8, 0.4, 1); }
@keyframes dotpop { from { transform: scale(0.3); } }
.mission .m-arrow { font-size: 22px; color: var(--plum-soft); margin: 0 -2px; }
.mission .m-reward { width: 30px; height: 30px; }
.mission .m-reward svg { width: 30px; height: 30px; }
.mission.done { animation: missiondone 0.9s ease-out; border-color: #ffc93c; background: #fffbe6; }
@keyframes missiondone {
  0% { transform: translateX(-50%) scale(1); }
  25% { transform: translateX(-50%) scale(1.22) rotate(-3deg); }
  50% { transform: translateX(-50%) scale(1.12) rotate(3deg); }
  100% { transform: translateX(-50%) scale(1); }
}
.mission.fresh { animation: missionnew 0.45s cubic-bezier(0.2, 1.5, 0.4, 1); }
@keyframes missionnew { from { transform: translateX(-50%) translateY(-24px) scale(0.6); opacity: 0; } }

/* -------------------------------------------------------------- Tools --- */
.tools {
  position: fixed; z-index: 3; left: 0; right: 0;
  bottom: calc(var(--safe-bottom) + 6px);
  display: flex; justify-content: center; gap: 22px;
  pointer-events: none;
}
.tool {
  pointer-events: auto;
  position: relative;
  width: 64px; height: 80px;
  border: 0; background: none; padding: 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.tool svg {
  width: 62px; height: 62px; padding: 10px;
  background: var(--card);
  border: 2.5px solid rgba(74, 44, 58, 0.16);
  border-radius: 50%;
  box-shadow: 0 4px 0 rgba(74, 44, 58, 0.14);
  transition: transform 0.1s;
}
.tool:active svg { transform: translateY(3px); box-shadow: 0 1px 0 rgba(74, 44, 58, 0.14); }
.tool .tool-name { font-size: 13px; font-weight: 600; color: var(--plum-soft); }
.tool .badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 26px; height: 26px; padding: 0 6px;
  border-radius: 999px; background: var(--ink); color: #fff;
  font-size: 15px; font-weight: 700; line-height: 26px; text-align: center;
  box-shadow: 0 2px 0 var(--ink-dark);
}
.tool.empty svg { opacity: 0.4; filter: grayscale(0.7); }
.tool.empty .badge { background: rgba(74, 44, 58, 0.3); box-shadow: none; }
.tool.ready svg { animation: toolready 1.6s ease-in-out infinite; border-color: #ffc93c; }
@keyframes toolready { 50% { transform: scale(1.08); box-shadow: 0 0 0 6px rgba(255, 201, 60, 0.3); } }
.tool.active svg { border-color: var(--ink); box-shadow: 0 0 0 6px rgba(212, 84, 138, 0.35); animation: none; }
.tool .bump { animation: badgebump 0.5s cubic-bezier(0.2, 1.8, 0.4, 1); }
@keyframes badgebump { 40% { transform: scale(1.6); } }
.flyer {
  position: fixed; z-index: 30; width: 40px; height: 40px; pointer-events: none;
  transition: transform 0.7s cubic-bezier(0.5, -0.3, 0.6, 1), opacity 0.2s 0.6s;
}
.flyer svg { width: 40px; height: 40px; }

/* -------------------------------------------------------------- Cheer --- */
.cheer {
  position: fixed; z-index: 4; left: 50%;
  transform: translateX(-50%);
  font-size: clamp(40px, 12vw, 58px); font-weight: 700;
  color: #fff;
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 5px 0 rgba(176, 58, 111, 0.35);
  pointer-events: none; white-space: nowrap;
}
.cheer.go { animation: cheer 1.25s cubic-bezier(0.2, 1.4, 0.4, 1) forwards; }
.cheer.gold { -webkit-text-stroke-color: #c98a12; text-shadow: 0 5px 0 rgba(201, 138, 18, 0.35); color: #fff6c2; }
@keyframes cheer {
  0% { transform: translateX(-50%) scale(0.2) rotate(-8deg); opacity: 0; }
  18% { transform: translateX(-50%) scale(1.15) rotate(3deg); opacity: 1; }
  30% { transform: translateX(-50%) scale(1) rotate(0); }
  75% { transform: translateX(-50%) translateY(-10px) scale(1); opacity: 1; }
  100% { transform: translateX(-50%) translateY(-40px) scale(0.9); opacity: 0; }
}

/* ------------------------------------------------------------- Reveal --- */
.reveal {
  position: fixed; inset: 0; z-index: 12;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 45%, #fffbe9 0%, #ffe3ee 55%, rgba(252, 228, 236, 0.96) 100%);
  overflow: hidden;
  animation: fade 0.25s ease-out;
}
.reveal .rays {
  position: absolute; left: 50%; top: 45%; width: 180vmax; height: 180vmax;
  margin: -90vmax 0 0 -90vmax;
  background: repeating-conic-gradient(from 0deg, rgba(255, 214, 90, 0.28) 0deg 10deg, rgba(255, 255, 255, 0) 10deg 20deg);
  animation: spin 16s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.reveal-card { position: relative; text-align: center; padding: 24px; max-width: 420px; }
.reveal-kicker {
  display: inline-block; background: #ffcf4a; color: var(--plum);
  font-size: 20px; font-weight: 700; padding: 6px 18px; border-radius: 999px;
  box-shadow: 0 3px 0 #d9a520;
  animation: pop 0.4s 0.1s both cubic-bezier(0.2, 1.8, 0.4, 1);
}
.reveal-art { width: 220px; height: 220px; margin: 14px auto 4px; animation: friendin 0.7s 0.15s both cubic-bezier(0.2, 1.6, 0.4, 1); }
.reveal-art canvas { width: 220px; height: 220px; animation: friendbob 1.6s 0.9s ease-in-out infinite; }
@keyframes friendin { from { transform: scale(0) rotate(-30deg); } }
@keyframes friendbob { 50% { transform: translateY(-8px) rotate(4deg); } }
.reveal-name { font-size: 38px; font-weight: 700; color: var(--ink); margin: 6px 0 2px; animation: pop 0.4s 0.5s both cubic-bezier(0.2, 1.8, 0.4, 1); }
.reveal-line { font-size: 20px; margin: 0 auto; max-width: 30ch; animation: fade 0.4s 0.8s both; }
.reveal-tap { font-size: 16px; color: var(--plum-soft); margin-top: 18px; animation: fade 0.4s 1.4s both; }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i {
  position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 3px;
  animation: fall linear forwards;
}
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
@media (min-width: 700px) and (min-height: 700px) {
  .score { font-size: 46px; }
}
