/* ============ Team badge ============ */
.tbadge {
  --tb-sz: 26px;
  width: var(--tb-sz); height: var(--tb-sz); flex: none;
  display: inline-grid; place-items: center; border-radius: 50%;
  background: var(--tb-bg); color: var(--tb-ink);
  font-family: var(--font-num); font-weight: 800; font-size: var(--tb-fs, 10px); letter-spacing: -.2px; line-height: 1;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .28), 0 1px 2px rgba(0, 0, 0, .15);
  overflow: hidden;
}
:root[data-theme="dark"] .tbadge { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .22), 0 0 0 1px rgba(255, 255, 255, .14); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tbadge { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .22), 0 0 0 1px rgba(255, 255, 255, .14); } }

/* ============ Odometer ============ */
.odo { display: inline-flex; align-items: center; justify-content: flex-end; line-height: 1; }
.odo-digits { display: inline-flex; }
.odo-col { display: inline-block; height: 1em; overflow: hidden; width: .62em; text-align: center; }
.odo-strip { display: flex; flex-direction: column; transition: transform 650ms cubic-bezier(.2, .9, .25, 1.15); will-change: transform; }
.odo-strip > span { display: block; height: 1em; line-height: 1; }
.odo-sym { display: inline-block; min-width: .62em; text-align: center; color: var(--text-3); }
@media (prefers-reduced-motion: reduce) { .odo-strip { transition: none; } }

/* ============ Mini diamond ============ */
.diamond-wrap { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; }
.diamond .base { fill: transparent; stroke: var(--line-2); stroke-width: 1.4; transition: fill var(--dur); }
.diamond .base.on { fill: var(--cheer); stroke: var(--cheer); }
.outs { display: inline-flex; gap: 4px; }
.out-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); }
.out-dot.on { background: var(--live); }

/* ============ Game card ============ */
.gcard {
  position: relative; display: block; overflow: hidden;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-1);
  color: inherit; text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast);
}
.gcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--lg); }
:root[data-theme="dark"] .gcard::before { background: var(--lg-d, var(--lg)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gcard::before { background: var(--lg-d, var(--lg)); } }
.gcard:hover { box-shadow: var(--shadow-2); }
.gcard:active { transform: scale(.99); }
.gc-head { display: flex; align-items: center; gap: 6px; padding: 9px 12px 2px 16px; font-size: 12px; color: var(--text-2); min-width: 0; }
.gc-league { font-weight: 800; color: var(--text); flex: none; }
.gc-venue { min-width: 0; flex: 0 1 auto; }
.gc-status { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-weight: 800; font-size: 12.5px; color: var(--text-2); flex: none; font-variant-numeric: tabular-nums; }
.gc-status.st-live { color: var(--live); }
.gc-status.st-final { color: var(--text); }
.gc-status.st-postponed { color: var(--warn); }
.gc-hr {
  flex: none; height: 20px; padding: 0 7px; border-radius: 999px; display: inline-flex; align-items: center;
  background: linear-gradient(90deg, #FF5A1F, #F5B301); color: #fff; font-size: 11px; font-weight: 800;
  box-shadow: 0 2px 8px rgba(255, 90, 31, .4);
}
.live-dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--live); display: inline-block; flex: none; }
.live-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--live); animation: live-ping 1.6s ease-out infinite; }
@keyframes live-ping { 0% { transform: scale(1); opacity: .6; } 80%, 100% { transform: scale(2.6); opacity: 0; } }
.gc-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 4px 12px 10px 16px; }
.gc-teams { display: grid; gap: 2px; min-width: 0; }
.gc-team { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 9px; height: 32px; border-radius: 8px; padding-right: 2px; }
.gc-name { font-size: 15px; font-weight: 600; }
.gc-team.win .gc-name, .gc-team.win .gc-score { font-weight: 800; color: var(--text); }
.gc-team.lose .gc-name, .gc-team.lose .gc-score { color: var(--text-2); }
.gc-score { font-family: var(--font-num); font-weight: 800; font-size: 24px; letter-spacing: -.5px; color: var(--text); font-stretch: condensed; }
.gcard[data-status="scheduled"] .gc-score { color: var(--text-3); font-size: 18px; }
.gc-side { display: grid; place-items: center; padding-left: 10px; border-left: 1px solid var(--line); min-height: 52px; }
.gc-flash { position: absolute; inset: 0 -6px; border-radius: 8px; background: var(--tc); opacity: 0; pointer-events: none; z-index: 0; mix-blend-mode: normal; }
.gc-flash { background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--tc) 32%, transparent) 30%, color-mix(in srgb, var(--tc) 32%, transparent) 70%, transparent); }
.gc-team > :not(.gc-flash):not(.gc-plus) { position: relative; z-index: 1; }
.gc-plus { position: absolute; right: -4px; top: -6px; z-index: 2; font-size: 13px; font-weight: 900; color: var(--win); pointer-events: none; }
.gcard-skel .gc-team { grid-template-columns: 24px auto; }

/* ============ Avatar + frames ============ */
.avatar {
  --sz: 36px;
  --ring: max(2px, calc(var(--sz) * .085));
  position: relative; flex: none; display: inline-grid; place-items: center;
  width: var(--sz); height: var(--sz); border-radius: 50%;
  background: var(--av-bg, #E8EEF7);
  font-size: calc(var(--sz) * .56); line-height: 1;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .06);
  isolation: isolate;
}
.av-emoji { position: relative; z-index: 1; transform: translateY(1%); font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.avatar[class*="fr-"] { margin: calc(var(--ring) + 1px); }
.avatar[class*="fr-"]::before {
  content: ""; position: absolute; inset: calc(var(--ring) * -1 - 1px); border-radius: 50%; z-index: 2; pointer-events: none;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--ring)), #000 calc(100% - var(--ring) + .6px));
  mask: radial-gradient(farthest-side, transparent calc(100% - var(--ring)), #000 calc(100% - var(--ring) + .6px));
}
.avatar[class*="fr-"]::after { content: ""; position: absolute; pointer-events: none; z-index: 3; }

