:root {
  --stage: 430px;
  color-scheme: light;
  /* Shared chip palette — dock, fly, and port piles */
  --chip-1k: #15803d;
  --chip-2k: #1d4ed8;
  --chip-3k: #c2410c;
  --chip-5k: #be185d;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: stretch;
  background: #08324a;
  font-family: Outfit, "Segoe UI", sans-serif;
  color: #fff;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
  touch-action: manipulation;
}

button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.stage {
  position: relative;
  width: min(100vw, var(--stage));
  height: 100dvh;
  max-height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto auto;
  overflow: hidden;
  container-type: inline-size;
}

.sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(90% 42% at 50% 108%, rgba(255, 220, 90, 0.55), transparent 46%),
    radial-gradient(55% 32% at 92% 72%, rgba(96, 176, 58, 0.55), transparent 60%),
    linear-gradient(180deg, #57c4ff 0%, #7ed2ff 18%, #a6e0ff 42%, #c8ebff 62%, #fff1b8 80%, #d4ef7a 100%);
  overflow: hidden;
  pointer-events: none;
}

.sun {
  position: absolute;
  top: -40px;
  right: -30px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95), rgba(255, 236, 140, 0.35) 42%, transparent 70%);
}

.cloud {
  position: absolute;
  height: auto;
  pointer-events: none;
  overflow: visible;
  filter: drop-shadow(0 4px 6px rgba(80, 130, 180, 0.12));
}

/* A loose, staggered sky composition: distant clouds are smaller and paler. */
.cl-far-a {
  width: 64px;
  top: 22%;
  left: 14%;
  opacity: 0.7;
}

.cl-far-b {
  width: 54px;
  top: 13%;
  right: 19%;
  opacity: 0.48;
}

.cl-near-b {
  width: 112px;
  top: 28%;
  right: -4%;
  opacity: 0.86;
  transform: scaleX(-1);
}

.cottage {
  position: absolute;
  left: -6%;
  bottom: 52%;
  width: 40%;
  height: auto;
  opacity: 0.86;
  filter: blur(6px) drop-shadow(0 8px 10px rgba(80, 40, 10, 0.20));
  pointer-events: none;
}

.tree {
  position: absolute;
  bottom: 35%;
  width: 34%;
  height: auto;
  opacity: 0.88;
  filter: blur(4px) drop-shadow(0 8px 10px rgba(20, 60, 10, 0.14));
  pointer-events: none;
}

.t1 { right: -8%; }
.t2 { right: 18%; width: 26%; bottom: 39%; }

.hill {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -20px;
  height: 28%;
  background: radial-gradient(120% 100% at 50% 100%, #c6e85e, rgba(198, 232, 94, 0));
}

.top,
.wheel-zone,
.meta,
.results,
.bets,
.dock {
  position: relative;
  z-index: 1;
}

.top {
  position: relative;
  z-index: 50;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  padding: 8px 10px 0;
}

.orbs {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: none;
}

.orb {
  position: relative;
  margin-top: 8px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 0;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0) 34%),
    radial-gradient(circle at 68% 78%, rgba(120, 0, 50, 0.28), transparent 44%),
    linear-gradient(180deg, #ff9fd0 0%, #ff4aa0 46%, #e0187a 100%);
  box-shadow:
    0 0 0 2.5px #fff4b8,
    0 0 0 5px #e0a020,
    inset 0 2px 2px rgba(255, 255, 255, 0.8),
    inset 0 -7px 9px rgba(120, 0, 50, 0.28),
    0 4px 0 #9a0a52,
    0 7px 12px rgba(80, 10, 40, 0.22);
}

.orb::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  pointer-events: none;
}

.orb svg {
  position: relative;
  z-index: 1;
  width: 18px;
  height: 18px;
  display: block;
  filter: drop-shadow(0 1px 0 rgba(90, 20, 0, 0.35));
}

.orb .slash { display: none; }
.orb[aria-pressed="true"] .wave { display: none; }
.orb[aria-pressed="true"] .slash { display: block; }
.orb:active {
  transform: translateY(2px);
  box-shadow:
    0 0 0 2.5px #fff4b8,
    0 0 0 5px #e0a020,
    inset 0 2px 2px rgba(255, 255, 255, 0.75),
    inset 0 -7px 9px rgba(120, 0, 50, 0.3),
    0 2px 0 #9a0a52,
    0 4px 8px rgba(80, 10, 40, 0.2);
}

.plaque {
  position: relative;
  z-index: 1;
  margin: 6px auto 0;
  justify-self: center;
  align-self: start;
  min-width: 0;
  max-width: min(100%, 200px);
  width: 100%;
  padding: 11px 20px 12px;
  text-align: center;
  border: 0;
  background: transparent;
  filter: drop-shadow(0 8px 10px rgba(70, 0, 90, 0.28));
}

.plaque-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  filter: drop-shadow(0 3px 0 #6e3a0c);
}

.plaque-scroll {
  position: absolute;
  top: 50%;
  width: 28px;
  height: 46px;
  transform: translateY(-50%);
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 35% 28%, #fff8d8 0 18%, transparent 19%),
    radial-gradient(ellipse at 50% 50%, #ffd34a 0 42%, #c4841c 68%, #8a5712 100%);
  border-radius: 42% 58% 55% 45% / 40% 42% 58% 60%;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.85),
    inset 0 -4px 6px rgba(120, 60, 0, 0.35),
    0 0 0 2px #a86e18,
    0 3px 5px rgba(0, 0, 0, 0.25);
}

.plaque-scroll::before,
.plaque-scroll::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff6c4, #f0c14b 46%, #b77814);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 1px 2px rgba(0, 0, 0, 0.2);
}

.plaque-scroll::before {
  width: 12px;
  height: 12px;
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
}

.plaque-scroll::after {
  width: 10px;
  height: 10px;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
}

