/* ===== Player app (phones) ===== */
:root {
  --bg: #090c16;
  --bg-2: #10162a;
  --bg-3: #19213b;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f4f5fa;
  --muted: #9aa4bd;
  --red: #e3263a;
  --red-2: #b8162a;
  --gold: #f7c548;
  --gold-2: #d9a21b;
  --green: #22c55e;
  --brand: #0095da; /* Yaticorp blue */
  --radius: 18px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
body::before {
  content: "";
  position: fixed;
  inset: -40px;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(40rem 22rem at 0% -5%, rgba(227, 38, 58, 0.3), transparent 65%),
    radial-gradient(34rem 22rem at 105% 0%, rgba(247, 197, 72, 0.18), transparent 60%),
    radial-gradient(36rem 26rem at 50% 115%, rgba(0, 149, 218, 0.12), transparent 60%);
  animation: bgDrift 18s ease-in-out infinite alternate;
}
@keyframes bgDrift { to { transform: translate3d(0, -18px, 0) scale(1.05); } }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
.hidden { display: none !important; }
.center { text-align: center; }
.fine { color: var(--muted); font-size: 0.85rem; margin: 0.5rem 0 0; }
.eyebrow { color: var(--gold); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }

/* Event + partner logos in the top corners of every screen (sticky, so games and the hub sit below it). */
:root { --brandbar: calc(max(8px, env(safe-area-inset-top)) + 47px); }
.brandbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--brandbar);
  box-sizing: border-box;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(8px, env(safe-area-inset-top)) 14px 8px;
  background: rgba(9, 12, 22, 0.86);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brandbar img { display: block; width: auto; }
.bb-bni { height: 34px; border-radius: 5px; background: #fff; }
.bb-yc { height: 20px; opacity: 0.95; }

.view {
  min-height: calc(100dvh - var(--brandbar));
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px max(28px, env(safe-area-inset-bottom));
}

.card {
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 30px rgba(0, 0, 0, 0.25);
}

/* ----- buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg-3);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.08s, filter 0.15s;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.5; cursor: default; }
@media (hover: hover) { .btn:not(:disabled):hover { filter: brightness(1.1); } }
.btn-primary { background: linear-gradient(180deg, #f0364a, var(--red-2)); border-color: transparent; box-shadow: 0 8px 24px rgba(227, 38, 58, 0.35); animation: primaryGlow 2.4s ease-in-out infinite alternate; }
@keyframes primaryGlow { to { box-shadow: 0 8px 32px rgba(227, 38, 58, 0.6); } }
.btn-gold { background: linear-gradient(180deg, #ffd96a, var(--gold-2)); color: #1d1503; border-color: transparent; box-shadow: 0 8px 24px rgba(247, 197, 72, 0.3); }
.btn-gold::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 40%; left: -60%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: shimmer 2.8s ease-in-out infinite;
}
@keyframes shimmer { 0% { left: -60%; } 55%, 100% { left: 130%; } }
/* touch ripple (sprinkled in by app.js on every tap) */
.btn, .icon-btn, .game-card { position: relative; overflow: hidden; }
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  animation: ripple 0.6s ease-out forwards;
  pointer-events: none;
}
@keyframes ripple { to { transform: scale(1); opacity: 0; } }
.btn-ghost { background: transparent; }
.btn-lg { min-height: 56px; font-size: 1.1rem; width: 100%; }
.icon-btn {
  width: 42px; height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  display: grid; place-items: center;
  font-size: 1.1rem;
  flex: none;
}
.link { background: none; border: 0; padding: 0; color: var(--gold); text-decoration: underline; font-size: inherit; }

/* ----- boot ----- */
.boot { display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); }
.boot-logo { height: 30px; margin-bottom: 18px; opacity: 0.9; }

/* ----- "Powered by Yaticorp" ----- */
.powered { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 26px; color: var(--muted); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.85; }
.powered img { height: 16px; }
.spinner {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--gold);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ----- join ----- */
.hero { text-align: center; padding: 28px 0 22px; }
.hero-badge {
  width: 84px; height: 84px;
  margin: 0 auto 16px;
  border-radius: 26px;
  display: grid; place-items: center;
  font-size: 46px;
  background: radial-gradient(circle at 30% 25%, #ffe9a6, var(--gold-2));
  box-shadow: 0 12px 40px rgba(247, 197, 72, 0.35), inset 0 -4px 0 rgba(0, 0, 0, 0.15);
  animation: float 3s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-6px) rotate(-3deg); } }
.hero h1 { font-size: clamp(1.8rem, 7vw, 2.4rem); font-weight: 850; letter-spacing: -0.02em; }
.hero-sub { color: var(--muted); margin: 8px 0 0; }
.hero-games { display: flex; justify-content: center; gap: 10px; margin-top: 16px; font-size: 1.6rem; }
.hero-games span {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}

.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.field input, .field select {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* no iOS zoom on focus */
  outline: none;
}
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.field input:focus, .field select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(247, 197, 72, 0.2); }