/* silver — brushed metal */
.avatar.fr-silver::before { background: conic-gradient(from 20deg, #FDFEFF, #9BA6B5, #E6EBF1, #7D8898, #FAFCFE, #A9B3C1, #FDFEFF); }
.avatar.fr-silver::after { inset: calc(var(--ring) * -1 - 1px); border-radius: 50%; box-shadow: 0 1px 3px rgba(60, 72, 90, .35); }
/* gold — polished gold + crown gem */
.avatar.fr-gold::before { background: conic-gradient(from 0deg, #FFF6C2, #D9A21B, #FFE680, #A8760A, #FFF2A6, #E3B33B, #FFF6C2); }
.avatar.fr-gold::after {
  content: "◆"; top: calc(var(--ring) * -2.1); left: 50%; transform: translateX(-50%);
  font-size: max(7px, calc(var(--sz) * .2)); line-height: 1; color: #FFD54A;
  text-shadow: 0 0 0 #A8760A, 0 1px 1px rgba(120, 80, 0, .6), 0 0 6px rgba(255, 213, 74, .8);
}
/* neon — cyan/magenta glow (static) */
.avatar.fr-neon::before { background: conic-gradient(from 0deg, #00E5FF, #7C4DFF, #FF2BD6, #7C4DFF, #00E5FF); }
.avatar.fr-neon::after {
  inset: calc(var(--ring) * -1 - 1px); border-radius: 50%;
  box-shadow: 0 0 6px 1px rgba(0, 229, 255, .75), 0 0 14px 2px rgba(255, 43, 214, .45), inset 0 0 6px rgba(124, 77, 255, .5);
}
/* flame — rotating fire ring + flicker (animated) */
.avatar.fr-flame::before {
  background: conic-gradient(from 0deg, #FF1E00, #FF7A00, #FFD000, #FF7A00, #FF1E00, #FF5A00, #FFC400, #FF1E00);
  animation: ring-spin 2.2s linear infinite;
}
.avatar.fr-flame::after {
  inset: calc(var(--ring) * -1 - 1px); border-radius: 50%;
  box-shadow: 0 0 10px 3px rgba(255, 98, 0, .7), 0 -4px 12px 2px rgba(255, 196, 0, .45);
  animation: flicker 1.1s steps(1, end) infinite;
}
/* rainbow — rotating spectrum (animated) */
.avatar.fr-rainbow::before {
  background: conic-gradient(#FF3B30, #FF9500, #FFCC00, #34C759, #00C7BE, #007AFF, #AF52DE, #FF2D55, #FF3B30);
  animation: ring-spin 3s linear infinite;
}
.avatar.fr-rainbow::after {
  inset: calc(var(--ring) * -1 - 2px); border-radius: 50%;
  box-shadow: 0 0 10px 2px rgba(255, 255, 255, .5), 0 0 16px 3px rgba(175, 82, 222, .35);
  animation: pulse-op 2s ease-in-out infinite;
}
/* diamond — icy facets + sparkle (animated) */
.avatar.fr-diamond { --ring: max(3px, calc(var(--sz) * .11)); }
.avatar.fr-diamond::before {
  background: conic-gradient(from 0deg, #FFFFFF, #8FE3FF, #E0F7FF, #4FC3F7, #FFFFFF, #B388FF, #E8F8FF, #7FDBFF, #FFFFFF);
  animation: ring-spin 6s linear infinite;
}
.avatar.fr-diamond::after {
  content: "✦"; top: calc(var(--ring) * -1.6); right: calc(var(--ring) * -1.2);
  font-size: max(9px, calc(var(--sz) * .3)); line-height: 1; color: #FFFFFF;
  text-shadow: 0 0 4px #7FDBFF, 0 0 10px #4FC3F7;
  animation: twinkle 1.8s ease-in-out infinite;
}
@keyframes ring-spin { to { transform: rotate(360deg); } }
@keyframes flicker { 0% { opacity: 1; } 18% { opacity: .65; } 33% { opacity: .95; } 52% { opacity: .7; } 70% { opacity: 1; } 86% { opacity: .8; } }
@keyframes pulse-op { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes twinkle { 0%, 100% { opacity: .25; transform: scale(.6) rotate(0deg); } 45% { opacity: 1; transform: scale(1.15) rotate(25deg); } }

/* ============ Level badge / nickname ============ */
.lv {
  display: inline-flex; align-items: center; height: 16px; padding: 0 5px; border-radius: 4px; flex: none;
  font-family: var(--font-num); font-size: 10.5px; font-weight: 800; letter-spacing: .2px; color: #fff; line-height: 1;
}
.lv-t1 { background: #94A3B8; }
.lv-t2 { background: #3B82F6; }
.lv-t3 { background: #8B5CF6; }
.lv-t4 { background: linear-gradient(90deg, #F97316, #EF4444); }
.lv-t5 { background: linear-gradient(90deg, #F5B301, #FF5A1F); box-shadow: 0 0 0 1px rgba(255, 213, 74, .6); }
.nick { font-weight: 700; color: var(--text); }
.nick.has-color { color: var(--nc); }
:root[data-theme="dark"] .nick.has-color { filter: brightness(1.25) saturate(1.05); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .nick.has-color { filter: brightness(1.25) saturate(1.05); } }

/* ============ Chat bubbles ============ */
.bubble {
  position: relative; display: inline-block; max-width: 100%;
  padding: 7px 12px; border-radius: 4px 16px 16px 16px;
  background: var(--bubble-bg); color: var(--bubble-ink);
  font-size: 14.5px; line-height: 1.45; overflow-wrap: anywhere; word-break: break-word;
  isolation: isolate;
}
.bubble.big { font-size: 17px; font-weight: 700; }
.bubble-text { position: relative; z-index: 1; }
.msg.mine .bubble { border-radius: 16px 4px 16px 16px; }

.bb-sky {
  background: linear-gradient(165deg, #F0F8FF 0%, #CFE8FF 100%); color: #0B3A66;
  box-shadow: inset 0 0 0 1px #A9D3FF, 0 2px 6px rgba(56, 145, 230, .18);
}
.bb-sky::before { content: ""; position: absolute; left: 10px; top: 4px; width: 40%; height: 35%; border-radius: 999px; background: linear-gradient(180deg, rgba(255, 255, 255, .85), rgba(255, 255, 255, 0)); z-index: 0; }
.bb-mint {
  background: linear-gradient(165deg, #F1FDF7 0%, #C6F0DC 100%); color: #0D4D36;
  box-shadow: inset 0 0 0 1px #8EDDBE, 0 2px 6px rgba(22, 163, 106, .16);
}
.bb-mint::after { content: "🍃"; position: absolute; right: -6px; bottom: -6px; font-size: 13px; z-index: 2; }
.bb-gold {
  background: linear-gradient(140deg, #FFF8DA 0%, #FFE07A 42%, #F2B705 100%); color: #4A3300;
  box-shadow: inset 0 0 0 1px #D9A400, inset 0 1px 0 rgba(255, 255, 255, .8), 0 3px 8px rgba(217, 164, 0, .35);
  font-weight: 600;
}
.bb-gold::after { content: "✦"; position: absolute; right: 6px; top: -7px; font-size: 12px; color: #FFF6C2; text-shadow: 0 0 4px #F5B301, 0 1px 1px #A8760A; z-index: 2; }
.bb-comic {
  background-color: #FFF27A;
  background-image: radial-gradient(rgba(0, 0, 0, .14) 1px, transparent 1.3px);
  background-size: 6px 6px;
  color: #111; font-weight: 800; letter-spacing: .2px;
  border: 2px solid #111; border-radius: 14px;
  box-shadow: 3px 3px 0 #111;
}
.msg.mine .bb-comic { border-radius: 14px; box-shadow: -3px 3px 0 #111; }
.bb-sakura {
  background: linear-gradient(150deg, #FFF3F7 0%, #FFD0E0 100%); color: #7A1E44;
  box-shadow: inset 0 0 0 1px #F8A8C4, 0 2px 8px rgba(240, 98, 146, .2);
}
.bb-sakura::after { content: "🌸"; position: absolute; right: -8px; top: -9px; font-size: 15px; z-index: 2; transform: rotate(15deg); }
.bb-neon {
  background: #120A2A; color: #F6ECFF;
  box-shadow: inset 0 0 0 1.5px #FF3CF2, 0 0 8px rgba(255, 60, 242, .75), inset 0 0 10px rgba(0, 229, 255, .35);
  text-shadow: 0 0 6px rgba(255, 60, 242, .85), 0 0 2px rgba(0, 229, 255, .6);
}
/* flame — flowing fire gradient + ember glow (animated) */
.bb-flame {
  background: #B71C00; color: #FFFFFF; overflow: hidden; font-weight: 600;
  box-shadow: 0 0 12px rgba(255, 98, 0, .55), inset 0 0 0 1px rgba(255, 213, 74, .55);
  text-shadow: 0 1px 2px rgba(80, 0, 0, .6);
}
.bb-flame::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 200%; z-index: 0;
  background: linear-gradient(100deg, #8E0E00 0%, #FF3D00 12%, #FF9100 22%, #FFC400 28%, #FF6D00 36%, #D50000 46%, #8E0E00 50%, #FF3D00 62%, #FF9100 72%, #FFC400 78%, #FF6D00 86%, #D50000 96%, #8E0E00 100%);
  animation: flow-x 2.4s linear infinite;
}
.bb-flame::after {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(circle at 18% 115%, rgba(255, 230, 0, .75), transparent 42%), radial-gradient(circle at 78% 125%, rgba(255, 140, 0, .8), transparent 48%);
  animation: flicker 1.2s steps(1, end) infinite;
}
/* galaxy — drifting nebula + twinkling stars (animated) */
.bb-galaxy {
  background: #140B33; color: #FFFFFF; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(160, 130, 255, .5), 0 0 10px rgba(110, 70, 255, .45);
  text-shadow: 0 0 6px rgba(180, 160, 255, .8);
}
.bb-galaxy::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 200%; z-index: 0;
  background: linear-gradient(90deg, #1A0B3D 0%, #3A1478 14%, #0B2A6B 28%, #5B1E8C 40%, #1A0B3D 50%, #3A1478 64%, #0B2A6B 78%, #5B1E8C 90%, #1A0B3D 100%);
  animation: flow-x 9s linear infinite;
  opacity: .95;
}
.bb-galaxy::after {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 30%, #fff, transparent 60%),
    radial-gradient(1px 1px at 28% 78%, #fff, transparent 60%),
    radial-gradient(1.4px 1.4px at 46% 20%, #E0D4FF, transparent 60%),
    radial-gradient(1px 1px at 63% 64%, #fff, transparent 60%),
    radial-gradient(1.6px 1.6px at 81% 32%, #fff, transparent 60%),
    radial-gradient(1px 1px at 92% 80%, #CFE3FF, transparent 60%),
    radial-gradient(1.2px 1.2px at 6% 86%, #fff, transparent 60%);
  animation: pulse-op 2.6s ease-in-out infinite;
}
@keyframes flow-x { from { transform: translateX(0); } to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
  .avatar.fr-flame::before, .avatar.fr-flame::after, .avatar.fr-rainbow::before, .avatar.fr-rainbow::after, .avatar.fr-diamond::before, .avatar.fr-diamond::after,
  .bb-flame::before, .bb-flame::after, .bb-galaxy::before, .bb-galaxy::after, .live-dot::after { animation: none; }
}

/* ============ Toast ============ */
#toast-root {
  position: fixed; left: 0; right: 0; top: calc(var(--topbar-h) + var(--safe-top) + 8px); z-index: 90;
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px;
}
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: min(560px, 100%);
  padding: 10px 14px 10px 10px; border-radius: 14px; background: #111827; color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25); font-size: 14px; font-weight: 600;
  animation: toast-in 260ms var(--ease-spring);
}
.toast.out { animation: toast-out 220ms ease-in forwards; }
.toast-ico { width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 13px; font-weight: 900; background: rgba(255, 255, 255, .14); }
.toast-ico .coin-ico { width: 24px; height: 24px; }
.toast-success .toast-ico { background: var(--win); }
.toast-error .toast-ico { background: var(--live); }
.toast-error { background: #2A1215; box-shadow: 0 10px 30px rgba(229, 50, 45, .25), inset 0 0 0 1px rgba(229, 50, 45, .4); }
.toast-coin .toast-ico { background: transparent; }
.toast-level .toast-ico { background: linear-gradient(135deg, #F5B301, #FF5A1F); }
:root[data-theme="dark"] .toast { background: #F3F4F6; color: #111827; }
:root[data-theme="dark"] .toast-ico { background: rgba(0, 0, 0, .1); }
:root[data-theme="dark"] .toast-error { background: #FFF1F1; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px) scale(.97); } }

/* ============ Sheet ============ */
.sheet-wrap { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: var(--overlay); opacity: 0; transition: opacity 220ms ease; }
.sheet {
  position: relative; width: 100%; max-width: 560px; max-height: min(88vh, 760px); overflow: auto; overscroll-behavior: contain;
  background: var(--card); color: var(--text); border-radius: 22px 22px 0 0;
  padding: 6px 18px calc(18px + var(--safe-bottom));
  box-shadow: var(--shadow-3);
  transform: translateY(100%); transition: transform 280ms var(--ease-out);
}
.sheet-wrap.in .sheet-backdrop { opacity: 1; }
.sheet-wrap.in .sheet { transform: none; }
.sheet-wrap.out .sheet-backdrop { opacity: 0; }
.sheet-wrap.out .sheet { transform: translateY(100%); }
.sheet-grip { width: 42px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 6px auto 4px; touch-action: none; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 6px 0 10px; touch-action: none; }
.sheet-title { flex: 1; font-size: 17px; font-weight: 800; }
.sheet-body .stack, .stack { display: flex; flex-direction: column; gap: 10px; }
html.sheet-open { overflow: hidden; } /* html only: keeps the sticky top bar stuck */
@media (min-width: 640px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 22px; padding-bottom: 20px; } }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-backdrop { transition: none; } }

/* ============ Coins / fx layer ============ */
#fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 85; overflow: hidden; }
.coin-fly { position: fixed; left: 0; top: 0; width: 22px; height: 22px; opacity: 0; will-change: transform, opacity; }
.coin-fly .coin-ico { width: 22px; height: 22px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .3)); }
.coin-sm { display: inline-flex; width: 16px; height: 16px; flex: none; }
.coin-sm .coin-ico { width: 16px; height: 16px; }
.coin-md { display: inline-flex; width: 28px; height: 28px; }
.coin-md .coin-ico { width: 28px; height: 28px; }

/* ============ Stage (live area) ============ */
.stage {
  position: relative; aspect-ratio: 16 / 9; width: 100%; overflow: hidden;
  border-radius: var(--radius); background: #0A1A33; box-shadow: var(--shadow-2); color: #fff;
  isolation: isolate; contain: layout paint;
}
.stage-media, .field, .field-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.field-svg { display: block; }
/* ---- video mode (SPEC §11.4): player under danmaku + HUD; controls move off the player UI ---- */
.stream-slot { position: absolute; inset: 0; background: #000; z-index: 1; }
.player { position: absolute; inset: 0; background: #000; }
.player-frame, .player-video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #000; object-fit: contain; }
.player-loading, .player-msg {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px;
  text-align: center; padding: 16px; color: rgba(255, 255, 255, .85); font-size: 13.5px;
}
.player-msg p { max-width: 280px; }
.player-msg-ico { font-size: 28px; line-height: 1; }
.stage[data-mode="video"] .field { visibility: hidden; }
.stage[data-mode="video"] .field-overlay, .stage[data-mode="video"] .field-caption, .stage[data-mode="video"] .bso-wrap { display: none; }
.stage[data-mode="video"] .stage-ctrl-br { bottom: auto; top: 46px; }
.stage[data-mode="video"] .scorebug { opacity: .9; transform: scale(.9); transform-origin: top left; }
.vt-lock { font-size: 10px; margin-left: 2px; }
/* fullscreen: whole stage (player + danmaku + HUD) */
.stage:fullscreen { aspect-ratio: auto; width: 100%; height: 100%; border-radius: 0; box-shadow: none; }
.stage:-webkit-full-screen { aspect-ratio: auto; width: 100%; height: 100%; border-radius: 0; }
.stage.stage-full {
  position: fixed; inset: 0; z-index: 95; aspect-ratio: auto; width: 100vw; height: 100vh; height: 100dvh;
  border-radius: 0; padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
}
html.stage-full-open { overflow: hidden; }
.stage:fullscreen .dm-item, .stage.stage-full .dm-item { font-size: 18px; line-height: 24px; }
.stage:fullscreen .dm-item.dm-big, .stage.stage-full .dm-item.dm-big { font-size: 28px; line-height: 50px; }

.f-base { fill: #FFFFFF; }
.f-fielder circle { fill: var(--fld); stroke: #fff; stroke-width: 1.4; }
.f-batter circle { fill: var(--bat); stroke: #fff; stroke-width: 1.6; }
.f-bat { stroke: #E7C08A; stroke-width: 2.6; stroke-linecap: round; }
.f-runner circle { fill: var(--bat); stroke: #fff; stroke-width: 2; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .5)); }
.f-ball circle { fill: #FFFFFF; stroke: #D7DCE3; stroke-width: .6; }
.f-ball-seam { fill: none; stroke: #E5322D; stroke-width: .7; }
.f-shadow { fill: rgba(0, 0, 0, .45); }
.f-ring { fill: none; stroke: #FFE58A; stroke-width: 2; }
.f-trail-path { fill: none; stroke: #FFFFFF; stroke-width: 1.6; stroke-dasharray: 3 4; stroke-linecap: round; opacity: 0; }
.f-trail-path.hr { stroke: #FFD54A; stroke-width: 2.2; }
.f-land circle { fill: rgba(255, 255, 255, .25); stroke: #fff; stroke-width: 1; }
.f-land path { stroke: #fff; stroke-width: 1.2; }
.f-spark { fill: #FFD54A; }
.f-pop { fill: #FFD54A; font-weight: 900; font-size: 14px; stroke: #0B1F3A; stroke-width: 3; paint-order: stroke; font-family: var(--font-num); }

.field-hud { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.scorebug {
  position: absolute; left: 8px; top: 8px; display: flex; align-items: stretch; gap: 0;
  background: rgba(8, 18, 36, .82); border-radius: 8px; overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(255, 255, 255, .08);
  font-size: 12px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.bug-rows { display: grid; }
.bug-row { display: flex; align-items: center; gap: 0; height: 20px; }
.bug-abbr { min-width: 38px; height: 100%; display: grid; place-items: center; padding: 0 6px; background: var(--tc); color: var(--ti, #fff); font-family: var(--font-num); font-weight: 800; letter-spacing: .3px; }
.bug-score { min-width: 24px; text-align: center; font-weight: 800; font-size: 14px; padding: 0 6px; }
.bug-row.batting .bug-score::after { content: "◂"; font-size: 9px; color: #FFD54A; margin-left: 2px; }
.bug-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 0 7px; border-left: 1px solid rgba(255, 255, 255, .12); }
.bug-inning { font-weight: 800; font-size: 12px; color: #FFD54A; }
.scorebug .diamond .base { stroke: rgba(255, 255, 255, .55); }
.scorebug .diamond .base.on { fill: #FFD54A; stroke: #FFD54A; }
.scorebug .out-dot { width: 5px; height: 5px; background: rgba(255, 255, 255, .3); }
.scorebug .out-dot.on { background: #FF6B5F; }

.bso-wrap { position: absolute; left: 8px; bottom: 8px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; max-width: 38%; }
.bso {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 9px; border-radius: 999px; background: rgba(8, 18, 36, .8);
  font-family: var(--font-num); font-size: 11px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.bso-grp { display: inline-flex; align-items: center; gap: 2.5px; }
.bso-grp b { font-weight: 800; margin-right: 1px; opacity: .85; }
.light { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .2); display: inline-block; }
.light.on.l-b { background: #22C55E; box-shadow: 0 0 6px #22C55E; }
.light.on.l-s { background: #FACC15; box-shadow: 0 0 6px #FACC15; }
.light.on.l-o { background: #EF4444; box-shadow: 0 0 6px #EF4444; }
.bso-pitch {
  max-width: 100%; padding: 3px 9px; border-radius: 999px; background: rgba(8, 18, 36, .8);
  font-size: 11.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bso-pitch:empty { display: none; }
.bso-pitch.c-strike { color: #FDE68A; }
.bso-pitch.c-ball { color: #86EFAC; }
.bso-pitch.c-inplay { color: #FDBA74; }
.field-caption {
  position: absolute; left: 50%; top: 8px; transform: translateX(-50%);
  max-width: calc(100% - 200px); padding: 5px 12px; border-radius: 999px;
  background: rgba(255, 90, 31, .92); color: #fff; font-size: 12.5px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
}
.field-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(5, 14, 30, .45); }
.ov-card {
  text-align: center; padding: 14px 22px; border-radius: 16px; background: rgba(8, 18, 36, .82);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(255, 255, 255, .1);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); max-width: 86%;
}
.ov-kicker { font-size: 12px; font-weight: 800; letter-spacing: 1px; color: #FFD54A; }
.ov-title { font-size: 26px; font-weight: 900; margin: 2px 0; }
.ov-sub { font-size: 14px; opacity: .9; }
.ov-hint { font-size: 12.5px; opacity: .75; margin-top: 6px; }
.ov-score { display: flex; align-items: baseline; justify-content: center; gap: 10px; font-size: 22px; font-weight: 800; margin: 4px 0; }
.ov-score .w { color: #FFD54A; }
.ov-colon { opacity: .6; }

.stage-ctrl-tr { position: absolute; right: 8px; top: 8px; z-index: 5; }
.stage-ctrl-br { position: absolute; right: 8px; bottom: 8px; z-index: 5; display: flex; align-items: center; gap: 6px; }
.stage-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: rgba(8, 18, 36, .72); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
}
.stage-btn svg { width: 16px; height: 16px; }
.stage-btn[aria-pressed="false"] { opacity: .55; }
.stage-btn[aria-pressed="false"]::after { content: ""; position: absolute; width: 18px; height: 2px; background: #fff; transform: rotate(-45deg); }
.dm-pop { display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(8, 18, 36, .82); font-size: 12px; }
.dm-opacity { width: 90px; accent-color: var(--cheer); }
.seg-dark { background: rgba(8, 18, 36, .72); padding: 2px; border-radius: 10px; }
.seg-dark button { color: rgba(255, 255, 255, .75); height: 26px; padding: 0 10px; font-size: 12px; }
.seg-dark button[aria-selected="true"] { background: #fff; color: #0B1F3A; }
.stage-fx { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }

/* ============ Danmaku ============ */
.danmaku { position: absolute; inset: 0; z-index: 2; overflow: hidden; pointer-events: none; opacity: var(--dm-opacity, .9); contain: strict; }
.dm-item {
  position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform;
  transform: translate3d(110vw, 0, 0);
  font-size: 15px; font-weight: 700; line-height: 22px; color: var(--dm-color, #fff);
  text-shadow: 0 0 2px rgba(0, 0, 0, .9), 0 1px 2px rgba(0, 0, 0, .8), 1px 0 1px rgba(0, 0, 0, .7), -1px 0 1px rgba(0, 0, 0, .7);
}
.dm-item.dm-big { font-size: 24px; line-height: 44px; font-weight: 900; }
.dm-item.dm-mine { padding: 0 6px; border-radius: 6px; box-shadow: inset 0 0 0 1.5px #FFD54A; background: rgba(0, 0, 0, .15); }

/* ============ Scoreboard ============ */
.scoreboard { margin-top: 12px; overflow: hidden; }
.ls-wrap { overflow-x: auto; scrollbar-width: thin; }
.linescore { width: 100%; font-size: 13.5px; text-align: center; }
.linescore th, .linescore td { padding: 7px 0; min-width: 24px; border-bottom: 1px solid var(--line); position: relative; }
.linescore thead th { font-size: 11.5px; color: var(--text-2); font-weight: 700; padding: 6px 0; }
.linescore thead th.cur { color: var(--cheer); }
.linescore .ls-team { text-align: left; padding-left: 12px; padding-right: 6px; white-space: nowrap; position: sticky; left: 0; background: var(--card); z-index: 1; }
.linescore .ls-team .tbadge { display: inline-grid; vertical-align: middle; margin-right: 6px; }
.ls-abbr { font-weight: 800; vertical-align: middle; }
.linescore tbody tr:last-child th, .linescore tbody tr:last-child td { border-bottom: 0; }
.linescore td.cur { background: var(--card-3); }
.linescore td.bat { background: color-mix(in srgb, var(--cheer) 12%, transparent); }
.linescore td.scored { font-weight: 800; color: var(--text); }
.linescore td { color: var(--text-2); }
.linescore .rhe { min-width: 30px; font-weight: 700; color: var(--text); }
.linescore th.rhe { color: var(--text-2); }
.linescore .rhe.r { border-left: 1px solid var(--line); font-weight: 900; font-size: 15px; }
.linescore th.rhe.r { font-size: 11.5px; }
.linescore .rhe.r.won { color: var(--win); }
.ls-flash { position: absolute; inset: 2px; border-radius: 6px; background: var(--cheer); opacity: 0; pointer-events: none; mix-blend-mode: multiply; }
:root[data-theme="dark"] .ls-flash { mix-blend-mode: screen; }
.matchup { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line); background: var(--card-2); font-size: 13px; }
.mu-people { display: flex; align-items: baseline; gap: 5px; flex: 1; min-width: 0; flex-wrap: wrap; }
.mu-role { color: var(--text-2); font-size: 11.5px; }
.mu-name { font-weight: 800; }
.mu-vs { color: var(--text-3); font-size: 11px; margin: 0 2px; }
.mu-right { display: flex; align-items: center; gap: 8px; flex: none; }
.mu-state { color: var(--text-2); font-size: 12px; font-weight: 700; }

/* ============ Cheer dock ============ */
.cheer-dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  padding: 0 calc(var(--gutter) + var(--safe-right)) var(--safe-bottom) calc(var(--gutter) + var(--safe-left));
  background: var(--tabbar-bg);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 24px rgba(17, 24, 39, .08);
  transition: transform 220ms var(--ease-out);
}
body.typing .cheer-dock { transform: translateY(110%); }
.dock-inner { max-width: var(--page-max); margin: 0 auto; padding: 8px 0 10px; }
.tug { display: grid; gap: 5px; overflow-x: clip; }
.tug-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.tug-side { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.tug-side.h { justify-content: flex-end; }
.tug-name { font-weight: 700; max-width: 7em; }
.tug-pct { font-weight: 900; font-size: 14px; }
.tug-side.a .tug-pct { color: var(--ca); }
.tug-side.h .tug-pct { color: var(--ch); }
:root[data-theme="dark"] .tug-pct { filter: brightness(1.35); }
.tug-tot { color: var(--text-2); font-size: 11.5px; }
.tug-bar { position: relative; height: 12px; border-radius: 999px; background: var(--ch); overflow: visible; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.tug-fill { position: absolute; inset: 0; border-radius: 999px 0 0 999px; background: var(--ca); transform-origin: left center; transform: scaleX(.5); transition: transform 600ms var(--ease-out); }
.tug-knot-wrap { position: absolute; inset: 0; transform: translateX(50%); transition: transform 600ms var(--ease-out); pointer-events: none; }
.tug-knot {
  position: absolute; left: -9px; top: -4px; width: 18px; height: 20px; border-radius: 6px;
  background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35), inset 0 0 0 2px var(--cheer);
}
.tug-knot::after { content: "⚡"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; }
.pick-row { text-align: center; padding-top: 8px; }
.pick-hint { font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.pick-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pick-btn {
  height: 50px; border-radius: 14px; border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--tc); color: var(--ti); font-weight: 800; font-size: 14.5px; padding: 0 10px;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--tc) 45%, transparent), inset 0 -3px 0 rgba(0, 0, 0, .15);
}
.pick-btn:active { transform: scale(.97); }
.pick-btn span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-play { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding-top: 8px; }
.dock-left, .dock-right { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--text-2); min-width: 0; }
.dock-right { align-items: flex-end; text-align: right; }
.dock-coins { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--text); }
.dock-next { font-size: 11.5px; }
.dock-my b { color: var(--text); }
.dock-swap { align-self: flex-start; border: 0; background: none; color: var(--info); font-size: 12px; font-weight: 700; padding: 0; text-decoration: underline; }
.combo { display: inline-flex; align-items: baseline; gap: 1px; color: var(--my); font-family: var(--font-num); font-weight: 900; font-style: italic; opacity: 0; transition: opacity 150ms; height: 26px; }
.combo.show { opacity: 1; }
.combo-x { font-size: 15px; }
.combo-num { font-size: 24px; display: inline-block; letter-spacing: -.5px; text-shadow: 0 1px 0 rgba(0, 0, 0, .08); }
.combo[data-lv="2"] .combo-num, .combo[data-lv="3"] .combo-num { font-size: 27px; }
.combo[data-lv="4"] .combo-num, .combo[data-lv="5"] .combo-num, .combo[data-lv="6"] .combo-num { font-size: 30px; background: linear-gradient(180deg, #FFD54A, var(--my)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bat-wrap { position: relative; }
.bat-btn {
  position: relative; width: 72px; height: 72px; border-radius: 50%; border: 0; padding: 0;
  display: grid; place-items: center;
  background: var(--my);
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--my) 70%, #fff), var(--my) 60%, color-mix(in srgb, var(--my) 75%, #000));
  color: var(--my-ink);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .22), inset 0 -4px 0 rgba(0, 0, 0, .18), inset 0 2px 0 rgba(255, 255, 255, .35);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--my) 50%, transparent), inset 0 -4px 0 rgba(0, 0, 0, .18), inset 0 2px 0 rgba(255, 255, 255, .35);
  touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.bat-btn:disabled { filter: grayscale(.8); opacity: .5; }
.bat-ring { position: absolute; inset: -5px; border-radius: 50%; border: 2px dashed color-mix(in srgb, var(--my) 60%, transparent); animation: ring-spin 12s linear infinite; pointer-events: none; }
.bat-icon { width: 40px; height: 40px; display: block; margin-top: -8px; transform: rotate(18deg); transform-origin: 18% 82%; pointer-events: none; }
.bat-icon svg { width: 100%; height: 100%; }
.bat-label { position: absolute; bottom: 9px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 900; letter-spacing: 1px; color: var(--my-ink); opacity: .9; white-space: nowrap; pointer-events: none; }
.plus-one {
  position: absolute; left: 50%; top: -4px; transform: translate(-50%, 0); opacity: 0; pointer-events: none; z-index: 2;
  padding: 1px 8px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow-2);
  font-size: 12px; font-weight: 900; color: var(--my); white-space: nowrap;
}
.dock-over { text-align: center; padding: 10px 0 2px; font-size: 13.5px; font-weight: 700; color: var(--text-2); }
.cheer-fx { position: fixed; inset: 0; pointer-events: none; z-index: 46; overflow: hidden; }
.cheer-word {
  position: fixed; left: 0; top: 0; opacity: 0; white-space: nowrap; will-change: transform, opacity;
  font-weight: 900; font-size: 22px; letter-spacing: .5px; color: #fff; font-style: italic;
  -webkit-text-stroke: 4px var(--tc); paint-order: stroke fill;
  text-shadow: 0 3px 8px rgba(0, 0, 0, .25);
}
.cheer-word.long { font-size: 19px; }
.cheer-word.lv1 { font-size: 25px; } .cheer-word.lv2 { font-size: 28px; } .cheer-word.lv3 { font-size: 31px; }
.cheer-word.lv4 { font-size: 34px; color: #FFF3B0; } .cheer-word.lv5 { font-size: 37px; color: #FFE066; } .cheer-word.lv6 { font-size: 40px; color: #FFD54A; }
.cheer-ball { position: fixed; left: 0; top: 0; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: inset -2px -2px 0 #D7DCE3, 0 1px 3px rgba(0, 0, 0, .35); opacity: 0; will-change: transform, opacity; }
@media (prefers-reduced-motion: reduce) { .bat-ring { animation: none; } .tug-fill, .tug-knot-wrap { transition: none; } }

/* ============ Chat ============ */
.chat { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.chat-scroll-wrap { position: relative; flex: 1; min-height: 0; display: flex; }
.chat-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 8px 12px 12px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: auto; }
.chat-items { display: flex; flex-direction: column; gap: 10px; }
.chat-more { align-self: center; }
.chat-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); font-size: 13px; pointer-events: none; }
.msg { display: flex; gap: 8px; align-items: flex-start; max-width: 100%; }
.msg-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; max-width: calc(100% - 50px); align-items: flex-start; }
.msg.mine { flex-direction: row-reverse; }
.msg.mine .msg-main { align-items: flex-end; }
.msg.mine .msg-meta { flex-direction: row-reverse; }
.msg-meta { display: flex; align-items: center; gap: 5px; font-size: 12px; min-width: 0; max-width: 100%; }
.msg-meta .nick { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 11em; }
.msg-time { color: var(--text-3); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.side-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tc); flex: none; box-shadow: 0 0 0 1.5px var(--card); }
.dm-swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2); }
.msg-sys { align-self: center; text-align: center; max-width: 92%; }
.msg-sys span { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--card-3); color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.msg-deleted span { font-style: italic; color: var(--text-3); }
.new-pill {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 2;
  border: 0; border-radius: 999px; height: 32px; padding: 0 14px; background: var(--brand); color: #fff;
  font-weight: 800; font-size: 12.5px; box-shadow: var(--shadow-2);
}
.chat-input-wrap { position: relative; border-top: 1px solid var(--line); padding: 8px 10px; background: var(--card); }
.chat-input { display: flex; align-items: center; gap: 6px; }
.ci-btn { width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--card-3); display: grid; place-items: center; flex: none; font-weight: 900; color: var(--text-2); }
.ci-btn .swatch { width: 18px; height: 18px; border-radius: 50%; background: var(--c, #fff); box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .25); }
.ci-big[aria-pressed="true"] { background: var(--cheer); color: #fff; }
.ci-field { position: relative; flex: 1; min-width: 0; }
.ci-input { width: 100%; height: 38px; border-radius: 19px; border: 1px solid var(--line-2); background: var(--card-2); padding: 0 48px 0 14px; outline: none; color: var(--text); font-size: 16px; }
.ci-input:focus { border-color: var(--cheer); box-shadow: 0 0 0 3px rgba(255, 90, 31, .16); }
.ci-count { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--text-3); pointer-events: none; }
.ci-send { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--cheer); color: #fff; display: grid; place-items: center; flex: none; }
.ci-send svg { width: 18px; height: 18px; }
.ci-send:disabled { background: var(--line-2); color: var(--text-3); }
.ci-cost { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--warn); font-weight: 700; padding: 0 4px 6px; }
.ci-palette { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 2px 8px; }
.pal-item { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px 0 6px; border-radius: 999px; border: 0; background: var(--card-3); font-size: 12px; font-weight: 700; color: var(--text-2); }
.pal-item .swatch { width: 18px; height: 18px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .2); display: inline-block; }
.pal-item[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--cheer); color: var(--text); }
.act-preview { padding: 10px 12px; border-radius: 12px; background: var(--card-3); font-size: 13.5px; overflow-wrap: anywhere; }
.act-group { display: grid; gap: 8px; margin-top: 6px; }
.act-label { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 13px; color: var(--text-2); }
.act-label svg { width: 16px; height: 16px; }
.act-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.act-chips .chip { box-shadow: inset 0 0 0 1px var(--line-2); }

/* ============ Predict ============ */
.predict { display: grid; gap: 12px; }
.mk-list { display: grid; gap: 10px; }
.mk-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 12px 14px; }
.mk-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.mk-title { font-weight: 900; font-size: 15px; }
.mk-sub { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.mk-state { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.mk-state.open { color: var(--win); background: color-mix(in srgb, var(--win) 12%, transparent); }
.mk-state.lock { color: var(--text-2); background: var(--card-3); }
.mk-state.mine { color: var(--info); background: color-mix(in srgb, var(--info) 12%, transparent); }
.mk-state.res { color: var(--cheer); background: color-mix(in srgb, var(--cheer) 12%, transparent); }
.mk-lock svg { width: 12px; height: 12px; }
.mk-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.odd-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 48px; padding: 0 14px; border-radius: 12px;
  border: 0; background: var(--card-2); box-shadow: inset 0 0 0 1.5px var(--line); color: var(--text); text-align: left;
  transition: box-shadow var(--dur-fast), transform var(--dur-fast);
}
.odd-btn:hover:not(:disabled) { box-shadow: inset 0 0 0 2px var(--oc); }
.odd-btn:active:not(:disabled) { transform: scale(.97); }
.odd-label { font-weight: 700; font-size: 14px; min-width: 0; }
.odd-val { font-weight: 900; font-size: 18px; color: var(--oc); }
.odd-btn:disabled { cursor: not-allowed; }
.odd-btn:disabled .odd-val { color: var(--text-3); font-size: 13px; }
.odd-btn.picked { box-shadow: inset 0 0 0 2px var(--oc); background: color-mix(in srgb, var(--oc) 10%, var(--card)); }
.odd-btn.picked .odd-val { color: var(--oc); font-size: 18px; }
.odd-btn.winner { box-shadow: inset 0 0 0 2px var(--win); }
/* team colours can be very dark (e.g. maroon/navy) — lift them on the dark theme */
:root[data-theme="dark"] .odd-val, :root[data-theme="dark"] .bet-pick, :root[data-theme="dark"] .tug-pct { filter: brightness(1.5) saturate(1.1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .odd-val, :root:not([data-theme="light"]) .bet-pick, :root:not([data-theme="light"]) .tug-pct { filter: brightness(1.5) saturate(1.1); } }
.odd-btn.winner .odd-label::after { content: " ✓"; color: var(--win); }
.mk-bar { position: relative; height: 6px; border-radius: 999px; background: var(--rc); margin-top: 10px; overflow: hidden; }
.mk-fill { position: absolute; inset: 0; background: var(--lc); transform-origin: left center; transition: transform 500ms var(--ease-out); }
.mk-bar-lbl { display: flex; justify-content: space-between; font-size: 11.5px; font-weight: 700; margin-top: 4px; }
.mk-mine { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-2); font-size: 13px; font-weight: 600; }
.mk-note { font-size: 11.5px; color: var(--text-3); line-height: 1.6; }
.pst { flex: none; display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 800; white-space: nowrap; }
.pst-open { background: color-mix(in srgb, var(--info) 14%, transparent); color: var(--info); }
.pst-won { background: color-mix(in srgb, var(--win) 16%, transparent); color: var(--win); }
.pst-lost { background: var(--card-3); color: var(--text-2); }
.pst-push, .pst-void { background: color-mix(in srgb, var(--coin) 18%, transparent); color: var(--warn); }
.sub-title { font-size: 14px; font-weight: 800; margin: 4px 2px 8px; }
.bet-list { overflow: hidden; }
.bet-row { display: flex; align-items: center; gap: 10px; padding: 11px 14px; color: inherit; text-decoration: none; }
.bet-list > li + li, .bet-list > li + li .bet-row { border-top: 1px solid var(--line); }
.bet-list > li > .bet-row { border-top: 0; }
.bet-row.link:hover { background: var(--card-2); }
.bet-main { flex: 1; min-width: 0; }
.bet-title { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bet-lg { font-size: 11px; font-weight: 800; color: var(--text-2); margin-right: 6px; }
.bet-sub { font-size: 12px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bet-empty { padding: 18px 14px; text-align: center; font-size: 13px; }
.bet-sheet { display: grid; gap: 14px; }
.bet-odds { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bet-pick { font-size: 16px; font-weight: 900; color: var(--oc); }
.bet-at { font-size: 18px; font-weight: 900; }
.bet-amount { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; border-radius: 14px; background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line); }
.bet-amt { font-size: 34px; font-weight: 900; letter-spacing: -.5px; }
.bet-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.bet-presets .chip { flex: 1; justify-content: center; min-width: 56px; box-shadow: inset 0 0 0 1px var(--line-2); }
.bet-presets .chip[aria-pressed="true"] { background: var(--cheer); color: #fff; box-shadow: none; }
.bet-presets .chip:disabled { opacity: .4; }
.bet-slider { width: 100%; accent-color: var(--cheer); height: 28px; }
.bet-calc { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bet-calc > div { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--card-2); font-size: 12px; }
.bet-calc b { font-size: 18px; font-family: var(--font-num); }
.bet-calc b.win { color: var(--win); }
