:root {
  --outline: #14102b;
  --card: #fffdf5;
  --coral: #ff7a59;
  --gold: #ffd93d;
  --cyan: #4dd8ff;
  --blue: #0ea5e9;
  --green: #10b981;
  --red: #ff5563;
  --text: #2b2547;
  --muted: #7d7699;
  --lite: #cfc9ec;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  background:
    radial-gradient(ellipse at 20% 15%, rgba(255, 182, 255, 0.55) 0%, transparent 42%),
    radial-gradient(ellipse at 80% 10%, rgba(255, 214, 165, 0.5) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 90%, rgba(167, 232, 255, 0.55) 0%, transparent 45%),
    linear-gradient(165deg, #b8e0ff 0%, #ffd6f0 35%, #ffe9b8 65%, #c8ffe8 100%);
  background-color: #cfe8ff;
  color: var(--lite);
  font-family: "Baloo 2", "Comic Sans MS", cursive;
  line-height: 1.35;
  font-size: 15px;
  overflow: hidden;
  position: relative;
}

.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  perspective: 900px;
}

.wrap {
  position: relative;
  z-index: 1;
  height: 100dvh;
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px;
  display: flex;
  gap: 12px;
}

/* Fluffy layered rainbow clouds with soft 3D volume */
.cloud {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.9;
  transform-style: preserve-3d;
  will-change: transform;
}
.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  inset: auto;
}

