/* Shared Turbo 9 race styles. Edit here for both editions. */
  /* ---------- bonus level: TURBO 9 (built from the invite's own HUD pieces) ---------- */
  .race-tile { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
  .race-tile .tile-label, .race-tile .cta-primary { grid-column: 1 / -1; }
  .race-tile h3 { font-family: var(--display) !important; font-weight: 400 !important; letter-spacing: .06em !important; }
  .race-tile .rt-car { grid-row: 2 / 4; grid-column: 2; width: 84px; height: 84px; background: url(./car-yellow.png) 6.6667% 0 / 1600% 100% no-repeat; filter: drop-shadow(0 6px 10px rgba(255,46,136,.45)); }
  .race-tile .cta-primary { margin-top: 10px; }
  #race { position: fixed; inset: 0; z-index: 15; display: none; touch-action: none; overflow: hidden; }
  #race.on { display: block; }
  #race .rc-top, #race .rc-bottom { opacity: 0; transition: opacity .6s; }
  #race.hud .rc-top, #race.hud .rc-bottom { opacity: 1; }
  .rc-top { pointer-events: none; }
  .rc-score { position: absolute; left: 50%; top: -4px; transform: translateX(-50%); text-align: center; }
  .rc-score output { display: block; font-family: var(--display); font-size: 1.7rem; line-height: 1.1; letter-spacing: .04em; font-variant-numeric: tabular-nums; color: var(--ink); text-shadow: 0 0 12px rgba(255, 46, 136, .6), 0 0 2px rgba(255,255,255,.6); }
  .rc-score span { font-size: .58rem; letter-spacing: .28em; color: var(--dim); }
  .rc-score em { font-style: normal; color: var(--ink); }
  .rc-icons { display: flex; pointer-events: auto; }
  .rc-icon { width: 44px; height: 44px; display: grid; place-items: center; color: var(--dim); }
  .rc-icon svg { width: 22px; height: 22px; }
  .rc-bottom { position: absolute; left: 0; right: 0; bottom: calc(8px + var(--safe-b)); display: flex; flex-direction: column; align-items: center; pointer-events: none; }
  .rc-bottom::before { content: ""; position: absolute; left: 0; right: 0; bottom: calc(-8px - var(--safe-b)); height: 130px; z-index: -1; background: linear-gradient(180deg, rgba(7,4,15,0), rgba(7,4,15,.6) 75%); }
  .rc-pips { pointer-events: none; }
  .rc-pips button { width: 26px; height: 28px; }
  .rc-pips svg { width: 17px; height: 23px; --s: #4f3c25; }
  .rc-pips svg .s { fill: var(--s); }
  .rc-pips svg .d { fill: #402b16; }
  .rc-pips button.current svg { --o: #fff0a0; --f: #ffd43840; --h: #fff4b080; --s: #ad781d; filter: drop-shadow(0 0 4px rgba(255,197,49,.7)); }
  .rc-pips button.done svg { --o: #714012; --f: #ffd438; --h: #fff4b0; --s: #c27a14; filter: drop-shadow(0 0 5px rgba(255,197,49,.55)); }
  .rc-pips.burn button.done svg { --s: #08788b; }
  .rc-pips.full button.done svg { --o: #3a2604; --f: #ffc531; --h: #fff6c9; filter: drop-shadow(0 0 6px rgba(255,197,49,.85)); animation: beat .7s ease-in-out infinite; }
  .rc-pips.burn button.done svg { --o: #062a33; --f: #3df2ff; --h: #e8ffff; filter: drop-shadow(0 0 7px rgba(61,242,255,.95)); }
  .rc-prompt { margin: 0; min-height: 38px; display: flex; align-items: center; font-size: .9rem; letter-spacing: .22em; text-transform: uppercase; color: var(--ink); font-variant-numeric: tabular-nums; text-shadow: 0 0 10px rgba(255, 46, 136, .8), 0 0 2px rgba(255,255,255,.6); }
  .rc-prompt .caret { color: var(--pink); margin-right: .4em; }
  .rc-prompt .cursor { animation: breathe 1s steps(2, start) infinite; color: var(--cyan); }
  .rc-boost { pointer-events: auto; margin-bottom: 6px; min-height: 58px; padding: 12px 34px; border-radius: 999px; font-family: var(--display); font-size: 1.1rem; letter-spacing: .26em; color: #12081f; background: linear-gradient(90deg, var(--pink), var(--orange) 50%, var(--cyan)); box-shadow: 0 0 30px rgba(255,46,136,.55), inset 0 1px 0 rgba(255,255,255,.6); transform: scale(.6); opacity: 0; visibility: hidden; transition: transform .35s cubic-bezier(.2,1.4,.4,1), opacity .25s, visibility .25s; touch-action: manipulation; }
  .rc-boost.show { transform: none; opacity: 1; visibility: visible; animation: boostPulse .8s ease-in-out infinite; }
  .rc-boost.link { background: linear-gradient(100deg, #ffc531, #fff1ad, #3df2ff); font-size: .9rem; letter-spacing: .14em; }
  .rc-drive { min-height: 22px; margin: 0 0 5px; padding: 4px 12px 8px; font-size: .62rem; letter-spacing: .12em; color: var(--cyan); opacity: 0; position: relative; text-align: center; font-variant-numeric: tabular-nums; }
  .rc-drive.on { opacity: 1; }
  .rc-drive::after { content: ''; position: absolute; bottom: 0; left: 0; width: var(--fuel, 0%); height: 2px; background: currentColor; box-shadow: 0 0 8px currentColor; }
  .rc-drive[data-level="2"] { color: #ffc531; }
  .rc-drive[data-level="3"] { color: #d9ffff; text-shadow: 0 0 10px #3df2ff; }
  @keyframes boostPulse { 50% { box-shadow: 0 0 48px rgba(255,197,49,.85), inset 0 1px 0 rgba(255,255,255,.6); filter: brightness(1.12); } }
  #rcPops { position: absolute; inset: 0; pointer-events: none; }
  .rc-pop { position: absolute; left: 50%; top: 31%; transform: translate(-50%, -50%); text-align: center; white-space: nowrap; font-family: var(--display); font-size: 1.1rem; line-height: 1.3; letter-spacing: .28em; text-transform: uppercase; color: var(--ink); text-shadow: 0 0 12px var(--c, var(--pink)), 0 0 30px var(--c2, var(--orange)); animation: rcPop 1.1s cubic-bezier(.2,.9,.25,1) forwards; }
  .rc-pop small { display: block; max-width: min(320px, 82vw); margin-inline: auto; white-space: normal; line-height: 1.5; margin-top: 2px; font-family: var(--mono); font-size: .72rem; letter-spacing: .3em; }
  .rc-pop.big { font-size: 1.8rem; }
  .rc-pop.dim { color: var(--dim); text-shadow: none; font-size: .8rem; }
  @keyframes rcPop { 0% { opacity: 0; letter-spacing: .6em; transform: translate(-50%, -50%) scale(1.2); } 16% { opacity: 1; letter-spacing: .28em; transform: translate(-50%, -50%) scale(1); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -120%); } }
  .rc-hint { position: absolute; left: 0; right: 0; top: 60%; margin: 0; text-align: center; font-size: .74rem; letter-spacing: .42em; color: var(--ink); text-shadow: 0 0 8px rgba(61,242,255,.8); opacity: 0; transition: opacity .6s; pointer-events: none; }
  .rc-hint.show { opacity: 1; }
  .rc-cars { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .rc-cars button { padding: 6px 6px 12px; border-radius: 18px; background: rgba(0,0,0,.22); box-shadow: inset 0 0 0 .5px rgba(255,255,255,.12); text-align: center; transition: transform .15s, box-shadow .2s; }
  .rc-cars button:hover, .rc-cars button:focus-visible { box-shadow: inset 0 0 0 1.5px var(--c), 0 0 22px color-mix(in srgb, var(--c) 35%, transparent); outline: none; }
  .rc-cars button:active { transform: scale(.97); }
  .rc-cars i { display: block; aspect-ratio: 1; max-width: 128px; margin: 0 auto; background: var(--img) 0 0 / 1600% 100% no-repeat; animation: carSpin 2.4s steps(1) infinite; }
  .rc-cars b { display: block; font-family: var(--display); font-weight: 400; font-size: .95rem; letter-spacing: .12em; color: var(--c); }
  .rc-cars span { font-size: .78rem; color: var(--dim); }
  #race.scene-ready .rc-top { opacity: 1; }
  #race:not(.scene-ready) .rc-top * { pointer-events: none; }
  .rc-top { display: grid; grid-template-columns: 80px minmax(0, 1fr) 80px; align-items: start; }
  .rc-brand { display: block; padding-top: 4px; min-height: 44px; pointer-events: auto; }
  .rc-brand:hover img { opacity: 1; }
  .rc-brand:focus-visible, .studio-credit a:focus-visible, .rc-games-link:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }
  .rc-brand img { display: block; width: 68px; height: 28px; object-fit: contain; opacity: .8; }
  .rc-score output { font-size: clamp(1.4rem, 7vw, 1.7rem); }
  .rc-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .rc-score { position: static; transform: none; opacity: 0; }
  #race.hud .rc-score { opacity: 1; }
  .rc-icons { justify-self: end; }
  .rc-icon { width: 40px; min-height: 44px; }
  .rc-icon[hidden] { display: none; }
  .rc-shields { display: flex; justify-content: center; gap: 5px; margin-top: 6px; }
  .rc-health-heart { display: block; }
  .rc-health-heart svg { display: block; width: 22px; height: 20px; shape-rendering: crispEdges; filter: drop-shadow(0 0 5px rgba(232,35,47,.7)); transition: transform .3s; animation: beat 1.1s ease-in-out infinite; }
  .rc-health-heart .o { fill: #2a0508; } .rc-health-heart .f { fill: #e8232f; } .rc-health-heart .h { fill: #ffffff; }
  .rc-health-heart.empty svg { filter: none; animation: none; }
  .rc-health-heart.empty .o { fill: rgba(243,236,255,.4); } .rc-health-heart.empty .f, .rc-health-heart.empty .h { fill: rgba(0,0,0,.45); }
  @media (prefers-reduced-motion: reduce) { .rc-health-heart svg { animation: none; } }
  .studio-credit { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 14px auto 0; color: var(--dim); font: .6rem var(--mono); letter-spacing: .06em; }
  .studio-credit img { width: 34px; height: 34px; object-fit: contain; }
  .studio-credit a { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; text-underline-offset: 3px; }
  .studio-credit a:hover { color: var(--ink); }
  .rc-drive.warning { color: #ffd477; }
  .rc-pips.warn button.done svg { --o: #382104; --f: #ffb44a; --h: #fff1cf; filter: drop-shadow(0 0 7px rgba(255,180,74,.8)); }
  .rc-pips.warn { animation: fuelLow .65s ease-in-out infinite; }
  @keyframes fuelLow { 50% { opacity: .55; } }
  @media (prefers-reduced-motion: reduce) { .rc-pips.warn { animation: none; } }
  .rc-stage { position: absolute; z-index: 2; left: 16px; right: 16px; bottom: calc(20px + var(--safe-b)); width: min(100% - 32px, 480px); margin: auto; text-align: center; }
  .rc-stage[hidden] { display: none; }
  .rc-stage::before { content: ''; position: absolute; z-index: -1; inset: -80px -16px calc(-20px - var(--safe-b)); background: linear-gradient(transparent, rgba(7,4,15,.88) 32%); pointer-events: none; }
  .rc-stage .eyebrow { color: var(--cyan); font-size: .66rem; letter-spacing: .24em; }
  .rc-stage h2 { margin: 8px 0; font-family: var(--display); font-size: clamp(1.1rem, 4.5vw, 1.6rem); font-weight: 400; }
  .rc-stage p { max-width: 350px; margin: 8px auto 14px; font-family: var(--body); font-size: .86rem; line-height: 1.5; color: var(--dim); }
  .rc-stage .rc-cars { max-width: 340px; margin: 16px auto 6px; gap: 12px; }
  .rc-stage .rc-cars button { border-radius: 12px; background: linear-gradient(180deg, rgba(61,242,255,.03), rgba(61,242,255,.1)); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); }
  .rc-stage .rc-cars i { max-width: 112px; }
  .rc-stage .rc-cars b { font-size: .78rem; }
  .rc-stage .rc-cars span { display: block; margin-top: 5px; font-size: .68rem; }
  .rc-stage .cta-primary { display: block; width: min(100%, 340px); margin: 14px auto 0; min-height: 52px; font-family: var(--display); font-size: .85rem; letter-spacing: .06em; }
  .rc-stage .skip { margin-top: 8px; min-height: 44px; font-size: .66rem; letter-spacing: .09em; }
  .rc-stage .rc-games-link { display: flex; align-items: center; justify-content: center; width: 160px; min-height: 56px; margin: 10px auto 0; }
  .rc-stage .rc-games-link img { display: block; width: 144px; height: 52px; object-fit: contain; opacity: .85; transition: opacity .2s; }
  .rc-stage .rc-games-link:hover img, .rc-stage .rc-games-link:focus-visible img { opacity: 1; }
  .rc-stage .times { justify-content: center; margin: 14px auto; }
  .rc-stage.rez > * { animation: raceRez .52s steps(7, end) both; }
  @keyframes raceRez { 0% { opacity: 0; clip-path: inset(0 0 100%); transform: translateX(-7px); } 35% { opacity: 1; clip-path: inset(0 0 48%); transform: translateX(5px); } 65% { clip-path: inset(0 0 15%); transform: translateX(-2px); } 100% { opacity: 1; clip-path: inset(0); transform: none; } }
  .rc-steer { position: absolute; left: 14px; right: 14px; bottom: calc(32px + var(--safe-b)); display: flex; justify-content: space-between; pointer-events: none; }
  .rc-steer button { pointer-events: auto; width: 58px; height: 58px; border: 1px solid rgba(61,242,255,.35); border-radius: 16px; background: rgba(7,4,15,.65); color: var(--cyan); font-size: 1.8rem; touch-action: none; }
  .rc-steer button:active { background: rgba(61,242,255,.2); box-shadow: 0 0 22px rgba(61,242,255,.3); }
  @media (max-width: 640px), (pointer: coarse) {
    #race .rc-steer { bottom: calc(94px + var(--safe-b)); }
    #race .rc-boost { max-width: calc(100% - 164px); padding-inline: 16px; }
  }
  @media (max-height: 520px) and (orientation: landscape) {
    #race .rc-steer { bottom: calc(94px + var(--safe-b)); }
  }
  #race:not(.hud) .rc-steer, #race.paused .rc-steer, #race.paused .rc-bottom { display: none; }
  #race.paused .rc-stage { bottom: max(24px, 14vh); }
  .rc-stage .rc-summary { display: flex; justify-content: center; gap: 24px; margin: 20px 0; }
  .rc-summary b { display: block; font-family: var(--display); color: var(--ink); font-size: 1.25rem; }
  .rc-summary span { font-size: .6rem; color: var(--dim); letter-spacing: .13em; text-transform: uppercase; }
  @media (max-height: 520px) and (orientation: landscape) {
    .rc-stage { left: auto; right: 24px; width: 310px; bottom: calc(10px + var(--safe-b)); }
    .rc-stage .rc-cars { margin: 8px auto; } .rc-stage .rc-cars i { max-width: 70px; }
    .rc-stage h2 { font-size: 1.1rem; } .rc-stage p { margin: 6px auto; font-size: .75rem; }
    .rc-stage .skip { margin-top: 0; }
  }
  @keyframes carSpin { 0% { background-position-x: 0.0000%; } 6.25% { background-position-x: 6.6667%; } 12.5% { background-position-x: 13.3333%; } 18.75% { background-position-x: 20.0000%; } 25% { background-position-x: 26.6667%; } 31.25% { background-position-x: 33.3333%; } 37.5% { background-position-x: 40.0000%; } 43.75% { background-position-x: 46.6667%; } 50% { background-position-x: 53.3333%; } 56.25% { background-position-x: 60.0000%; } 62.5% { background-position-x: 66.6667%; } 68.75% { background-position-x: 73.3333%; } 75% { background-position-x: 80.0000%; } 81.25% { background-position-x: 86.6667%; } 87.5% { background-position-x: 93.3333%; } 93.75% { background-position-x: 100.0000%; } }