/* ----- hub ----- */
.hub-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.hub-head h2 { font-size: 1.5rem; margin-top: 4px; }
.hub-id { display: flex; align-items: center; gap: 12px; min-width: 0; background: none; border: 0; padding: 0; text-align: left; }
.hub-id:active { transform: scale(0.98); }
.hub-photo { width: 52px; height: 52px; flex: none; border-radius: 50%; overflow: hidden; border: 2px solid rgba(247, 197, 72, 0.6); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4); }
.hub-photo img, .mini-av img, .win-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini-av { position: relative; width: 34px; height: 34px; border-radius: 50%; overflow: hidden; background: rgba(255, 255, 255, 0.08); display: grid; place-items: center; font-size: 1rem; font-weight: 800; color: var(--muted); }
.mini-av img { position: absolute; inset: 0; }
.win-photo { width: 96px; height: 96px; border-radius: 50%; overflow: hidden; margin: 12px auto 0; border: 3px solid var(--gold); box-shadow: 0 0 30px rgba(247, 197, 72, 0.5); }
.score-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-radius: var(--radius);
  background:
    radial-gradient(18rem 10rem at 100% 0%, rgba(247, 197, 72, 0.25), transparent 70%),
    linear-gradient(135deg, #2a1020, #141a33);
  border: 1px solid rgba(247, 197, 72, 0.25);
  margin-bottom: 14px;
}
.label { color: var(--muted); font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.big { font-size: 2.6rem; font-weight: 850; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.rank-box { text-align: right; }
.rank-num { font-size: 2rem; font-weight: 850; color: var(--gold); font-variant-numeric: tabular-nums; }
.rank-of { color: var(--muted); font-size: 0.8rem; }

.notice {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(247, 197, 72, 0.1);
  border: 1px solid rgba(247, 197, 72, 0.3);
  color: #ffe7a3;
  margin-bottom: 14px;
  font-size: 0.92rem;
}

.games { display: grid; gap: 12px; margin-bottom: 18px; }
.game-card {
  --accent: var(--red);
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px;
  text-align: left;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%), var(--bg-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 8px 24px rgba(0, 0, 0, 0.22);
  transition: transform 0.12s, box-shadow 0.2s, border-color 0.2s;
}
.game-card:active:not(:disabled) {
  transform: scale(0.98);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 30%, transparent);
}
@media (hover: hover) {
  .game-card:not(:disabled):hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
    box-shadow: 0 12px 32px color-mix(in srgb, var(--accent) 22%, rgba(0, 0, 0, 0.3));
  }
  .game-card:not(:disabled):hover .gc-emoji { transform: scale(1.12) rotate(-6deg); }
}
.game-card:disabled { cursor: default; }
.game-card.is-off { opacity: 0.55; }
.gc-emoji {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  font-size: 30px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 22%, #0000);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, #0000);
  transition: transform 0.2s;
}
.gc-name { font-weight: 800; font-size: 1.05rem; }
.gc-tag { color: var(--muted); font-size: 0.82rem; margin-top: 2px; }
.gc-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 6px; font-size: 0.8rem; color: var(--muted); }
.gc-meta b { color: var(--text); }
.chip { padding: 2px 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.07); font-size: 0.75rem; white-space: nowrap; }
.gc-cta {
  padding: 9px 14px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.9rem;
  background: var(--accent);
  color: var(--accent-fg, #fff);
  white-space: nowrap;
}
.game-card.is-done .gc-cta { background: rgba(34, 197, 94, 0.15); color: #86efac; }
.game-card.is-off .gc-cta { background: rgba(255, 255, 255, 0.08); color: var(--muted); }

.mini-board h3 { font-size: 1rem; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.mini-row { display: grid; grid-template-columns: 32px 34px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.mini-row:first-of-type { border-top: 0; }
.mini-row.me { background: rgba(247, 197, 72, 0.08); margin: 0 -10px; padding: 9px 10px; border-radius: 10px; }
.mini-rank { font-weight: 800; color: var(--muted); text-align: center; }
.mini-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-name small { display: block; color: var(--muted); font-weight: 500; font-size: 0.75rem; }
.mini-total { font-weight: 800; font-variant-numeric: tabular-nums; }
.hub-foot { margin-top: 18px; text-align: center; color: var(--muted); font-size: 0.85rem; }

/* ----- modal ----- */
.modal {
  position: fixed; inset: 0;
  z-index: 50;
  display: grid; place-items: end center;
  background: rgba(3, 5, 12, 0.7);
  backdrop-filter: blur(4px);
  padding: 16px;
  animation: fade 0.15s;
}
.modal-box {
  width: 100%;
  max-width: 520px;
  border-radius: 22px;
  padding: 22px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  animation: rise 0.22s cubic-bezier(.2, .8, .2, 1);
  margin-bottom: env(safe-area-inset-bottom);
}
.modal-box h3 { font-size: 1.4rem; }
.modal-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 18px; }
.howto { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.howto li { padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(30px); opacity: 0; } }

#toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translate(-50%, 30px);
  z-index: 60;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 14px;
  background: #fff;
  color: #111;
  font-weight: 600;
  font-size: 0.92rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: 0.25s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 70; }

/* ===== Game view ===== */
.view-game {
  max-width: none;
  padding: 0;
  height: calc(100dvh - var(--brandbar));
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
.hud {
  --accent: var(--red);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 22%, transparent), transparent 80%), var(--bg-2);
}
.hud-name { flex: 1; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-stats { display: flex; gap: 8px; }
.hud-stat { min-width: 64px; padding: 4px 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.3); text-align: center; }
.hud-stat span { display: block; font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.hud-stat b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 16px 16px max(16px, env(safe-area-inset-bottom));
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}
.stage.shake { animation: shake 0.3s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

.countdown { flex: 1; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--muted); }
.cd-num { font-size: 7rem; font-weight: 900; color: var(--gold); line-height: 1; }
.cd-num.pop { animation: pop 0.5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { from { transform: scale(0.3); opacity: 0; } }
.saving { flex: 1; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); }

/* ----- Referral Rush ----- */
.rush { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.rush-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; width: min(100%, 62dvh); margin: 0 auto; }
.hole {
  position: relative;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 70%, #050711 30%, #1b2440 75%);
  box-shadow: inset 0 8px 18px rgba(0, 0, 0, 0.7), 0 2px 0 rgba(255, 255, 255, 0.06);
  display: grid; place-items: center;
  touch-action: none;
}
.mole {
  font-size: clamp(2.4rem, 13vw, 3.6rem);
  transform: scale(0);
  transition: transform 0.12s ease-out;
  pointer-events: none;
}
.mole.up { transform: scale(1); }
.mole.golden { filter: drop-shadow(0 0 14px rgba(247, 197, 72, 0.9)); }
.mole.hit { transform: scale(1.35); opacity: 0; transition: 0.18s; }
.float {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 900;
  font-size: 1.3rem;
  color: #86efac;
  pointer-events: none;
  animation: floatUp 0.7s ease-out forwards;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}
.float.golden { color: var(--gold); font-size: 1.6rem; }
.float.ghost { color: #fca5a5; }
@keyframes floatUp { to { transform: translate(-50%, -50px); opacity: 0; } }
.legend { display: flex; justify-content: center; gap: 16px; color: var(--muted); font-size: 0.9rem; }

/* ----- Lightning Reflex ----- */
.reflex { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.reflex-pad {
  flex: 1;
  border: 0;
  border-radius: 26px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: #fff;
  touch-action: none;
  transition: background 0.05s;
}
.reflex-pad.wait { background: linear-gradient(160deg, #b8162a, #6d0d1a); }
.reflex-pad.go { background: linear-gradient(160deg, #22c55e, #15803d); }
.reflex-pad.early { background: linear-gradient(160deg, #f59e0b, #b45309); }
.reflex-pad.result { background: linear-gradient(160deg, #1e2a52, #121933); }
.reflex-big { font-size: clamp(2.4rem, 13vw, 4rem); font-weight: 900; }
.reflex-sub { font-size: 1.05rem; opacity: 0.85; text-align: center; padding: 0 16px; }
.reflex-dots { display: flex; justify-content: center; gap: 10px; }
.reflex-dots i { width: 12px; height: 12px; border-radius: 50%; background: rgba(255, 255, 255, 0.15); }
.reflex-dots i.done { background: var(--gold); }

/* ----- Memory Match ----- */
.memory { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.mem-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: min(100%, 64dvh); margin: 0 auto; }
.mem-card { aspect-ratio: 1; border: 0; padding: 0; background: none; perspective: 600px; touch-action: none; }
.mem-inner { position: relative; display: block; width: 100%; height: 100%; transition: transform 0.3s; transform-style: preserve-3d; }
.mem-card.open .mem-inner, .mem-card.matched .mem-inner { transform: rotateY(180deg); }
.mem-face {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  border-radius: 14px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.mem-back { background: linear-gradient(145deg, #2a3560, #161d38); border: 1px solid rgba(247, 197, 72, 0.25); color: rgba(247, 197, 72, 0.6); font-size: 1.3rem; }
.mem-front { background: #f4f5fa; transform: rotateY(180deg); font-size: clamp(1.8rem, 9vw, 2.6rem); }
.mem-card.matched .mem-front { background: #dcfce7; box-shadow: 0 0 0 3px var(--green); }

/* ----- Colour Clash ----- */
.clash { flex: 1; display: flex; flex-direction: column; gap: 16px; }
.clash-hint { text-align: center; color: var(--muted); margin: 0; }
.clash-hint b { color: var(--text); }
.clash-word-wrap {
  flex: 1;
  display: grid; place-items: center;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  transition: background 0.15s;
}
.clash-word-wrap.ok { background: rgba(34, 197, 94, 0.15); }
.clash-word-wrap.no { background: rgba(227, 38, 58, 0.2); }
.clash-word { font-size: clamp(3rem, 17vw, 5rem); font-weight: 900; letter-spacing: 0.02em; }
.clash-word.pop { animation: wordPop 0.2s ease-out; }
@keyframes wordPop { from { transform: scale(0.8); } }
.clash-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.clash-btn {
  min-height: 76px;
  border: 0;
  border-radius: 18px;
  background: var(--c);
  color: var(--fg, #fff);
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.2);
  touch-action: none;
}
.clash-btn:active { transform: translateY(2px); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.2); }

/* ----- Quiz ----- */
.quiz { flex: 1; display: flex; flex-direction: column; gap: 16px; }
.quiz-timer { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.quiz-timer i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--green), var(--gold)); border-radius: 99px; }
.quiz-q { font-size: clamp(1.25rem, 5.5vw, 1.6rem); font-weight: 800; padding: 8px 2px; }
.quiz-opts { display: grid; gap: 10px; }
.quiz-opt {
  display: flex; align-items: center; gap: 12px;
  min-height: 58px;
  padding: 10px 14px;
  text-align: left;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg-3);
  font-weight: 650;
  transition: background 0.15s, border-color 0.15s;
}
.quiz-opt:disabled { cursor: default; }
.quiz-letter {
  flex: none;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 800;
  font-size: 0.85rem;
}
.quiz-opt.picked { border-color: var(--gold); }
.quiz-opt.right { background: rgba(34, 197, 94, 0.2); border-color: var(--green); }
.quiz-opt.right .quiz-letter { background: var(--green); }
.quiz-opt.wrong { background: rgba(227, 38, 58, 0.2); border-color: var(--red); }
.quiz-opt.wrong .quiz-letter { background: var(--red); }
.quiz-feedback { min-height: 2rem; text-align: center; font-size: 1.3rem; font-weight: 800; }

/* ===== Team Tap Battle ===== */
.team-card {
  --accent: #64748b;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 14px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%), var(--bg-2);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}
.team-card h3 { font-size: 1.15rem; margin-top: 4px; }
.team-card .btn { flex: none; animation: pulseBtn 1.2s infinite; }
@keyframes pulseBtn { 50% { transform: scale(1.05); } }
.tap-stage { gap: 14px; }
.tap-standing { text-align: center; font-weight: 700; min-height: 1.4em; }
.tap-btn {
  --accent: var(--red);
  flex: 1;
  min-height: 40dvh;
  border: 0;
  border-radius: 32px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--accent) 80%, #fff), var(--accent) 55%, color-mix(in srgb, var(--accent) 70%, #000));
  color: #fff;
  box-shadow: 0 14px 40px color-mix(in srgb, var(--accent) 45%, transparent), inset 0 -10px 0 rgba(0, 0, 0, 0.25);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  opacity: 0.55;
  transition: opacity 0.2s;
}
.tap-btn.live { opacity: 1; }
.tap-btn.over { opacity: 0.85; background: linear-gradient(160deg, #1e2a52, #121933); box-shadow: none; }
.tap-btn.hit { animation: tapHit 0.12s ease-out; }
@keyframes tapHit { 50% { transform: scale(0.94); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3), inset 0 -2px 0 rgba(0, 0, 0, 0.25); } }
.tap-big { font-size: clamp(2.4rem, 13vw, 4rem); font-weight: 900; letter-spacing: 0.02em; text-shadow: 0 3px 10px rgba(0, 0, 0, 0.3); text-align: center; padding: 0 12px; }
.tap-sub { font-size: 1rem; opacity: 0.9; font-weight: 600; }
.tap-teams { display: grid; gap: 8px; }
.tap-team { display: grid; grid-template-columns: 7.5rem 1fr 3.6rem; align-items: center; gap: 10px; font-size: 0.9rem; font-weight: 700; }
.tap-team.me { color: var(--gold); }
.tap-team i { display: block; height: 14px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.tap-team i b { display: block; height: 100%; border-radius: inherit; transition: width 0.2s linear; }
.tap-team em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; }

/* ----- Handshake Sequence ----- */
.simon { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.simon-status { text-align: center; font-weight: 800; font-size: 1.15rem; min-height: 2.6em; }
.simon-status small { display: block; color: var(--muted); font-weight: 600; font-size: 0.85rem; margin-top: 2px; }
.simon-grid { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: min(100%, 62dvh); margin: 0 auto; }
.simon-pad {
  border: 0;
  border-radius: 26px;
  background: color-mix(in srgb, var(--c) 32%, #000);
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.3);
  transition: background 0.08s, transform 0.08s, box-shadow 0.08s;
  touch-action: none;
}
.simon-pad.lit { background: var(--c); box-shadow: 0 0 40px var(--c), inset 0 -8px 0 rgba(0, 0, 0, 0.2); transform: scale(1.03); }
.simon-pad.wrong { background: #7f1d1d; }
.simon-grid.locked .simon-pad { opacity: 0.8; }

/* ----- Odd One Out ----- */
.odd { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.odd-hint { text-align: center; color: var(--muted); font-weight: 700; margin: 0; min-height: 1.4em; }
.odd-grid { flex: 1; display: grid; gap: 8px; width: min(100%, 62dvh); margin: 0 auto; align-content: center; }
.odd-cell {
  aspect-ratio: 1;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  font-size: var(--fs, 2rem);
  display: grid; place-items: center;
  touch-action: none;
  transition: background 0.1s;
}
.odd-cell.hit { background: rgba(34, 197, 94, 0.35); }
.odd-cell.miss { background: rgba(227, 38, 58, 0.35); }

/* ----- Emoji Pictionary ----- */
.pict-hint { text-align: center; color: var(--muted); margin: 0; font-weight: 600; }
.pict-emoji { font-size: clamp(3.4rem, 22vw, 5.6rem); text-align: center; line-height: 1.2; padding: 6px 0 10px; }

/* ===== Avatars, hosted games, nudges ===== */
.hud-stat.urgent b { color: #f87171; animation: urgentPulse 0.5s infinite alternate; }
@keyframes urgentPulse { to { transform: scale(1.15); } }

/* ----- game juice ----- */
.rush { position: relative; }
.rush-banner, .bal-banner {
  position: absolute; left: 50%; top: 4%;
  transform: translate(-50%, -20px) scale(0.8);
  padding: 8px 18px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.7);
  font-weight: 900;
  font-size: 1.15rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: 0.18s;
  z-index: 2;
}
.rush-banner.show, .bal-banner.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.rush-banner.hot, .bal-banner.hot { background: linear-gradient(90deg, #f97316, #e3263a); }
.rush-banner.gold, .bal-banner.gold { background: linear-gradient(90deg, #ffd96a, var(--gold-2)); color: #1d1503; font-size: 1.35rem; }
.rush-banner.bad, .bal-banner.bad { background: rgba(227, 38, 58, 0.85); }
.legend .streak { color: var(--gold); font-weight: 800; min-width: 3.5em; }
.clash-word-wrap.final { animation: finalPulse 0.5s infinite alternate; }
@keyframes finalPulse { to { box-shadow: inset 0 0 0 4px rgba(248, 113, 113, 0.7); } }
.clash-pop {
  position: absolute; left: 50%; top: 14%;
  transform: translateX(-50%);
  font-weight: 900; font-size: 1.3rem;
  color: var(--gold);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  animation: floatUp 0.9s ease-out forwards;
}
.clash-word-wrap { position: relative; }
.memory { position: relative; }
.mem-pop {
  position: absolute; left: 50%; top: 40%;
  transform: translateX(-50%);
  font-weight: 900; font-size: 1.6rem;
  color: var(--gold);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  animation: floatUp 0.9s ease-out forwards;
  z-index: 2;
}
.mem-done {
  position: absolute; inset: 0;
  display: grid; place-content: center;
  text-align: center;
  font-size: 2rem; font-weight: 900;
  background: rgba(9, 12, 22, 0.75);
  border-radius: 20px;
  animation: pop 0.5s cubic-bezier(.2, 1.6, .4, 1);
  z-index: 3;
}
.mem-done small { display: block; font-size: 1rem; color: var(--muted); font-weight: 600; margin-top: 6px; }

/* ===== Result ===== */
.result { text-align: center; margin-top: 6vh; padding: 28px 20px; }
.result-emoji { font-size: 3.2rem; }
.result-score {
  font-size: clamp(4rem, 22vw, 6rem);
  font-weight: 900;
  line-height: 1;
  margin-top: 10px;
  background: linear-gradient(180deg, #fff3c4, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}
.result-sub { color: var(--muted); font-weight: 600; margin-top: 2px; }
.badge-best {
  display: inline-block;
  margin-top: 14px;
  padding: 8px 14px;
  border-radius: 99px;
  background: rgba(247, 197, 72, 0.15);
  border: 1px solid rgba(247, 197, 72, 0.4);
  color: #ffe7a3;
  font-weight: 800;
  animation: pop 0.5s cubic-bezier(.2, 1.6, .4, 1);
}
.result-meta { color: var(--muted); margin: 14px 0 0; }
.result-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.result-stats div { padding: 12px; border-radius: 14px; background: rgba(0, 0, 0, 0.25); }
.result-stats span { display: block; color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; }
.result-stats b { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.result-actions { display: grid; gap: 10px; margin-top: 20px; }

@media (prefers-reduced-motion: reduce) {
  .hero-badge, .live-dot, .cd-num.pop, .badge-best, .stage.shake, .modal, .modal-box,
  body::before, .btn-primary, .btn-gold::after, .ripple, #view-hub > * { animation: none; }
}

/* ----- profile ----- */
.pf-id { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.pf-photo {
  position: relative;
  width: 76px; height: 76px;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  border: 2.5px solid rgba(247, 197, 72, 0.65);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  background: hsl(var(--h, 200) 55% 42%);
  display: grid; place-items: center;
  font-weight: 800; font-size: 1.5rem; color: #fff;
}
.pf-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pf-who { min-width: 0; display: grid; gap: 3px; color: var(--muted); font-size: 0.92rem; }
.pf-who b { color: var(--text); font-size: 1.15rem; }

.prize-ticket {
  position: relative;
  margin-bottom: 14px;
  padding: 18px 26px;
  text-align: center;
  border-radius: var(--radius);
  border: 1.5px dashed rgba(247, 197, 72, 0.65);
  background: linear-gradient(135deg, rgba(247, 197, 72, 0.16), rgba(247, 197, 72, 0.04)), var(--bg-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 30px rgba(0, 0, 0, 0.25);
}
/* ticket notches */
.prize-ticket::before, .prize-ticket::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px dashed rgba(247, 197, 72, 0.65);
}
.prize-ticket::before { left: -13px; transform: translateY(-50%); }
.prize-ticket::after { right: -13px; transform: translateY(-50%); }
.pf-prize.text { font-size: 1.9rem; line-height: 1.25; padding: 6px 0; }
.pf-prize {
  font-size: 3rem;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 2px 16px rgba(247, 197, 72, 0.4);
  animation: pop 0.5s cubic-bezier(.2, 1.6, .4, 1);
}
.prize-ticket .btn { margin-top: 10px; }

.pf-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.pf-stat { padding: 12px 14px; display: grid; gap: 2px; }
.pf-stat span { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
.pf-stat b { font-size: 1.35rem; }
.pf-bests { display: grid; gap: 8px; margin-top: 10px; }
.pf-best {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}
.pf-best span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pf-best small { color: var(--muted); }
.pf-best b { color: var(--gold); font-variant-numeric: tabular-nums; }

/* Wider phones and tablets: two columns of game cards, roomier page. */
@media (min-width: 600px) {
  .view { max-width: 820px; }
  .games { grid-template-columns: 1fr 1fr; }
}

/* The hub glides in, section by section. */
#view-hub > * { animation: rise 0.4s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
#view-hub > *:nth-child(2) { animation-delay: 0.05s; }
#view-hub > *:nth-child(3) { animation-delay: 0.1s; }
#view-hub > *:nth-child(4) { animation-delay: 0.15s; }
#view-hub > *:nth-child(5) { animation-delay: 0.2s; }
#view-hub > *:nth-child(n + 6) { animation-delay: 0.25s; }

/* ----- Tap Frenzy ----- */
.frenzy { --heat: 0; flex: 1; min-height: 0; position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(8px, 2vh, 18px); padding: 10px 16px; }
.frenzy-hint { margin: 0; color: var(--muted); font-size: clamp(0.85rem, 2.8vw, 1rem); text-align: center; min-height: 1.4em; }
.frenzy-wrap { position: relative; width: min(76vw, 42dvh, 360px); height: min(76vw, 42dvh, 360px); flex: none; margin: 16px 0 12px; }
.frenzy-ring { position: absolute; inset: -11px; width: calc(100% + 22px); height: calc(100% + 22px); transform: rotate(-90deg); pointer-events: none; }
.frenzy-ring circle { fill: none; stroke-width: 5; }
.frenzy-ring .track { stroke: rgba(255, 255, 255, 0.12); }
.frenzy-ring .left { stroke: var(--gold); stroke-linecap: round; transition: stroke-dashoffset 0.1s linear; }
.frenzy-btn {
  width: 100%; height: 100%;
  border: 0; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f9a8d4, #ec4899 55%, #9d174d);
  box-shadow: 0 0 0 calc(6px + var(--heat) * 22px) rgba(236, 72, 153, calc(0.18 + var(--heat) * 0.35)), 0 18px 50px rgba(236, 72, 153, 0.45);
  color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: box-shadow 0.25s, background 0.4s;
}
.frenzy[data-tier="1"] .frenzy-btn { background: radial-gradient(circle at 35% 30%, #fda4af, #f43f5e 55%, #9f1239); box-shadow: 0 0 0 calc(6px + var(--heat) * 22px) rgba(244, 63, 94, calc(0.18 + var(--heat) * 0.35)), 0 18px 50px rgba(244, 63, 94, 0.45); }
.frenzy[data-tier="2"] .frenzy-btn { background: radial-gradient(circle at 35% 30%, #fdba74, #f97316 55%, #9a3412); box-shadow: 0 0 0 calc(6px + var(--heat) * 22px) rgba(249, 115, 22, calc(0.18 + var(--heat) * 0.35)), 0 18px 50px rgba(249, 115, 22, 0.5); }
.frenzy[data-tier="3"] .frenzy-btn { background: radial-gradient(circle at 35% 30%, #fde68a, #f7c548 55%, #b45309); box-shadow: 0 0 0 28px rgba(247, 197, 72, 0.45), 0 18px 60px rgba(247, 197, 72, 0.6); animation: feverPulse 0.45s ease-in-out infinite alternate; }
@keyframes feverPulse { from { transform: scale(1); } to { transform: scale(1.04); } }
.frenzy-btn.hit { animation: frenzyHit 0.1s ease-out; }
.frenzy[data-tier="3"] .frenzy-btn.hit { animation: frenzyHit 0.1s ease-out, feverPulse 0.45s ease-in-out infinite alternate; }
@keyframes frenzyHit { 50% { transform: scale(0.94); } }
.frenzy.final .frenzy-btn { filter: grayscale(0.4); animation: none; transition: filter 0.4s; }
.frenzy.final .frenzy-count { animation: pop 0.5s cubic-bezier(.2, 1.6, .4, 1); }
.frenzy-count { font-size: clamp(3rem, 20vw, 5.6rem); font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; text-shadow: 0 4px 16px rgba(0, 0, 0, 0.35); }
.frenzy-sub { font-size: clamp(0.7rem, 2.4vw, 0.85rem); letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.85; }
.frenzy-tier { font-weight: 900; color: var(--gold); font-size: clamp(0.95rem, 3.4vw, 1.2rem); font-variant-numeric: tabular-nums; min-height: 1.4em; text-align: center; }
.frenzy[data-tier="3"] .frenzy-tier { animation: urgentPulse 0.4s infinite alternate; }
.frenzy-pop { position: absolute; left: 50%; top: 12%; transform: translateX(-50%); font-weight: 900; font-size: clamp(1.2rem, 5vw, 1.6rem); white-space: nowrap; pointer-events: none; z-index: 2; animation: frenzyPop 0.9s ease-out forwards; }
@keyframes frenzyPop { from { opacity: 0; transform: translate(-50%, 10px) scale(0.6); } 25% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } to { opacity: 0; transform: translate(-50%, -30px) scale(1); } }
.frenzy-plus { position: absolute; transform: translate(-50%, -50%); font-weight: 900; font-size: 1.25rem; color: #fff; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); pointer-events: none; z-index: 2; animation: frenzyPlus 0.6s ease-out forwards; }
@keyframes frenzyPlus { to { transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% - 70px)) scale(1.3); opacity: 0; } }
.frenzy-ripple { position: absolute; width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.85); transform: translate(-50%, -50%); pointer-events: none; animation: frenzyRipple 0.5s ease-out forwards; }
@keyframes frenzyRipple { to { transform: translate(-50%, -50%) scale(4); opacity: 0; } }
@media (max-height: 600px) { .frenzy { gap: 6px; } .frenzy-hint { font-size: 0.8rem; } }

/* ===== BNI Game Arena: join tabs, team hub, section titles ===== */
.join-tabs { display: flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 14px; }
.join-tabs button { flex: 1; border: 0; background: transparent; padding: 12px; font-weight: 800; color: var(--muted); font-size: 1rem; cursor: pointer; }
.join-tabs button.on { background: var(--gold); color: #1d1503; }
.sec-title { margin: 20px 2px 10px; font-size: 1.05rem; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sec-title small { color: var(--muted); font-weight: 600; font-size: 0.8rem; }
.team-card { display: block; }
.team-card .btn { animation: none; }
.team-card #team-join { animation: pulseBtn 1.2s infinite; width: 100%; margin-top: 12px; }
.team-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.team-standing { text-align: right; flex: none; }
.team-standing .rank-num { font-size: 1.5rem; font-weight: 900; line-height: 1.1; }
.team-standing .rank-of { font-size: 0.72rem; color: var(--muted); }
.team-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.team-members { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.member-chip { padding: 4px 10px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); font-size: 0.8rem; font-weight: 700; }
.member-chip.me { background: color-mix(in srgb, var(--accent) 30%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent); }
.team-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.team-code { font-size: 0.85rem; color: var(--muted); margin-right: auto; }
.team-code b { color: #fff; font-size: 1rem; letter-spacing: 2px; background: rgba(255, 255, 255, 0.08); padding: 3px 8px; border-radius: 8px; }
.btn-sm { padding: 8px 12px; font-size: 0.85rem; }
.team-list { max-height: 50vh; overflow: auto; display: grid; gap: 4px; margin: 8px 0; }
.team-list .mini-row small { display: block; font-weight: 500; color: var(--muted); font-size: 0.72rem; }

/* ===== Welcome spin: one free Spin & Win wheel on arrival ===== */
.spin-stage { display: grid; gap: 18px; justify-items: center; text-align: center; margin-top: 4vh; }
.spin-stage h2 { font-size: 1.8rem; }
.spin-box { position: relative; width: min(82vw, 46dvh, 360px); }
.spin-pointer {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  color: var(--gold); font-size: 1.7rem; line-height: 1; z-index: 2;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.6));
}
#spin-wheel {
  display: block; width: 100%; aspect-ratio: 1; border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(90, 49, 21, 0.55), 0 18px 50px rgba(0, 0, 0, 0.5);
  transition: transform 4.5s cubic-bezier(0.15, 0.7, 0.1, 1);
  will-change: transform;
}
#spin-wheel text { fill: #fff; font-weight: 900; text-anchor: middle; paint-order: stroke; stroke: rgba(0, 0, 0, 0.45); stroke-width: 2px; }
.spin-result { min-height: 2.4rem; }
.spin-prize { font-size: 1.7rem; font-weight: 900; color: var(--gold); animation: pop 0.5s cubic-bezier(.2, 1.6, .4, 1); display: inline-block; }
#spin-btn { min-width: 60%; }

/* ===== Power Connections: my QR, the scanner, members met ===== */
.cx-qr { text-align: center; }
.cx-qr-img {
  width: min(62vw, 240px); margin: 6px auto 10px;
  background: #fff; border-radius: 16px; padding: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.cx-qr-img img { display: block; width: 100%; aspect-ratio: 1; }
.cx-code { font-size: 1.5rem; font-weight: 900; letter-spacing: 6px; margin-bottom: 8px; color: var(--gold); }
.cx-actions { display: grid; gap: 10px; }
.cx-row { display: flex; gap: 8px; }
.cx-row .txt { flex: 1; text-transform: uppercase; letter-spacing: 2px; }
.cx-met-list { display: grid; gap: 8px; }
.cx-met-row {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 10px;
}
.cx-met-who { flex: 1; min-width: 0; line-height: 1.25; }
.cx-met-who small { display: block; color: var(--muted); font-size: 0.72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(5, 8, 15, 0.96);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 20px;
}
.scan-overlay video {
  width: min(92vw, 420px); aspect-ratio: 1; object-fit: cover;
  border-radius: 18px; background: #000;
}
.scan-frame {
  position: absolute; width: min(60vw, 250px); aspect-ratio: 1;
  border: 3px solid var(--gold); border-radius: 18px;
  box-shadow: 0 0 0 2000px rgba(5, 8, 15, 0.35);
  pointer-events: none;
  animation: pulseBtn 1.4s infinite;
}

/* ------------------------------------------------------------------ quick maths */
.qm { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.qm-hint { text-align: center; color: var(--muted); margin: 0; }
.qm-sum-wrap {
  flex: 1;
  position: relative;
  display: grid; place-items: center;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  transition: background 0.15s;
}
.qm-sum-wrap.ok { background: rgba(34, 197, 94, 0.15); }
.qm-sum-wrap.no { background: rgba(227, 38, 58, 0.2); }
.qm-sum-wrap.final { animation: finalPulse 0.5s infinite alternate; }
.qm-sum { font-size: clamp(2.4rem, 13vw, 4rem); font-weight: 900; font-variant-numeric: tabular-nums; }
.qm-sum.pop { animation: wordPop 0.18s; }
.qm-pop {
  position: absolute; left: 50%; top: 14%;
  transform: translateX(-50%);
  font-weight: 900; font-size: 1.3rem;
  color: var(--gold);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  animation: floatUp 0.9s ease-out forwards;
}
.qm-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.qm-btn {
  min-height: 72px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(160deg, #10b981, #0b7a57);
  color: #fff;
  font-weight: 900;
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.2);
  touch-action: none;
}
.qm-btn:active { transform: scale(0.96); }
.shake-no { animation: shake 0.25s; }

/* ------------------------------------------------------------------ perfect timing */
.pt { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.pt-pad {
  flex: 1;
  border: 0;
  border-radius: 26px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: #fff;
  touch-action: none;
  transition: background 0.2s;
  background: linear-gradient(160deg, #1e2a52, #121933);
}
.pt-pad.running { background: linear-gradient(160deg, #d97706, #92400e); }
.pt-pad.running.blind { background: linear-gradient(160deg, #273352, #141b36); }
.pt-pad.great { background: linear-gradient(160deg, #22c55e, #15803d); }
.pt-clock { font-size: clamp(3rem, 18vw, 5rem); font-weight: 900; font-variant-numeric: tabular-nums; }
.pt-sub { font-size: 1.02rem; opacity: 0.85; text-align: center; padding: 0 16px; }
.pt-dots { display: flex; justify-content: center; gap: 10px; }
.pt-dots i { width: 12px; height: 12px; border-radius: 50%; background: rgba(255, 255, 255, 0.15); }
.pt-dots i.done { background: var(--gold); }

/* ------------------------------------------------------------------ number hunt */
.hunt { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.hunt-hint { text-align: center; color: var(--muted); margin: 0; }
.hunt-hint b, .hunt-next { color: var(--gold); font-size: 1.2em; }
.hunt-grid {
  flex: 1;
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr;
  gap: 10px;
}
.hunt-grid.final { animation: finalPulse 0.5s infinite alternate; border-radius: 16px; }
.hunt-cell {
  border: 0;
  border-radius: 16px;
  background: linear-gradient(160deg, #27335f, #1a2347);
  color: var(--text);
  font-weight: 900;
  font-size: clamp(1.2rem, 6vw, 1.7rem);
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.25);
  touch-action: none;
  transition: transform 0.15s, opacity 0.25s, background 0.15s;
}
.hunt-cell.found {
  background: linear-gradient(160deg, #22c55e, #15803d);
  color: #06240f;
  transform: scale(0.9);
  opacity: 0.3;
}
.hunt-grid.won .hunt-cell.found { opacity: 0.85; transform: scale(1); }
.hunt-cell.shake-no { background: linear-gradient(160deg, #b8162a, #6d0d1a); color: #fff; }
.hunt-spark {
  position: absolute;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--gold);
  pointer-events: none;
  animation: sparkFly 0.5s ease-out forwards;
}
@keyframes sparkFly { to { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; } }

/* ------------------------------------------------------------------ balloon burst */
.bal { flex: 1; display: flex; flex-direction: column; gap: 10px; position: relative; }
.bal-sky {
  flex: 1;
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.08), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
}
.bal-sky.done .bal-b { animation-play-state: paused; opacity: 0.35; transition: opacity 0.4s; }
.bal-b {
  position: absolute;
  bottom: -150px;
  width: 60px; height: 76px;
  border: 0;
  padding: 0;
  display: grid; place-items: center;
  font-size: 1.5rem;
  color: #1d1503;
  background: radial-gradient(circle at 35% 28%, color-mix(in srgb, var(--c) 45%, #fff), var(--c) 55%, color-mix(in srgb, var(--c) 65%, #000));
  border-radius: 50% 50% 48% 52% / 56% 56% 44% 44%;
  animation: balRise var(--dur) linear forwards;
  touch-action: none;
  z-index: 1;
}
.bal-b::after {
  content: '';
  position: absolute;
  top: 99%; left: 50%;
  width: 2px; height: 26px;
  background: rgba(255, 255, 255, 0.35);
}
.bal-b.gold {
  width: 70px; height: 88px;
  --c: #f7c548;
  background: radial-gradient(circle at 35% 28%, #ffeeb0, #f7c548 55%, #a8720a);
  box-shadow: 0 0 20px rgba(247, 197, 72, 0.55);
}
@keyframes balRise {
  50% { transform: translateY(calc(var(--rise) / 2)) translateX(var(--sway)); }
  to { transform: translateY(var(--rise)) translateX(0); }
}
.bal-scrap {
  position: absolute;
  width: 10px; height: 10px;
  border-radius: 50% 0 50% 50%;
  pointer-events: none;
  z-index: 2;
  animation: sparkFly 0.6s ease-out forwards;
}
.bal-plus {
  position: absolute;
  font-weight: 900;
  font-size: 1.15rem;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  z-index: 2;
  animation: balPlus 0.75s ease-out forwards;
}
.bal-plus.gold { color: var(--gold); font-size: 1.45rem; }
@keyframes balPlus { to { transform: translateY(-48px); opacity: 0; } }

/* ------------------------------------------------------------------ bullseye */
.be { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.be-hint { text-align: center; color: var(--muted); margin: 0; }
.be-pad {
  flex: 1;
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  touch-action: none;
}
.be-bar {
  position: relative;
  width: 88%;
  height: 54px;
  border-radius: 14px;
  background: linear-gradient(90deg,
    #6d0d1a 0%, #b45309 22%, var(--gold) 36%,
    #fff3c4 47%, #fff3c4 53%,
    var(--gold) 64%, #b45309 78%, #6d0d1a 100%);
  box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.45);
}
.be-marker {
  position: absolute;
  top: -8px; bottom: -8px;
  left: 50%;
  width: 7px;
  margin-left: -3.5px;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}
.be-marker.stopped { background: var(--gold); box-shadow: 0 0 14px rgba(247, 197, 72, 0.9); }
.be-result {
  min-height: 2rem;
  font-weight: 900;
  font-size: 1.3rem;
  opacity: 0;
  transform: scale(0.8);
  transition: 0.15s;
}
.be-result.show { opacity: 1; transform: scale(1); }
.be-result.bull { color: var(--gold); font-size: 1.55rem; }
.be-result.gold { color: var(--gold); }
.be-dots { display: flex; justify-content: center; gap: 8px; }
.be-dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.15); }
.be-dots i.done { background: var(--gold); }

/* ------------------------------------------------------------------ follow the lead */
.cup { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.cup-hint { text-align: center; color: var(--muted); margin: 0; min-height: 1.4em; }
.cup-stage {
  flex: 1;
  position: relative;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}
.cup-case {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 29%;
  aspect-ratio: 1;
  border: 0;
  padding: 0;
  background: none;
  display: grid; place-items: center;
  font-size: clamp(3rem, 16vw, 4.6rem);
  transform: translate(calc(-50% + (var(--slot) - 1) * 112%), -50%);
  transition: transform 0.32s ease-in-out;
  touch-action: none;
  z-index: 2;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.45));
}
.cup-case.over { z-index: 3; }
.cup-case.up { transform: translate(calc(-50% + (var(--slot) - 1) * 112%), calc(-50% - 52px)); }
.cup-case.won { filter: drop-shadow(0 0 18px rgba(247, 197, 72, 0.8)); }
.cup-case.lost { filter: grayscale(0.8) drop-shadow(0 8px 12px rgba(0, 0, 0, 0.45)); }
.cup-pick .cup-case { animation: pulseBtn 1s infinite; }
.cup-money {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: clamp(1.8rem, 9vw, 2.6rem);
  transform: translate(calc(-50% + (var(--slot) - 1) * 112%), calc(-50% + 14px));
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 1;
  pointer-events: none;
}
.cup-money.show { opacity: 1; }
.cup-dots { display: flex; justify-content: center; gap: 10px; }
.cup-dots i { width: 12px; height: 12px; border-radius: 50%; background: rgba(255, 255, 255, 0.15); }
.cup-dots i.done { background: var(--gold); }
.cup-dots i.done.miss { background: rgba(227, 38, 58, 0.75); }

/* ------------------------------------------------------------------ higher or lower */
.hl { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.hl-hint { text-align: center; color: var(--muted); margin: 0; }
.hl-card-wrap {
  flex: 1;
  position: relative;
  display: grid; place-items: center;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  transition: background 0.15s;
}
.hl-card-wrap.ok { background: rgba(34, 197, 94, 0.15); }
.hl-card-wrap.no { background: rgba(227, 38, 58, 0.2); }
.hl-card-wrap.final { animation: finalPulse 0.5s infinite alternate; }
.hl-card {
  width: min(42vw, 170px);
  aspect-ratio: 5 / 7;
  border-radius: 16px;
  background: #f7f6f2;
  color: #16213f;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}
.hl-card b { font-size: clamp(2.6rem, 14vw, 4rem); line-height: 1; }
.hl-card span { font-size: clamp(1.6rem, 9vw, 2.4rem); }
.hl-card.red { color: #c21f33; }
.hl-card.pop { animation: wordPop 0.18s; }
.hl-pop {
  position: absolute; left: 50%; top: 10%;
  transform: translateX(-50%);
  font-weight: 900; font-size: 1.3rem;
  color: var(--gold);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  animation: floatUp 0.9s ease-out forwards;
}
.hl-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hl-btn {
  min-height: 72px;
  border: 0;
  border-radius: 18px;
  color: #fff;
  font-weight: 900;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.2);
  touch-action: none;
}
.hl-btn.hi { background: linear-gradient(160deg, #22c55e, #15803d); }
.hl-btn.lo { background: linear-gradient(160deg, #6366f1, #4338ca); }
.hl-btn:active { transform: scale(0.96); }

