@font-face {
  font-family: BBFont;
  src: url("../assets/fonts/Elephantmen-Italic.ttf") format("truetype");
  font-display: swap;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #090f17;
}
body {
  display: grid;
  place-items: center;
}
/* Every rule below is limited to the game container, so portal ad overlays keep their own default UI. */
:where(#game),
:where(#game) * {
  box-sizing: border-box;
}
:where(#game) {
  color: #f5f8fb;
  font-family: BBFont, Arial, sans-serif;
  -webkit-user-select: none;
  user-select: none;
}
:where(#game) button,
:where(#game) input,
:where(#game) select {
  font: inherit;
}
:where(#game) button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
:where(#game) button:focus-visible,
:where(#game) select:focus-visible,
:where(#game) input:focus-visible {
  outline: 4px solid #5deaff;
  outline-offset: 4px;
}
#game {
  position: absolute;
  width: 1280px;
  height: 720px;
  transform-origin: top left;
  overflow: hidden;
  background: #17252c;
  outline: none;
  touch-action: none;
}
#world,
#scene,
#hud,
#overlay {
  position: absolute;
  inset: 0;
  width: 1280px;
  height: 720px;
}
#world {
  display: block;
}
#scene:empty {
  pointer-events: none;
}
#hud {
  pointer-events: none;
}
#overlay {
  pointer-events: none;
}
#overlay > * {
  pointer-events: auto;
}
[hidden] {
  display: none !important;
}
.art {
  position: absolute;
  inset: 0;
  background: url("../assets/images/hero.jpg") center/cover;
}
.art:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #061425df 0%, #071a3050 45%, #06142508 75%), linear-gradient(0deg, #041123b3, transparent 45%);
}
.logo {
  object-fit: contain;
  filter: drop-shadow(0 9px 2px #00132770);
  pointer-events: none;
}
.splash .art:after {
  background: linear-gradient(0deg, #071625da, transparent 40%), linear-gradient(180deg, #08233c70, transparent 40%);
}
.splash-logo {
  position: absolute;
  top: 12px;
  left: 320px;
  width: 640px;
  height: 260px;
}
.splash-hit {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
  color: white;
}
.play-prompt {
  position: absolute;
  left: 0;
  right: 0;
  top: 342px;
  font-size: 35px;
  letter-spacing: 3px;
  text-shadow:
    0 3px 0 #142435,
    0 0 20px #040e1d;
  animation: pulse 1.6s infinite;
}
.prompt-box {
  padding: 16px 36px;
  background: #061b32b3;
  border: 2px solid #b8efff79;
  border-radius: 7px;
  box-shadow: 0 5px 0 #0613228a;
}
.mapi {
  position: absolute;
  bottom: 18px;
  left: 570px;
  width: 140px;
  height: 72px;
  object-fit: contain;
  pointer-events: none;
}
.splash-foot {
  position: absolute;
  bottom: 101px;
  width: 100%;
  text-align: center;
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 4px;
  color: #e7f1fa;
}
.menu-logo {
  position: absolute;
  width: 470px;
  height: 208px;
  left: 36px;
  top: 23px;
}
.menu-kicker {
  position: absolute;
  left: 73px;
  top: 219px;
  letter-spacing: 3px;
  font-size: 20px;
  color: #96e7ff;
}
.menu-actions {
  position: absolute;
  left: 75px;
  top: 281px;
  width: 350px;
  display: flex;
  flex-direction: column;
  gap: 17px;
}
.btn {
  border: 2px solid #7d949e;
  border-radius: 9px;
  background: linear-gradient(#334959, #152431);
  box-shadow:
    0 6px 0 #07131d,
    0 8px 2px #0006,
    inset 0 2px 0 #ffffff36;
  color: #fff;
  font-size: 25px;
  min-height: 57px;
  padding: 11px 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  text-shadow: 0 2px 0 #0005;
  transition:
    filter 0.13s,
    transform 0.13s,
    box-shadow 0.13s;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}
.btn:before {
  content: "";
  position: absolute;
  top: 0;
  left: 12px;
  width: 13px;
  height: 100%;
  background: #fff1;
  transform: skew(-25deg);
}
.btn:hover {
  filter: brightness(1.18);
  transform: translateY(-2px);
}
.btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #07131d;
}
.btn.primary {
  color: #172231;
  border: 3px solid #ffe99b;
  background: linear-gradient(#ffe947, #ffbf1f);
  box-shadow:
    0 6px 0 #925318,
    0 9px 0 #07131d,
    inset 0 2px 0 #fff9;
  text-shadow: 0 1px #fff6;
}
.btn.large {
  height: 88px;
  font-size: 48px;
  border-width: 4px;
}
.btn.cyan {
  background: linear-gradient(#3fcbe9, #128da9);
  border-color: #9aecff;
  color: #061c2b;
}
.btn.small {
  font-size: 20px;
  min-height: 44px;
  padding: 8px 16px;
}
.btn:disabled {
  filter: grayscale(0.7) brightness(0.6);
  cursor: default;
  transform: none;
}
.row {
  display: flex;
  gap: 15px;
}
.row .btn {
  flex: 1;
}
.icon {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linejoin: round;
  stroke-linecap: round;
  flex-shrink: 0;
}
.large .icon {
  width: 37px;
  height: 37px;
}
.wallet {
  position: absolute;
  right: 38px;
  top: 25px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: #ffe045;
  border: 2px solid #afc5cf55;
  border-radius: 8px;
  padding: 9px 20px;
  background: #0b1a2add;
  font-size: 27px;
  box-shadow: 0 5px 0 #07111b8c;
  min-width: 150px;
  justify-content: center;
}
.wallet .icon {
  width: 23px;
}
.menu-stamp {
  position: absolute;
  right: 42px;
  bottom: 34px;
  text-align: right;
  font-size: 20px;
  color: #fff;
  text-shadow: 0 3px 0 #0b1825;
}
.menu-stamp b {
  display: block;
  color: #ffe32c;
  font-size: 30px;
  letter-spacing: 1px;
}
.menu-bottom {
  position: absolute;
  left: 76px;
  bottom: 26px;
  letter-spacing: 2px;
  font-family: Arial, sans-serif;
  font-size: 11px;
  font-weight: bold;
  color: #a5bacb;
}
.topbar {
  position: absolute;
  top: 27px;
  left: 40px;
  right: 40px;
  height: 69px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar h1 {
  font-size: 45px;
  margin: 0;
  color: #ffe534;
  text-shadow: 0 4px 0 #081425;
}
.topbar .back {
  height: 48px;
  min-width: 108px;
}
.screen-bg {
  background:
    radial-gradient(ellipse at 75% 30%, #3a647274, #0a192deb 72%),
    url("../assets/images/hero.jpg") center/cover;
}
.screen-bg:before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(130deg, transparent 0 90px, #ffffff02 91px 93px);
}
.section-sub {
  font-family: Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #9cc0cc;
}
.tracks-body {
  position: absolute;
  left: 45px;
  right: 45px;
  top: 111px;
}
.track-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.segments {
  display: flex;
  gap: 6px;
}
.segments .btn {
  font-size: 17px;
  min-height: 37px;
  padding: 7px 17px;
}
.segments .selected {
  color: #182435;
  background: linear-gradient(#ffe247, #ffc62b);
  border-color: #ffed8e;
}
.track-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.track-card {
  height: 226px;
  position: relative;
  border: 2px solid #a4c4ce65;
  background: #152c3b;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 5px 0 #05101e;
}
.track-card:hover {
  border-color: #9ef1ff;
}
.track-card.selected {
  border: 4px solid #ffe13f;
  box-shadow:
    0 0 0 2px #142935,
    0 5px 0 #05101e;
}
.track-card img {
  width: 100%;
  height: 166px;
  object-fit: cover;
  filter: saturate(1.12);
}
.track-card.locked img {
  filter: saturate(0.25) brightness(0.6);
}
.track-copy {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 63px;
  padding: 11px 15px;
  background: linear-gradient(#163344f5, #0d2034);
  text-align: left;
}
.track-copy b {
  font-size: 25px;
  color: #fff;
}
.track-copy small {
  display: block;
  font-family: Arial;
  font-size: 10px;
  letter-spacing: 1.2px;
  color: #a5c5d4;
  margin-top: 3px;
}
.track-number {
  position: absolute;
  left: 11px;
  top: 9px;
  color: #fff;
  background: #11283bc4;
  padding: 4px 9px;
  border-radius: 4px;
  font-size: 21px;
}
.track-medal {
  position: absolute;
  right: 14px;
  top: 12px;
  color: #ffe042;
  font-size: 29px;
  text-shadow: 0 3px #162a3e;
}
.bottom-controls {
  position: absolute;
  bottom: 23px;
  left: 45px;
  right: 45px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.bottom-controls .btn {
  min-width: 220px;
}
.track-best {
  font-size: 19px;
  color: #acd8e1;
}
.garage-platform {
  position: absolute;
  left: 32px;
  top: 128px;
  width: 780px;
  height: 389px;
  background: radial-gradient(ellipse at 50% 70%, #28779252, #172b3b00 70%);
}
#garage-model {
  width: 760px;
  height: 376px;
  position: absolute;
  left: 40px;
  top: 142px;
}
.garage-name {
  position: absolute;
  left: 75px;
  top: 116px;
  font-size: 43px;
  color: #ffe538;
}
.garage-number {
  color: #3fd9ff;
  margin-right: 14px;
}
.stats-panel {
  position: absolute;
  right: 44px;
  top: 157px;
  width: 382px;
  padding: 25px;
  border: 2px solid #b3d0d64d;
  border-radius: 10px;
  background: linear-gradient(135deg, #253e4fe8, #122333f5);
  box-shadow: 0 7px 0 #06131d;
}
.stats-title {
  font-size: 27px;
  margin: 0 0 7px;
}
.stats-sub {
  font-family: Arial;
  font-size: 10px;
  letter-spacing: 1.4px;
  color: #b3d6e1;
  margin-bottom: 26px;
}
.stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 20px;
  margin: 16px 0;
}
.stat .bars {
  display: flex;
  gap: 5px;
}
.bars i {
  display: block;
  width: 17px;
  height: 10px;
  transform: skew(-14deg);
  background: #0a1f2c;
}
.bars i.lit {
  background: #ffe23f;
  box-shadow: 0 0 5px #fce73228;
}
.tuning {
  margin: 27px 0 15px;
  padding-top: 15px;
  border-top: 1px solid #9ac5d443;
  color: #49d9f1;
  font-size: 19px;
}
.stats-panel .btn {
  width: 100%;
  margin: 5px 0;
}
.car-cards {
  position: absolute;
  left: 68px;
  right: 468px;
  bottom: 112px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.car-card {
  height: 113px;
  border: 2px solid #7e9fac80;
  border-radius: 8px;
  background: linear-gradient(#254455, #102634);
  position: relative;
  cursor: pointer;
}
.car-card.selected {
  border: 3px solid #ffe237;
  background: linear-gradient(#3e6269, #203747);
}
.car-card canvas {
  width: 150px;
  height: 92px;
  margin-top: -9px;
}
.car-card .car-label {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  text-align: center;
  color: white;
  font-size: 18px;
}
.car-card .lock {
  position: absolute;
  top: 6px;
  right: 7px;
  color: #f9d55a;
}
.setting-panel {
  position: absolute;
  left: 85px;
  right: 85px;
  top: 134px;
  bottom: 117px;
  border: 2px solid #8cafbd66;
  background: #112536ee;
  border-radius: 12px;
  box-shadow: 0 8px 0 #06111d;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 35px;
  padding: 30px 39px;
}
.setting-group h2 {
  color: #ffe23e;
  font-size: 28px;
  margin: 0 0 21px;
}
.setting-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
  font-size: 21px;
  gap: 13px;
  border-bottom: 1px solid #a0c0d11d;
}
.setting-line input[type="range"] {
  width: 190px;
  accent-color: #3cd9ee;
  height: 24px;
  cursor: pointer;
}
.setting-line output {
  width: 47px;
  text-align: right;
  color: #80dcec;
  font-size: 18px;
}
.setting-line input[type="checkbox"] {
  appearance: none;
  width: 65px;
  height: 30px;
  border-radius: 5px;
  background: #394d5a;
  border: 2px solid #647c89;
  position: relative;
  cursor: pointer;
}
.setting-line input[type="checkbox"]:after {
  content: "OFF";
  position: absolute;
  inset: 3px;
  font-size: 17px;
  text-align: center;
}
.setting-line input:checked {
  background: #45983f;
  border-color: #9ad77b;
}
.setting-line input:checked:after {
  content: "ON";
}
.setting-line select {
  width: 158px;
  padding: 7px;
  color: #fff;
  background: #243d4e;
  border: 1px solid #638591;
  border-radius: 5px;
  font-size: 18px;
}
.setting-note {
  font-family: Arial;
  font-size: 11px;
  line-height: 1.6;
  color: #9ebcca;
  padding-top: 20px;
}
.trophy-grid {
  position: absolute;
  inset: 134px 65px 105px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 19px;
}
.trophy-card {
  background: linear-gradient(135deg, #294653, #152435);
  border: 2px solid #8dc3ce50;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
}
.trophy-card.earned {
  border-color: #ffe039;
  background: linear-gradient(135deg, #5a4d2d, #152b35);
}
.trophy-card .icon {
  width: 68px;
  height: 68px;
  color: #526f83;
  margin-bottom: 8px;
}
.trophy-card.earned .icon {
  color: #ffe14a;
  filter: drop-shadow(0 5px 0 #694923);
}
.trophy-card h2 {
  font-size: 26px;
  margin: 3px 0 7px;
}
.trophy-card p {
  font-family: Arial;
  font-size: 12px;
  color: #acc7d3;
  margin: 0 0 12px;
}
.trophy-card span {
  font-size: 18px;
  color: #9abece;
}
.trophy-card.earned span {
  color: #ffe347;
}
.hud-top {
  position: absolute;
  top: 22px;
  left: 24px;
  right: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.hud-panel {
  background: linear-gradient(135deg, #132633e9, #18384bd1);
  border: 2px solid #bbd5db6f;
  border-radius: 5px;
  box-shadow: 0 4px 0 #0916247c;
  padding: 9px 17px;
  transform: skew(-6deg);
  text-shadow: 0 2px #142332;
}
.hud-panel > * {
  transform: skew(6deg);
}
.lap-value {
  font-size: 33px;
  line-height: 1.2;
}
.lap-value b {
  color: #ffe132;
}
.lap-sub {
  font-family: Arial;
  font-size: 9px;
  letter-spacing: 1.5px;
  color: #a3d1df;
}
.pos {
  position: absolute;
  top: 10px;
  left: 540px;
  width: 200px;
  text-align: center;
  color: #ffdc27;
  font-size: 62px;
  text-shadow:
    0 5px 0 #132432,
    2px 0 #132432,
    -2px 0 #132432;
}
.pos small {
  font-size: 23px;
  color: #fff;
  vertical-align: super;
}
.pos-label {
  display: block;
  font-family: Arial;
  font-size: 10px;
  letter-spacing: 3px;
  color: #d8f0f4;
  text-shadow: 0 2px #101f30;
}
.hud-right {
  display: flex;
  gap: 13px;
  align-items: flex-start;
}
.race-time {
  font-size: 28px;
  min-width: 165px;
}
.hud-button {
  pointer-events: auto;
  padding: 9px;
  min-height: 46px;
  border-color: #89b4bd99;
}
.minimap-panel {
  position: absolute;
  right: 25px;
  top: 87px;
  background: #0c2434bf;
  border: 2px solid #a5d5da8a;
  width: 155px;
  height: 148px;
  border-radius: 10px;
  padding: 7px;
}
.minimap-panel canvas {
  width: 138px;
  height: 126px;
}
.speed-panel {
  position: absolute;
  right: 27px;
  bottom: 27px;
  width: 253px;
  padding: 10px 19px;
}
.speed {
  font-size: 50px;
  line-height: 1;
}
.speed small {
  font-size: 18px;
  color: #c4dbe1;
}
.nitro-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  letter-spacing: 1px;
  color: #70e8fc;
  margin-top: 7px;
}
.nitro-bar {
  height: 13px;
  display: flex;
  gap: 4px;
  margin-top: 5px;
}
.nitro-bar i {
  height: 12px;
  flex: 1;
  background: #205272;
  transform: skew(-16deg);
}
.nitro-bar i.lit {
  background: #19d9f2;
  box-shadow: 0 0 9px #1ad6ec33;
}
.race-cash {
  position: absolute;
  top: 95px;
  left: 28px;
  color: #ffe23a;
  font-size: 22px;
  text-shadow: 0 2px #132737;
}
.race-cash small {
  font-size: 12px;
  color: #d7eaf0;
}
.touch-controls {
  position: absolute;
  left: 30px;
  bottom: 28px;
  display: flex;
  gap: 20px;
  pointer-events: auto;
}
.touch {
  width: 79px;
  height: 79px;
  border-radius: 50%;
  border: 3px solid #e5f6fa8a;
  background: linear-gradient(#122f45b0, #092131de);
  box-shadow: 0 4px 0 #081521a1;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 58px;
  padding: 0;
  line-height: 1;
  touch-action: none;
}
.touch.active {
  background: #21acc2;
  border-color: #c8ffff;
  transform: translateY(3px);
}
.touch.nitro {
  position: absolute;
  right: 319px;
  bottom: 29px;
  color: #74efff;
  font-size: 25px;
  border-color: #6ce4f19c;
  pointer-events: auto;
}
.touch.nitro .icon {
  width: 39px;
  height: 39px;
}
.controls-help {
  position: absolute;
  left: 28px;
  bottom: 127px;
  font-family: Arial;
  font-size: 10px;
  letter-spacing: 1px;
  color: #e9f8fccc;
  text-shadow: 0 2px #132636;
}
.countdown {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffe233;
  font-size: 150px;
  text-shadow:
    0 8px 0 #10233a,
    0 0 40px #143348;
  pointer-events: none;
}
.countdown small {
  position: absolute;
  top: 461px;
  font-size: 22px;
  color: #fff;
  letter-spacing: 3px;
}
.modal-shade {
  position: absolute;
  inset: 0;
  background: #051224b8;
  backdrop-filter: blur(5px);
  display: grid;
  place-items: center;
}
.modal {
  width: 460px;
  padding: 35px;
  border: 3px solid #89b0bd;
  border-radius: 13px;
  background: linear-gradient(135deg, #30495c, #132737);
  box-shadow: 0 10px 0 #051220;
  text-align: center;
}
.modal h1 {
  font-size: 48px;
  color: #ffe337;
  margin: 0 0 13px;
}
.modal p {
  font-family: Arial;
  font-size: 13px;
  color: #bedde5;
  margin: 0 0 26px;
}
.modal .btn {
  width: 100%;
  margin-bottom: 15px;
}
.results {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 25%, #1f6e819f, #07192eeb 80%);
  backdrop-filter: blur(5px);
}
.results-title {
  position: absolute;
  top: 30px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 60px;
  color: #ffe238;
  margin: 0;
  text-shadow: 0 5px 0 #162439;
}
.results-track {
  position: absolute;
  top: 103px;
  left: 0;
  right: 0;
  text-align: center;
  color: #b9e9f3;
  font-size: 22px;
  letter-spacing: 2px;
}
.podium {
  position: absolute;
  top: 143px;
  left: 68px;
  width: 650px;
  height: 363px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
}
.podium-place {
  position: relative;
  width: 199px;
  text-align: center;
}
.podium-car {
  position: absolute;
  width: 190px;
  height: 115px;
  left: 4px;
  top: -105px;
}
.podium-base {
  border: 2px solid #9bbfc7;
  background: linear-gradient(110deg, #4d7384, #263f58);
  border-radius: 7px 7px 0 0;
  height: 120px;
  padding-top: 13px;
  color: #fff;
  box-shadow: 0 10px 0 #071527;
}
.podium-place.first .podium-base {
  height: 179px;
  background: linear-gradient(110deg, #ffd444, #db941d);
  border-color: #ffef91;
  color: #253244;
}
.podium-place.third .podium-base {
  height: 88px;
  background: linear-gradient(110deg, #ae7653, #694b3d);
}
.podium-base b {
  font-size: 63px;
  display: block;
  line-height: 1.05;
}
.podium-base span {
  font-size: 18px;
}
.results-info {
  position: absolute;
  right: 62px;
  top: 169px;
  width: 381px;
  padding: 27px;
  border: 2px solid #a8cdd55d;
  background: #122638e8;
  border-radius: 10px;
}
.results-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 21px;
  margin-bottom: 19px;
}
.results-line b {
  color: #6ee7f5;
  font-size: 27px;
}
.results-reward {
  border-top: 1px solid #91bbcc55;
  padding-top: 21px;
  font-size: 28px;
  color: #ffdc30;
}
.results-info p {
  font-family: Arial;
  font-size: 12px;
  color: #abd0dd;
  margin: 15px 0 0;
  line-height: 1.6;
}
.results-buttons {
  position: absolute;
  bottom: 56px;
  left: 0;
  right: 0;
  display: flex;
  gap: 20px;
  justify-content: center;
}
.results-buttons .btn {
  min-width: 208px;
}
.coin-fly {
  position: absolute;
  top: 365px;
  left: 645px;
  font-size: 34px;
  color: #ffe233;
  text-shadow: 0 3px #985119;
  pointer-events: none;
  animation: fly 0.75s cubic-bezier(0.4, 0, 0.6, 1) forwards;
}
.confetti {
  position: absolute;
  top: -30px;
  width: 10px;
  height: 20px;
  pointer-events: none;
  animation: confetti 3s linear forwards;
}
#toast {
  position: absolute;
  top: 177px;
  left: 330px;
  right: 330px;
  z-index: 20;
  text-align: center;
  padding: 15px;
  background: #0d2637e8;
  border: 2px solid #6eeaf5;
  color: #ffe647;
  border-radius: 7px;
  font-size: 29px;
  box-shadow: 0 6px 0 #062137;
  opacity: 0;
  transform: translateY(-15px);
  transition: 0.2s;
  pointer-events: none;
}
#toast.show {
  opacity: 1;
  transform: none;
}
#loading {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: radial-gradient(ellipse, #294b60, #0b1d30);
  display: grid;
  place-content: center;
  text-align: center;
}
.loading-word {
  font-size: 58px;
  color: #ffe632;
}
.loading-bar {
  height: 8px;
  border-radius: 6px;
  background: #061727;
  width: 340px;
  margin: 25px auto 5px;
  overflow: hidden;
}
.loading-bar i {
  display: block;
  background: #37deef;
  width: 40%;
  height: 100%;
  animation: load 1.3s infinite;
}
.loading-bar + p {
  font-family: Arial;
  font-size: 10px;
  letter-spacing: 3px;
  color: #aed4e5;
}
#loading.done {
  display: none;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.68;
    transform: scale(0.98);
  }
}
@keyframes load {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(350%);
  }
}
@keyframes fly {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-602px, -262px) scale(0.45);
  }
}
@keyframes confetti {
  to {
    transform: translateY(770px) rotate(720deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .play-prompt {
    animation: none;
  }
}
.garage-art {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, #08172888, #081b3030),
    url(../assets/images/garage.jpg) center/cover;
}
#rotate-hint {
  display: none;
}
@media (pointer: coarse) and (max-aspect-ratio: 1/1) {
  #rotate-hint {
    display: block;
    position: fixed;
    bottom: 10vh;
    left: 20px;
    right: 20px;
    text-align: center;
    color: #82dbea;
    font:
      16px BBFont,
      Arial;
    letter-spacing: 2px;
  }
}
.garage-platform {
  background: none;
}

.touch {
  width: 86px;
  height: 86px;
}
body {
  display: block;
}
#game {
  position: fixed;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
.touch.brake {
  position: absolute;
  left: 242px;
  bottom: 28px;
  pointer-events: auto;
  color: #ffe28a;
  border-color: #f8d38c9c;
  font-size: 19px;
}
.touch.brake.active {
  background: #aa7430;
  border-color: #ffeab2;
}

.countdown .count-number {
  font-size: 200px;
  animation: start-pop 0.22s ease-out;
  text-shadow:
    0 8px 0 #081a2d,
    0 0 55px #081a2d;
}
.countdown.go {
  color: #8fff80;
}
.start-lights {
  position: absolute;
  top: 465px;
  display: flex;
  gap: 19px;
  padding: 10px 18px;
  border: 2px solid #667e87;
  border-radius: 30px;
  background: #091923e8;
  box-shadow: 0 5px 0 #030d17;
}
.start-lights i {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #31424b;
  box-shadow: inset 0 2px 4px #0008;
}
.start-lights i.on {
  background: #ffe02f;
  box-shadow: 0 0 15px #ffe02f88;
}
.start-lights i.green {
  background: #79ff72;
  box-shadow: 0 0 15px #79ff72aa;
}
.countdown small {
  top: 532px;
  font-family: Arial, sans-serif;
  font-size: 15px;
  font-weight: 700;
  text-shadow: 0 2px 5px #000;
  letter-spacing: 2px;
}
.record-badge {
  color: #ffe231;
  font-size: 22px;
  margin: -9px 0 16px;
  text-align: center;
}
.recover {
  pointer-events: auto;
  color: #ffe440;
}
@keyframes start-pop {
  from {
    transform: scale(1.28);
    opacity: 0.5;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
.podium-base span {
  display: block;
  font-size: 16px;
  line-height: 1.15;
  white-space: nowrap;
}
.podium-place.third .podium-base {
  padding-top: 7px;
}
.podium-place.third .podium-base b {
  font-size: 49px;
  line-height: 1;
}
.countdown.go .count-number {
  position: absolute;
  top: 84px;
  font-size: 124px;
}
.countdown.go .start-lights {
  top: 215px;
}
.countdown.go small {
  top: 278px;
}

#world {
  filter: brightness(1.16) saturate(1.03);
}

/* The live cool-down lap remains visible behind the classification. */
.results {
  background: linear-gradient(180deg, #04152655, transparent 32%, transparent 74%, #03101c77);
  backdrop-filter: none;
  animation: finish-reveal 0.45s ease-out;
}
.finish-checkers {
  position: absolute;
  left: 40px;
  top: 23px;
  width: 190px;
  height: 13px;
  background: repeating-conic-gradient(#edfaff 0% 25%, #123043 0% 50%) 0 0/26px 26px;
  transform: skew(-12deg);
  box-shadow: 0 3px 10px #0007;
}
.results-title {
  top: 47px;
  left: 38px;
  right: auto;
  text-align: left;
  font-size: 59px;
  text-shadow:
    0 5px 0 #071525,
    0 0 18px #061c2c;
}
.results-track {
  top: 122px;
  left: 42px;
  right: auto;
  text-align: left;
  font-size: 19px;
  text-shadow: 0 2px 5px #000;
}
.autopilot-badge {
  position: absolute;
  left: 42px;
  top: 158px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid #80e8e9a0;
  background: #071e2ddd;
  border-radius: 6px;
  color: #a9faff;
  font-size: 15px;
  letter-spacing: 1px;
  box-shadow: 0 3px 8px #0005;
}
.autopilot-badge .icon {
  width: 20px;
  height: 20px;
}
.classification {
  position: absolute;
  right: 36px;
  top: 140px;
  width: 441px;
  background: linear-gradient(135deg, #173747f2, #091d2af2);
  border: 2px solid #95dce0aa;
  border-radius: 12px;
  padding: 19px 15px 16px;
  box-shadow:
    0 9px 0 #04101bdd,
    0 14px 22px #0005;
  animation: classification-in 0.65s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.classification-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 12px;
}
.classification-heading h2 {
  font-size: 23px;
  color: #ffe139;
  margin: 0;
  line-height: 1.1;
}
.classification-heading > span {
  font:
    10px Arial,
    sans-serif;
  color: #9fd0da;
  white-space: nowrap;
  font-weight: bold;
}
.classification-labels {
  display: flex;
  justify-content: space-between;
  margin: 0 9px 9px;
  font:
    10px Arial,
    sans-serif;
  letter-spacing: 1.3px;
  color: #9fc0d0;
  font-weight: bold;
}
.classification-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.classification-row {
  height: 68px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #507582;
  border-left: 4px solid var(--car-color);
  border-radius: 6px;
  background: linear-gradient(115deg, #284b5c, #102c3e);
  padding: 0 9px 0 6px;
  animation: row-reveal 0.4s both;
  animation-delay: calc(0.12s + var(--row) * 0.08s);
}
.classification-row.your-result {
  border-color: #ffe238;
  background: linear-gradient(115deg, #5a552d, #2b3c38);
  box-shadow: inset 0 0 14px #ffd63712;
}
.classification-place {
  font-size: 30px;
  color: #e8f7ff;
  width: 27px;
  text-align: center;
}
.your-result .classification-place {
  color: #ffe13c;
}
.classification-row canvas {
  width: 86px;
  height: 59px;
  flex-shrink: 0;
}
.classification-driver {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 92px;
}
.classification-driver b {
  font-size: 21px;
}
.classification-driver span {
  font:
    10px Arial,
    sans-serif;
  letter-spacing: 1px;
  color: #a6c6d3;
  font-weight: bold;
}
.classification-time {
  margin-left: auto;
  font-size: 19px;
  color: #95ddf1;
  white-space: nowrap;
}
.has-finished .classification-time {
  color: #edfbff;
}
.results-info {
  left: 40px;
  right: auto;
  top: auto;
  bottom: 119px;
  width: 650px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 25px;
  padding: 19px 22px;
  border-color: #a8cdd58a;
  background: #0b2636e3;
}
.results-line {
  margin: 0;
  font-size: 18px;
}
.results-line b {
  font-size: 24px;
}
.results-reward {
  grid-column: 1/-1;
  border-top: 1px solid #91bbcc55;
  padding-top: 12px;
  font-size: 26px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.results-reward .icon {
  width: 23px;
}
.results-reward #reward {
  margin-right: 0;
}
.record-badge {
  position: absolute;
  right: 20px;
  bottom: 20px;
  font-size: 15px;
  line-height: 1.2;
  margin: 0;
  max-width: 165px;
  text-align: right;
}
.results-buttons {
  bottom: 34px;
  left: 40px;
  right: 36px;
  justify-content: flex-start;
}
.results-buttons .btn {
  min-width: 178px;
}
.results-buttons .primary {
  margin-left: auto;
  min-width: 300px;
}
@keyframes finish-reveal {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes classification-in {
  from {
    opacity: 0;
    transform: translateX(90px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes row-reveal {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.world-body {
  top: 114px;
}
.campaign-route {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  height: 58px;
  padding: 0 10px;
  margin-bottom: 9px;
}
.campaign-route:before {
  content: "";
  position: absolute;
  left: 31px;
  right: 31px;
  top: 23px;
  height: 4px;
  border: 1px solid #537584;
  background: linear-gradient(90deg, #ffe03e var(--progress), #234352 var(--progress));
  box-shadow: 0 2px 0 #071623;
}
.campaign-node {
  position: relative;
  width: 48px;
  height: 48px;
  background: linear-gradient(#1a3546, #0a1f2f);
  border: 2px solid #567986;
  border-radius: 50%;
  color: #78929f;
  font-size: 22px;
  box-shadow: 0 4px 0 #04121c;
  padding: 0;
  display: grid;
  place-items: center;
}
.campaign-node .icon {
  position: absolute;
  bottom: -8px;
  right: -5px;
  width: 18px;
  height: 18px;
  color: #64899a;
  background: #102a39;
  border-radius: 3px;
}
.campaign-node.cleared {
  background: linear-gradient(#f7d33b, #a77516);
  border-color: #ffe891;
  color: #182b3a;
}
.campaign-node.cleared .icon {
  color: #ffe238;
}
.campaign-node.available {
  color: #ffe436;
  border-color: #ffe239;
  background: linear-gradient(#485746, #1c3c46);
}
.campaign-node.current {
  outline: 2px solid #64e7f5;
  outline-offset: 4px;
}
.campaign-node:disabled {
  cursor: default;
  opacity: 0.75;
}
.world-body .track-tools {
  margin-bottom: 15px;
}
.world-body .section-sub {
  font-size: 11px;
  letter-spacing: 1px;
}
.world-body .track-grid {
  gap: 16px;
}
.world-body .track-card {
  height: 183px;
}
.world-body .track-card img {
  height: 128px;
}
.world-body .track-copy {
  height: 54px;
  padding: 8px 13px;
}
.world-body .track-copy b {
  font-size: 23px;
}
.world-body .track-copy small {
  font-size: 9px;
  letter-spacing: 0.7px;
}
.reverse-label {
  position: absolute;
  top: 12px;
  left: 58px;
  padding: 5px 8px;
  border-radius: 4px;
  background: #cc3477de;
  color: #fff;
  font:
    10px Arial,
    sans-serif;
  font-weight: bold;
  letter-spacing: 1px;
}
.campaign-result {
  position: absolute;
  top: 211px;
  left: 43px;
  font-size: 17px;
  letter-spacing: 1px;
  color: #ffe643;
  text-shadow: 0 2px 4px #071421;
  max-width: 600px;
}

/* Live illustrated title scene. Branding and controls sit above its particles. */
.menu-cinema {
  position: absolute;
  inset: 0;
  width: 1280px;
  height: 720px;
  pointer-events: none;
}
.menu-logo,
.splash-logo {
  animation: logo-wave 6s ease-in-out infinite;
  transform-origin: 50% 80%;
}
.menu-mapi {
  left: 584px;
  bottom: 18px;
  width: 112px;
  height: 66px;
  filter: drop-shadow(0 3px 4px #061020);
}
.menu-bottom {
  max-width: 430px;
  line-height: 1.6;
  bottom: 22px;
}
.menu-actions {
  animation: menu-arrive 0.65s cubic-bezier(0.2, 0.8, 0.3, 1);
}
@keyframes logo-wave {
  0%,
  100% {
    transform: translateY(0) rotate(-0.12deg) scale(1);
  }
  50% {
    transform: translateY(-2.4px) rotate(0.15deg) scale(1.006);
  }
}
@keyframes menu-arrive {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.btn.danger {
  background: linear-gradient(#f75357, #ac1c31);
  border-color: #ffb1a4;
  color: #fff;
  box-shadow:
    0 5px 0 #681523,
    0 8px 0 #07131d,
    inset 0 2px 0 #ffc5b055;
  text-shadow: 0 2px #6d142c;
}
.reset-setting {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 16px;
}
.reset-setting span {
  font:
    11px Arial,
    sans-serif;
  color: #ecbfc1;
  line-height: 1.5;
}
.reset-modal {
  width: 530px;
  border-color: #ff9399;
}
.reset-modal h1 {
  color: #ff7886;
}
.reset-modal p {
  font:
    15px Arial,
    sans-serif;
  line-height: 1.7;
  color: #e2eef4;
}
.reset-modal .reset-note {
  font-size: 12px;
  color: #91b7c9;
}
.reset-modal .btn {
  margin: 12px 5px 0;
  min-width: 190px;
}
@media (prefers-reduced-motion: reduce) {
  .menu-logo,
  .splash-logo,
  .menu-actions {
    animation: none;
  }
}
@media (pointer: coarse) {
  .reset-setting .btn {
    min-height: 82px;
    min-width: 170px;
  }
  .reset-modal .btn {
    min-height: 82px;
  }
}

/* ===== SUPER UPDATE: modes, cups, race HUD ===== */
.mode-grid {
  position: absolute;
  left: 45px;
  right: 45px;
  top: 118px;
  bottom: 112px;
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 18px;
}
.mode-card {
  position: relative;
  border: 3px solid #a4c4ce70;
  border-radius: 14px;
  overflow: hidden;
  background: #10283a;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 7px 0 #05101e;
  text-align: left;
  color: #fff;
  transition:
    transform 0.14s,
    border-color 0.14s;
}
.mode-card.wide {
  grid-row: 1/3;
}
.mode-card:hover,
.mode-card:focus-visible {
  border-color: #ffe23f;
  transform: translateY(-3px);
}
.mode-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.15);
}
.mode-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #06152500 30%, #061525e8 78%);
}
.mode-copy {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 20px;
}
.mode-copy b {
  display: block;
  font-size: 34px;
  color: #ffe23e;
  text-shadow: 0 4px 0 #071525;
}
.mode-card.wide .mode-copy b {
  font-size: 46px;
}
.mode-copy small {
  display: block;
  font:
    13px Arial,
    sans-serif;
  font-weight: 700;
  color: #d6eef5;
  margin-top: 6px;
  line-height: 1.4;
}
.mode-stat {
  position: absolute;
  right: 16px;
  top: 14px;
  background: #071e2ddd;
  border: 1px solid #80e8e9a0;
  border-radius: 6px;
  padding: 6px 11px;
  font-size: 16px;
  color: #a9faff;
}
.difficulty-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -6px 0 12px;
  font-size: 17px;
  color: #ffe23e;
}
.difficulty-row .btn {
  font-size: 16px;
  min-height: 34px;
  padding: 5px 16px;
}
.difficulty-row .btn.selected {
  color: #182435;
  background: linear-gradient(#ffe247, #ffc62b);
  border-color: #ffed8e;
}
.difficulty-row small {
  font-family: Arial;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #9cc0cc;
  margin-left: 8px;
}
.mode-banner {
  height: 44px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #80e8e9a0;
  background: #071e2ddd;
  border-radius: 8px;
  color: #a9faff;
  font-size: 16px;
  letter-spacing: 1px;
}
.track-medal.m1 {
  color: #d8945a;
}
.track-medal.m2 {
  color: #dfe8ee;
}
.track-medal.m3 {
  color: #ffe042;
}
.cup-grid {
  position: absolute;
  left: 45px;
  right: 45px;
  top: 118px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.cup-card {
  position: relative;
  height: 376px;
  border: 3px solid #a4c4ce60;
  border-radius: 14px;
  background: linear-gradient(170deg, #21414f, #0c1f2d);
  padding: 18px 14px;
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: 0 7px 0 #05101e;
  text-align: center;
}
.cup-card:hover {
  border-color: var(--cup);
}
.cup-card.selected {
  border-color: var(--cup);
  box-shadow:
    0 0 0 2px #142935,
    0 0 26px color-mix(in srgb, var(--cup) 45%, transparent),
    0 7px 0 #05101e;
}
.cup-card.locked {
  filter: grayscale(0.75) brightness(0.7);
}
.cup-trophy .icon {
  width: 74px;
  height: 74px;
  color: var(--cup);
  filter: drop-shadow(0 5px 0 #0008);
}
.cup-card b {
  font-size: 26px;
  color: var(--cup);
  text-shadow: 0 3px 0 #061322;
}
.cup-card small {
  font:
    11px Arial,
    sans-serif;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: #b9d8e2;
}
.cup-tracks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  width: 100%;
  margin-top: 4px;
}
.cup-tracks img {
  width: 100%;
  height: 56px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid #ffffff30;
}
.cup-prize {
  font-size: 17px;
  color: #ffe23a;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cup-prize .icon {
  width: 18px;
  height: 18px;
}
.cup-state {
  margin-top: auto;
  font-size: 15px;
  color: #a9faff;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  line-height: 1.2;
}
.cup-state .icon {
  width: 16px;
  height: 16px;
}
.cup-info {
  position: absolute;
  left: 48px;
  right: 48px;
  top: 510px;
  font-size: 17px;
  color: #ffe23e;
  text-align: center;
  line-height: 1.5;
}
.cup-info small {
  font:
    11px Arial,
    sans-serif;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #9cc0cc;
}
.btn.danger {
  background: linear-gradient(#e2533f, #a62a22);
  border-color: #ff9f8c;
}
.standings {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}
.standing-row {
  display: grid;
  grid-template-columns: 34px 1fr 54px 60px;
  align-items: center;
  height: 38px;
  padding: 0 12px;
  border-radius: 6px;
  background: linear-gradient(115deg, #284b5c, #102c3e);
  border: 1px solid #507582;
  font-size: 19px;
}
.standing-row.you {
  border-color: #ffe238;
  background: linear-gradient(115deg, #5a552d, #2b3c38);
}
.standing-row b {
  color: #ffe13c;
}
.standing-row em {
  font-style: normal;
  color: #7dffb0;
  font-size: 16px;
  text-align: right;
}
.standing-row strong {
  text-align: right;
  color: #6ee7f5;
  font-size: 22px;
}
.cup-side {
  display: block !important;
}
.cup-side .results-line {
  margin-bottom: 8px;
  color: #ffe23e;
}
.cup-side .standings {
  margin-bottom: 10px;
}
.cup-final {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 34px;
}
.cup-final h1 {
  margin: 8px 0 4px;
  font-size: 54px;
  color: var(--cup);
  text-shadow: 0 5px 0 #071525;
}
.cup-final .results-track {
  position: static;
  margin-bottom: 16px;
}
.cup-final .standings {
  width: 520px;
}
.cup-final .campaign-result {
  position: static;
  margin-top: 12px;
}
.cup-final .results-buttons {
  left: 0;
  right: 0;
  justify-content: center;
}
.cup-final .results-buttons .primary {
  margin-left: 0;
}
.cup-final-trophy .icon {
  width: 120px;
  height: 120px;
  color: #55707f;
  filter: drop-shadow(0 7px 0 #0009);
}
.cup-final-trophy.t3 .icon {
  color: #ffd23a;
  animation: trophy-pop 0.9s cubic-bezier(0.2, 1.6, 0.4, 1);
}
.cup-final-trophy.t2 .icon {
  color: #e2edf2;
  animation: trophy-pop 0.9s;
}
.cup-final-trophy.t1 .icon {
  color: #d8945a;
  animation: trophy-pop 0.9s;
}
@keyframes trophy-pop {
  from {
    transform: scale(0.2) rotate(-25deg);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
.cup-prize-big {
  margin-top: 14px;
  font-size: 34px;
  color: #ffe23a;
  display: flex;
  gap: 10px;
  align-items: center;
}
.cup-prize-big .icon {
  width: 30px;
  height: 30px;
}
.race-stats {
  position: absolute;
  left: 42px;
  top: 248px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 650px;
}
.race-stats span {
  background: #071e2ddd;
  border: 1px solid #80e8e980;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 14px;
  color: #a9faff;
}
.race-stats b {
  color: #ffe23e;
  margin-left: 4px;
}
.results.mode-tt .results-info {
  bottom: 119px;
}
.classification-row.out {
  opacity: 0.55;
  filter: grayscale(0.6);
}
/* race HUD */
.lap-times {
  display: flex;
  gap: 12px;
  font:
    10px Arial,
    sans-serif;
  font-weight: 700;
  letter-spacing: 1px;
  color: #a3d1df;
  margin-top: 3px;
}
.lap-times b {
  color: #fff;
  font-size: 12px;
}
.gaps {
  display: flex;
  gap: 10px;
  justify-content: center;
  font:
    12px Arial,
    sans-serif;
  font-weight: 700;
  margin-top: 4px;
  text-shadow: 0 2px #101f30;
}
.gaps .good {
  color: #7dffb0;
}
.gaps .bad {
  color: #ff9d7a;
}
.popups {
  position: absolute;
  left: 300px;
  right: 300px;
  top: 168px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}
.popup {
  font-size: 27px;
  text-shadow:
    0 3px 0 #0b1a28,
    0 0 14px #000a;
  animation: popup 1.6s ease-out forwards;
  white-space: nowrap;
}
.popup.big {
  font-size: 44px;
}
@keyframes popup {
  0% {
    opacity: 0;
    transform: scale(0.5) translateY(14px);
  }
  12% {
    opacity: 1;
    transform: scale(1.12);
  }
  22% {
    transform: scale(1);
  }
  78% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-26px);
  }
}
.wrong-way {
  position: absolute;
  left: 0;
  right: 0;
  top: 300px;
  text-align: center;
  font-size: 64px;
  color: #ff4f3f;
  text-shadow:
    0 5px 0 #2a0b08,
    0 0 22px #000;
  animation: blink 0.5s steps(2) infinite;
}
@keyframes blink {
  50% {
    opacity: 0.25;
  }
}
.mode-tag {
  position: absolute;
  top: 132px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 15px;
  letter-spacing: 2px;
  color: #ffe23e;
  text-shadow: 0 2px 4px #000;
}
.mode-tag:empty {
  display: none;
}
.drift-meter {
  position: absolute;
  right: 27px;
  bottom: 150px;
  width: 253px;
  height: 22px;
  border-radius: 5px;
  background: #0b1d2bcc;
  border: 2px solid #bbd5db55;
  overflow: hidden;
  opacity: 0.35;
  transition: opacity 0.2s;
}
.drift-meter i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: #5fd8ff;
  transition: background 0.15s;
}
.drift-meter span {
  position: absolute;
  inset: 0;
  text-align: center;
  font-size: 13px;
  line-height: 19px;
  letter-spacing: 3px;
  color: #fff;
  text-shadow: 0 1px 2px #000;
}
.drift-meter.on {
  opacity: 1;
}
.drift-meter.lv0 i {
  background: #6a8796;
}
.drift-meter.lv1 i {
  background: #5fd8ff;
}
.drift-meter.lv2 i {
  background: #ffae2e;
}
.drift-meter.lv3 i {
  background: #d36bff;
}
.drift-meter.turbo {
  opacity: 1;
  border-color: #ffe23e;
}
.drift-meter.turbo span:after {
  content: " TURBO!";
}
#hud.tt .race-cash {
  display: none;
}
.trophy-grid {
  inset: 122px 50px 100px;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.trophy-card {
  padding: 10px 12px;
}
.trophy-card .icon {
  width: 40px;
  height: 40px;
  margin-bottom: 2px;
}
.trophy-card h2 {
  font-size: 19px;
  margin: 2px 0 4px;
}
.trophy-card p {
  font-size: 11px;
  margin: 0 0 6px;
}
.trophy-card span {
  font-size: 15px;
}
.setting-group .setting-line {
  height: 46px;
}
.setting-panel {
  padding: 22px 39px;
}
#hud.touch-on .controls-help {
  display: none;
}
.controls-help {
  animation: helpfade 0.8s 10s forwards;
}
@keyframes helpfade {
  to {
    opacity: 0;
  }
}

/* keyboard menu focus */
.kb-focus {
  outline: 4px solid #ffe23f !important;
  outline-offset: 3px;
  box-shadow:
    0 0 0 7px #ffe23f40,
    0 0 26px #ffe23f90 !important;
  z-index: 2;
}
#game:focus {
  outline: none;
}
/* GOKART RUSH — original 16:9 presentation, 1280 × 720. */
html,
body {
  background: #050c15;
}
#game,
#world,
#scene,
#hud,
#overlay {
  width: 1280px;
  height: 720px;
}
#world {
  filter: brightness(1.04) saturate(1.05);
}

.menu-cinema {
  width: 1280px;
  height: 720px;
}
.menu-logo {
  left: 18px;
  top: -5px;
  width: 540px;
  height: 300px;
}
.menu-kicker {
  left: 69px;
  top: 264px;
  font-size: 17px;
  letter-spacing: 1.8px;
  color: #fff1b4;
  text-shadow: 0 2px 5px #000;
}
.menu-actions {
  left: 75px;
  top: 308px;
  width: 360px;
  gap: 17px;
}
.menu-actions > .large {
  height: 88px;
}
.menu-actions .row .btn {
  font-size: 23px;
  padding: 13px 12px;
}
.menu-stamp {
  font-size: 16px;
  max-width: 500px;
  line-height: 1.5;
}
.menu-stamp b {
  font-size: 28px;
}
.menu-bottom {
  font-size: 10px;
  letter-spacing: 1px;
  line-height: 1.7;
  bottom: 27px;
}
.splash-logo {
  left: 38px;
  top: 1px;
  width: 570px;
  height: 330px;
}
.splash .art:after {
  background: linear-gradient(90deg, #06142533, transparent 70%), linear-gradient(0deg, #071625ba, transparent 40%);
}
.play-prompt {
  left: 41px;
  right: auto;
  width: 565px;
  top: 405px;
  font-size: 30px;
  letter-spacing: 2px;
}
.prompt-box {
  display: inline-block;
  padding: 20px 27px;
  background: linear-gradient(#ffe943, #ffbf1f);
  color: #172738;
  border: 3px solid #fff0a4;
  border-radius: 10px;
  box-shadow:
    0 6px #925318,
    0 9px 16px #0006;
  text-shadow: 0 1px #fff6;
}
.splash-foot {
  bottom: 100px;
  font-size: 12px;
  letter-spacing: 3px;
  text-shadow: 0 2px 6px #000;
}
.mapi {
  left: 570px;
  bottom: 18px;
  width: 140px;
  height: 72px;
}
.menu-mapi {
  left: 584px;
  bottom: 18px;
  width: 112px;
  height: 66px;
}
.screen-bg {
  background:
    radial-gradient(ellipse at 75% 30%, #25485b94, #07152bea 72%),
    url("../assets/images/hero.jpg") center/cover;
}
.garage-art {
  background:
    linear-gradient(90deg, #0821389c, #07162799),
    url("../assets/images/garage.jpg") center/cover;
}
#garage-model {
  left: 55px;
  top: 177px;
  width: 715px;
  height: 354px;
}
.garage-name {
  top: 115px;
  font-size: 43px;
  left: 75px;
}
.car-card .car-label {
  bottom: 0;
  padding: 5px 0;
  background: linear-gradient(#09223acc, #061b2fff);
  font-size: 17px;
  text-shadow: 0 2px #000;
}
.stats-panel .stats-sub {
  font-size: 10px;
  line-height: 1.6;
}
#garage-model {
  left: 100px;
  top: 177px;
  width: 620px;
  height: 307px;
}
.world-body .track-card {
  height: 166px;
}
.world-body .track-card img {
  height: 112px;
}
/* Static HD showroom illustrations in an enclosed workshop. */
.garage-art {
  background:
    linear-gradient(90deg, #06111e18, #0713208c),
    url("../assets/images/garage.jpg") center/cover;
}
.garage-platform {
  left: 118px;
  top: 346px;
  width: 590px;
  height: 147px;
  background: radial-gradient(ellipse, #020a13a6 0%, #020a1342 40%, #020a1300 71%);
  pointer-events: none;
}
#garage-model {
  left: 100px;
  top: 177px;
  width: 620px;
  height: 307px;
  pointer-events: none;
}
.car-card canvas {
  width: 150px;
  height: 92px;
}

/* ---------- WebGL effects layer (sits right above the 2D race canvas, below the HUD) ---------- */
#fx {
  position: absolute;
  left: 0;
  top: 0;
  width: 1280px;
  height: 720px;
  display: block;
  pointer-events: none;
  visibility: hidden;
}
/* ---------- item slot ---------- */
.item-slot {
  position: absolute;
  top: 18px;
  left: 262px;
  width: 104px;
  height: 104px;
  border-radius: 18px;
  background: radial-gradient(circle at 50% 40%, #1f4a63e6, #0c1d2bf0 70%);
  border: 3px solid #bfe9f3a0;
  box-shadow:
    0 5px 0 #08142099,
    inset 0 0 18px #59e8ff33;
  transform: skew(-6deg);
}
.item-slot canvas {
  position: absolute;
  inset: 2px;
  width: 94px;
  height: 94px;
  transform: skew(6deg);
}
.item-slot.empty canvas {
  opacity: 0;
}
.item-slot.empty::after {
  content: "ITEM";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 15px;
  letter-spacing: 2px;
  color: #6f98a8;
  transform: skew(6deg);
}
.item-slot.ready {
  border-color: #ffe54a;
  animation: itemReady 0.6s ease-in-out infinite alternate;
}
@keyframes itemReady {
  from {
    box-shadow:
      0 5px 0 #08142099,
      0 0 8px #ffe54a55;
  }
  to {
    box-shadow:
      0 5px 0 #08142099,
      0 0 26px #ffe54acc;
  }
}
.item-key {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -20px;
  text-align: center;
  font-size: 12px;
  letter-spacing: 1px;
  color: #d8f0f4;
  text-shadow: 0 2px #0b1a28;
  transform: skew(6deg);
}
.item-slot.empty .item-key {
  opacity: 0;
}
.touch.item {
  position: absolute;
  right: 319px;
  bottom: 128px;
  pointer-events: auto;
  color: #ffe54a;
  border-color: #ffe54a9c;
  font-size: 13px;
  overflow: hidden;
}
.touch.item canvas {
  position: absolute;
  inset: 6px;
  width: calc(100% - 12px);
  height: calc(100% - 12px);
}
.touch.item span {
  position: absolute;
  bottom: 6px;
  left: 0;
  right: 0;
  text-align: center;
}
/* ---------- portrait phones: ask to rotate ---------- */
#rotate-hint {
  display: none;
}
@media (orientation: portrait) and (pointer: coarse) {
  #rotate-hint {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: #071220;
    color: #ffe23e;
    font-family: BBFont, Arial, sans-serif;
    font-size: 30px;
    text-align: center;
  }
  #rotate-hint span {
    font-size: 14px;
    color: #cfe7ee;
    letter-spacing: 2px;
  }
  .rotate-phone {
    width: 64px;
    height: 110px;
    border: 6px solid #e9f6fa;
    border-radius: 14px;
    animation: rotatePhone 1.6s ease-in-out infinite;
  }
  @keyframes rotatePhone {
    0%,
    30% {
      transform: rotate(0deg);
    }
    60%,
    100% {
      transform: rotate(-90deg);
    }
  }
}