/* Far back, soft and slow */
.cloud.c1 {
  width: 280px; height: 110px;
  left: -4%; top: 8%;
  background:
    radial-gradient(circle at 30% 40%, #fff 0%, rgba(255,255,255,0.1) 62%),
    radial-gradient(circle at 70% 50%, #ffc2e8 0%, transparent 60%),
    radial-gradient(circle at 50% 80%, #b8f0ff 0%, transparent 55%);
  box-shadow:
    40px 10px 0 -10px rgba(255, 255, 255, 0.85),
    90px 0 0 -18px rgba(255, 210, 240, 0.7),
    140px 12px 0 -28px rgba(200, 240, 255, 0.65),
    0 28px 40px rgba(80, 60, 120, 0.18);
  filter: blur(4px);
  animation: driftFar 42s linear infinite;
}
.cloud.c2 {
  width: 340px; height: 130px;
  right: -6%; top: 18%;
  background:
    radial-gradient(circle at 35% 45%, #fff 0%, transparent 60%),
    radial-gradient(circle at 65% 40%, #ffe0a8 0%, transparent 58%),
    radial-gradient(circle at 55% 75%, #c8ffd8 0%, transparent 55%);
  box-shadow:
    -50px 8px 0 -12px rgba(255,255,255,0.8),
    -110px 4px 0 -24px rgba(255, 224, 180, 0.65),
    60px 14px 0 -20px rgba(180, 255, 230, 0.55),
    0 30px 44px rgba(80, 60, 120, 0.16);
  filter: blur(5px);
  animation: driftFar 55s linear infinite reverse;
}

/* Mid layer */
.cloud.c3 {
  width: 220px; height: 90px;
  left: 18%; top: 42%;
  background:
    radial-gradient(circle at 40% 40%, #fff 0%, transparent 58%),
    radial-gradient(circle at 70% 55%, #d4b8ff 0%, transparent 60%),
    radial-gradient(circle at 20% 70%, #a8e8ff 0%, transparent 55%);
  box-shadow:
    36px 6px 0 -8px rgba(255,255,255,0.9),
    78px -4px 0 -16px rgba(220, 200, 255, 0.7),
    0 22px 32px rgba(70, 50, 110, 0.2);
  filter: blur(2.5px);
  animation: driftMid 28s ease-in-out infinite;
}
.cloud.c4 {
  width: 260px; height: 100px;
  right: 14%; top: 55%;
  background:
    radial-gradient(circle at 45% 40%, #fff 0%, transparent 58%),
    radial-gradient(circle at 75% 50%, #ffb8c8 0%, transparent 58%),
    radial-gradient(circle at 25% 65%, #fff0b0 0%, transparent 55%);
  box-shadow:
    -42px 8px 0 -10px rgba(255,255,255,0.85),
    -90px 0 0 -20px rgba(255, 190, 210, 0.65),
    48px 10px 0 -14px rgba(255, 240, 180, 0.6),
    0 24px 36px rgba(70, 50, 110, 0.18);
  filter: blur(3px);
  animation: driftMid 34s ease-in-out infinite reverse;
}
.cloud.c5 {
  width: 180px; height: 75px;
  left: 48%; top: 12%;
  background:
    radial-gradient(circle at 40% 45%, #fff 0%, transparent 60%),
    radial-gradient(circle at 70% 40%, #b8ffe0 0%, transparent 58%),
    radial-gradient(circle at 30% 75%, #c8d4ff 0%, transparent 55%);
  box-shadow:
    32px 4px 0 -8px rgba(255,255,255,0.9),
    70px 8px 0 -16px rgba(190, 255, 230, 0.65),
    0 18px 28px rgba(70, 50, 110, 0.16);
  filter: blur(2px);
  animation: bobCloud 9s ease-in-out infinite, driftMid 40s linear infinite;
}

/* Near / chunkier "3D" clouds */
.cloud.c6 {
  width: 300px; height: 120px;
  left: -2%; bottom: 6%;
  background:
    radial-gradient(circle at 35% 35%, #ffffff 0%, transparent 55%),
    radial-gradient(circle at 60% 45%, #ffd0f0 0%, transparent 58%),
    radial-gradient(circle at 45% 70%, #b8e8ff 0%, transparent 55%);
  box-shadow:
    55px 8px 0 -8px #fff,
    110px -6px 0 -18px rgba(255, 210, 240, 0.85),
    160px 10px 0 -30px rgba(190, 230, 255, 0.7),
    20px -28px 0 -28px rgba(255, 255, 255, 0.75),
    0 34px 40px rgba(60, 40, 100, 0.22),
    inset 0 -10px 20px rgba(160, 140, 200, 0.12);
  filter: blur(1.2px);
  transform: translateZ(40px);
  animation: driftNear 22s ease-in-out infinite;
}
.cloud.c7 {
  width: 240px; height: 100px;
  right: 2%; bottom: 14%;
  background:
    radial-gradient(circle at 40% 35%, #ffffff 0%, transparent 55%),
    radial-gradient(circle at 70% 50%, #ffe8b8 0%, transparent 58%),
    radial-gradient(circle at 25% 70%, #c8ffd8 0%, transparent 55%);
  box-shadow:
    -48px 6px 0 -8px #fff,
    -100px -4px 0 -20px rgba(255, 230, 180, 0.8),
    50px 12px 0 -16px rgba(190, 255, 220, 0.7),
    10px -24px 0 -24px rgba(255,255,255,0.7),
    0 30px 36px rgba(60, 40, 100, 0.2),
    inset 0 -8px 18px rgba(160, 140, 200, 0.12);
  filter: blur(1.4px);
  animation: driftNear 26s ease-in-out infinite reverse;
}
.cloud.c8 {
  width: 160px; height: 70px;
  left: 38%; bottom: 28%;
  background:
    radial-gradient(circle at 45% 40%, #fff 0%, transparent 58%),
    radial-gradient(circle at 70% 55%, #e0c8ff 0%, transparent 58%);
  box-shadow:
    28px 4px 0 -6px #fff,
    62px 0 0 -14px rgba(220, 200, 255, 0.8),
    0 16px 24px rgba(60, 40, 100, 0.18);
  filter: blur(1px);
  animation: bobCloud 7s ease-in-out infinite, driftNear 30s linear infinite;
}

@keyframes driftFar {
  from { transform: translate3d(0, 0, -80px); }
  to { transform: translate3d(40vw, 8px, -80px); }
}
@keyframes driftMid {
  0%, 100% { transform: translate3d(0, 0, -20px); }
  50% { transform: translate3d(6vw, -12px, -20px); }
}
@keyframes driftNear {
  0%, 100% { transform: translate3d(0, 0, 40px) scale(1); }
  50% { transform: translate3d(-4vw, -10px, 40px) scale(1.04); }
}
@keyframes bobCloud {
  0%, 100% { margin-top: 0; }
  50% { margin-top: -10px; }
}

/* ---- Left rail: live feed with winners snug below ---- */
.rail {
  flex: 0 0 clamp(230px, 25vw, 330px);
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card {
  background: var(--card);
  border: 3px solid var(--outline);
  border-radius: 20px;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.45);
  min-width: 0;
}

.feed-card {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 10px 10px 6px;
}

.winners-card {
  flex: 0 0 45%;
  max-height: 45%;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  padding: 8px 10px 6px;
  background: linear-gradient(180deg, #ffe9d9 0%, #fff6e3 100%);
}

.winners-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  flex: 0 0 auto;
}
.winners-head h3 { margin: 0; }

.solscan-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: "Baloo 2", cursive;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border: 2px solid #14102b;
  border-radius: 999px;
  padding: 2px 9px 2px 6px;
  box-shadow: 0 2px 0 #14102b;
  transition: transform 0.08s, filter 0.12s;
}
.solscan-btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.solscan-btn:active { transform: translateY(1px); }
.solscan-btn .solscan-icon {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}

.winners-card li {
  font-size: 0.84rem;
  padding: 5px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.winners-card li time { flex: 0 0 auto; }
.winners-card li b { flex: 0 0 auto; }
.winners-card li .amt { flex: 1 1 auto; min-width: 0; }
.solscan-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1.5px solid #14102b;
  background: #1a1a2e;
  color: #7dffb3;
  text-decoration: none;
  margin-left: auto;
  box-shadow: 0 1px 0 #14102b;
  transition: transform 0.08s, filter 0.12s;
}
.solscan-link:hover { filter: brightness(1.2); transform: scale(1.08); }
.solscan-link svg { width: 12px; height: 12px; }

h3 {
  font-family: "Luckiest Guy", cursive;
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 1px;
  color: var(--text);
  margin: 0 0 5px 4px;
  flex: 0 0 auto;
}

ul {
  list-style: none;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
ul::-webkit-scrollbar { width: 6px; }
ul::-webkit-scrollbar-thumb { background: #d9d2f0; border-radius: 4px; }

li {
  padding: 3px 8px;
  font-size: 0.76rem;
  font-weight: 500;
  border-radius: 9px;
  margin-bottom: 2px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
li:nth-child(odd) { background: rgba(43, 37, 71, 0.05); }
li time { color: #b3aecb; font-size: 0.64rem; margin-right: 5px; font-family: Consolas, monospace; }
li.buy { color: #0a9152; font-weight: 700; }
li.buy b { color: #067a43; }
li.sell { color: #d0342c; font-weight: 700; }
li.sell b { color: #b02a23; }
li.winner-jackpot { color: #17141f; font-weight: 700; }
li.winner-crown { color: #0d9488; font-weight: 700; }
li.winner-jackpot .amt,
li.winner-crown .amt {
  color: #39ff14;
}

/* ---- Right stage ---- */
.stage {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

header { text-align: center; flex: 0 0 auto; }

.ingest-chip {
  align-self: flex-start;
  margin-top: 10px;
  margin-left: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 2px solid var(--outline);
  background: #fffdf5;
  color: var(--text);
  font-family: "Baloo 2", cursive;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 2px 2px 0 var(--outline);
}
.ingest-chip[data-mode="live"] { background: #c8ffe8; }
.ingest-chip[data-mode="test"],
.ingest-chip[data-shadow="1"],
.ingest-chip[data-mode="replay"] { background: var(--gold); color: #4a3800; }
.ingest-chip[data-mode="demo"] { background: #fffdf5; }
.ingest-chip[data-status="error"] { background: #ffd0d4; color: #5c1020; }
.ingest-chip[data-status="connecting"] { background: #ffe9b8; }

.ingest-status {
  margin: 0 0 8px;
  min-height: 1.2em;
  font-size: 0.82rem;
  font-weight: 700;
  color: #3d3560;
  text-shadow: 0 1px 0 rgba(255,255,255,0.5);
}
.ingest-status.error { color: #8b1e2d; }

.watch-bar {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 8px;
  max-width: 720px;
  width: 100%;
  padding: 0 8px;
}
.watch-bar input {
  flex: 1 1 auto;
  min-width: 0;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  border: 2.5px solid var(--outline);
  background: var(--card);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 14px;
  outline: none;
}
.watch-bar input:focus { box-shadow: 0 0 0 3px rgba(255, 217, 61, 0.55); }
.watch-bar button {
  flex: 0 0 auto;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  border: 2.5px solid var(--outline);
  background: var(--gold);
  color: #4a3800;
  border-radius: 999px;
  padding: 6px 18px;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.5);
}
.watch-bar button.stop {
  background: #ffd0d4;
  color: #5c1020;
}
.watch-bar button.stop:hover { filter: brightness(1.05); }
.watch-bar button.stop:disabled {
  opacity: 0.35;
  cursor: default;
  filter: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 2px;
}

.logo {
  width: clamp(56px, 9vh, 92px);
  height: auto;
  flex: 0 0 auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
  animation: logoFloat 3.5s ease-in-out infinite;
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.brand-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

h1 {
  font-family: "Luckiest Guy", cursive;
  font-size: clamp(1.7rem, 6vh, 3rem);
  letter-spacing: 3px;
  line-height: 0.95;
  color: #ff9f43;
  -webkit-text-fill-color: transparent;
  background-image: linear-gradient(
    90deg,
    #ff3b3b,
    #ff7a00,
    #ffd93d,
    #7dffb3,
    #4dd8ff,
    #c084fc,
    #ff3b3b
  );
  background-size: 100% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-stroke: 2.5px #14102b;
  paint-order: stroke fill;
  /* Hue spin is seamless: 360deg looks identical to 0deg */
  filter: drop-shadow(0 3px 0 #14102b) drop-shadow(0 6px 0 rgba(20, 16, 43, 0.25)) hue-rotate(0deg);
  animation: titleFlow 1.4s linear infinite;
}
@keyframes titleFlow {
  from {
    filter: drop-shadow(0 3px 0 #14102b) drop-shadow(0 6px 0 rgba(20, 16, 43, 0.25)) hue-rotate(0deg);
  }
  to {
    filter: drop-shadow(0 3px 0 #14102b) drop-shadow(0 6px 0 rgba(20, 16, 43, 0.25)) hue-rotate(360deg);
  }
}

.squiggle {
  width: min(280px, 100%);
  height: 10px;
  display: block;
  margin: 2px 0 0;
}

.sub {
  color: #3a3558;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
  max-width: 420px;
  margin: 0 auto 6px;
  font-weight: 500;
  font-size: 0.85rem;
}

.how-btn {
  font-family: "Baloo 2", cursive;
  font-weight: 700;
  font-size: 0.8rem;
  background: var(--coral);
  color: #fff;
  border: 3px solid var(--outline);
  border-radius: 999px;
  padding: 3px 16px;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.5);
}
.how-btn:hover { transform: translateY(-1px); }
.how-btn:active { transform: translateY(1px); }

/* ---- Prize pool cards ---- */
.games {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.game {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  text-align: center;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ---- Animated title areas ---- */
.card-head {
  position: relative;
  flex: 0 0 auto;
  padding: 10px 0 8px;
  margin-bottom: 2px;
}

.game h2 {
  font-family: "Luckiest Guy", cursive;
  font-size: clamp(0.95rem, 3vh, 1.35rem);
  font-weight: 400;
  letter-spacing: 1.5px;
  color: var(--outline);
  line-height: 1.2;
  position: relative;
  z-index: 2;
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  z-index: 2;
}

.title-emoji {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.55rem;
  line-height: 1;
  animation: bob 2.2s ease-in-out infinite;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35));
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.round {
  font-family: "Baloo 2", cursive;
  font-size: 0.68rem;
  letter-spacing: 0;
  display: block;
}

/* Smoke oozing off the Buyer title */
.smoke {
  position: absolute;
  z-index: 1;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(190, 190, 205, 0.5) 0%, transparent 68%);
  filter: blur(5px);
  top: 4px;
  left: 50%;
  opacity: 0;
  pointer-events: none;
  animation: smoke 4.6s ease-out infinite;
}
.smoke.s1 { margin-left: -92px; animation-delay: 0s; }
.smoke.s2 { margin-left: -44px; animation-delay: 1.7s; animation-duration: 5.4s; }
.smoke.s3 { margin-left: 2px; animation-delay: 0.8s; animation-duration: 6s; }
.smoke.s4 { margin-left: 48px; animation-delay: 2.6s; }
.smoke.s5 { margin-left: 86px; animation-delay: 3.5s; animation-duration: 5s; }

@keyframes smoke {
  0% { transform: translateY(10px) scale(0.55); opacity: 0; }
  25% { opacity: 0.75; }
  100% { transform: translateY(-30px) translateX(10px) scale(1.7); opacity: 0; }
}

/* Money and droplets around the Whale title */
.cash {
  position: absolute;
  z-index: 1;
  font-family: "Luckiest Guy", cursive;
  font-size: 1rem;
  color: #b9ffdd;
  text-shadow: 0 2px 0 #064e3b;
  top: 8px;
  opacity: 0;
  pointer-events: none;
  animation: cash 3.8s ease-out infinite;
}
.cash.c1 { left: 12%; animation-delay: 0s; }
.cash.c2 { left: 50%; animation-delay: 1.4s; animation-duration: 4.4s; }
.cash.c3 { right: 12%; animation-delay: 2.5s; }

@keyframes cash {
  0% { transform: translateY(10px) rotate(-12deg) scale(0.7); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(-26px) rotate(16deg) scale(1.2); opacity: 0; }
}

.drop {
  position: absolute;
  z-index: 1;
  width: 8px;
  height: 12px;
  background: linear-gradient(180deg, #d9f6ff 0%, #38bdf8 100%);
  border: 1px solid rgba(3, 105, 161, 0.5);
  border-radius: 50% 50% 55% 55% / 35% 35% 65% 65%;
  top: 78%;
  opacity: 0;
  pointer-events: none;
  animation: drip 3.4s ease-in infinite;
}
.drop.d1 { left: 20%; animation-delay: 0.4s; }
.drop.d2 { left: 38%; animation-delay: 2.1s; animation-duration: 4s; }
.drop.d3 { left: 62%; animation-delay: 1.2s; }
.drop.d4 { left: 81%; animation-delay: 2.9s; animation-duration: 3s; }

@keyframes drip {
  0% { transform: translateY(-2px) scale(0.7); opacity: 0; }
  18% { opacity: 0.95; }
  100% { transform: translateY(30px) scale(1); opacity: 0; }
}

/* Time bomb fuse: rope burns down as the holder timer runs out */
.fuse-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  width: min(240px, 82%);
  margin: 0 auto 8px;
  flex: 0 0 auto;
}

.bomb {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #4a4a55 0%, #17171c 55%, #000 100%);
  border: 2px solid #000;
  box-shadow: 0 0 8px rgba(255, 140, 40, 0.25), inset -2px -2px 3px rgba(0, 0, 0, 0.8);
  position: relative;
}
.bomb::after {
  content: "";
  position: absolute;
  top: -5px;
  right: 1px;
  width: 4px;
  height: 6px;
  border-radius: 2px;
  background: #6b431f;
  transform: rotate(24deg);
}

.fuse-bar {
  flex: 1 1 auto;
  height: 9px;
  border: 2px solid #000;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  position: relative;
}

.fuse-rope {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: repeating-linear-gradient(-55deg, #9c6a33 0 4px, #6b431f 4px 8px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  position: relative;
  transition: width 0.2s linear;
}

.ember {
  position: absolute;
  right: -5px;
  top: 50%;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff7ae 0%, #ffb02e 40%, #ff5a1f 72%, transparent 100%);
  animation: flicker 0.3s infinite alternate;
  pointer-events: none;
}
@keyframes flicker {
  from { transform: translateY(-50%) scale(0.8); opacity: 0.8; }
  to { transform: translateY(-50%) scale(1.3); opacity: 1; }
}
#clockCard.idle .ember { display: none; }
#clockCard.danger .ember { animation-duration: 0.15s; }

/* Nietzschean Buyer: black, ominous */
#clockCard {
  background:
    radial-gradient(ellipse at 50% -20%, rgba(120, 120, 135, 0.22) 0%, transparent 55%),
    linear-gradient(170deg, #0b0b0e 0%, #17171c 55%, #0c0c10 100%);
  border-color: #000;
  box-shadow: 0 5px 0 #000, 0 0 30px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  color: #d9d9de;
}
#clockCard h2 {
  color: #0a0a0c;
  -webkit-text-stroke: 1.2px #9c9caa;
  paint-order: stroke fill;
  text-shadow: 0 0 16px rgba(200, 200, 215, 0.4), 0 4px 8px #000;
}
#clockCard .label { color: #85858d; }
#clockCard .holder { color: #b3b3ba; }
#clockCard .holder b { color: #fff; }
#clockCard .rule { color: #7c7c84; border-top-color: rgba(255, 255, 255, 0.16); }
#clockCard .countdown { background: #fff; border-color: #000; color: #0b0b0e; box-shadow: 0 2px 0 #000; }
#clockCard.danger .countdown { background: var(--red); border-color: #7f1d1d; color: #fff; animation: bounce 0.5s infinite alternate; }
@keyframes bounce { from { transform: scale(1); } to { transform: scale(1.06); } }
#clockCard.idle .countdown { color: #75757d; background: #222227; border-color: #45454c; }
#clockCard .mini {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
}
#clockCard .mini h4 { color: #ececf0; }
#clockCard .mini li:nth-child(odd) { background: rgba(255, 255, 255, 0.06); }
#clockCard .mini li .who { color: #dcdce1; }
#clockCard .mini li .amt { color: #fff; }
#clockCard .mini li time { color: #75757d; }
#clockCard .mini li.top {
  background: #fff;
  border-color: #fff;
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.35);
}
#clockCard .mini li.top .who, #clockCard .mini li.top .amt { color: #0b0b0e; }
#clockCard .mini li.top time { color: #63636b; }
#clockCard .mini li.empty { color: #75757d; }

/* King of the Whale: whale blue + rich green */
#crownCard {
  background:
    radial-gradient(ellipse at 15% 0%, rgba(255, 255, 255, 0.3) 0%, transparent 45%),
    linear-gradient(150deg, #0ea5e9 0%, #14b8c9 45%, #10b981 100%);
  border-color: #075985;
  box-shadow: 0 5px 0 #064e3b, 0 0 26px rgba(16, 185, 129, 0.3);
  color: #f0fdff;
}
#crownCard h2 {
  background: linear-gradient(100deg, #075985 0%, #064e3b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1.2px rgba(255, 255, 255, 0.85);
  paint-order: stroke fill;
  filter: drop-shadow(0 2px 0 rgba(6, 78, 59, 0.5));
}
#crownCard .round { color: #d3f6ff; -webkit-text-stroke: 0; background: none; }
#crownCard .label { color: #d9fff2; }
#crownCard .holder { color: #eafffa; }
#crownCard .holder b { color: #fff; }
#crownCard .rule { color: #d3f3ea; border-top-color: rgba(255, 255, 255, 0.3); }
#crownCard .countdown { background: #fff; border-color: #064e3b; color: #065f46; box-shadow: 0 2px 0 #064e3b; }
#crownCard .round-bar { border-color: #064e3b; background: rgba(255, 255, 255, 0.35); }
#crownCard .round-fill { background: repeating-linear-gradient(-45deg, #064e3b 0 8px, #0369a1 8px 16px); }
#crownCard .mini {
  background: rgba(6, 78, 59, 0.28);
  border: 2px solid rgba(255, 255, 255, 0.45);
  box-shadow: inset 0 0 18px rgba(3, 105, 161, 0.3);
}
#crownCard .mini h4 { color: #fff; }
#crownCard .mini li:nth-child(odd) { background: rgba(255, 255, 255, 0.1); }
#crownCard .mini li .who { color: #f0fdff; }
#crownCard .mini li .amt { color: #d9ffe9; }
#crownCard .mini li .rank { color: #bdefff; }
#crownCard .mini li.top {
  background: #fff;
  border-color: #fff;
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.5);
}
#crownCard .mini li.top .who { color: #065f46; }
#crownCard .mini li.top .amt { color: #047857; }
#crownCard .mini li.top .rank { color: #0284c7; }
#crownCard .mini li.empty { color: #d3f3ea; }

.prize {
  font-family: "Luckiest Guy", cursive;
  font-size: clamp(1.5rem, 7.5vh, 2.8rem);
  line-height: 1;
  white-space: nowrap;
  flex: 0 0 auto;
  color: #39ff14;
  -webkit-text-fill-color: #39ff14;
  -webkit-text-stroke: 2.5px #000;
  paint-order: stroke fill;
  filter: drop-shadow(0 2px 0 #000);
  animation: prizeShine 3.2s ease-in-out infinite;
}
@keyframes prizeShine {
  0%, 100% { filter: drop-shadow(0 2px 0 #000) brightness(1); }
  50% { filter: drop-shadow(0 2px 0 #000) brightness(1.18); }
}

/* Keep neon green even on themed cards */

.label {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 2px 0 8px;
}

.countdown {
  font-family: Consolas, monospace;
  font-weight: 700;
  font-size: clamp(0.95rem, 3vh, 1.3rem);
  font-variant-numeric: tabular-nums;
  border: 3px solid var(--outline);
  border-radius: 999px;
  display: inline-block;
  align-self: center;
  padding: 2px 16px;
  margin-bottom: 8px;
}
.countdown.small { font-size: clamp(0.8rem, 2.4vh, 1rem); }

.holder {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 6px;
  min-height: 1.2em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.round-bar {
  height: 9px;
  border: 2.5px solid var(--outline);
  border-radius: 999px;
  margin: 0 auto 8px;
  width: min(220px, 80%);
  overflow: hidden;
  flex: 0 0 auto;
}
.round-fill {
  height: 100%;
  width: 0%;
  transition: width 0.4s linear;
}

/* Mini feeds inside the prize cards, the stare magnets */
.mini {
  width: min(360px, 98%);
  margin: 8px auto 0;
  border-radius: 14px;
  padding: 10px 10px 8px;
  flex: 1.4 1 auto;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.mini h4 {
  font-family: "Luckiest Guy", cursive;
  font-size: clamp(0.75rem, 2.2vh, 0.95rem);
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: none;
  margin: 0 0 8px 2px;
  flex: 0 0 auto;
}

.mini ul {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mini li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: clamp(0.88rem, 2.4vh, 1.08rem);
  font-weight: 600;
  text-align: left;
  border-radius: 11px;
  margin-bottom: 0;
  white-space: nowrap;
  overflow: hidden;
  line-height: 1.2;
  border: 1.5px solid transparent;
}
.mini li .who {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}
.mini li .amt {
  flex: 0 0 auto;
  font-weight: 800;
  font-size: 1.08em;
  font-variant-numeric: tabular-nums;
}
.mini li .rank {
  flex: 0 0 20px;
  font-family: "Luckiest Guy", cursive;
  font-size: 1em;
  font-weight: 400;
}
.mini li time {
  flex: 0 0 auto;
  font-size: 0.72em;
  margin-right: 0;
}
.mini li.top {
  transform: scale(1.03);
  font-size: 1.1em;
}
.mini li.top .who { font-weight: 800; }
.mini li.empty {
  font-style: italic;
  justify-content: center;
  font-weight: 500;
  flex: 1;
  align-items: center;
}

.rule {
  font-size: 0.72rem;
  max-width: 300px;
  margin: 6px auto 0;
  border-top: 2px dashed rgba(255, 255, 255, 0.2);
  padding-top: 6px;
  flex: 0 0 auto;
}

/* ---- Footer ---- */
footer {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 3px dashed rgba(58, 53, 88, 0.28);
  padding-top: 7px;
}

.controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.mint-watch {
  display: flex;
  gap: 6px;
  align-items: center;
}
.mint-watch input {
  width: min(280px, 42vw);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  border: 2.5px solid var(--outline);
  background: var(--card);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 12px;
  outline: none;
}
.mint-watch input:focus { box-shadow: 0 0 0 3px rgba(255, 217, 61, 0.55); }
.controls button.test { background: #ffd6a3; color: #4a2800; }
.controls button.test.on { background: var(--gold); color: #4a3800; }

button { font-family: inherit; }

.controls button {
  font-size: 0.78rem;
  font-weight: 700;
  border: 2.5px solid var(--outline);
  background: var(--card);
  color: var(--text);
  border-radius: 999px;
  padding: 3px 16px;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.5);
}
.controls button.demo { background: var(--gold); color: #4a3800; }
.controls button.demo.on { background: var(--cyan); color: #063a52; }
.controls button:hover { filter: brightness(1.05); }
.controls button:active { transform: translateY(1px); }

/* Split demo-winner control */
.winner-split {
  display: inline-flex;
  border: 2.5px solid var(--outline);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.5);
  height: 32px;
}

.split-half {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 14px !important;
  height: 100%;
  cursor: pointer;
  font-family: "Baloo 2", cursive;
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.4px;
  transition: filter 0.12s, transform 0.08s;
}
.split-half:active { transform: translateY(1px); filter: brightness(0.92); }

.split-holder {
  background: linear-gradient(180deg, #2a2a30 0%, #0b0b0e 100%);
  color: #f0f0f2;
  border-right: 2px solid var(--outline) !important;
  text-shadow: 0 1px 0 #000;
}
.split-holder:hover { filter: brightness(1.15); }

.split-whale {
  background: linear-gradient(135deg, #0ea5e9 0%, #10b981 100%);
  color: #fff;
  text-shadow: 0 1px 0 rgba(6, 78, 59, 0.45);
}
.split-whale:hover { filter: brightness(1.08); }

.split-emoji { font-size: 0.95rem; line-height: 1; }
.split-label { text-transform: lowercase; }

/* Winner toasts */
.toasts {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  width: min(420px, calc(100vw - 24px));
}

.toast {
  pointer-events: auto;
  width: 100%;
  border: 3px solid var(--outline);
  border-radius: 22px;
  padding: 14px 16px 14px 14px;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.45), 0 18px 40px rgba(0, 0, 0, 0.35);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  animation: toastIn 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both;
  position: relative;
  overflow: hidden;
}
.toast.out { animation: toastOut 0.28s ease-in forwards; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-28px) scale(0.86); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(-16px) scale(0.92); }
}

.toast-badge {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  border: 2.5px solid var(--outline);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
}

.toast-copy { min-width: 0; }
.toast-kicker {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 2px;
}
.toast-title {
  font-family: "Luckiest Guy", cursive;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
  line-height: 1.15;
  margin-bottom: 2px;
}
.toast-detail {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast-amt {
  font-family: "Luckiest Guy", cursive;
  font-size: 1.2rem;
  white-space: nowrap;
  text-align: right;
  line-height: 1;
  color: #39ff14;
  -webkit-text-fill-color: #39ff14;
  -webkit-text-stroke: 1.5px #000;
  paint-order: stroke fill;
  filter: drop-shadow(0 2px 0 #000);
  animation: prizeShine 3.2s ease-in-out infinite;
}

.toast.holder {
  background: linear-gradient(145deg, #1a1a20 0%, #0b0b0e 100%);
  color: #f2f2f4;
  box-shadow: 0 8px 0 #000, 0 0 28px rgba(255, 255, 255, 0.12), 0 18px 40px rgba(0, 0, 0, 0.5);
}
.toast.holder .toast-badge {
  background: #fff;
  box-shadow: 0 3px 0 #000;
}
.toast.holder .toast-kicker { color: #a8a8b0; }
.toast.holder .toast-title { color: #fff; }
.toast.holder .toast-detail { color: #c8c8ce; }
.toast.holder .toast-detail b { color: #fff; }
.toast.holder::before {
  content: "";
  position: absolute;
  inset: -20% 20% auto;
  height: 60%;
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.12), transparent 70%);
  pointer-events: none;
}

.toast.whale {
  background: linear-gradient(135deg, #0ea5e9 0%, #14b8c9 45%, #10b981 100%);
  color: #f0fdff;
  box-shadow: 0 8px 0 #064e3b, 0 0 28px rgba(16, 185, 129, 0.35), 0 18px 40px rgba(0, 0, 0, 0.35);
}
.toast.whale .toast-badge {
  background: #fffdf5;
  box-shadow: 0 3px 0 #064e3b;
}
.toast.whale .toast-kicker { color: #d9fff2; }
.toast.whale .toast-title { color: #fff; text-shadow: 0 2px 0 rgba(6, 78, 59, 0.4); }
.toast.whale .toast-detail { color: #eafffa; }
.toast.whale .toast-detail b { color: #fff; }
.toast.whale::after {
  content: "$  $  $";
  position: absolute;
  right: 10px;
  bottom: 4px;
  font-family: "Luckiest Guy", cursive;
  font-size: 0.7rem;
  letter-spacing: 4px;
  color: rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

/* ---- Rules popup ---- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 24, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}
.overlay.hidden { display: none; }

.modal {
  background: var(--card);
  border: 3px solid var(--outline);
  border-radius: 26px;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.5);
  max-width: 520px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 24px 24px 20px;
  position: relative;
  color: var(--text);
}

.modal h2 {
  font-family: "Luckiest Guy", cursive;
  font-size: 1.3rem;
  font-weight: 400;
  background: linear-gradient(90deg, var(--coral), var(--gold), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(1px 2px 0 rgba(0, 0, 0, 0.35));
  margin-bottom: 10px;
}

.modal p { margin-bottom: 10px; font-size: 0.9rem; font-weight: 500; }
.modal .lead { font-size: 0.98rem; }

.rule-block {
  border: 3px solid var(--outline);
  border-radius: 16px;
  padding: 9px 13px 5px;
  margin-bottom: 10px;
  box-shadow: 0 3px 0 rgba(20, 16, 43, 0.3);
}
.rule-block.whale-rule { background: linear-gradient(150deg, #0ea5e9, #10b981); }
.rule-block.whale-rule h3 { color: #fff; }
.rule-block.whale-rule p { color: #eafffa; }
.rule-block.buyer-rule { background: linear-gradient(170deg, #0b0b0e, #1b1b21); }
.rule-block.buyer-rule h3 { color: #fff; }
.rule-block.buyer-rule p { color: #c9c9cf; }

.flywheel-copy p {
  font-size: 0.84rem;
  line-height: 1.4;
  margin-bottom: 8px;
  color: var(--text);
}
.flywheel-copy p:last-child { margin-bottom: 12px; font-weight: 700; }

.rule-block h3 {
  font-family: "Luckiest Guy", cursive;
  font-size: 0.85rem;
  margin: 0 0 3px;
}
.rule-block p { margin-bottom: 4px; }

.fine { font-size: 0.78rem; color: var(--muted); }

.close {
  position: absolute;
  top: 9px;
  right: 15px;
  font-size: 1.5rem;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  line-height: 1;
}

.got-it {
  display: block;
  margin: 6px auto 0;
  font-family: "Baloo 2", cursive;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 5px 24px;
  background: var(--coral);
  color: #fff;
  border: 3px solid var(--outline);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.4);
}
.got-it:hover { transform: translateY(-1px); }

/* ---- Short screens: drop the fluff so it still fits ---- */
@media (max-height: 640px) {
  .sub { display: none; }
  .squiggle { display: none; }
  .rule { display: none; }
  h1 { margin-bottom: 2px; }
  .label { margin-bottom: 4px; }
  .winners-card { max-height: 26%; }
  .card-head { padding: 6px 0 4px; }
}

/* ---- Narrow screens: stack and allow scrolling ---- */
@media (max-width: 780px) {
  body { overflow: auto; }
  .wrap { height: auto; min-height: 100dvh; flex-direction: column; }
  .rail { flex: 0 0 auto; order: 2; }
  .feed-card { flex: 0 0 auto; }
  .feed-card ul { max-height: 300px; }
  .winners-card { max-height: none; }
  .winners-card ul { max-height: 180px; }
  .stage { order: 1; }
  .games { grid-template-columns: 1fr; flex: 0 0 auto; }
  .game { padding: 18px 14px; }
}
