:root {
  --ink: #0b0f0d;
  --panel: #111713;
  --panel-2: #182019;
  --lime: #d8ff38;
  --cream: #f3f5e8;
  --muted: #93a095;
  --line: rgba(243, 245, 232, .14);
  --red: #ff715f;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  background: #080b09;
  color: var(--cream);
  font-family: 'DM Sans', sans-serif;
  overflow: hidden;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* GAME CONTAINER SHELL - FULLY FLUID IFRAME COMPATIBLE (800x450 and up) */
.game-container {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
  background: #101712;
  border: 0;
  box-shadow: 0 30px 100px #000;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  touch-action: none;
}

/* TOPBAR NAVIGATION */
.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5%;
  background: linear-gradient(180deg, rgba(6, 9, 7, .85), transparent);
  pointer-events: none;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 0;
  color: var(--cream);
  font: 700 12px 'DM Sans';
  letter-spacing: 1.7px;
  text-align: left;
  cursor: pointer;
  pointer-events: auto;
}

.wordmark b {
  color: var(--lime);
  font-weight: 700;
}

.mark {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 2px solid var(--lime);
  color: var(--lime);
  font-size: 18px;
  line-height: 16px;
  transform: rotate(45deg);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 1.5px;
}

.online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 10px var(--lime);
}

.avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-left: 6px;
  border-radius: 50%;
  background: #e2ebcf;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

/* SCREEN PANELS BASE */
.screen-panel {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  transition: opacity .3s ease, transform .3s ease;
  overflow-x: hidden;
}

.screen-panel.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(.98);
}

/* HOME PANEL LAYOUT (OPTIMIZED FOR 800x450 IFRAME & DESKTOP) */
.home-panel {
  justify-content: space-between;
  padding: 68px 6% 76px;
  background: linear-gradient(90deg, rgba(5, 8, 6, .90) 0%, rgba(5, 8, 6, .56) 45%, transparent 80%);
}

.hero-copy {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 580px;
}

.eyebrow, .pause-kicker {
  font-size: 10px;
  letter-spacing: 2.5px;
  color: var(--lime);
  font-weight: 700;
}

.hero-copy h1 {
  font: 800 clamp(42px, 8.5vh, 80px)/.86 'Barlow Condensed';
  letter-spacing: -1.5px;
  text-transform: uppercase;
  margin: 10px 0 14px;
}

.hero-copy h1 em {
  font-style: normal;
  color: var(--lime);
}

.hero-description {
  color: #cad2c7;
  line-height: 1.5;
  font-size: clamp(12px, 2.2vh, 14px);
  max-width: 480px;
}

.home-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.btn {
  height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 2px;
  font: 700 11px 'DM Sans';
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: .2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  white-space: nowrap;
}

.btn i {
  font-style: normal;
  font-size: 16px;
  line-height: 0;
}

.primary-btn {
  color: var(--ink);
  background: var(--lime);
  box-shadow: 0 8px 25px rgba(216, 255, 56, .18);
}

.primary-btn:hover {
  background: #e8ff84;
  transform: translateY(-2px);
}

.secondary-btn {
  color: var(--cream);
  background: rgba(255, 255, 255, .06);
  border-color: var(--line);
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, .13);
}

.text-btn {
  border: 0;
  background: none;
  color: var(--cream);
  font: 700 11px 'DM Sans';
  letter-spacing: 1.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  transition: color 0.2s ease;
}

.text-btn:hover {
  color: var(--lime);
}

.text-btn span {
  color: var(--lime);
  font-size: 16px;
  line-height: 0;
}

.quick-links {
  display: flex;
  gap: 20px;
  margin-top: 14px;
}

.quick-links .text-btn {
  color: var(--muted);
  font-size: 10px;
}

.quick-links .text-btn:hover {
  color: var(--lime);
}

.hero-meta {
  position: absolute;
  right: 6%;
  bottom: 86px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 2px;
}

.hero-meta b {
  color: var(--lime);
  font-size: 12px;
}

.meta-line {
  width: 40px;
  height: 1px;
  background: var(--lime);
}

.home-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6%;
  border-top: 1px solid rgba(255, 255, 255, .12);
  background: rgba(7, 10, 8, .75);
  backdrop-filter: blur(10px);
  z-index: 12;
}

