/* Cyber Run — page-only styles */
.game-section {
  background: #07080c;
  padding: 1.75rem 0 2.75rem;
}

.game-shell {
  max-width: 960px;
  margin: 0 auto;
}

.game-frame {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #070814;
  border: 1px solid rgba(255, 43, 214, 0.45);
  box-shadow: 0 0 0 1px rgba(25, 240, 255, 0.18), 0 18px 40px rgba(0, 0, 0, 0.35);
  touch-action: manipulation;
}

.game-frame canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #070814;
  touch-action: none;
}

.game-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  pointer-events: none;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
}

/* Level label: bottom-left, same look on every level (matches the score HUD). */
.game-level {
  position: absolute;
  left: 0.55rem;
  bottom: 0.55rem;
  z-index: 2;
  max-width: calc(100% - 7.5rem);
  padding: 0.28rem 0.6rem;
  color: #fff;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.78rem;
  line-height: 1.2;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(8, 10, 18, 0.82);
  border: 1px solid rgba(25, 240, 255, 0.35);
  border-radius: 6px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
  pointer-events: none;
}

.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.25rem;
  background: rgba(5, 6, 16, 0.72);
  color: #fff;
}

.game-overlay.hidden {
  display: none;
}

.game-overlay .btn,
.game-overlay .btn:hover,
.game-overlay .btn:focus,
.game-overlay .btn:active {
  transform: none;
  touch-action: manipulation;
}

.game-overlay h2 {
  color: #fff;
  font-size: 2rem;
  margin-bottom: 0.4rem;
}

.game-overlay p {
  max-width: 28rem;
  color: #d5d8de;
  margin-bottom: 1rem;
}

.game-new {
  color: #19f0ff;
  font-weight: 700;
}

.game-pad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.game-pad button {
  touch-action: manipulation;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  background: #141824;
  border: 1px solid rgba(25, 240, 255, 0.45);
  border-radius: 8px;
  min-height: 48px;
  cursor: pointer;
}

.game-pad button:hover,
.game-pad button:focus {
  border-color: #ff2bd6;
  color: #fff;
}

.game-pad button:active {
  background: #E3253E;
}

.game-help {
  color: #b0b3b8;
  font-size: 0.8rem;
  text-align: center;
  margin: 0.85rem 0 0;
}

