@font-face { font-family: "Baloo 2"; font-weight: 500; font-display: swap; src: url(fonts/baloo-2-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Baloo 2"; font-weight: 600; font-display: swap; src: url(fonts/baloo-2-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Baloo 2"; font-weight: 700; font-display: swap; src: url(fonts/baloo-2-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Baloo 2"; font-weight: 800; font-display: swap; src: url(fonts/baloo-2-latin-800-normal.woff2) format("woff2"); }

:root {
  --night: #3A21B4;
  --night-d: #2A1690;
  --deep: #1E1064;
  --ink: #25174A;
  --cream: #FFF6DD;
  --gold: #FFC93C;
  --rose: #FF4D6D;
  --mint: #3EE0B5;
  --lilac: #B9A8FF;
}

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

html {
  font-size: min(calc(100vw / 39), calc(100vh / 48));
  font-size: min(calc(100vw / 39), calc(100dvh / 48));
  height: 100%;
}

body {
  height: 100%;
  overflow: hidden;
  background: linear-gradient(var(--night), var(--night-d));
  color: var(--ink);
  font-family: "Baloo 2", "Nunito", system-ui, sans-serif;
  font-weight: 600;
  line-height: 1.15;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
button:focus-visible { outline: 0.3rem solid var(--mint); outline-offset: 0.2rem; }
img { display: block; -webkit-user-drag: none; }

#app { position: relative; width: 39rem; height: 100%; margin: 0 auto; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; overflow: clip; background-image: radial-gradient(rgba(255, 255, 255, 0.09) 0.18rem, transparent 0.2rem); background-size: 2.2rem 2.2rem; }

.wheel { position: relative; height: 33.6rem; flex: none; }
.frame { position: absolute; inset: 0; width: 100%; height: 100%; }
.bulb { fill: var(--cream); stroke: var(--ink); stroke-width: 2.5; }
.s-lock .bulb, .s-spin .bulb { animation: bulb 0.5s steps(1) infinite; }
.s-lock .bulb:nth-child(odd), .s-spin .bulb:nth-child(odd) { animation-delay: 0.25s; }
@keyframes bulb { 0% { fill: var(--rose); } 50% { fill: var(--cream); } }

.head { position: absolute; left: 1.2rem; top: 0.8rem; color: var(--lilac); font-size: 1.15rem; line-height: 1.3; z-index: 5; }
.head h1 { font-size: 2.1rem; font-weight: 800; line-height: 1.1; color: var(--gold); -webkit-text-stroke: 0.1rem var(--ink); paint-order: stroke fill; text-shadow: 0 0.2rem 0 var(--ink); }
.head b { font-weight: 800; color: var(--cream); }
.online { display: flex; align-items: center; gap: 0.35rem; }
.online i { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--mint); }
.tools { position: absolute; right: 1rem; top: 0.8rem; display: flex; gap: 0.6rem; z-index: 5; }
.ic { width: 2.8rem; height: 2.8rem; flex: none; border-radius: 50%; background: var(--deep); color: var(--cream); display: grid; place-items: center; }
.ic svg { width: 1.6rem; height: 1.6rem; }
.ic:active { transform: scale(0.9); }
#btnSound .mute { display: none; }
#btnSound.off .wave { display: none; }
#btnSound.off .mute { display: block; }

.pod { position: absolute; width: 7.2rem; height: 7.2rem; border-radius: 50%; background: var(--cream); border: 0.28rem solid var(--ink); box-shadow: 0 0.35rem 0 var(--ink); transition: transform 0.12s, background 0.12s, opacity 0.25s, filter 0.25s; }
.pod img.art { position: absolute; left: 50%; top: 0.4rem; width: 3.7rem; height: 3.7rem; margin-left: -1.85rem; pointer-events: none; }
.pod .all { position: absolute; left: 0; right: 0; bottom: 1.4rem; display: flex; align-items: center; justify-content: center; gap: 0.2rem; font-size: 1.05rem; font-weight: 800; line-height: 1; color: var(--night); opacity: 0; }
.pod .all svg { width: 1.1rem; height: 1.1rem; margin-top: -0.15rem; }
.pod.any .all { opacity: 1; }
.pod .mult { position: absolute; left: 50%; bottom: -0.95rem; transform: translateX(-50%); min-width: 3.6rem; padding: 0.15rem 0.7rem 0; border-radius: 1.1rem; background: var(--ink); color: var(--gold); font-size: 1.35rem; font-weight: 800; text-align: center; line-height: 1.25; }
.pod .mult.big { background: var(--rose); color: var(--cream); border: 0.2rem solid var(--ink); }
.pod .mine { position: absolute; top: -0.8rem; right: -1rem; display: none; align-items: center; gap: 0.15rem; padding: 0.1rem 0.6rem 0 0.2rem; border-radius: 1.1rem; background: var(--mint); border: 0.2rem solid var(--ink); font-size: 1.2rem; font-weight: 800; line-height: 1.3; z-index: 2; }
.pod .mine img { width: 1.4rem; height: 1.4rem; }
.pod.has .mine { display: flex; }
.pod.has { border-color: var(--ink); box-shadow: 0 0.35rem 0 var(--ink), 0 0 0 0.3rem var(--mint); }
.pod.is-hot { box-shadow: 0 0.35rem 0 var(--ink), 0 0 0 0.3rem var(--rose); }
.s-betting .pod:active { transform: scale(0.93); }
.pod.on { background: var(--gold); transform: scale(1.1); z-index: 3; }
.pod.win { background: var(--gold); z-index: 3; animation: win 0.5s ease-in-out infinite alternate; }
@keyframes win { from { transform: scale(1.06) rotate(-3deg); } to { transform: scale(1.16) rotate(3deg); } }
.pod.dim { filter: brightness(0.62) saturate(0.55); }
.pod.bump { animation: bump 0.22s; }
@keyframes bump { 50% { transform: scale(1.1); } }

.hot { position: absolute; left: -2rem; top: -1.6rem; width: 4.4rem; height: 5.16rem; overflow: hidden; pointer-events: none; z-index: 4; }
.hot img { width: 100%; height: 100%; }
.s-result .hot, .s-spin .hot { display: none; }

.hub { position: absolute; left: 14.5rem; top: 11.8rem; width: 10rem; height: 10rem; border-radius: 50%; background: var(--rose); border: 0.3rem solid var(--ink); box-shadow: inset 0 -0.7rem 0 rgba(37, 23, 74, 0.22), 0 0.35rem 0 var(--ink); z-index: 2; }
.bunny { position: absolute; left: 50%; top: 50%; width: 6.6rem; height: 6.82rem; margin: -3.7rem 0 0 -3.3rem; overflow: hidden; }
.bunny canvas, .fx canvas, .hot canvas { position: absolute; left: 0; top: 0; }
.tick { position: absolute; left: 50%; bottom: -1.7rem; transform: translateX(-50%); min-width: 4.2rem; height: 3.3rem; padding: 0.42rem 0.9rem 0; border-radius: 1.7rem; background: var(--gold); border: 0.28rem solid var(--ink); box-shadow: 0 0.25rem 0 var(--ink); font-size: 2.1rem; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; line-height: 1; white-space: nowrap; }
.tick.word { font-size: 1.3rem; padding-top: 0.75rem; }
.tick.hurry { background: var(--rose); color: var(--cream); animation: hurry 0.5s ease-in-out infinite alternate; }
@keyframes hurry { to { transform: translateX(-50%) scale(1.14); } }

.ped { position: absolute; bottom: 0.9rem; width: 5.4rem; display: flex; flex-direction: column; align-items: center; z-index: 4; }
.ped-salad { left: 0.7rem; }
.ped-pizza { right: 0.7rem; }
.ped .plate { width: 4.8rem; height: 4.8rem; border-radius: 50%; background: var(--cream); border: 0.28rem solid var(--ink); display: grid; place-items: center; }
.ped .plate img { width: 3.3rem; height: 3.3rem; }
.ped .tag { position: relative; z-index: 1; margin-top: -0.8rem; padding: 0.1rem 0.8rem 0; border-radius: 1.1rem; background: var(--ink); color: var(--cream); font-size: 1.15rem; font-weight: 700; }
.ped.win .plate { background: var(--gold); animation: win 0.5s ease-in-out infinite alternate; }

.fx { position: absolute; left: 3.5rem; top: 0.8rem; width: 32rem; height: 32rem; overflow: hidden; pointer-events: none; z-index: 6; }

.panel { position: relative; flex: none; background: var(--deep); border-top: 0.28rem solid var(--ink); border-radius: 2rem 2rem 0 0; padding: 1rem 1.2rem calc(1rem + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 0.8rem; z-index: 3; }
.row { display: flex; gap: 0.8rem; align-items: stretch; }

.wallet { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 0 0.9rem; border-radius: 1.6rem; background: var(--cream); border: 0.28rem solid var(--ink); }
.bal { display: flex; align-items: center; gap: 0.4rem; }
.bal img { width: 2rem; height: 2rem; flex: none; }
.bal b { font-size: 1.7rem; font-weight: 800; line-height: 1.1; padding-top: 0.2rem; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bal b.tight { font-size: 1.4rem; }
.wallet small { font-size: 1.05rem; font-weight: 600; opacity: 0.75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wallet small b { font-weight: 800; }
.wallet .plus { position: absolute; right: -0.7rem; top: -0.9rem; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--mint); border: 0.25rem solid var(--ink); font-size: 1.8rem; font-weight: 800; line-height: 1; padding-top: 0.2rem; }
.bal b.pop-up { animation: bump 0.3s; }

.tray { flex: none; display: flex; gap: 0.7rem; padding: 0.9rem 0.9rem 0.7rem; border-radius: 1.6rem; background: var(--night-d); border: 0.28rem solid var(--ink); }
.chip { position: relative; width: 5rem; height: 5rem; border-radius: 50%; border: 0.26rem solid var(--ink); background: var(--c); box-shadow: 0 0.3rem 0 var(--ink); display: grid; place-items: center; transition: transform 0.14s, box-shadow 0.14s; }
.chip::before { content: ""; position: absolute; inset: 0.28rem; border-radius: 50%; border: 0.28rem dashed var(--cream); opacity: 0.9; }
.chip span { position: relative; width: 3.2rem; height: 3.2rem; border-radius: 50%; background: var(--cream); border: 0.22rem solid var(--ink); display: grid; place-items: center; padding-top: 0.18rem; font-size: 1.35rem; font-weight: 800; }
.chip span.long { font-size: 1.1rem; }
.chip[aria-checked="true"] { transform: translateY(-0.7rem) scale(1.08); box-shadow: 0 0.7rem 0 var(--ink), 0 0 0 0.25rem var(--cream); }

.hist { display: flex; align-items: center; gap: 0.75rem; height: 3rem; }
.dot { position: relative; width: 3rem; height: 3rem; flex: none; border-radius: 50%; background: var(--cream); border: 0.24rem solid var(--ink); display: grid; place-items: center; }
.dot img { width: 2.05rem; height: 2.05rem; }
.dot:first-child { background: var(--gold); width: 3.4rem; height: 3.4rem; margin-right: 0.5rem; }
.dot:first-child::after { content: "new"; position: absolute; bottom: -0.75rem; left: 50%; transform: translateX(-50%); padding: 0 0.45rem; border-radius: 0.8rem; background: var(--rose); color: var(--cream); font-size: 0.95rem; font-weight: 700; line-height: 1.3; }
.dot.drop { animation: drop 0.35s cubic-bezier(0.3, 1.5, 0.6, 1); }
@keyframes drop { from { transform: translateY(-1.6rem) scale(0.4); opacity: 0; } }
.hist:empty::before { content: "Results show up here after the first round"; color: var(--lilac); font-size: 1.2rem; }

.ava { position: relative; width: 2.6rem; height: 2.6rem; flex: none; border-radius: 50%; border: 0.2rem solid var(--ink); background: var(--a, var(--night)); color: var(--cream); display: grid; place-items: center; font-size: 1.3rem; font-weight: 800; overflow: hidden; padding-top: 0.15rem; }
.ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.pop { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 1rem calc(0.5rem + env(safe-area-inset-bottom)); z-index: 8; transform: translateY(110%); transition: transform 0.32s cubic-bezier(0.2, 1.2, 0.4, 1); pointer-events: none; }
.pop.show { transform: none; }
.pop-card { display: flex; align-items: center; gap: 1rem; min-height: 12.2rem; background: var(--cream); border: 0.28rem solid var(--ink); border-radius: 1.8rem; box-shadow: 0 0.4rem 0 var(--ink); padding: 1rem 1.2rem; }
.pop-card > img { width: 6.2rem; height: 6.2rem; flex: none; }
.pop-main { flex: 1; min-width: 0; }
.pop-main > b { display: block; font-size: 2rem; font-weight: 800; line-height: 1.1; white-space: nowrap; }
.pop-mine { display: inline-block; margin-top: 0.5rem; padding: 0.45rem 1rem 0.25rem; border-radius: 1.1rem; background: var(--ink); color: var(--cream); font-size: 1.25rem; font-weight: 700; }
.pop-mine.won { background: var(--gold); color: var(--ink); border: 0.25rem solid var(--ink); font-size: 1.45rem; font-weight: 800; white-space: nowrap; }
.pop-mine img { display: inline-block; width: 1.7rem; height: 1.7rem; vertical-align: -0.3rem; margin-right: 0.3rem; }
.pop-top { flex: none; display: flex; flex-direction: column; gap: 0.35rem; padding-left: 1rem; border-left: 0.2rem dashed rgba(37, 23, 74, 0.25); }
.pop-top:empty { display: none; }
.winner { display: flex; align-items: center; gap: 0.45rem; font-size: 1.1rem; }
.winner b { max-width: 5.2rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.winner em { font-style: normal; font-weight: 800; color: var(--rose); font-variant-numeric: tabular-nums; margin-left: auto; padding-left: 0.3rem; }

.veil { position: absolute; inset: 0; background: rgba(20, 10, 60, 0.6); opacity: 0; pointer-events: none; transition: opacity 0.2s; z-index: 10; }
.veil.show { opacity: 1; pointer-events: auto; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; height: 92%; display: flex; flex-direction: column; background: var(--cream); border-top: 0.28rem solid var(--ink); border-radius: 2rem 2rem 0 0; transform: translateY(105%); transition: transform 0.28s cubic-bezier(0.2, 1, 0.3, 1); z-index: 11; }
.sheet.show { transform: none; }
.sheet-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 1.2rem 1.4rem 0.4rem; }
.sheet-head b { font-size: 2rem; font-weight: 800; }
.sheet .ic { background: var(--ink); }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0.2rem 1.4rem 2rem; -webkit-overflow-scrolling: touch; }

.rules h3 { font-size: 1.6rem; font-weight: 800; margin: 1.4rem 0 0.6rem; }
.rules ol { padding-left: 2rem; font-size: 1.4rem; font-weight: 500; line-height: 1.4; }
.rules li { margin-bottom: 0.4rem; }
.rules p { font-size: 1.4rem; font-weight: 500; line-height: 1.4; }
.pay { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.7rem; }
.pay div { display: flex; flex-direction: column; align-items: center; padding: 0.7rem 0 0.4rem; border-radius: 1.3rem; border: 0.24rem solid var(--ink); background: #fff; font-size: 1.15rem; }
.pay img { width: 3.4rem; height: 3.4rem; }
.pay b { font-size: 1.6rem; font-weight: 800; color: var(--rose); line-height: 1.1; }
.special { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.7rem; }
.special img { width: 4rem; height: 4rem; flex: none; }
.legend { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.6rem; font-size: 1.4rem; font-weight: 500; }
.legend span { flex: none; min-width: 5.4rem; text-align: center; padding: 0.15rem 0.7rem 0; border-radius: 1.1rem; border: 0.2rem solid var(--ink); font-weight: 800; font-size: 1.2rem; }
.legend .l-mine { background: var(--mint); }
.legend .l-all { background: #fff; color: var(--night); }
.legend .l-hot { background: var(--rose); color: var(--cream); }

.toast { position: absolute; left: 50%; top: 4.2rem; transform: translate(-50%, -2rem); display: flex; align-items: center; gap: 1rem; max-width: 36rem; padding: 0.8rem 1.4rem 0.6rem; border-radius: 1.5rem; background: var(--ink); color: var(--cream); border: 0.2rem solid var(--cream); font-size: 1.35rem; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity 0.18s, transform 0.18s; z-index: 20; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { padding: 0.3rem 1rem 0.1rem; border-radius: 1rem; background: var(--gold); color: var(--ink); font-weight: 800; }

.cover { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2rem; background: linear-gradient(var(--night), var(--night-d)); color: var(--cream); font-size: 1.7rem; font-weight: 700; text-align: center; padding: 0 4rem; }
.cover img { width: 8rem; height: 8rem; animation: wob 0.6s ease-in-out infinite alternate; }
@keyframes wob { to { transform: translateY(-0.4rem) rotate(-6deg); } }
.cover button { padding: 0.8rem 2.4rem 0.5rem; border-radius: 1.8rem; background: var(--gold); border: 0.28rem solid var(--ink); box-shadow: 0 0.4rem 0 var(--ink); font-weight: 800; color: var(--ink); }
.cover.hide { display: none; }

.fly { position: absolute; width: 2.2rem; height: 2.2rem; z-index: 9; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .pod.win, .ped.win .plate, .tick.hurry, .cover img { animation: none; }
  .pop, .sheet { transition: none; }
}