.home-bottom-stats {
  display: flex;
  align-items: center;
  gap: 36px;
}

.label {
  display: block;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 1.8px;
  margin-bottom: 2px;
}

.home-bottom strong {
  font: 700 20px 'Barlow Condensed';
  letter-spacing: 1px;
}

.home-bottom small {
  font: 500 10px 'DM Sans';
  color: var(--muted);
}

.home-bottom-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.round-link {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, .05);
  color: var(--cream);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}

.round-link:hover {
  background: rgba(216, 255, 56, .2);
  border-color: var(--lime);
  color: var(--lime);
}

/* PAGE PANELS (TRAIL SELECT, CONTROLS, SETTINGS, MISSIONS, GARAGE) */
.page-panel {
  padding: 80px 6% 24px;
  background: rgba(9, 13, 10, .96);
  backdrop-filter: blur(20px);
  overflow-y: auto;
}

.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.page-heading h2, .overlay-panel h2 {
  font: 800 clamp(38px, 8vh, 56px)/.9 'Barlow Condensed';
  letter-spacing: 1px;
  margin-top: 6px;
}

.close-btn {
  border: 1px solid var(--line);
  border-radius: 50%;
  background: none;
  color: var(--cream);
  width: 36px;
  height: 36px;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  border-color: var(--lime);
  color: var(--lime);
}

.trail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.trail-card {
  position: relative;
  min-width: 0;
  padding: 0;
  text-align: left;
  color: var(--cream);
  background: var(--panel);
  border: 1px solid var(--line);
  cursor: pointer;
  overflow: hidden;
  border-radius: 4px;
}

.trail-card.active {
  border-color: var(--lime);
  box-shadow: 0 0 0 1px var(--lime);
}

.trail-number {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 14px;
  color: var(--lime);
  font-size: 10px;
  letter-spacing: 1px;
}

.trail-art {
  height: 140px;
  position: relative;
  overflow: hidden;
}

.alpine-art {
  background-image: linear-gradient(180deg, rgba(8, 15, 11, .08), rgba(8, 15, 11, .52)), url('assets/trail-alpine.png');
  background-size: cover;
  background-position: center;
}

.desert-art {
  background-image: linear-gradient(180deg, rgba(35, 13, 8, .05), rgba(35, 13, 8, .5)), url('assets/trail-canyon.png');
  background-size: cover;
  background-position: center;
}

.night-art {
  background-image: linear-gradient(180deg, rgba(5, 10, 20, .05), rgba(5, 10, 20, .54)), url('assets/trail-midnight.png');
  background-size: cover;
  background-position: center;
}

.trail-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
}

.trail-info h3 {
  font: 700 18px 'Barlow Condensed';
  letter-spacing: .4px;
}

.trail-info p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.arrow {
  color: var(--lime);
  font-size: 18px;
}

.page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 1.5px;
}

/* CONTROLS & SETTINGS */
.controls-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

.control-keys {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 8px 18px;
  border-radius: 4px;
}

.key-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.key-row:last-child {
  border: 0;
}

.keys {
  display: flex;
  gap: 6px;
  min-width: 90px;
}

.key {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: #273128;
  border: 1px solid #455446;
  border-radius: 3px;
  color: var(--lime);
  font-weight: 700;
  font-size: 12px;
}

.key.wide {
  width: 40px;
}

.key-row b, .settings-list b {
  display: block;
  font-size: 11px;
  letter-spacing: 1px;
}

.key-row small, .settings-list small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 3px;
}

.tip-card {
  padding: 20px;
  background: linear-gradient(145deg, #283b25, #162019);
  border: 1px solid #566d42;
  border-radius: 4px;
}

.tip-icon {
  color: var(--lime);
  font-size: 18px;
}

.tip-card .eyebrow {
  margin-top: 12px;
}

.tip-card h3 {
  font: 700 24px/.95 'Barlow Condensed';
  margin: 8px 0 10px;
}

.tip-card > p:last-child {
  font-size: 11px;
  color: #bcc8ba;
  line-height: 1.5;
}

.settings-list {
  width: min(100%, 620px);
  background: var(--panel);
  border: 1px solid var(--line);
  margin-bottom: 20px;
  border-radius: 4px;
}

.settings-list label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.settings-list label:last-child {
  border: 0;
}

.settings-list input {
  display: none;
}

.toggle {
  position: relative;
  width: 38px;
  height: 20px;
  border-radius: 20px;
  background: #313c34;
  transition: .2s;
}

.toggle::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: #89938a;
  transition: .2s;
}