@media (min-width: 800px) {
  .game-pad {
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* LED title — game page only */
.page-hero-cyber {
  background: #070814;
  border-bottom: 1px solid rgba(25, 240, 255, 0.28);
}

.page-hero-cyber p {
  color: #c9d4e0;
}

.page-hero-cyber h1.cyber-led,
.game-overlay h2.cyber-led {
  display: inline-block;
  margin: 0 0 0.55rem;
  padding: 0 0.1em;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1.15;
  color: #e9fdff;
  background-image: repeating-linear-gradient(
    to bottom,
    #ffffff 0px,
    #ffffff 2px,
    rgba(25, 240, 255, 0.15) 2px,
    rgba(25, 240, 255, 0.15) 3px,
    #7ef6ff 3px,
    #7ef6ff 5px,
    rgba(255, 43, 214, 0.2) 5px,
    rgba(255, 43, 214, 0.2) 6px
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 1.5px #bffbff;
  paint-order: stroke fill;
  filter:
    drop-shadow(0 0 1px rgba(255, 255, 255, 0.9))
    drop-shadow(0 0 7px rgba(25, 240, 255, 0.95))
    drop-shadow(0 0 16px rgba(255, 43, 214, 0.9));
}

.game-overlay h2.cyber-led {
  font-size: 2rem;
}

.game-pause {
  position: absolute;
  right: 0.55rem;
  bottom: 0.55rem;
  z-index: 4;
  min-width: 5.5rem;
  min-height: 44px;
  padding: 0.35rem 0.85rem;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  background: rgba(8, 10, 18, 0.82);
  border: 1px solid rgba(25, 240, 255, 0.7);
  border-radius: 8px;
  cursor: pointer;
  touch-action: manipulation;
}

.game-pause.hidden {
  display: none;
}

.game-pause-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.25rem;
  background: rgba(5, 6, 16, 0.62);
  color: #fff;
}

.game-pause-overlay.hidden {
  display: none;
}

.game-pause-overlay h2 {
  margin: 0 0 0.4rem;
  font-size: 2rem;
  color: #fff;
}

.game-pause-overlay p {
  max-width: 22rem;
  margin: 0 0 1rem;
  color: #d5d8de;
}

.game-pause-overlay .btn,
.game-pause-overlay .btn:hover,
.game-pause-overlay .btn:focus,
.game-pause-overlay .btn:active {
  transform: none;
  touch-action: manipulation;
}

.game-pause-promo {
  align-self: center;
  width: min(22rem, calc(100% - 1rem));
  margin: 0.35rem auto 1rem;
  padding: 0.9rem 1rem 1rem;
  background: #0c1018;
  border: 2px solid #19f0ff;
  border-radius: 10px;
  box-shadow: 0 0 18px rgba(25, 240, 255, 0.35);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-pause-promo-text {
  margin: 0 0 0.85rem;
  color: #fff;
  font-weight: 700;
}

.game-pause-promo-text a {
  color: #19f0ff;
  text-decoration: underline;
}

.game-save-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.55rem 1rem;
  border: 2px solid #ff2bd6;
  border-radius: 8px;
  background: #141824;
  color: #fff;
  font-family: var(--font);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  touch-action: manipulation;
}

.game-save-btn:hover,
.game-save-btn:focus {
  color: #fff;
  border-color: #19f0ff;
}

/* Crash screen: link to discount codes (below Restart) */
.game-codes-link {
  display: inline-block;
  margin-top: 0.85rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #7ef9ff;
  text-decoration: none;
  border-bottom: 1px solid rgba(126, 249, 255, 0.45);
  touch-action: manipulation;
}
.game-codes-link:hover,
.game-codes-link:focus-visible {
  color: #fff;
  border-bottom-color: #fff;
}
.game-codes-link[hidden] {
  display: none;
}

/* Car select */
.game-overlay { overflow-y: auto; }
.car-select { display: flex; gap: 0.6rem; justify-content: center; width: 100%; max-width: 36rem; margin: 0 auto 1rem; }
.car-select[hidden] { display: none; }
.car-card { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 0.35rem; padding: 0.55rem 0.5rem 0.6rem; color: #fff; background: rgba(12, 16, 32, 0.85); border: 2px solid rgba(25, 240, 255, 0.25); border-radius: 12px; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; font: inherit; }
.car-card:hover { border-color: rgba(25, 240, 255, 0.6); }
.car-card.selected { border-color: #19f0ff; background: rgba(25, 240, 255, 0.12); box-shadow: 0 0 18px rgba(25, 240, 255, 0.55), inset 0 0 14px rgba(255, 43, 214, 0.25); }
.car-card:focus-visible { outline: 2px solid #ff2bd6; outline-offset: 2px; }
.car-prev { background: transparent !important; width: 100%; max-width: 220px; height: auto; aspect-ratio: 220 / 150; }
.car-name { font-weight: 700; letter-spacing: 0.04em; }
@media (max-height: 460px), (max-width: 420px) {
  .game-overlay { justify-content: flex-start; padding: 0.75rem; }
  .game-overlay h2 { font-size: 1.4rem; }
  .game-overlay p { margin-bottom: 0.5rem; font-size: 0.85rem; }
  .car-select { gap: 0.5rem; margin-bottom: 0.6rem; }
  .car-card { padding: 0.35rem; }
}
@media (max-width: 520px) {
  .car-card { padding: 0.3rem 0.2rem 0.4rem; border-radius: 10px; }
  .car-name { font-size: 0.85rem; }
  .game-overlay { padding: 0.6rem; }
}

/* Run timer (HUD, centered) */
#hud-time { font-variant-numeric: tabular-nums; color: #19f0ff; letter-spacing: 0.04em; }

/* Weekly leaderboard: win-screen name entry, start-screen button, modal */
.bt-final { margin-top: 0.3rem; color: #fff; font-size: 1rem; }
.bt-final strong { color: #19f0ff; font-variant-numeric: tabular-nums; font-size: 1.15rem; }
.bt-actions { display: flex; gap: 0.6rem; align-items: center; justify-content: center; flex-wrap: wrap; }
.bt-open { background: transparent; color: #fff; border: 1px solid rgba(25, 240, 255, 0.55); }
.bt-open:hover, .bt-open:focus-visible { border-color: #19f0ff; background: rgba(25, 240, 255, 0.1); }
.bt-submit { width: 100%; max-width: 24rem; margin: 0 auto 0.7rem; text-align: center; }
.bt-submit[hidden] { display: none; }
.bt-submit label { display: block; font-size: 0.8rem; color: #d5d8de; margin-bottom: 0.3rem; }
.bt-row { display: flex; gap: 0.4rem; align-items: stretch; justify-content: center; flex-wrap: wrap; }
.bt-row input { flex: 1 1 8rem; min-width: 0; padding: 0.5rem 0.65rem; font: inherit; font-size: 16px; color: #fff; background: rgba(12, 16, 32, 0.9); border: 1px solid rgba(25, 240, 255, 0.5); border-radius: 8px; }
.bt-row input:focus { outline: 2px solid #19f0ff; outline-offset: 1px; }
.bt-skip { background: none; border: 0; color: #9aa3b5; font: inherit; font-size: 0.8rem; text-decoration: underline; cursor: pointer; padding: 0 0.3rem; touch-action: manipulation; }
.bt-msg { min-height: 1.1em; margin: 0.3rem 0 0 !important; font-size: 0.78rem; color: #ffb3c1 !important; }
.bt-modal { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(3, 4, 12, 0.82); overflow-y: auto; }
.bt-modal[hidden] { display: none; }
.bt-card { width: 100%; max-width: 26rem; margin: auto; padding: 1.1rem 1.1rem 1rem; color: #fff; text-align: center; background: #0c1020; border: 1px solid rgba(25, 240, 255, 0.5); border-radius: 14px; box-shadow: 0 0 28px rgba(25, 240, 255, 0.25); }
.bt-card h2 { margin: 0 0 0.2rem; font-size: 1.4rem; color: #fff; }
.bt-sub, .bt-mode, .bt-note { margin: 0.2rem 0; font-size: 0.8rem; color: #b8bfcd; }
.bt-mode.bt-local { color: #ffd166; font-weight: 700; }
.bt-note { color: #19f0ff; font-weight: 700; min-height: 1.1em; }
.bt-list { list-style: none; margin: 0.6rem 0; padding: 0; text-align: left; }
.bt-list li { display: grid; grid-template-columns: 1.6rem auto 1fr; gap: 0.6rem; align-items: baseline; padding: 0.32rem 0.5rem; border-bottom: 1px solid rgba(255, 255, 255, 0.08); font-size: 0.92rem; }
.bt-list li.bt-empty { display: block; text-align: center; color: #b8bfcd; border: 0; }
.bt-list li.bt-me { background: rgba(25, 240, 255, 0.14); border-radius: 6px; }
.bt-r { color: #19f0ff; font-weight: 700; }
.bt-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-t { font-variant-numeric: tabular-nums; font-weight: 700; }
@media (max-width: 520px) {
  .bt-submit label { font-size: 0.72rem; margin-bottom: 0.2rem; }
  .bt-row input { padding: 0.4rem 0.55rem; }
  .bt-row .btn { padding: 0.45rem 0.9rem; }
  .bt-final { font-size: 0.85rem; margin-top: 0.1rem; }
  .game-hud { font-size: 0.78rem; }
}
.game-overlay.bt-pending .game-codes-link { display: none; }
@media (max-width: 520px) {
  .game-overlay.bt-pending h2.cyber-led { font-size: 1.7rem; margin-bottom: 0.1rem; }
  .game-overlay.bt-pending p { margin-bottom: 0.35rem; font-size: 0.85rem; line-height: 1.3; }
  .game-overlay.bt-pending .bt-submit { margin-bottom: 0.4rem; }
  .game-overlay.bt-pending .bt-submit label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .game-overlay.bt-pending .bt-actions .btn { padding: 0.45rem 0.9rem; }
}
@media (max-width: 520px) {
  .game-frame:has(.game-overlay.bt-won) .game-level { display: none; }
}

.bt-d { text-align: right; color: #b8bfcd; font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
