/* Omikuji Shrine — shared tokens and small parts (same family as Pon Pon Park: pale candy colours) */
:root {
  --ink: #4a4560;
  --ink-soft: #857ea3;
  --paper: #fffdf8;
  --lilac: #cfc4ff;
  --lilac-deep: #b3a5f2;
  --lilac-ink: #3d3270;
  --logo: #7466c2;
  --coral: #ffd6c8;
  --coral-deep: #eaa08c;
  --coral-ink: #8a4433;
  --mint: #d4f3e6;
  --mint-deep: #a9e2cb;
  --mint-ink: #2f6b57;
  --straw: #f3dfa6;
  --straw-deep: #e3c67e;
  --gold-1: #ffe9a3;
  --gold-2: #f6cf63;
  --gold-3: #fff6d6;
  --m-main: var(--coral);        /* glow and sparkle colours of the slip overlay */
  --m-deep: var(--coral-deep);
  --font: 'Fredoka', 'Arial Rounded MT Bold', 'Trebuchet MS', system-ui, sans-serif;
  --kanji: 'Klee One', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  /* u = the width of one thing standing in the scene (offering box, omikuji box, rack) */
  --u: min(calc((100vw - 28px) / 3.02), 190px, calc((100dvh - 330px) * 0.5));
  --omw: var(--u);               /* the rack's width (name kept from the park's stylesheet) */
  --ctl: 172px;                  /* height of the controls under the scene */
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { overflow: hidden; }
body {
  position: fixed; inset: 0;   /* the page itself never scrolls; only the cabinet and the slip do */
  margin: 0;
  font-family: var(--font);
  font-weight: 500;
  color: var(--ink);
  background: linear-gradient(180deg, #ece7ff 0%, #f8eefc 38%, #fff1ea 70%, #fff6ee 100%) #f4f0ff;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
button { font: inherit; color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 3px solid var(--lilac-deep); outline-offset: 3px; border-radius: 12px; }

/* ---------- round header buttons ---------- */
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  border: 0; background: rgba(255, 255, 255, .8);
  box-shadow: 0 3px 0 #e6dfff, 0 6px 14px rgba(110, 95, 170, .12);
  color: var(--ink); cursor: pointer;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #e6dfff; }
#muteBtn .snd-off { display: none; }
#muteBtn.muted .snd-on { display: none; }
#muteBtn.muted .snd-off { display: inline; }
#muteBtn.muted { color: var(--ink-soft); }
#musicBtn .mus-off { display: none; }
#musicBtn.off { color: var(--ink-soft); background: rgba(255, 255, 255, .55); }
#musicBtn.off .mus-off { display: inline; }
#musicBtn.off svg > :not(.mus-off) { opacity: .55; }

/* ---------- buttons ---------- */
.btn {
  min-height: 50px; padding: 0 20px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 2px solid #e6dfff; background: #fff; color: var(--ink);
  font-size: 17px; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 0 #e6dfff;
  transition: transform .08s, box-shadow .08s;
}
.btn svg { width: 20px; height: 20px; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #e6dfff; }
.btn.primary { background: var(--lilac); border-color: var(--lilac-deep); color: var(--lilac-ink); box-shadow: 0 4px 0 var(--lilac-deep); }
.btn.primary:active { box-shadow: 0 1px 0 var(--lilac-deep); }
.btn.small { min-height: 44px; padding: 0 16px; font-size: 15px; }

/* ---------- hint line ---------- */
.hint {
  margin: 0; min-height: 22px; text-align: center; text-wrap: balance;
  font-size: 16px; line-height: 1.3; font-weight: 600; color: var(--ink);
}
.hint:not(:empty) { animation: hintIn .4s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes hintIn { from { transform: translateY(8px) scale(.9); opacity: 0; } }

/* ---------- coin (shape from the park; the ¥100 look is in shrine.css) ---------- */
.coin {
  --size: 50px;
  width: var(--size); height: var(--size); flex: none;
  border-radius: 50%; padding: 0;
  display: grid; place-items: center;
  border: 3px solid #cfcbea;
}
.coin-face { width: 74%; height: 74%; border-radius: 50%; display: grid; place-items: center; }
button.coin { cursor: grab; touch-action: none; animation: coinBob 1.6s ease-in-out infinite; }
button.coin.lifted { opacity: .25; animation: none; }
button.coin.spent { visibility: hidden; pointer-events: none; animation: none; }
@keyframes coinBob {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-9px) rotate(8deg); }
}
.coin.flying, .coin.dragging { position: fixed; z-index: 70; margin: 0; pointer-events: none; animation: none; transform: none; }
.coin.dragging { cursor: grabbing; box-shadow: 0 14px 24px rgba(120, 110, 180, .3); scale: 1.12; }

/* ---------- glow and sparkles of the slip overlay (from the park) ---------- */
.reveal-glow {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  width: min(440px, 120vw); aspect-ratio: 1; border-radius: 50%; opacity: 0; pointer-events: none;
  background: radial-gradient(circle, #fff 0 22%, var(--m-main) 46%, transparent 70%);
}
.reveal-glow.gold {
  background:
    repeating-conic-gradient(from 0deg, rgba(255, 233, 163, .55) 0 10deg, transparent 10deg 24deg),
    radial-gradient(circle, #fff 0 22%, var(--gold-1) 45%, transparent 70%);
  -webkit-mask: radial-gradient(circle, #000 40%, transparent 70%);
  mask: radial-gradient(circle, #000 40%, transparent 70%);
  animation: spin 14s linear infinite;
}
@keyframes spin { to { rotate: 360deg; } }
.reveal-fx { width: 0; height: 0; position: relative; pointer-events: none; }
.fx-spot { position: fixed; width: 0; height: 0; pointer-events: none; }
.sparkle {
  position: absolute; display: block;
  background: #fff;
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  filter: drop-shadow(0 0 3px var(--m-deep));
}
.sparkle.gold { background: var(--gold-2); filter: drop-shadow(0 0 4px #fff3c4); }
.sparkle:nth-child(3n) { background: var(--m-main); }
.sparkle.gold:nth-child(3n) { background: #fff6d6; }

.fly-layer { position: fixed; inset: 0; pointer-events: none; z-index: 70; }

@media (prefers-reduced-motion: reduce) {
  button.coin, .reveal-glow.gold, .hint:not(:empty) { animation: none !important; }
}