.settings-list input:checked + .toggle {
  background: var(--lime);
}

.settings-list input:checked + .toggle::after {
  left: 21px;
  background: var(--ink);
}

/* MISSIONS & GARAGE */
.mission-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.mission-card {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 16px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 4px;
}

.mission-card.complete {
  border-color: var(--lime);
  background: linear-gradient(145deg, rgba(216, 255, 56, .12), var(--panel));
}

.mission-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.mission-card h3 {
  font: 700 20px 'Barlow Condensed';
  margin-top: 4px;
}

.mission-card p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
  margin-top: 3px;
}

.mission-reward {
  color: var(--lime);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.mission-progress {
  height: 4px;
  background: #2b342d;
  margin-top: 14px;
  border-radius: 2px;
  overflow: hidden;
}

.mission-progress i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--lime);
  transition: width .25s;
}

.mission-status {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 9px;
  margin-top: 6px;
}

.garage-wallet {
  align-self: center;
  margin-left: auto;
  margin-right: 18px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 1.4px;
}

.garage-wallet b {
  color: var(--lime);
  margin-left: 6px;
  font-size: 13px;
}

.bike-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.bike-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 14px;
  min-height: 230px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 4px;
  transition: transform .2s ease, border-color .2s ease;
}

.bike-card:hover {
  transform: translateY(-2px);
  border-color: var(--bike-color);
}

.bike-card.selected {
  border-color: var(--lime);
  box-shadow: 0 0 15px rgba(216, 255, 56, .18);
}

.bike-card h3 {
  font: 700 22px 'Barlow Condensed';
  margin-top: 6px;
  letter-spacing: .5px;
}

.bike-card p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  margin-top: 2px;
  min-height: 26px;
}

.bike-visual {
  height: 95px;
  position: relative;
  margin: 4px 0;
  border-radius: 4px;
  background: radial-gradient(circle at center, rgba(216, 255, 56, .06) 0%, transparent 70%), #0a0e0b;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .08);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.bike-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .8));
  transition: transform .3s ease;
}

.bike-card:hover .bike-img {
  transform: scale(1.05);
}

.bike-specs {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.spec-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9px;
  color: var(--muted);
}

.spec-row b {
  color: var(--cream);
  font-size: 10px;
}

.spec-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, .1);
  margin-left: 10px;
  border-radius: 2px;
  overflow: hidden;
}

.spec-bar i {
  display: block;
  height: 100%;
  background: var(--bike-color);
  border-radius: 2px;
}

.bike-card .btn {
  width: 100%;
  margin-top: 10px;
  height: 34px;
  font-size: 10px;
}

.lock-tag {
  position: absolute;
  right: 14px;
  top: 14px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 1px;
}

/* OVERLAY PANELS (PAUSE, LEVEL COMPLETE, GAME OVER) */
.overlay-panel {
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(5, 8, 6, .88);
  backdrop-filter: blur(12px);
  padding: 40px 20px;
}

.overlay-panel h2 {
  font-size: clamp(48px, 10vh, 72px);
  color: var(--cream);
  margin: 10px 0 10px;
}

.overlay-panel > p {
  color: var(--muted);
  font-size: 12px;
}

.menu-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  width: 220px;
}

.menu-actions .btn {
  width: 100%;
}

.result-stats {
  display: flex;
  margin-top: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
  border-radius: 4px;
}

.result-stats div {
  min-width: 130px;
  padding: 12px 18px;
}

.result-stats div + div {
  border-left: 1px solid var(--line);
}

.result-stats span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 1.4px;
}

.result-stats b {
  display: block;
  margin-top: 4px;
  color: var(--lime);
  font: 700 22px 'Barlow Condensed';
}

.danger-kicker {
  color: var(--red);
}

/* IN-GAME HUD OVERLAY */
#hud-overlay {
  position: absolute;
  inset: 0;
  z-index: 18;
  pointer-events: none;
}

#hud-overlay.hidden {
  display: none !important;
}

