
:root{
  --bg:#050a14;
  --bg2:#071526;
  --text:#eef6ff;
  --muted:#8fb2cc;
  --line:rgba(112,216,255,.16);
  --line-soft:rgba(255,255,255,.07);
  --hot:#ff3b63;
  --gold:#ffd24f;
  --green:#3ee7a3;
  --blue:#40c5ff;
  --shadow:0 18px 40px rgba(0,0,0,.35);
  --racer-scale:1;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  min-height:100vh;
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  color:var(--text);
  background:
    radial-gradient(circle at 50% -10%, rgba(33,179,255,.20), transparent 35%),
    radial-gradient(circle at 10% 45%, rgba(39,239,154,.09), transparent 28%),
    radial-gradient(circle at 90% 35%, rgba(255,68,98,.11), transparent 28%),
    linear-gradient(180deg,#04101d 0%, #030813 58%, #02060d 100%);
  overflow-x:hidden;
}
body::before{
  content:"";position:fixed;inset:0;pointer-events:none;opacity:.22;
  background:
    linear-gradient(180deg, rgba(255,255,255,.02), transparent 20%),
    repeating-linear-gradient(90deg, transparent 0 84px, rgba(255,255,255,.018) 85px, transparent 86px);
}
button,input,a{font:inherit}
a{text-decoration:none;color:inherit}

.app-shell{position:relative;z-index:1;width:min(100%,1320px);margin:0 auto;padding:18px 16px 24px}
.headline{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:14px}
.headline-group{display:flex;align-items:center;gap:10px}
.left-group{justify-content:flex-start}
.right-group{justify-content:flex-end}
.live-badge,.stat-badge,.user-chip,.glass-card,.lane-card,.track-shell,.support-strip,.controls,.gift-toast,.winner-card,.icon-circle{
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
}
.live-badge{
  display:inline-flex;align-items:center;gap:9px;min-height:56px;padding:0 16px;border-radius:19px;
  background:linear-gradient(135deg, rgba(255,44,86,.24), rgba(95,8,28,.35));
  border:1px solid rgba(255,94,123,.45);box-shadow:0 0 24px rgba(255,60,95,.14), inset 0 1px rgba(255,255,255,.08);
}
.live-badge strong{font-size:18px;letter-spacing:.6px}.live-badge small{font-size:13px;color:#ffe8ee}
.live-badge-dot{width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 0 0 5px rgba(255,255,255,.08)}
.live-badge.connected{background:linear-gradient(135deg, rgba(37,237,138,.18), rgba(13,73,43,.34));border-color:rgba(69,255,154,.36)}
.live-badge.offline{filter:saturate(.86)}
.stat-badge,.icon-circle,.user-chip{
  min-height:56px;border-radius:18px;border:1px solid var(--line);
  background:linear-gradient(145deg, rgba(6,18,31,.84), rgba(8,19,34,.62));
  box-shadow:inset 0 1px rgba(255,255,255,.04), var(--shadow);
}
.stat-badge{display:inline-flex;align-items:center;gap:10px;padding:0 18px;color:#dfefff}
.stat-badge span{font-size:14px;color:#a7c8df}.stat-badge b{font-size:26px;color:#fff}
.stat-icon{font-size:18px}
.icon-circle{width:56px;height:56px;display:grid;place-items:center;cursor:pointer;color:#fff;font-size:25px}
.league-brand{display:flex;align-items:center;justify-content:center;gap:12px;text-align:center}
.brand-logo{
  width:62px;height:62px;border-radius:18px;display:grid;place-items:center;font-size:34px;
  background:radial-gradient(circle at 40% 35%, rgba(255,210,79,.9), rgba(203,74,24,.75) 58%, rgba(70,9,0,.85));
  border:1px solid rgba(255,211,79,.35);box-shadow:0 0 30px rgba(255,188,69,.18);
}
.brand-copy b{display:block;font-size:40px;line-height:1;color:#ffc856;letter-spacing:2px;text-shadow:0 0 24px rgba(255,200,86,.16)}
.brand-copy small{display:block;font-size:12px;letter-spacing:4px;color:#89ebff;margin-top:3px}

.hero-strip{display:flex;justify-content:space-between;align-items:center;gap:14px;margin:18px 2px 16px;padding:12px 16px;border-radius:24px;border:1px solid rgba(96,212,255,.14);background:linear-gradient(145deg, rgba(6,17,29,.78), rgba(6,12,23,.56));box-shadow:var(--shadow)}
.hero-copy{position:relative;flex:1;min-width:0;min-height:92px;padding-left:220px;display:flex;flex-direction:column;justify-content:center}
.hero-copy small{display:block;font-size:20px;line-height:1.25;color:#9ceeff;margin-bottom:6px;font-weight:900;text-shadow:0 0 18px rgba(80,214,255,.18)}
.hero-copy h1{position:absolute;left:0;top:50%;transform:translateY(-50%);margin:0;font-size:56px;line-height:1;color:#fff;text-shadow:0 0 30px rgba(82,222,255,.16);white-space:nowrap}
.hero-copy p{margin:0;color:#d7e9f8;font-size:22px;line-height:1.4}
.user-chip{display:flex;align-items:center;gap:12px;padding:12px 18px;min-width:220px}
.user-chip small{display:block;color:#89b0cb;font-size:11px;letter-spacing:2px}
.user-chip b{display:block;font-size:24px;color:#fff}
.live-dot{width:14px;height:14px;border-radius:50%;background:#39e28a;box-shadow:0 0 0 6px rgba(57,226,138,.10),0 0 14px rgba(57,226,138,.4);flex:none}
.live-dot.offline{background:#7e90a3;box-shadow:none}

.board-layout{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:18px;align-items:start}
.race-stage{position:relative;min-height:620px;padding:22px 72px 24px 18px;border-radius:28px;border:1px solid rgba(109,222,255,.15);background:linear-gradient(145deg, rgba(5,16,27,.82), rgba(5,11,21,.68));box-shadow:var(--shadow)}
.race-stage::before{content:"";position:absolute;inset:0;border-radius:28px;background:linear-gradient(180deg, rgba(255,255,255,.03), transparent 18%);pointer-events:none}
.finish-tower{position:absolute;top:24px;bottom:24px;right:16px;width:42px;border-radius:20px;background:repeating-conic-gradient(from 0deg, rgba(245,245,245,.84) 0 25%, rgba(14,18,24,.92) 0 50%) 0/14px 14px;border:2px solid rgba(255,220,118,.45);box-shadow:0 0 26px rgba(255,200,78,.18)}
.finish-tower::before{content:"";position:absolute;inset:-4px;border-radius:22px;border:1px solid rgba(255,220,118,.22);pointer-events:none}
.finish-tower span{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;writing-mode:vertical-rl;font-weight:900;font-size:11px;letter-spacing:2px;color:#ffd24f;text-shadow:0 0 12px rgba(255,210,79,.35)}
.race-list{display:flex;flex-direction:column;gap:18px;position:relative;z-index:1}
.lane{display:grid;grid-template-columns:170px minmax(0,1fr);gap:16px;align-items:center;direction:ltr}
.lane-card{
  position:relative;display:grid;grid-template-columns:56px minmax(0,1fr) 40px;gap:12px;align-items:center;padding:16px 14px;border-radius:24px;
  background:linear-gradient(145deg, rgba(10,22,35,.88), rgba(8,17,28,.72));border:1px solid color-mix(in srgb, var(--lane-color) 45%, rgba(255,255,255,.08));
  box-shadow:0 12px 30px rgba(0,0,0,.25), 0 0 20px color-mix(in srgb, var(--lane-color) 8%, transparent);
}
.flag-circle{width:56px;height:56px;border-radius:50%;display:grid;place-items:center;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.14);box-shadow:inset 0 1px rgba(255,255,255,.08),0 0 18px color-mix(in srgb, var(--lane-color) 14%, transparent)}
.flag-emoji{display:inline-flex;align-items:center;justify-content:center;font-size:34px;line-height:1}
.flag-emoji.small{font-size:18px}
.flag-art{display:inline-flex;width:38px;height:26px;border-radius:6px;overflow:hidden;border:1px solid rgba(255,255,255,.26);box-shadow:0 2px 10px rgba(0,0,0,.35)}
.flag-art.small{width:20px;height:14px;border-radius:4px}
.flag-art svg{width:100%;height:100%;display:block}
.card-copy{min-width:0;direction:rtl;text-align:right}
.card-name{display:flex;align-items:center;gap:8px;min-width:0;font-size:30px;font-weight:900;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.name-full{display:inline-block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.name-code{display:none;align-items:center;justify-content:center;min-width:34px;height:26px;padding:0 8px;border-radius:999px;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.12);font-size:15px;letter-spacing:.8px;line-height:1.1}
.card-score{display:flex;align-items:center;gap:8px;color:#ffd667;font-weight:700;font-size:26px;margin-top:4px}
.card-score b{font-size:42px;line-height:1;color:#fff}.rank-orb{width:40px;height:40px;border-radius:50%;display:grid;place-items:center;font-size:22px;font-weight:900;background:color-mix(in srgb, var(--lane-color) 78%, #0f2030);border:1px solid rgba(255,255,255,.16);box-shadow:0 0 18px color-mix(in srgb, var(--lane-color) 24%, transparent)}
.lane.leader .rank-orb{background:linear-gradient(135deg,#ffe773,#ffb829);color:#201500;border-color:#ffd85f;box-shadow:0 0 22px rgba(255,201,48,.36)}
.lane-track{position:relative;min-height:108px}
.track-shell{
  position:relative;height:108px;border-radius:28px;overflow:hidden;
  background:
    radial-gradient(circle at 14% 50%, color-mix(in srgb, var(--lane-color) 12%, transparent), transparent 35%),
    linear-gradient(180deg, rgba(4,11,20,.94), rgba(6,15,26,.84));
  border:1px solid color-mix(in srgb, var(--lane-color) 18%, rgba(255,255,255,.08));
  box-shadow:inset 0 1px rgba(255,255,255,.04), 0 12px 28px rgba(0,0,0,.20);
}
.track-shell::before{content:"";position:absolute;left:18px;right:18px;bottom:18px;height:3px;border-radius:999px;background:linear-gradient(90deg, transparent, color-mix(in srgb, var(--lane-color) 55%, transparent), transparent);opacity:.26}
.track-shell::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg, transparent 0 84px, rgba(255,255,255,.012) 85px, transparent 86px);background-size:86px 100%;pointer-events:none}
.runner-road{position:absolute;left:18px;right:18px;top:50%;margin-top:18px;height:16px;border-radius:999px;overflow:hidden;background:linear-gradient(180deg, rgba(25,35,48,.95), rgba(9,14,23,.98));border:1px solid rgba(255,255,255,.06);box-shadow:inset 0 1px rgba(255,255,255,.08), 0 0 18px color-mix(in srgb, var(--lane-color) 12%, transparent);opacity:.94;z-index:0}
.runner-road-line{position:absolute;left:12px;right:12px;top:50%;height:1px;transform:translateY(-50%);background:linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);opacity:.55}
.runner-road-dashes{position:absolute;inset:4px 10px;border-radius:999px;background:repeating-linear-gradient(90deg, rgba(255,224,137,.95) 0 14px, transparent 14px 32px);background-size:48px 100%;opacity:.72;filter:drop-shadow(0 0 3px rgba(255,214,102,.25));animation:roadMove 1.15s linear infinite}
.progress{position:absolute;left:20px;top:50%;height:18px;transform:translateY(-50%);border-radius:999px;background:linear-gradient(90deg, var(--lane-color), var(--lane-color2));box-shadow:0 0 22px color-mix(in srgb, var(--lane-color) 38%, transparent), inset 0 0 0 1px rgba(255,255,255,.08);z-index:1}
.progress::after{content:"";position:absolute;top:0;bottom:0;right:0;width:40px;border-radius:999px;background:linear-gradient(90deg, transparent, rgba(255,255,255,.35));filter:blur(1px)}
.racer{position:absolute;left:0;top:50%;width:200px;height:82px;transform:translateX(0);transition:transform .55s cubic-bezier(.2,.7,.15,1.02);margin-top:-41px;z-index:2}
.lion-wrap.sticker-wrap{position:absolute;inset:0;display:block;transform:scale(var(--racer-scale));transform-origin:left center;filter:drop-shadow(0 10px 14px rgba(0,0,0,.35))}
.lion-sticker{width:100%;height:100%;object-fit:contain;object-position:center center;display:block;border-radius:0;mask-image:none;-webkit-mask-image:none;image-rendering:auto}.running-sticker{will-change:transform,filter}.race-sticker{transform:scale(1.18);transform-origin:center center}.winner-sticker{transform:scale(1.05);transform-origin:center center}
.lion-wrap.sticker-wrap::after{content:"";position:absolute;left:16px;right:22px;bottom:8px;height:10px;border-radius:999px;background:var(--lane-color);filter:blur(10px);opacity:.35}
.speed-lines{position:absolute;left:-18px;top:30px;width:58px;height:18px;background:repeating-linear-gradient(180deg, transparent 0 3px, var(--lane-color) 3px 4px, transparent 4px 7px);opacity:.22;filter:blur(.3px)}
.boost-flash{position:absolute;right:8px;top:4px;font-size:25px;opacity:0;transform:scale(.4)}
.sprint-glow{position:absolute;left:8%;right:5%;bottom:3px;height:12px;border-radius:999px;background:linear-gradient(90deg,transparent,var(--lane-color),rgba(255,255,255,.85),var(--lane-color),transparent);filter:blur(8px);opacity:.18;pointer-events:none}
.lane.impact .track-shell{box-shadow:inset 0 1px rgba(255,255,255,.05), 0 0 28px color-mix(in srgb, var(--lane-color) 18%, transparent), 0 12px 28px rgba(0,0,0,.24)}
.racer.boost .lion-wrap.sticker-wrap{animation:kick .45s ease}.racer.strong-boost .lion-wrap.sticker-wrap{filter:drop-shadow(0 12px 14px rgba(0,0,0,.42)) drop-shadow(0 0 18px var(--lane-color))}
.racer.boost .boost-flash{animation:flashPop .45s ease}
.racer.boost .sprint-glow{animation:sprintGlow .55s ease}
.lane.impact .runner-road-dashes{animation-duration:.34s;opacity:1;filter:drop-shadow(0 0 6px var(--lane-color))}
.lane.impact .speed-lines{opacity:.95;animation:speedLinePulse .5s ease}
.lane.impact .progress{filter:saturate(1.35) brightness(1.18)}
.lane.leader .track-shell{border-color:rgba(255,214,88,.36);box-shadow:inset 0 1px rgba(255,255,255,.05), 0 0 32px rgba(255,193,78,.16), 0 12px 28px rgba(0,0,0,.22)}
.lane.leader .track-shell::before{opacity:.7}
.lane.near-finish .track-shell{box-shadow:inset 0 1px rgba(255,255,255,.04), 0 0 36px color-mix(in srgb, var(--lane-color) 20%, transparent), 0 12px 28px rgba(0,0,0,.22)}
.lane.finished .track-shell{outline:1px solid rgba(255,218,104,.35)}
.spark{position:absolute;width:8px;height:8px;border-radius:50%;background:radial-gradient(circle,#fff, var(--lane-color) 55%, transparent 70%);pointer-events:none;animation:sparkFly .75s ease-out forwards}

.side-panel{display:flex;flex-direction:column;gap:16px}
.glass-card{padding:16px 16px 18px;border-radius:24px;border:1px solid var(--line);background:linear-gradient(145deg, rgba(7,19,31,.90), rgba(7,14,26,.74));box-shadow:var(--shadow)}
.card-title{font-size:26px;font-weight:900;margin-bottom:14px;color:#fff}
.choice-grid{display:grid;grid-template-columns:1fr;gap:10px}
.choice-item{display:flex;align-items:center;justify-content:flex-start;gap:10px;padding:10px 12px;border-radius:16px;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.06)}
.choice-inline{display:inline-flex;align-items:center;justify-content:flex-start;gap:10px;direction:ltr;min-width:0;width:100%}
.choice-item .choice-num{width:36px;height:36px;min-width:36px;border-radius:50%;display:grid;place-items:center;background:rgba(77,214,255,.14);border:1px solid rgba(77,214,255,.24);font-size:18px;color:#fff;box-shadow:0 0 14px rgba(63,203,255,.12)}
.choice-inline .choice-code{font-size:20px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;letter-spacing:1px;color:#f3fbff}
.rank-name{display:flex;align-items:center;gap:8px;min-width:0}
.rank-name-full{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rank-name-code{display:none;align-items:center;justify-content:center;min-width:32px;height:24px;padding:0 8px;border-radius:999px;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.10);font-size:13px;letter-spacing:.8px}
.rule-text{margin-top:14px;color:#c7daeb;line-height:1.7;font-size:17px}
.mini-status{font-size:16px;color:#8fd8ff;margin-bottom:12px}
.ranking-list{display:flex;flex-direction:column;gap:10px}
.rank-row{display:grid;grid-template-columns:36px 28px 1fr auto;gap:10px;align-items:center;padding:10px 12px;border-radius:16px;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.06)}
.rank-row .rank-num{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;font-weight:900;background:#153147;border:1px solid rgba(255,255,255,.10)}
.rank-row.leader .rank-num{background:linear-gradient(135deg,#ffe773,#ffb829);color:#221500;border-color:#ffd85f}
.rank-name{font-size:19px;font-weight:800}.rank-score{font-size:18px;color:#ffd667;font-weight:800}
.boost-card{display:flex;align-items:center;gap:14px;background:linear-gradient(135deg, rgba(18,37,74,.92), rgba(9,20,33,.78));border-color:rgba(72,222,255,.18)}
.boost-icon{width:92px;height:92px;border-radius:24px;display:grid;place-items:center;font-size:40px;background:radial-gradient(circle at 35% 35%, rgba(255,214,79,.85), rgba(255,111,34,.45) 50%, rgba(33,132,255,.16) 100%);border:1px solid rgba(255,214,79,.28);box-shadow:0 0 26px rgba(56,185,255,.18)}
.boost-copy small{display:block;color:#9bc6ec;font-size:15px;margin-bottom:4px}.boost-copy b{display:block;font-size:48px;line-height:1;color:#fff}.boost-copy span{display:block;color:#ffe28d;font-size:18px;margin-top:5px}

.support-strip{margin-top:18px;padding:16px 18px 18px;border-radius:24px;border:1px solid rgba(73,221,255,.14);background:linear-gradient(145deg, rgba(7,18,30,.88), rgba(5,11,21,.76));box-shadow:var(--shadow)}
.support-strip-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}
.support-title{font-size:24px;font-weight:900}.live-footer{display:flex;align-items:center;gap:10px;color:#cfe4f3;font-size:17px;flex-wrap:wrap}
.green-dot{width:12px;height:12px;border-radius:50%;background:#34e287;box-shadow:0 0 0 5px rgba(52,226,135,.10),0 0 16px rgba(52,226,135,.35)}
.activity-feed{display:flex;gap:10px;overflow-x:auto;padding-bottom:2px;scrollbar-width:thin}
.activity-item{min-width:240px;display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:18px;background:rgba(255,255,255,.045);border:1px solid rgba(255,255,255,.06)}
.avatar,.toast-avatar{width:46px;height:46px;border-radius:50%;display:grid;place-items:center;overflow:hidden;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.08);flex:none}
.avatar img,.toast-avatar img{width:100%;height:100%;object-fit:cover}
.feed-copy{min-width:0;flex:1}.feed-copy b{display:block;font-size:15px;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.feed-copy small{display:block;font-size:13px;color:#a9c7de;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.feed-gain{font-size:22px;font-weight:900;color:#ffd767}
.empty{padding:18px 12px;color:#9dbdd4}
.connector-hint{margin-top:10px;padding:0 6px;color:#ffb4b4;font-size:14px;display:none}.connector-hint.show{display:block}

.test-buttons{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:10px;margin-top:12px}
.test-buttons button,.ctrl-row button,.admin-link{border:1px solid rgba(255,255,255,.10);background:rgba(255,255,255,.06);color:#fff;padding:12px 14px;border-radius:14px;cursor:pointer;text-align:center}
.test-buttons small{display:block;color:#a9c7de;font-size:12px;margin-top:4px}
.controls{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%) scale(.95);width:min(92vw,720px);padding:18px;border:1px solid rgba(83,226,255,.18);background:linear-gradient(145deg, rgba(7,19,32,.96), rgba(6,12,22,.96));box-shadow:0 30px 80px rgba(0,0,0,.48);border-radius:26px;opacity:0;pointer-events:none;transition:.25s;z-index:25}
.controls.open{opacity:1;pointer-events:auto;transform:translate(-50%,-50%) scale(1)}
.controls-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.controls-head b{font-size:24px}.controls-head small{display:block;color:#97b9d1;margin-top:4px}
.controls-head button{width:42px;height:42px;border-radius:50%;border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.05);color:#fff;cursor:pointer}
.ctrl-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:14px}

.gift-toast{position:fixed;left:50%;top:18px;transform:translateX(-50%);display:flex;align-items:center;gap:12px;padding:12px 16px;border-radius:20px;border:1px solid rgba(255,255,255,.10);background:linear-gradient(145deg, rgba(7,18,30,.94), rgba(10,17,29,.92));box-shadow:0 14px 40px rgba(0,0,0,.35);z-index:26;animation:toastIn .2s ease}
.gift-toast.hidden{display:none}.toast-copy{min-width:0}.toast-copy b{display:block;font-size:17px}.toast-copy small{display:block;color:#a9c7de;font-size:13px;max-width:280px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#toastPoints{font-size:24px;color:#ffd767}
.winner{position:fixed;inset:0;display:grid;place-items:center;background:rgba(1,4,9,.54);z-index:28}.winner.hidden{display:none}
.winner-card{position:relative;width:min(92vw,760px);padding:24px 20px;border-radius:30px;text-align:center;border:1px solid rgba(255,214,90,.34);background:linear-gradient(145deg, rgba(9,18,30,.96), rgba(7,12,21,.96));box-shadow:0 30px 90px rgba(0,0,0,.52),0 0 40px rgba(255,201,76,.08)}
.winner-crown{font-size:44px;margin-bottom:4px}.winner-lion{display:flex;justify-content:center;align-items:center;height:140px;margin:12px 0 8px}.winner-lion .sticker-wrap{position:relative;width:320px;height:132px}.winner-lion .winner-sticker{width:100%;height:100%;object-fit:contain;border-radius:0;mask-image:none;-webkit-mask-image:none}
.winner-card h2{margin:0;font-size:36px}.winner-card p{margin:10px 0 6px;font-size:26px;color:#ffd767}.winner-card small{color:#a7c4d8;font-size:16px}
.confetti{position:absolute;inset:0;overflow:hidden;pointer-events:none}.piece{position:absolute;top:-20px;width:9px;height:15px;opacity:.9;animation:fall linear forwards}


/* V8.7 supporter avatar bubble follows the lion while it gets pushed */
.supporter-push{
  position:absolute;left:6px;bottom:calc(100% - 6px);z-index:8;
  display:flex;align-items:center;gap:8px;min-width:0;max-width:238px;
  padding:5px 10px 5px 6px;border-radius:999px;
  color:#fff;font-size:12px;font-weight:900;line-height:1.05;text-shadow:0 1px 2px rgba(0,0,0,.65);
  background:linear-gradient(135deg,rgba(5,13,23,.98),rgba(15,29,43,.92));
  border:1px solid color-mix(in srgb,var(--lane-color) 62%,rgba(255,255,255,.18));
  box-shadow:0 7px 18px rgba(0,0,0,.34),0 0 16px color-mix(in srgb,var(--lane-color) 22%,transparent);
  pointer-events:none;transform-origin:left bottom;
}
.supporter-push::after{
  content:'';position:absolute;left:22px;top:100%;width:12px;height:12px;transform:translateY(-6px) rotate(45deg);
  background:linear-gradient(135deg,rgba(15,29,43,.94),rgba(5,13,23,.98));
  border-right:1px solid color-mix(in srgb,var(--lane-color) 62%,rgba(255,255,255,.18));
  border-bottom:1px solid color-mix(in srgb,var(--lane-color) 62%,rgba(255,255,255,.18));
}
.supporter-push.hidden{display:none}
.supporter-push.pop{animation:supporterPushPop .5s cubic-bezier(.2,.8,.25,1)}
.supporter-push.gift{box-shadow:0 8px 20px rgba(0,0,0,.38),0 0 20px color-mix(in srgb,var(--lane-color) 30%,#ffd35b)}
.supporter-avatar-ring{
  width:34px;height:34px;min-width:34px;border-radius:50%;display:grid;place-items:center;overflow:hidden;
  background:radial-gradient(circle at 30% 30%,rgba(255,255,255,.22),rgba(255,255,255,.05) 40%,rgba(0,0,0,.12));
  border:2px solid color-mix(in srgb,var(--lane-color) 72%,rgba(255,255,255,.25));
  box-shadow:0 0 0 3px color-mix(in srgb,var(--lane-color) 20%,transparent),0 0 14px color-mix(in srgb,var(--lane-color) 45%,transparent);
  color:#fff;font-size:18px;font-weight:900;
}
.supporter-avatar-ring img{width:100%;height:100%;object-fit:cover;display:block}
.supporter-avatar-ring .flag-emoji.small{font-size:18px}
.supporter-avatar-ring .flag-art.small{width:22px;height:14px}
.supporter-initial{display:grid;place-items:center;width:100%;height:100%}
.supporter-copy{display:flex;flex-direction:column;gap:2px;min-width:0}
.supporter-copy b,.supporter-copy small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.supporter-copy b{font-size:12px;letter-spacing:.2px}
.supporter-copy small{font-size:10px;font-weight:700;color:#d5e7f7;opacity:.95}
@keyframes supporterPushPop{
  0%{opacity:0;transform:translate(-10px,8px) scale(.72)}
  65%{opacity:1;transform:translate(2px,-2px) scale(1.05)}
  100%{opacity:1;transform:translate(0,0) scale(1)}
}


@keyframes roadMove{to{background-position-x:-48px}}
@keyframes sprintGlow{0%{opacity:.15;transform:scaleX(.75)}45%{opacity:.95;transform:scaleX(1.08)}100%{opacity:.18;transform:scaleX(1)}}
@keyframes speedLinePulse{0%{transform:translateX(8px);opacity:.18}45%{transform:translateX(-7px);opacity:1}100%{transform:translateX(0);opacity:.28}}
@keyframes kick{0%{transform:scale(var(--racer-scale)) translateY(0)}40%{transform:scale(calc(var(--racer-scale) + .08)) translateY(-5px) rotate(-1deg)}100%{transform:scale(var(--racer-scale)) translateY(0)}}
@keyframes flashPop{35%{opacity:1;transform:scale(1.24) rotate(-8deg)}100%{opacity:0;transform:translateY(-8px) scale(.7)}}
@keyframes sparkFly{0%{opacity:1;transform:translate(0,0) scale(1)}100%{opacity:0;transform:translate(var(--sx),var(--sy)) scale(.2)}}
@keyframes fall{to{transform:translateY(110vh) rotate(680deg);opacity:.8}}
@keyframes toastIn{from{opacity:0;transform:translate(-50%,-12px)}}

@media (max-width:1200px){
  .brand-copy b{font-size:32px}.hero-copy h1{font-size:54px}.card-name{font-size:26px}.card-score b{font-size:34px}
}
@media (max-width:980px){
  .headline{grid-template-columns:1fr;justify-items:center}.headline-group{justify-content:center;flex-wrap:wrap}.hero-strip{flex-direction:column;align-items:flex-start}.board-layout{grid-template-columns:1fr}.side-panel{order:2}.race-stage{padding-right:64px;min-height:unset}.support-strip-head{flex-direction:column;align-items:flex-start}
}
@media (max-width:720px){
  .app-shell{padding:12px 10px 20px}.live-badge,.stat-badge,.icon-circle,.user-chip{min-height:46px;border-radius:14px}.live-badge strong{font-size:14px}.live-badge small{font-size:11px}.live-badge-dot{width:12px;height:12px}
  .stat-badge{padding:0 12px}.stat-badge b{font-size:20px}.stat-badge span{font-size:11px}.icon-circle{width:46px;height:46px;font-size:21px}
  .brand-logo{width:48px;height:48px;border-radius:14px;font-size:28px}.brand-copy b{font-size:24px;letter-spacing:1px}.brand-copy small{font-size:9px;letter-spacing:2px}
  .hero-copy small{font-size:13px}.hero-copy h1{font-size:38px}.hero-copy p{font-size:14px}.user-chip{padding:10px 12px;min-width:unset}.user-chip b{font-size:18px}
  .race-stage{padding:14px 54px 16px 10px;border-radius:22px}.finish-tower{width:34px;right:10px;top:16px;bottom:16px}.finish-tower span{font-size:9px}
  .race-list{gap:12px}.lane{grid-template-columns:110px 1fr;gap:10px}.lane-card{grid-template-columns:38px 1fr 28px;padding:10px 8px;border-radius:18px;gap:8px}.flag-circle{width:38px;height:38px}.flag-emoji{font-size:24px}.flag-art{width:27px;height:18px}.card-name{font-size:18px}.card-score{font-size:16px}.card-score b{font-size:24px}.rank-orb{width:28px;height:28px;font-size:15px}
  .lane-track{min-height:76px}.track-shell{height:76px;border-radius:20px}.progress{left:12px;height:12px}.racer{width:132px;height:56px;margin-top:-28px}.lion-sticker{width:100%;height:100%}.lion-wrap.sticker-wrap::after{left:10px;right:14px;height:8px}.speed-lines{top:20px;width:44px;height:13px}.boost-flash{font-size:18px;right:4px;top:2px}
  .glass-card{padding:12px 12px 14px;border-radius:18px}.card-title{font-size:19px}.choice-item{padding:8px 10px}.choice-item span{font-size:15px}.choice-item b{width:28px;height:28px;font-size:14px}.rule-text,.mini-status,.rank-name,.rank-score,.live-footer,.support-title{font-size:14px}.boost-card{gap:10px}.boost-icon{width:64px;height:64px;border-radius:16px;font-size:28px}.boost-copy b{font-size:34px}.boost-copy span{font-size:14px}
  .support-strip{margin-top:14px;padding:12px;border-radius:18px}.activity-item{min-width:200px;padding:8px 10px}.avatar,.toast-avatar{width:38px;height:38px}.feed-copy b{font-size:13px}.feed-copy small{font-size:11px}.feed-gain{font-size:17px}
  .controls{padding:14px;border-radius:20px}.controls-head b{font-size:18px}.ctrl-row{grid-template-columns:1fr}.gift-toast{top:10px;padding:10px 12px;border-radius:16px}.toast-copy b{font-size:14px}.toast-copy small{max-width:170px;font-size:11px}#toastPoints{font-size:18px}
}

/* V8.1 MOBILE ONE-SCREEN MODE: keep the entire 4-team race inside one portrait viewport */
@media (max-width:720px){
  html,body{width:100%;height:100%;overflow:hidden;overscroll-behavior:none}
  body{min-height:100dvh}
  .app-shell{
    width:100%;height:100dvh;max-height:100dvh;overflow:hidden;
    padding:calc(6px + env(safe-area-inset-top)) 7px calc(6px + env(safe-area-inset-bottom));
    display:flex;flex-direction:column;gap:6px;
  }

  /* Compact single-row top bar */
  .headline{
    flex:0 0 43px;min-height:43px;
    display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:5px;
  }
  .headline-group{gap:4px;flex-wrap:nowrap}
  .left-group{justify-content:flex-start}.right-group{justify-content:flex-end}
  .left-group .stat-badge{display:none}
  .live-badge{min-height:39px;height:39px;padding:0 9px;border-radius:12px;gap:5px}
  .live-badge strong{font-size:11px;letter-spacing:0}.live-badge small{display:none}.live-badge-dot{width:9px;height:9px;box-shadow:none}
  .league-brand{gap:5px;min-width:0}
  .brand-logo{width:34px;height:34px;border-radius:10px;font-size:19px;flex:none}
  .brand-copy{min-width:0;text-align:center}.brand-copy b{font-size:15px;line-height:1.05;letter-spacing:.3px;white-space:nowrap}.brand-copy small{font-size:6px;letter-spacing:1.4px;margin-top:2px;white-space:nowrap}
  .right-group .stat-badge{min-height:36px;height:36px;padding:0 7px;border-radius:11px;gap:3px}
  .right-group .stat-badge span{display:none}.right-group .stat-badge b{font-size:14px;line-height:1}
  .right-group .icon-circle{width:36px;height:36px;min-height:36px;border-radius:11px;font-size:17px}

  /* Compact hero */
  .hero-strip{
    flex:0 0 68px;min-height:68px;margin:0;padding:4px 6px;
    display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:6px;
  }
  .hero-copy{position:relative;min-width:0;flex:1;min-height:60px;padding-left:128px;display:flex;flex-direction:column;justify-content:center}
  .hero-copy small{font-size:12px;line-height:1.25;margin-bottom:3px;max-width:100%}
  .hero-copy h1{position:absolute;left:0;top:50%;transform:translateY(-50%);font-size:28px;line-height:1.05;margin:0;white-space:nowrap}
  .hero-copy p{font-size:11px;line-height:1.25;margin:0;white-space:normal;overflow:visible;text-overflow:clip}
  .user-chip{display:none}

  /* Board gets all remaining height; only support chooser + race are shown */
  .board-layout{
    flex:1 1 auto;min-height:0;height:auto;overflow:hidden;
    display:grid;grid-template-columns:1fr;grid-template-rows:54px minmax(0,1fr);gap:5px;
  }
  .side-panel{order:-1;display:block;min-height:0}
  .ranking-card,.boost-card{display:none!important}
  .help-card{height:54px;min-height:54px;padding:5px 7px;border-radius:14px;overflow:hidden;display:flex;align-items:center;gap:5px}
  .help-card .card-title{font-size:12px;line-height:1;margin:0;white-space:nowrap;flex:none}
  .help-card .rule-text{display:none}
  .choice-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;flex:1;min-width:0}
  .choice-item{height:38px;min-height:38px;padding:3px 5px;border-radius:11px;gap:3px;min-width:0}
  .choice-inline{gap:4px;width:100%}.choice-inline .choice-code{font-size:11px;letter-spacing:.9px}.choice-item .choice-num{width:21px;height:21px;min-width:21px;font-size:10px;border-radius:50%}
  .flag-emoji.small{font-size:14px}.flag-art.small{width:17px;height:11px}

  /* Race uses the rest of the viewport */
  .race-stage{order:2;height:100%;min-height:0;padding:6px 31px 6px 5px;border-radius:15px;overflow:hidden}
  .finish-tower{right:5px;top:6px;bottom:6px;width:21px;border-radius:9px;background-size:8px 8px;border-width:1px}
  .finish-tower::before{display:none}.finish-tower span{font-size:6px;letter-spacing:.7px}
  .race-list{height:100%;min-height:0;display:flex;flex-direction:column;justify-content:space-between;gap:5px}
  .lane{flex:1 1 0;min-height:0;height:auto;display:grid;grid-template-columns:88px minmax(0,1fr);gap:5px;align-items:stretch}
  .lane-card{height:100%;min-height:0;grid-template-columns:25px minmax(0,1fr) 20px;gap:4px;padding:4px 5px;border-radius:12px;align-content:center}
  .flag-circle{width:25px;height:25px;border-radius:50%}.flag-emoji{font-size:17px}.flag-art{width:22px;height:14px;border-radius:4px}
  .card-copy{align-self:center}.card-name{font-size:12px;line-height:1.1;gap:0}.name-full{display:none}.name-code{display:inline-flex;min-width:28px;height:20px;padding:0 6px;font-size:11px}.card-score{gap:2px;font-size:9px;margin-top:2px}.card-score span{font-size:9px}.card-score b{font-size:14px;line-height:1}
  .rank-orb{width:20px;height:20px;font-size:10px;border-radius:50%}
  .lane-track{height:100%;min-height:0}.track-shell{height:100%;min-height:0;border-radius:12px}
  .track-shell::before{left:7px;right:7px;bottom:7px;height:1px}.track-shell::after{background-size:48px 100%}
  .runner-road{left:8px;right:8px;margin-top:12px;height:10px}.runner-road-line{left:8px;right:8px}.runner-road-dashes{inset:2px 6px;background-size:32px 100%}
  .progress{left:7px;height:7px}.progress::after{width:18px}
  .racer{width:112px;height:46px;margin-top:-23px}.lion-sticker{width:100%;height:100%;border-radius:0}.race-sticker{transform:scale(1.23)}.lion-wrap.sticker-wrap::after{left:7px;right:9px;bottom:4px;height:5px;filter:blur(6px)}
  .speed-lines{left:-9px;top:15px;width:31px;height:10px}.boost-flash{right:1px;top:0;font-size:13px}

  .supporter-push{max-width:150px;gap:5px;padding:3px 7px 3px 4px;font-size:9px;bottom:calc(100% - 2px);box-shadow:0 3px 10px rgba(0,0,0,.32),0 0 10px color-mix(in srgb,var(--lane-color) 18%,transparent)} .supporter-avatar-ring{width:24px;height:24px;min-width:24px}.supporter-copy b{font-size:9px}.supporter-copy small{font-size:7px}

  /* Bottom support strip: one compact row, no page scrolling */
  .support-strip{
    flex:0 0 76px;min-height:76px;max-height:76px;margin:0;padding:6px 7px 7px;border-radius:14px;overflow:hidden;
  }
  .rank-name-full{display:none}.rank-name-code{display:inline-flex}
  .support-strip-head{height:19px;min-height:19px;margin:0 0 4px;display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:4px}
  .support-title{font-size:11px;white-space:nowrap}.live-footer{font-size:8px;gap:4px;white-space:nowrap;overflow:hidden}.green-dot{width:6px;height:6px;box-shadow:none}
  .activity-feed{height:43px;min-height:43px;gap:5px;overflow-x:auto;overflow-y:hidden;padding:0}
  .activity-item{min-width:145px;height:42px;padding:4px 5px;border-radius:10px;gap:5px}
  .avatar,.toast-avatar{width:27px;height:27px}.feed-copy b{font-size:9px}.feed-copy small{font-size:7px}.feed-gain{font-size:11px}.empty{padding:10px 6px;font-size:9px}
  .connector-hint{display:none!important}

  .gift-toast{top:calc(5px + env(safe-area-inset-top));max-width:92vw;padding:7px 9px;border-radius:12px}.toast-copy b{font-size:10px}.toast-copy small{font-size:8px;max-width:140px}#toastPoints{font-size:13px}
  .controls{max-height:86dvh;overflow:auto}
}

/* Extra compression for short phones / in-app browser chrome */
@media (max-width:720px) and (max-height:760px){
  .app-shell{gap:4px;padding-top:calc(4px + env(safe-area-inset-top));padding-bottom:calc(4px + env(safe-area-inset-bottom))}
  .headline{flex-basis:37px;min-height:37px}.live-badge{height:34px;min-height:34px}.right-group .stat-badge,.right-group .icon-circle{height:32px;min-height:32px}.right-group .icon-circle{width:32px}.brand-logo{width:30px;height:30px}.brand-copy b{font-size:13px}
  .hero-strip{flex-basis:58px;min-height:58px}.hero-copy{min-height:50px;padding-left:108px}.hero-copy h1{font-size:24px}.hero-copy small{font-size:10px}.hero-copy p{font-size:9px;margin-top:0}
  .board-layout{grid-template-rows:46px minmax(0,1fr);gap:4px}.help-card{height:46px;min-height:46px;padding:4px 6px}.choice-item{height:32px;min-height:32px}.choice-inline{gap:3px}.choice-item .choice-num{width:19px;height:19px;min-width:19px;font-size:9px}.choice-inline .choice-code{font-size:10px}.help-card .card-title{font-size:10px}
  .race-stage{padding-top:4px;padding-bottom:4px}.race-list{gap:3px}.lane{grid-template-columns:82px minmax(0,1fr);gap:4px}.lane-card{padding:3px 4px}.card-name{font-size:11px}.name-code{min-width:24px;height:18px;padding:0 5px;font-size:10px}.card-score b{font-size:12px}.runner-road{left:7px;right:7px;margin-top:10px;height:8px}.runner-road-line{left:6px;right:6px}.runner-road-dashes{inset:2px 5px;background-size:24px 100%}.racer{width:92px;height:38px;margin-top:-19px}.lion-sticker{width:100%;height:100%}.race-sticker{transform:scale(1.25)}
  .supporter-push{max-width:126px;gap:4px;padding:2px 5px 2px 3px;font-size:8px}.supporter-avatar-ring{width:20px;height:20px;min-width:20px}.supporter-copy b{font-size:8px}.supporter-copy small{font-size:6px}
  .support-strip{flex-basis:64px;min-height:64px;max-height:64px;padding:4px 6px}.support-strip-head{height:15px;min-height:15px;margin-bottom:3px}.activity-feed{height:37px;min-height:37px}.activity-item{height:36px;min-width:132px}.avatar{width:24px;height:24px}
}

/* V8.3 country music */
.sound-btn{transition:.2s}.sound-btn.needs-unlock{border-color:rgba(255,210,79,.42);box-shadow:0 0 18px rgba(255,210,79,.16);animation:soundPulse 1.4s ease-in-out infinite}
@keyframes soundPulse{50%{transform:scale(1.06);box-shadow:0 0 24px rgba(255,210,79,.26)}}
@media(max-width:720px){.right-group .sound-btn{width:32px;height:36px;min-height:36px;font-size:15px}}