.plaque-scroll-l { left: -8px; }
.plaque-scroll-r {
  right: -8px;
  transform: translateY(-50%) scaleX(-1);
}

.plaque-jewel {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 14px;
  height: 14px;
  transform: translateY(-50%) rotate(45deg);
  border-radius: 3px;
  background:
    linear-gradient(135deg, #fff6c4 0%, #ffd34a 35%, #e09a18 70%, #a8640c 100%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.9),
    inset 0 -2px 3px rgba(120, 60, 0, 0.35),
    0 0 0 1.5px #8a5712,
    0 2px 4px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

.plaque-jewel-l { left: -4px; }
.plaque-jewel-r { right: -4px; }

.plaque span {
  position: relative;
  z-index: 3;
  display: block;
  font-family: "Lilita One", Fredoka, sans-serif;
  font-size: clamp(15px, 4.8vw, 24px);
  font-weight: 400;
  letter-spacing: 0.5px;
  line-height: 1;
  color: #fff8d0;
  text-shadow:
    0 1px 0 #ffe9a0,
    0 2px 0 #7a1ab0,
    0 3px 0 #6b21a8,
    0 5px 10px rgba(50, 0, 80, 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wheel-zone {
  container-type: size;
  min-height: 0;
  display: grid;
  align-items: center;
  justify-content: center;
  padding: 2px 0 4px;
  overflow: visible;
}

.wheel {
  position: relative;
  /* Fill available middle area on tall phones; still capped on large screens */
  width: min(86cqw, 78cqh, 310px);
  aspect-ratio: 1;
  filter: drop-shadow(0 10px 8px rgba(70, 36, 0, 0.28));
  container-type: size;
  overflow: visible;
}

.rotor {
  position: absolute;
  inset: 0;
  transform-origin: 50% 50%;
  transition: transform 4.4s cubic-bezier(0.12, 0.68, 0.08, 1);
  overflow: visible;
}

.wheel {
  --boost: 0;
}

/* Rim nozzles (flush saddle + tangent) — intensity synced via --boost */
.booster {
  pointer-events: none;
  filter:
    drop-shadow(0 0 calc(var(--boost) * 10px) rgba(255, 190, 60, calc(var(--boost) * 0.85)))
    drop-shadow(0 0 calc(var(--boost) * 16px) rgba(255, 150, 30, calc(var(--boost) * 0.4)))
    drop-shadow(0 1px 1.2px rgba(90, 50, 0, 0.28));
}

.booster .nozzle-mount,
.booster .nozzle-barrel,
.booster .nozzle-bell {
  paint-order: stroke fill;
}

.booster .nozzle-mount {
  filter: drop-shadow(0 0 0.4px rgba(255, 246, 196, 0.35));
}

.booster .flame {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center top;
  transform: scaleY(0.4) scaleX(0.75);
  transition: opacity 0.05s linear, transform 0.05s linear;
  pointer-events: none;
}

.booster .flame-glow,
.booster .flame-outer,
.booster .flame-mid,
.booster .flame-inner,
.booster .spark {
  transform-box: fill-box;
  transform-origin: center top;
}

.booster .spark {
  opacity: 1;
}

.wheel.is-spinning .booster .flame-outer {
  animation: flameFlicker 0.12s ease-in-out infinite alternate;
}

.wheel.is-spinning .booster .flame-mid {
  animation: flameFlicker 0.14s ease-in-out infinite alternate-reverse;
}

.wheel.is-spinning .booster .flame-inner {
  animation: flameFlicker 0.1s ease-in-out infinite alternate;
}

.wheel.is-spinning .booster .spark.s1 {
  animation: sparkFly 0.24s linear infinite;
}
.wheel.is-spinning .booster .spark.s2 {
  animation: sparkFly 0.24s linear infinite;
  animation-delay: 0.08s;
}
.wheel.is-spinning .booster .spark.s3 {
  animation: sparkFly 0.24s linear infinite;
  animation-delay: 0.16s;
}

.wheel.is-coasting .booster .flame-outer,
.wheel.is-coasting .booster .flame-mid,
.wheel.is-coasting .booster .flame-inner,
.wheel.is-coasting .booster .spark {
  animation: none;
}

.wheel.is-spinning .count,
.wheel.is-igniting .count,
.wheel.is-coasting .count {
  opacity: 0;
}

@keyframes flameFlicker {
  from { transform: scaleY(0.92); opacity: 0.85; }
  to { transform: scaleY(1.18); opacity: 1; }
}

@keyframes sparkFly {
  from { transform: translateY(0) scale(1); opacity: 1; }
  to { transform: translateY(10px) scale(0.35); opacity: 0; }
}

.wheel-svg,
.hub-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.hub-svg {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.bulb {
  transform-box: fill-box;
  transform-origin: center;
  animation: bulb 1.35s ease-in-out infinite;
}

.bulb:nth-child(odd) { animation-delay: 0.65s; }

@keyframes bulb {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.38; }
}

.fruit {
  position: absolute;
  width: 15%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%) rotate(var(--turn, 0deg));
  filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.3));
  pointer-events: none;
}

.fruit img,
.badge img,
.hist img,
.bal svg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.count {
  position: absolute;
  left: 50%;
  top: 49%;
  transform: translate(-50%, -50%);
  margin: 0;
  font-family: Fredoka, Outfit, sans-serif;
  font-weight: 700;
  font-size: 14cqmin;
  line-height: 1;
  color: hsl(21.47deg 98.2% 21.76%);
  text-shadow: 0 1px 0 rgba(255, 236, 190, 0.45);
  pointer-events: none;
  z-index: 3;
  transition: opacity 0.2s ease;
}


.fruit.is-landed {
  filter: drop-shadow(0 0 8px rgba(255, 236, 140, 0.95)) drop-shadow(0 4px 3px rgba(0, 0, 0, 0.3));
}

.spot {
  opacity: 0;
  pointer-events: none;
}

.spot.is-on {
  opacity: 1;
  transition: opacity 0.35s ease;
}

.spot-wash {
  fill: url(#spotWash);
}

.spot.is-on .spot-wash {
  animation: spotPulse 1.15s ease-in-out infinite;
}

.spot-edge,
.spot-arc {
  fill: none;
  stroke: url(#edgeGlow);
  stroke-width: 2.6;
  stroke-linecap: round;
  filter: url(#spotGlow);
}

.spot-arc {
  stroke: #fff8e0;
  stroke-width: 2.2;
}

@keyframes spotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
}

.round,
.ping {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
}

.round { color: #7a8490; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35); }
.round b { font-weight: 800; color: #68727e; }
.ping { color: #18a84a; }
.ping svg { width: 16px; height: 16px; }
.ping b { font-family: Fredoka, Outfit, sans-serif; font-weight: 600; }

.results {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 14px 0;
  padding: 6px 12px;
  min-width: 0;
  min-height: 38px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(72, 150, 90, 0.58), rgba(42, 110, 60, 0.62));
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -2px 4px rgba(0, 0, 0, 0.12),
    0 2px 6px rgba(20, 50, 20, 0.1);
}

.result-label {
  flex: none;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.hist-item {
  position: relative;
  flex: none;
  width: 28px;
  height: 28px;
}

.new {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%) rotate(-18deg);
  font-style: normal;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.3px;
  line-height: 1;
  color: #fff;
  background: linear-gradient(180deg, #c084fc, #9333ea 55%, #7e22ce);
  border-radius: 999px;
  padding: 3px 6px 2px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 1px 3px rgba(60, 0, 90, 0.35);
  pointer-events: none;
}

.hist {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
}

.hist::-webkit-scrollbar { display: none; }
.hist img {
  width: 28px;
  height: 28px;
  flex: none;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}
.hist-item img { width: 100%; height: 100%; }

.bets {
  margin: 8px 12px 0;
  padding: 14px 8px 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0) 30%),
    linear-gradient(180deg, #9cf3bc 0%, #3ed27e 42%, #18a864 100%);
  border: 2px solid rgba(255, 255, 255, 0.45);
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 -10px 14px rgba(0, 90, 40, 0.12),
    0 8px 16px rgba(0, 50, 20, 0.16);
}

.slot { position: relative; min-width: 0; }

.badge {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: -13px;
  width: 32px;
  height: 32px;
  transform: translateX(-50%);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.25));
  pointer-events: none;
}

.card {
  position: relative;
  width: 100%;
  min-height: clamp(92px, 13.5dvh, 108px);
  border-radius: 14px;
  border: 3px solid var(--frame);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 16px 4px 6px;
  box-shadow:
    0 0 0 2px var(--frame-deep),
    inset 0 0 0 2px var(--frame-line),
    inset 0 2px 0 rgba(255, 255, 255, 0.55),
    inset 0 -10px 14px rgba(0, 0, 0, 0.12),
    0 6px 10px rgba(0, 0, 0, 0.16);
}



.card.lemon {
  --frame: #fff1b8;
  --frame-deep: #e08900;
  --frame-line: rgba(255, 236, 170, 0.95);
  background:
    linear-gradient(180deg, rgba(255, 213, 110, 0.78) 0%, rgba(255, 157, 28, 0.8) 50%, rgba(240, 116, 0, 0.84) 100%),
    url("../img/lemon.png") center 60% / 62% no-repeat,
    linear-gradient(180deg, #ffb03a, #f07400);
}

.card.melon {
  --frame: #e9ffe4;
  --frame-deep: #0c8a46;
  --frame-line: rgba(210, 255, 214, 0.95);
  background:
    linear-gradient(180deg, rgba(141, 255, 180, 0.78) 0%, rgba(46, 200, 100, 0.8) 48%, rgba(18, 150, 74, 0.84) 100%),
    url("../img/melon.png") center 60% / 62% no-repeat,
    linear-gradient(180deg, #3dce78, #12964a);
}

.card.apple {
  --frame: #ffe08a;
  --frame-deep: #c45a12;
  --frame-line: rgba(255, 226, 150, 0.95);
  background:
    linear-gradient(180deg, rgba(255, 94, 80, 0.97) 0%, rgba(255, 70, 60, 0.95) 34%, rgba(255, 61, 61, 0.74) 62%, rgba(217, 16, 34, 0.82) 100%),
    url("../img/apple.png") center 88% / 72% no-repeat,
    linear-gradient(180deg, #ff5a4a, #d91022);
}

.card:active { transform: translateY(1px); }
.card.is-hot { filter: brightness(1.08); }
.card.is-win { animation: winpulse 0.55s ease-in-out 3; }

@keyframes winpulse {
  50% { filter: brightness(1.2); }
}

.pool {
  position: relative;
  z-index: 2;
  font-size: clamp(13px, 4.2cqw, 18px);
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #fff;
  line-height: 1;
}

.odds {
  position: relative;
  z-index: 2;
  font-family: Fredoka, Outfit, sans-serif;
  font-size: clamp(24px, 8cqw, 32px);
  font-weight: 700;
  line-height: 0.9;
  color: rgba(255, 255, 255, 0.55);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.you {
  position: relative;
  z-index: 2;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.96);
}

.you b { font-weight: 800; }

.pile {
  position: absolute;
  z-index: 3;
  left: 6%;
  right: 6%;
  top: 28%;
  bottom: 22%;
  pointer-events: none;
  overflow: visible;
}

.mini {
  position: absolute;
  left: var(--mx, 40%);
  top: var(--my, 40%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 6px;
  font-weight: 800;
  color: #fff;
  border: 1.5px dashed rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.65), 0 1px 2px rgba(0, 0, 0, 0.28);
  transform: translate(-50%, -50%) rotate(var(--mrot, 0deg));
}

.c1 {
  background:
    radial-gradient(circle at 30% 26%, rgba(255, 255, 255, 0.28), transparent 40%),
    var(--chip-1k);
}

.c2 {
  background:
    radial-gradient(circle at 30% 26%, rgba(255, 255, 255, 0.28), transparent 40%),
    var(--chip-2k);
}

.c3 {
  background:
    radial-gradient(circle at 30% 26%, rgba(255, 255, 255, 0.28), transparent 40%),
    var(--chip-3k);
}

.c5 {
  background:
    radial-gradient(circle at 30% 26%, rgba(255, 255, 255, 0.28), transparent 40%),
    var(--chip-5k);
}

.dock {
  margin: 8px 10px calc(8px + env(safe-area-inset-bottom));
  padding: 10px 12px 10px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 14px;
  overflow: hidden;
  background:
    linear-gradient(180deg, #8fe8a8 0%, #5fd484 42%, #3cbc6c 100%);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.55),
    inset 0 -4px 8px rgba(0, 70, 30, 0.12),
    0 6px 12px rgba(20, 60, 20, 0.16);
}

.dock.is-shake { animation: shake 0.35s linear; }

@keyframes shake {
  25% { transform: translateX(-3px); }
  50% { transform: translateX(3px); }
  75% { transform: translateX(-2px); }
}

.who {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 5px 10px 5px 6px;
  border-radius: 10px;
  background:
    linear-gradient(135deg, #5b7cff 0%, #7a4ef0 48%, #a03af0 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 2px 4px rgba(40, 0, 80, 0.2);
}

.avatar {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-family: "Fredoka", "Outfit", sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.45), transparent 42%),
    linear-gradient(180deg, #8aa0ff, #5a4ad8);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.35),
    0 1px 3px rgba(0, 0, 0, 0.2);
}

.avatar svg { width: 22px; height: 22px; }
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar.has-photo {
  background: #2a3a6a;
}

.who-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.who-copy b {
  display: block;
  font-size: 13px;
  line-height: 1;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 0 rgba(40, 0, 80, 0.35);
}

.bal {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  color: #ffe566;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 0 rgba(40, 0, 80, 0.35);
}

.bal .coin {
  width: 15px;
  height: 15px;
  flex: none;
  display: grid;
  place-items: center;
}

.bal .coin svg,
.bal svg {
  width: 15px;
  height: 15px;
  display: block;
}

.bal #balance {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chips {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  flex: none;
}

.chip {
  --chip-size: clamp(40px, 11cqw, 50px);
  position: relative;
  width: var(--chip-size);
  height: var(--chip-size);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: Fredoka, Outfit, sans-serif;
  font-size: clamp(11px, 3cqw, 13px);
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.5), transparent 34%),
    radial-gradient(circle at 50% 50%, var(--face) 0 46%, transparent 47%),
    repeating-conic-gradient(from 10deg, #fff 0 11deg, var(--face) 11deg 22deg);
  box-shadow:
    inset 0 0 0 3px #fff,
    inset 0 0 0 6px rgba(0, 0, 0, 0.1),
    inset 0 4px 5px rgba(255, 255, 255, 0.35),
    inset 0 -5px 6px rgba(0, 0, 0, 0.2),
    0 3px 0 rgba(0, 0, 0, 0.18),
    0 6px 10px rgba(0, 0, 0, 0.16);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.chip::before {
  content: "";
  position: absolute;
  inset: 24%;
  border-radius: 50%;
  border: 1.5px dashed rgba(255, 255, 255, 0.75);
  pointer-events: none;
}

.chip::after {
  content: "";
  position: absolute;
  width: 42%;
  height: 18%;
  border-radius: 50%;
  top: 14%;
  background: linear-gradient(rgba(255, 255, 255, 0.85), transparent);
  pointer-events: none;
}

.c-1k { --face: var(--chip-1k); }
.c-2k { --face: var(--chip-2k); }
.c-3k { --face: var(--chip-3k); }
.c-5k { --face: var(--chip-5k); }

.chip.is-on {
  z-index: 1;
  transform: translateY(-1px) scale(1.04);
  box-shadow:
    inset 0 0 0 3px #fff,
    inset 0 0 0 6px rgba(0, 0, 0, 0.08),
    0 0 0 2px rgba(255, 255, 255, 0.95),
    0 3px 8px rgba(0, 0, 0, 0.22);
}

.chip:active { transform: translateY(1px) scale(0.97); }
.chip.is-on:active { transform: translateY(0) scale(1.02); }

/* Flying bet chip — colors via .c1/.c2/.c3/.c5 */
.fly-chip {
  position: fixed;
  z-index: 60;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  pointer-events: none;
  display: grid;
  place-items: center;
  font-family: Fredoka, Outfit, sans-serif;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
  border: 2px solid rgba(20, 10, 0, 0.75);
  box-shadow:
    inset 0 -2px 3px rgba(0, 0, 0, 0.4),
    0 4px 10px rgba(0, 0, 0, 0.4);
  animation: chip-fly 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes chip-fly {
  0% { opacity: 1; transform: translate(0, 0) scale(1) rotate(0deg); }
  70% { opacity: 1; }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(0.5) rotate(160deg);
  }
}

.mini.is-new {
  animation: mini-pop 0.32s cubic-bezier(0.2, 1.1, 0.3, 1) both;
}

@keyframes mini-pop {
  0% { transform: translate(-50%, -50%) rotate(var(--mrot, 0deg)) scale(0.3); opacity: 0; }
  70% { transform: translate(-50%, -50%) rotate(var(--mrot, 0deg)) scale(1.18); opacity: 1; }
  100% { transform: translate(-50%, -50%) rotate(var(--mrot, 0deg)) scale(1); opacity: 1; }
}

/* Tall phones (e.g. 360×804): bigger wheel, compact header */
@media (min-height: 720px) and (max-width: 430px) {
  .wheel {
    width: min(90cqw, 82cqh, 320px);
  }
  .orbs { gap: 8px; }
  .orb { width: 34px; height: 34px; }
  .orb svg { width: 16px; height: 16px; }
}

@media (max-height: 760px) {
  .orb { width: 34px; height: 34px; }
  .orb svg { width: 16px; height: 16px; }
  .orbs { gap: 8px; }
  .plaque {
    margin-top: 4px;
    padding: 9px 16px 10px;
    max-width: min(100%, 180px);
  }
  .plaque span { font-size: clamp(14px, 4.5vw, 18px); }
  .plaque-scroll { width: 18px; height: 32px; }
  .plaque-scroll-l { left: -5px; }
  .plaque-scroll-r { right: -5px; }
  .plaque-jewel { width: 10px; height: 10px; }
  .card { min-height: 88px; padding-top: 14px; }
  .odds { font-size: 24px; }
  .bets { margin-top: 4px; padding-top: 14px; }
  .hist img { width: 24px; height: 24px; }
  .hist-item { width: 24px; height: 24px; }
  .badge { width: 32px; height: 32px; top: -13px; }
}

@media (max-height: 640px) {
  .top { padding-top: 4px; gap: 4px; }
  .orb { width: 30px; height: 30px; }
  .orbs { gap: 6px; }
  .plaque { max-width: min(100%, 160px); padding: 8px 12px 9px; }
  .plaque-scroll { width: 14px; height: 26px; }
  .plaque-scroll-l { left: -4px; }
  .plaque-scroll-r { right: -4px; }
  .wheel { width: min(78cqw, 72cqh, 240px); }
  .card { min-height: 76px; }
  .pool { font-size: 13px; }
  .you { font-size: 11px; }
  .dock { padding: 5px 6px; }
  .chip { width: 34px; height: 34px; font-size: 10px; }
}

@media (max-width: 390px) {
  .top { gap: 8px; padding-left: 8px; padding-right: 8px; }
  .orb { width: 32px; height: 32px; }
  .orb svg { width: 15px; height: 15px; }
  .plaque {
    max-width: min(100%, 168px);
    padding: 8px 14px 9px;
    margin-top: 2px;
  }
  .plaque span {
    font-size: clamp(13px, 4vw, 16px);
    letter-spacing: 0.2px;
  }
  .plaque-scroll { display: none; }
  .plaque-jewel { width: 9px; height: 9px; }
  .plaque-jewel-l { left: 2px; }
  .plaque-jewel-r { right: 2px; }
}

@media (max-width: 360px) {
  .chip { width: 34px; height: 34px; font-size: 10px; }
  .chips { gap: 4px; }
  .who-copy b { font-size: 12px; }
  .bal { font-size: 11px; }
  .orb { width: 30px; height: 30px; }
  .plaque { max-width: min(100%, 156px); padding: 7px 12px 8px; }
  .plaque span { font-size: 14px; }
}

/* —— Result screen: compact top 3 —— */
.result-screen {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 12px 14px 18px;
  pointer-events: none;
}

.result-screen[hidden] { display: none; }

.result-screen.is-on {
  pointer-events: auto;
}

.result-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(12, 18, 48, 0.42);
  cursor: pointer;
}

.result-card {
  position: relative;
  z-index: 1;
  width: min(100%, 268px);
  padding: 20px 12px 10px;
  border-radius: 18px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 180, 255, 0.24), transparent 55%),
    linear-gradient(180deg, #7a3cff 0%, #5b1fd4 42%, #4a14b8 100%);
  border: 2.5px solid #f0c43a;
  box-shadow:
    0 0 0 1.5px rgba(255, 240, 180, 0.3) inset,
    0 12px 28px rgba(40, 10, 90, 0.4);
  animation: result-pop 0.38s cubic-bezier(0.2, 1.1, 0.3, 1) both;
}

.result-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, #a56bff, #6d2ae8);
  border: 2px solid #f6d56a;
  box-shadow: 0 4px 10px rgba(40, 10, 90, 0.35);
  font-family: Fredoka, Outfit, sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.result-lead {
  margin: 2px 0 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 0 rgba(40, 10, 90, 0.35);
}

.result-podium {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}

.result-champ {
  display: grid;
  justify-items: center;
  gap: 5px;
}

.result-crown {
  position: relative;
  width: 34px;
  height: 28px;
  margin-bottom: -14px;
  z-index: 2;
}

.result-crown svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
}

.result-crown span {
  position: absolute;
  inset: 11px 0 0;
  text-align: center;
  font-family: Lilita One, Fredoka, sans-serif;
  font-size: 11px;
  color: #6a3a00;
  line-height: 1;
}

.result-photo {
  width: 84px;
  height: 84px;
  border-radius: 12px;
  overflow: hidden;
  border: 2.5px solid #f0c43a;
  box-shadow: 0 5px 12px rgba(20, 5, 50, 0.35);
  background:
    linear-gradient(145deg, #9ad0ff, #5a8ad4 55%, #3a5f9a);
}

.result-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.result-photo.sm {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  border-width: 2px;
  flex-shrink: 0;
}

.result-name {
  max-width: 100%;
  padding: 3px 12px;
  border-radius: 6px;
  background: linear-gradient(180deg, #ffe27a, #f0b422);
  color: #6a3a00;
  font-family: Fredoka, Outfit, sans-serif;
  font-weight: 700;
  font-size: 11px;
  text-align: center;
  box-shadow:
    0 1px 0 rgba(120, 70, 0, 0.25),
    0 0 0 1px rgba(255, 250, 200, 0.35) inset;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-champ .result-name {
  min-width: 62%;
  font-size: 12px;
  clip-path: polygon(5% 0, 95% 0, 100% 50%, 95% 100%, 5% 100%, 0 50%);
  border-radius: 0;
}

.result-stats {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: center;
}

.result-stats span,
.result-you-stats span {
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(30, 8, 70, 0.55);
  border: 1px solid rgba(255, 220, 120, 0.28);
  font-size: 10px;
  font-weight: 700;
  color: #ffe9a8;
  white-space: nowrap;
}

.result-stats b,
.result-you-stats b {
  color: #fff;
  font-weight: 800;
}

.result-runners {
  display: grid;
  gap: 5px;
}

.result-runner {
  position: relative;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 5px 7px 5px 6px;
  border-radius: 10px;
  background: rgba(30, 8, 70, 0.3);
  border: 1px solid rgba(255, 220, 120, 0.2);
}

.result-rank {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #ffe27a, #e09a18);
  color: #6a3a00;
  font-size: 9px;
  font-weight: 800;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.45) inset;
  flex-shrink: 0;
}

.result-runner .result-name {
  justify-self: start;
  max-width: 100%;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
}

.result-runner .result-stats {
  display: grid;
  gap: 2px;
  justify-items: end;
}

.result-runner .result-stats span {
  font-size: 9px;
  padding: 1px 5px;
}

.result-you {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 10px;
  background: rgba(20, 5, 55, 0.55);
  border: 1px solid rgba(255, 220, 120, 0.28);
}

.result-you-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-family: "Fredoka", "Outfit", sans-serif;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(180deg, #7ec8ff, #3d7ec8);
  border: 1.5px solid #f0c43a;
}
.result-you-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.result-you-avatar.has-photo {
  background: #2a4a68;
}

.result-you-avatar svg {
  width: 15px;
  height: 15px;
}

.result-you-name {
  font-size: 11px;
  font-weight: 800;
}

.result-you-stats {
  display: flex;
  flex-direction: row;
  gap: 4px;
  align-items: center;
  justify-content: flex-end;
}

@keyframes result-pop {
  from { opacity: 0; transform: translateY(12px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* —— Shared info panels (My Bets / Ranking / History / How to play) —— */
.panel {
  position: absolute;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 14px 12px 20px;
  pointer-events: none;
}

.panel[hidden] { display: none; }

.panel.is-on { pointer-events: auto; }

.panel-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(10, 14, 40, 0.46);
  cursor: pointer;
}

.panel-card {
  position: relative;
  z-index: 1;
  width: min(100%, 300px);
  max-height: min(72vh, 460px);
  display: flex;
  flex-direction: column;
  padding: 22px 12px 12px;
  border-radius: 16px;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(255, 180, 255, 0.22), transparent 55%),
    linear-gradient(180deg, #7a3cff 0%, #5a1fd0 48%, #4712b4 100%);
  border: 2.5px solid #f0c43a;
  box-shadow:
    0 0 0 1.5px rgba(255, 240, 180, 0.28) inset,
    0 14px 30px rgba(30, 8, 70, 0.42);
  animation: result-pop 0.32s cubic-bezier(0.2, 1.1, 0.3, 1) both;
  overflow: hidden;
}

.panel-card::before {
  content: "";
  position: absolute;
  inset: 18% 8% 10%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.07), transparent 62%);
  pointer-events: none;
}

.panel-head {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  margin: -4px 0 10px;
  min-height: 28px;
}

.panel-title {
  position: relative;
  z-index: 1;
  padding: 6px 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, #b46cff, #6d2ae8);
  border: 2px solid #f6d56a;
  box-shadow: 0 4px 10px rgba(40, 10, 90, 0.3);
  font-family: Fredoka, Outfit, sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: #fff;
  text-shadow: 0 1px 0 rgba(40, 10, 90, 0.35);
}

.panel-x {
  position: absolute;
  top: -6px;
  right: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #fff1b0;
  background: linear-gradient(180deg, #ff6b6b, #d01828);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  display: grid;
  place-items: center;
  box-shadow: 0 3px 8px rgba(80, 0, 20, 0.35);
  cursor: pointer;
  padding: 0;
}

.panel-x:active { transform: scale(0.94); }

.panel-empty {
  margin: 18px 0 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
}

.panel-empty[hidden] { display: none; }

/* My Bets */
.bets-cols {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 0.9fr;
  gap: 6px;
  padding: 0 6px 6px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  text-align: center;
}

.bets-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 5px;
  overflow: auto;
  max-height: 280px;
  padding-right: 2px;
}

.bets-row {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 0.9fr;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  border-radius: 10px;
  background: rgba(20, 5, 55, 0.38);
  border: 1px solid rgba(255, 220, 120, 0.18);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  color: #ffe9a8;
}

.bets-row b { color: #fff; font-weight: 800; }

.bets-row .bet-fruit {
  width: 22px;
  height: 22px;
  object-fit: contain;
  margin: 0 auto;
  display: block;
}

/* Ranking */
.rank-head { margin-bottom: 12px; }

.rank-banner {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 150px;
  padding: 10px 28px 8px;
  border-radius: 12px 12px 10px 10px;
  background: linear-gradient(180deg, #a56bff, #5f22d8);
  border: 2px solid #f6d56a;
  box-shadow: 0 5px 12px rgba(40, 10, 90, 0.35);
}

.rank-banner::before,
.rank-banner::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 18px;
  height: 22px;
  transform: translateY(-50%);
  background:
    linear-gradient(135deg, #fff6c8, #e09a18);
  clip-path: polygon(0 20%, 100% 0, 100% 100%, 0 80%);
  opacity: 0.95;
}

.rank-banner::before { left: -10px; transform: translateY(-50%) scaleX(-1); }
.rank-banner::after { right: -10px; }

.rank-crown {
  position: absolute;
  top: -18px;
  width: 28px;
  height: 22px;
  display: block;
}

.rank-crown svg { width: 100%; height: 100%; display: block; }

.rank-banner .panel-title {
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  font-size: 15px;
}

.panel-card-rank {
  max-height: none;
  overflow: hidden;
}

.rank-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 6px;
  overflow: hidden;
  max-height: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.rank-list::-webkit-scrollbar { display: none; width: 0; height: 0; }

.rank-row {
  display: grid;
  grid-template-columns: 28px 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(20, 5, 55, 0.4);
  border: 1px solid rgba(255, 220, 120, 0.16);
}

.rank-row[data-place="1"] {
  background: linear-gradient(90deg, rgba(255, 210, 70, 0.55), rgba(240, 170, 30, 0.28));
  border-color: rgba(255, 230, 120, 0.55);
}

.rank-row[data-place="2"] {
  background: linear-gradient(90deg, rgba(170, 210, 255, 0.5), rgba(110, 160, 230, 0.22));
  border-color: rgba(190, 220, 255, 0.45);
}

.rank-row[data-place="3"] {
  background: linear-gradient(90deg, rgba(255, 180, 120, 0.5), rgba(220, 130, 70, 0.22));
  border-color: rgba(255, 200, 140, 0.45);
}

.rank-place {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.rank-row[data-place="1"] .rank-place,
.rank-row[data-place="2"] .rank-place,
.rank-row[data-place="3"] .rank-place {
  background: linear-gradient(180deg, #ffe27a, #e09a18);
  color: #6a3a00;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset;
}

.rank-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #f0c43a;
  background: linear-gradient(145deg, #9ad0ff, #3a5f9a);
}

.rank-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rank-name {
  min-width: 0;
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-score {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
}

.rank-score .coin {
  width: 14px;
  height: 14px;
  display: grid;
}

.rank-score .coin svg { width: 100%; height: 100%; }

/* Game History */
.panel-card-hist {
  width: min(100%, 292px);
  max-height: none;
  overflow: hidden;
}

.hist-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
  overflow: hidden;
  max-height: none;
  padding: 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.hist-grid::-webkit-scrollbar { display: none; width: 0; height: 0; }

.hist-cell {
  aspect-ratio: 1;
  min-width: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(20, 5, 55, 0.35);
  border: 1.5px solid rgba(255, 220, 120, 0.22);
  padding: 3px;
  box-sizing: border-box;
}

.hist-cell.is-new {
  border-color: #ffe27a;
  box-shadow: 0 0 0 1px rgba(255, 226, 122, 0.45), 0 0 10px rgba(255, 200, 60, 0.35);
}

.hist-cell img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* How to play */
.panel-card-how { width: min(100%, 310px); }

.how-list {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0 4px 4px 22px;
  display: grid;
  gap: 8px;
  overflow: auto;
  max-height: 320px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.95);
}

.how-list li::marker {
  font-weight: 800;
  color: #ffe27a;
}

@media (prefers-reduced-motion: reduce) {
  .bulb,
  .dock.is-shake,
  .wheel.is-spinning .booster .flame-outer,
  .wheel.is-spinning .booster .flame-mid,
  .wheel.is-spinning .booster .flame-inner,
  .wheel.is-spinning .booster .spark.s1,
  .wheel.is-spinning .booster .spark.s2,
  .wheel.is-spinning .booster .spark.s3,
  .result-card,
  .fly-chip,
  .mini.is-new { animation: none; }
}

/* —— Join / sync loader (Fruit Loops sky plaque — not Teen Patti card) —— */
#joinLoader {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 28px 20px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 55% at 50% -5%, #fff7c8 0%, transparent 55%),
    linear-gradient(180deg, #8fd4ff 0%, #6eb8f0 42%, #9fd48a 78%, #7ec86a 100%);
  transition: opacity 0.45s ease;
}
#joinLoader.is-leaving {
  opacity: 0;
  pointer-events: none;
}
#joinLoader.is-syncing {
  display: grid !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  z-index: 120;
  background:
    radial-gradient(ellipse 80% 50% at 50% 20%, rgba(255, 247, 200, 0.55), transparent 60%),
    linear-gradient(180deg, rgba(110, 184, 240, 0.92), rgba(126, 200, 255, 0.88));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
#joinLoader.is-error {
  background:
    radial-gradient(ellipse 70% 45% at 50% 10%, #ffe0a8, transparent 55%),
    linear-gradient(180deg, #7eb8e8 0%, #f0a878 100%);
}
#joinLoader[hidden] {
  display: none;
}

.fl-load {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.fl-load-sun {
  position: absolute;
  top: 8%;
  right: 12%;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff9d0, #ffd23a 55%, #f0a010);
  box-shadow: 0 0 0 10px rgba(255, 220, 80, 0.28), 0 0 40px rgba(255, 200, 40, 0.45);
  animation: flSunPulse 2.8s ease-in-out infinite;
}
.fl-load-cloud {
  position: absolute;
  width: 110px;
  height: 36px;
  border-radius: 40px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 28px 8px 0 -4px rgba(255, 255, 255, 0.7), -22px 6px 0 -6px rgba(255, 255, 255, 0.65);
  animation: flCloudDrift 12s linear infinite;
}
.fl-load-cloud.c1 { top: 18%; left: -40px; animation-duration: 16s; }
.fl-load-cloud.c2 { top: 28%; right: -50px; width: 90px; animation-duration: 20s; animation-direction: reverse; }

.fl-load-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 300px);
  padding: 28px 22px 24px;
  text-align: center;
  color: #2a4a28;
  border-radius: 28px 28px 32px 32px / 36px 36px 28px 28px;
  background:
    linear-gradient(180deg, #ffffff 0%, #fff8e8 38%, #ffe9b8 100%);
  border: 3px solid #fff;
  box-shadow:
    0 4px 0 #e8c86a,
    0 18px 36px rgba(40, 90, 40, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transition: transform 0.45s ease, opacity 0.45s ease;
}
#joinLoader.is-leaving .fl-load-panel {
  transform: translateY(16px) scale(0.96);
  opacity: 0;
}
#joinLoader.is-syncing .fl-load-panel {
  width: min(100%, 260px);
  padding: 22px 18px 18px;
  box-shadow: 0 3px 0 #e8c86a, 0 12px 28px rgba(40, 90, 40, 0.18);
}

.fl-load-orbit {
  position: relative;
  width: 124px;
  height: 124px;
  margin: 0 auto 14px;
}
.fl-load-ring {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 3px dashed rgba(255, 170, 40, 0.55);
  animation: flSpin 4.5s linear infinite;
}
.fl-load-hub {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: "Lilita One", "Fredoka", sans-serif;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: #7a4a08;
  background: radial-gradient(circle at 35% 30%, #fff6b8, #ffd023 55%, #f09800);
  border: 2px solid #fff3c0;
  box-shadow: 0 2px 0 #c98412;
}
.fl-load-fruit {
  --orbit: 0deg;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  object-fit: contain;
  filter: drop-shadow(0 3px 4px rgba(40, 80, 20, 0.25));
  transform: rotate(var(--orbit)) translateY(-46px) rotate(calc(-1 * var(--orbit)));
  animation: flFruitOrbit 3.2s linear infinite;
}
.fl-load-fruit.f1 { --orbit: 0deg; animation-delay: 0s; }
.fl-load-fruit.f2 { --orbit: 120deg; animation-delay: 0s; }
.fl-load-fruit.f3 { --orbit: 240deg; animation-delay: 0s; }

.fl-load-brand {
  margin: 0 0 6px;
  font-family: "Lilita One", "Fredoka", sans-serif;
  font-size: 1.65rem;
  line-height: 1.05;
  letter-spacing: 0.02em;
  color: #e85a2a;
  text-shadow: 0 2px 0 #ffe29a;
}
.fl-load-status,
#loaderStatus {
  margin: 0;
  font-family: "Fredoka", "Outfit", sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #3d6a38;
}
.fl-load-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 12px;
}
.fl-load-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffb020;
  animation: flDotPulse 1s ease-in-out infinite;
}
.fl-load-dots i:nth-child(2) { animation-delay: 0.15s; background: #5ecf5a; }
.fl-load-dots i:nth-child(3) { animation-delay: 0.3s; background: #ff6b5a; }
#joinLoader.is-error .fl-load-dots { display: none; }
#joinLoader.is-syncing .fl-load-dots i { animation-duration: 0.7s; }

.loader-code {
  margin: 12px 0 0;
  padding: 7px 10px;
  border-radius: 12px;
  background: rgba(232, 90, 42, 0.1);
  color: #c44a18;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  border: 1px dashed rgba(232, 90, 42, 0.35);
}
#loaderRetry {
  margin-top: 14px;
  padding: 10px 22px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff8a4a, #e85a2a);
  color: #fff8ef;
  font-family: "Fredoka", "Outfit", sans-serif;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 3px 0 #b84218;
}
#loaderRetry:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #b84218;
}

@keyframes flSpin {
  to { transform: rotate(360deg); }
}
@keyframes flFruitOrbit {
  from {
    transform: rotate(var(--orbit)) translateY(-46px) rotate(calc(-1 * var(--orbit)));
  }
  to {
    transform: rotate(calc(var(--orbit) + 360deg)) translateY(-46px)
      rotate(calc(-1 * (var(--orbit) + 360deg)));
  }
}
@keyframes flDotPulse {
  0%, 100% { transform: scale(0.75); opacity: 0.45; }
  50% { transform: scale(1.15); opacity: 1; }
}
@keyframes flSunPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@keyframes flCloudDrift {
  from { transform: translateX(0); }
  to { transform: translateX(40vw); }
}

#noUid {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 110;
  place-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 90% 55% at 50% -5%, #fff7c8 0%, transparent 55%),
    linear-gradient(180deg, #8fd4ff 0%, #6eb8f0 42%, #9fd48a 100%);
  color: #2a4a28;
  font-family: "Fredoka", "Outfit", sans-serif;
  font-weight: 700;
}
#noUid.is-visible { display: grid; }
.fl-nouid-panel p { margin: 0 0 8px; color: #3d6a38; }
#noUid code {
  display: inline-block;
  margin-top: 4px;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(232, 90, 42, 0.1);
  color: #c44a18;
  font-size: 13px;
}
main.stage { opacity: 0; pointer-events: none; transition: opacity 0.35s ease; }
main.stage.is-ready { opacity: 1; pointer-events: auto; }
.fl-toast {
  position: fixed;
  left: 50%;
  bottom: 16%;
  z-index: 130;
  transform: translateX(-50%) translateY(12px);
  padding: 11px 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff8e8, #ffe9b8);
  color: #2a4a28;
  font-family: "Fredoka", "Outfit", sans-serif;
  font-size: 13px;
  font-weight: 700;
  border: 2px solid #fff;
  box-shadow: 0 3px 0 #e8c86a, 0 10px 24px rgba(40, 90, 40, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: min(90vw, 320px);
  text-align: center;
}
.fl-toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }
.fl-toast[data-kind="err"] {
  background: linear-gradient(180deg, #ffe8e0, #ffc8b8);
  color: #8a2818;
  box-shadow: 0 3px 0 #e89078, 0 10px 24px rgba(120, 40, 20, 0.18);
}
.card.is-disabled { pointer-events: none; opacity: 0.72; }

@media (prefers-reduced-motion: reduce) {
  .fl-load-sun,
  .fl-load-cloud,
  .fl-load-ring,
  .fl-load-fruit,
  .fl-load-dots i {
    animation: none !important;
  }
}