.hud-top {
  position: absolute;
  top: 14px;
  left: 20px;
  right: 20px;
  z-index: 25;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 0;
  pointer-events: none;
}

.hud-stat span {
  display: block;
  color: #b5c0b2;
  font-size: 9px;
  letter-spacing: 1.6px;
}

.hud-stat b {
  display: block;
  font: 700 28px/.9 'Barlow Condensed';
  margin-top: 4px;
}

.hud-stat small {
  font: 500 10px 'DM Sans';
  color: var(--muted);
}

.level-stat b {
  color: var(--lime);
}

.level-stat {
  min-width: 50px;
}

.level-stat + .hud-stat {
  border-left: 1px solid rgba(255, 255, 255, .12);
  padding-left: 16px;
}

.speed-stat {
  width: 110px;
}

.speed-bar {
  height: 3px;
  background: rgba(255, 255, 255, .2);
  margin-top: 6px;
  border-radius: 2px;
  overflow: hidden;
}

.speed-bar i {
  display: block;
  width: 45%;
  height: 100%;
  background: var(--lime);
}

.nitro-stat {
  width: 110px;
  border-left: 1px solid rgba(255, 255, 255, .12);
  padding-left: 16px;
}

.nitro-bar {
  height: 5px;
  background: rgba(255, 255, 255, .15);
  margin-top: 6px;
  border-radius: 3px;
  overflow: hidden;
}

#nitro-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #ff4500, #ffaa00, #d8ff38);
  border-radius: 3px;
  transition: width 0.1s linear;
}

#nitro-text {
  font: 700 12px 'Barlow Condensed';
  color: #ffaa00;
  margin-top: 3px;
  letter-spacing: 1px;
}

.pause-icon-btn {
  position: relative;
  margin-left: auto;
  pointer-events: auto;
  width: 38px;
  height: 38px;
  border: 1px solid var(--lime);
  border-radius: 50%;
  background: rgba(11, 15, 13, .92);
  color: var(--lime);
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 0 18px rgba(216, 255, 56, .22);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.pause-icon-btn:hover {
  background: var(--lime);
  color: var(--ink);
}

.topbar.hidden-in-game {
  display: none !important;
}

.hud-bottom {
  position: absolute;
  bottom: 16px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  color: #bcc7b8;
  font-size: 9px;
  letter-spacing: 1.5px;
}

.hud-bottom span:first-child {
  color: var(--lime);
}

/* MOBILE TOUCH CONTROLS OVERLAY */
.touch-overlay {
  position: absolute;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 18px;
  touch-action: none;
}

.touch-overlay.hidden {
  display: none !important;
}

.touch-group {
  display: flex;
  gap: 10px;
  pointer-events: auto;
}

.touch-left {
  align-items: flex-end;
}

.touch-right {
  align-items: flex-end;
}

.touch-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(17, 23, 19, 0.76);
  border: 2px solid rgba(216, 255, 56, 0.5);
  color: var(--lime);
  font: 800 18px 'DM Sans';
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  cursor: pointer;
  transition: transform 0.1s, background 0.1s;
}

.touch-btn:active {
  transform: scale(0.92);
  background: rgba(216, 255, 56, 0.3);
  border-color: var(--lime);
}

.gas-btn, .brake-btn {
  width: 60px;
  height: 60px;
  font-size: 22px;
}

.gas-btn {
  border-color: var(--lime);
  background: rgba(216, 255, 56, 0.2);
}

.brake-btn {
  border-color: #ff715f;
  color: #ff715f;
  background: rgba(255, 113, 95, 0.15);
}

.nitro-btn {
  width: auto;
  height: 40px;
  padding: 0 14px;
  border-radius: 20px;
  border-color: #ffaa00;
  color: #ffaa00;
  font: 800 12px 'Barlow Condensed';
  letter-spacing: 1.5px;
  background: rgba(255, 170, 0, 0.2);
  margin-bottom: 8px;
}

/* ==========================================================================
   GAMEPIX 800x450 IFRAME & SHORT HEIGHT RESPONSIVE BREAKPOINTS (CRITICAL FIX)
   ========================================================================== */

@media (max-height: 520px) {
  .topbar {
    height: 46px;
    padding: 0 4%;
  }
  .wordmark {
    font-size: 10px;
  }
  .mark {
    width: 20px;
    height: 20px;
    font-size: 14px;
    line-height: 14px;
  }
  .topbar-right {
    font-size: 9px;
  }

  .home-panel {
    padding: 50px 5% 58px;
  }
  .eyebrow {
    font-size: 9px;
    letter-spacing: 2px;
  }
  .hero-copy h1 {
    font-size: clamp(30px, 9.5vh, 48px);
    margin: 4px 0 6px;
    line-height: .88;
  }
  .hero-description {
    font-size: 11px;
    line-height: 1.35;
    max-width: 380px;
  }
  .home-actions {
    margin-top: 10px;
    gap: 12px;
  }
  .btn {
    height: 36px;
    padding: 0 16px;
    font-size: 10px;
    gap: 12px;
  }
  .text-btn {
    font-size: 10px;
    padding: 4px 0;
  }
  .quick-links {
    margin-top: 6px;
    gap: 14px;
  }

  .hero-meta {
    right: 5%;
    bottom: 60px;
    font-size: 9px;
    gap: 10px;
  }

  .home-bottom {
    height: 52px;
    padding: 0 5%;
  }
  .label {
    font-size: 8px;
    margin-bottom: 1px;
  }
  .home-bottom strong {
    font-size: 16px;
  }
  .round-link {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }

  .page-panel {
    padding: 54px 5% 16px;
  }
  .page-heading {
    margin-bottom: 14px;
  }
  .page-heading h2 {
    font-size: clamp(28px, 7vh, 38px);
  }
  .close-btn {
    width: 30px;
    height: 30px;
    font-size: 18px;
  }

  .trail-art {
    height: 90px;
  }
  .trail-info {
    padding: 8px 12px;
  }
  .trail-info h3 {
    font-size: 15px;
  }
  .trail-info p {
    font-size: 9px;
  }
  .page-footer {
    margin-top: 12px;
    font-size: 9px;
  }

  .controls-layout {
    gap: 10px;
    margin-bottom: 12px;
  }
  .control-keys {
    padding: 6px 14px;
  }
  .key-row {
    padding: 8px 0;
  }
  .key {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }
  .tip-card {
    padding: 14px;
  }
  .tip-card h3 {
    font-size: 18px;
    margin: 4px 0 6px;
  }

  .mission-list, .bike-list {
    gap: 10px;
    margin-bottom: 14px;
  }
  .mission-card {
    min-height: 110px;
    padding: 12px;
  }
  .mission-card h3 {
    font-size: 16px;
  }

  .bike-card {
    min-height: 190px;
    padding: 10px;
  }
  .bike-card h3 {
    font-size: 18px;
  }
  .bike-visual {
    height: 65px;
  }
  .bike-card .btn {
    height: 30px;
    font-size: 9px;
    margin-top: 6px;
  }

  .hud-top {
    top: 8px;
    left: 14px;
    right: 14px;
    gap: 12px;
  }
  .hud-stat b {
    font-size: 22px;
  }
  .hud-stat span {
    font-size: 8px;
  }
  .speed-stat, .nitro-stat {
    width: 90px;
  }
  .pause-icon-btn {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
  .hud-bottom {
    bottom: 8px;
    left: 14px;
    right: 14px;
    font-size: 8px;
  }
}

@media (max-height: 420px) {
  .home-panel {
    padding: 44px 4% 50px;
  }
  .hero-copy h1 {
    font-size: 32px;
    margin: 2px 0 4px;
  }
  .hero-description {
    display: none; /* Hide fluff paragraph on ultra-short 400px iframe so buttons are huge & 100% visible */
  }
  .home-actions {
    margin-top: 6px;
  }
  .quick-links {
    margin-top: 4px;
  }
  .hero-meta {
    display: none;
  }
  .home-bottom {
    height: 44px;
  }
  .home-bottom-stats > div:nth-child(3) {
    display: none;
  }
}

@media (max-width: 680px) {
  .trail-grid, .mission-list, .bike-list {
    grid-template-columns: 1fr;
  }
  .controls-layout {
    grid-template-columns: 1fr;
  }
  .tip-card {
    display: none;
  }
  .home-bottom-stats > div:nth-child(2), .home-bottom-stats > div:nth-child(3) {
    display: none;
  }
}
