/* Yard Run - forklift yard game (brand tokens from public radical) */
.oj-yard {
  --yr-bg: var(--rad-bg, #05080f);
  --yr-elev: var(--rad-elev, #0a101c);
  --yr-line: var(--rad-line, rgba(148, 163, 184, 0.14));
  --yr-sky: var(--oj-rad-sky, #38bdf8);
  --yr-gold: var(--oj-rad-gold, #fbbf24);
  --yr-gold-soft: var(--oj-rad-gold-soft, #fde68a);
  --yr-lime: #4ade80;
  --yr-hot: #f43f5e;
  --yr-text: var(--rad-ink, #f8fafc);
  --yr-dim: var(--rad-muted, #94a3b8);
  color: var(--yr-text);
  background: var(--yr-bg, #05080f);
  min-height: 40vh;
  font-family: Inter, system-ui, sans-serif;
}
.oj-yard * { box-sizing: border-box; }

.oj-yard-titlebar {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem 1.25rem 0.5rem;
  text-align: center;
}
.oj-yard-game-title {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 1.95rem);
  font-weight: 900;
  letter-spacing: -0.03em;
}
.oj-yard-game-title-a { margin-right: 0.28rem; }
.oj-yard-game-title-b {
  background: linear-gradient(110deg, var(--yr-gold-soft) 0%, var(--yr-gold) 40%, var(--yr-sky) 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.oj-yard-game-credit {
  margin: 0.3rem 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--yr-dim);
}
.oj-yard-game-blurb {
  margin: 0.45rem auto 0;
  max-width: 34rem;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--yr-dim);
}
body.oj-yard-in-session .oj-yard-titlebar { display: none !important; }

.oj-yard-wrap {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}
.oj-yard-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 960px) {
  .oj-yard-shell { grid-template-columns: 1fr 300px; align-items: start; }
}

.oj-yard-stage {
  position: relative;
  border-radius: 1.15rem;
  overflow: hidden;
  border: 1px solid var(--yr-line);
  background: #0a0f18;
  box-shadow: 0 24px 60px -20px color-mix(in srgb, var(--yr-gold) 22%, transparent);
  aspect-ratio: 16 / 10;
  min-height: 320px;
}
.oj-yard-stage canvas#oj-yard-canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  touch-action: none;
}
.oj-yard-stage:not(.is-racing) canvas#oj-yard-canvas {
  pointer-events: none;
  touch-action: pan-y;
}
.oj-yard-stage.is-racing canvas#oj-yard-canvas {
  pointer-events: auto;
  touch-action: none;
}

.oj-yard-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(8px);
  overflow: hidden;
}
.oj-yard-overlay[hidden] { display: none !important; }
.oj-yard-overlay-inner {
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0.75rem 1rem 0;
}
.oj-yard-overlay-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: 0.35rem;
  /* Invisible scrollbar - a fat track over the stage is pure noise */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.oj-yard-overlay-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
.oj-yard-overlay-brand {
  text-align: center;
  margin: 0 0 0.35rem;
}
.oj-yard-overlay-brand-title {
  display: block;
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  font-weight: 900;
  background: linear-gradient(110deg, var(--yr-gold-soft), var(--yr-gold), var(--yr-sky));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.oj-yard-overlay-brand-studio {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--yr-dim);
  margin-top: 0.15rem;
}
.oj-yard-overlay h2 {
  margin: 0 0 0.25rem;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 900;
}
.oj-yard-overlay-lede {
  margin: 0 0 0.35rem;
  text-align: center;
  font-size: 0.84rem;
  color: var(--yr-dim);
  font-weight: 600;
  line-height: 1.4;
}
.oj-yard-overlay kbd {
  display: inline-block;
  padding: 0.08rem 0.32rem;
  border-radius: 0.3rem;
  border: 1px solid var(--yr-line);
  background: rgba(15, 23, 42, 0.85);
  font-size: 0.78em;
  font-weight: 800;
}

.oj-yard-form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.oj-yard-form label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--yr-dim);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.oj-yard-form input[type="text"],
.oj-yard-form select {
  border-radius: 0.75rem;
  border: 1px solid var(--yr-line);
  background: rgba(15, 23, 42, 0.9);
  color: var(--yr-text);
  padding: 0.7rem 0.85rem;
  font-size: 1rem;
  font-weight: 600;
}
.oj-yard-check-row {
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem !important;
}

.oj-yard-overlay-actions {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  padding: 0.65rem 0 max(0.65rem, env(safe-area-inset-bottom));
  border-top: 1px solid color-mix(in srgb, var(--yr-line) 80%, transparent);
}
@media (min-width: 821px) {
  .oj-yard-overlay-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.oj-yard-btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 0.85rem;
  padding: 0.7rem 0.9rem;
  font-weight: 800;
  font-size: 0.86rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: var(--yr-text);
  background: rgba(30, 41, 59, 0.9);
}
.oj-yard-btn--lime {
  background: linear-gradient(160deg, #86efac, #22c55e 55%, #15803d);
  color: #052e16;
}
.oj-yard-btn--primary {
  background: linear-gradient(160deg, #7dd3fc, #0ea5e9 55%, #0369a1);
  color: #082f49;
}
.oj-yard-btn--hot {
  background: linear-gradient(160deg, #fda4af, #e11d48 55%, #9f1239);
  color: #fff;
}
.oj-yard-btn--ghost {
  border-color: var(--yr-line);
  background: rgba(15, 23, 42, 0.75);
}
.oj-yard-btn--gold {
  background: linear-gradient(160deg, var(--yr-gold-soft), var(--yr-gold) 55%, #d97706);
  color: #1c1917;
}
.oj-yard-err {
  min-height: 1.2rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fda4af;
  margin: 0.25rem 0 0;
}

.oj-yard-hud {
  position: absolute;
  top: max(0.5rem, env(safe-area-inset-top));
  /* Leave room for leave/end if ever top-aligned; chips stay readable */
  left: 0.55rem;
  right: max(3.4rem, calc(env(safe-area-inset-right) + 2.9rem));
  z-index: 8;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  pointer-events: none;
}
.oj-yard-hud[hidden] { display: none !important; }
.oj-yard-chip {
  padding: 0.35rem 0.65rem;
  border-radius: 0.55rem;
  background: rgba(2, 6, 23, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 0.78rem;
  font-weight: 800;
  backdrop-filter: blur(8px);
  font-variant-numeric: tabular-nums;
}
.oj-yard-chip span { color: var(--yr-gold-soft); }
.oj-yard-chip--score { border-color: color-mix(in srgb, var(--yr-lime) 40%, transparent); }

.oj-yard-banner {
  position: absolute;
  left: 50%;
  top: 18%;
  transform: translateX(-50%);
  z-index: 12;
  padding: 0.55rem 1.1rem;
  border-radius: 0.65rem;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid color-mix(in srgb, var(--yr-gold) 45%, transparent);
  font-weight: 900;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-align: center;
  pointer-events: none;
  text-transform: uppercase;
}
.oj-yard-banner[hidden] { display: none !important; }

.oj-yard-countdown {
  position: absolute;
  inset: 0;
  z-index: 11;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(4rem, 18vw, 8rem);
  font-weight: 900;
  color: var(--yr-gold);
  text-shadow: 0 0 40px rgba(251, 191, 36, 0.5);
  pointer-events: none;
}
.oj-yard-countdown[hidden] { display: none !important; }

.oj-yard-end-btn {
  position: absolute;
  bottom: max(0.75rem, env(safe-area-inset-bottom));
  left: max(0.65rem, env(safe-area-inset-left));
  z-index: 14;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(248, 113, 113, 0.55);
  background: rgba(127, 29, 29, 0.88);
  color: #fef2f2;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}
.oj-yard-end-btn[hidden] { display: none !important; }

/* Single fullscreen control - top-right (not a pair) */
.oj-yard-fs-btn {
  position: absolute;
  top: max(0.5rem, env(safe-area-inset-top));
  right: max(0.5rem, env(safe-area-inset-right));
  z-index: 15;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(2, 6, 23, 0.88);
  color: #e2e8f0;
  border-radius: 0.75rem;
  min-width: 2.55rem;
  min-height: 2.55rem;
  padding: 0.45rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
.oj-yard-fs-btn i { font-size: 0.95rem; line-height: 1; }
@media (max-width: 640px) {
  .oj-yard-fs-btn .oj-yard-fs-label { display: none; }
  .oj-yard-fs-btn {
    width: 2.65rem;
    height: 2.65rem;
    padding: 0;
  }
}

.oj-yard-game-badge {
  position: absolute;
  top: max(0.5rem, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--yr-gold) 35%, transparent);
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(10px);
}
.oj-yard-game-badge-title {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(110deg, var(--yr-gold-soft), var(--yr-gold), var(--yr-sky));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.oj-yard-game-badge-studio {
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--yr-dim);
}
.oj-yard-stage:has(#oj-yard-overlay-home:not([hidden])) .oj-yard-game-badge {
  opacity: 0;
  visibility: hidden;
}

.oj-yard-legend {
  position: absolute;
  bottom: 0.65rem;
  right: 0.65rem;
  z-index: 8;
  padding: 0.45rem 0.6rem;
  border-radius: 0.55rem;
  background: rgba(2, 6, 23, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--yr-dim);
  line-height: 1.45;
  pointer-events: none;
}
.oj-yard-legend[hidden] { display: none !important; }

/* Touch - tools left, full drive stick right by default */
.oj-yard-touch {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 13;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0.55rem max(0.55rem, env(safe-area-inset-right)) max(0.65rem, env(safe-area-inset-bottom)) max(0.55rem, env(safe-area-inset-left));
  pointer-events: none;
  gap: 0.5rem;
  background: linear-gradient(180deg, transparent 0%, rgba(5, 8, 15, 0.35) 60%, rgba(5, 8, 15, 0.55) 100%);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.oj-yard-touch[hidden] { display: none !important; }
.oj-yard-pad-tools-col {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-start;
  order: 1;
  align-self: flex-end;
  margin-bottom: 0.25rem;
}
.oj-yard-pad--stick,
.oj-yard-pad--steer {
  pointer-events: auto;
  position: relative;
  width: min(44vw, 9.6rem);
  height: min(44vw, 9.6rem);
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--yr-sky, #38bdf8) 40%, transparent);
  background: rgba(2, 6, 23, 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.4),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  order: 2;
  overflow: visible;
}
.oj-yard-touch[data-stick-side="left"] .oj-yard-pad-tools-col { order: 2; }
.oj-yard-touch[data-stick-side="left"] .oj-yard-pad--stick,
.oj-yard-touch[data-stick-side="left"] .oj-yard-pad--steer { order: 1; }
.oj-yard-pad-ring {
  position: absolute;
  inset: 12%;
  border-radius: 999px;
  border: 1px dashed rgba(148, 163, 184, 0.28);
  pointer-events: none;
}
.oj-yard-pad-cross {
  position: absolute;
  inset: 18%;
  pointer-events: none;
  opacity: 0.35;
  background:
    linear-gradient(90deg, transparent 0%, transparent calc(50% - 0.5px), rgba(148, 163, 184, 0.55) calc(50% - 0.5px), rgba(148, 163, 184, 0.55) calc(50% + 0.5px), transparent calc(50% + 0.5px), transparent 100%),
    linear-gradient(0deg, transparent 0%, transparent calc(50% - 0.5px), rgba(148, 163, 184, 0.55) calc(50% - 0.5px), rgba(148, 163, 184, 0.55) calc(50% + 0.5px), transparent calc(50% + 0.5px), transparent 100%);
}
.oj-yard-pad-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2.55rem;
  height: 2.55rem;
  margin: -1.275rem 0 0 -1.275rem;
  border-radius: 999px;
  background: linear-gradient(145deg, var(--yr-gold-soft), var(--yr-gold));
  border: 2px solid rgba(255,255,255,0.4);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  will-change: transform;
  z-index: 2;
}
.oj-yard-pad--stick.is-active .oj-yard-pad-knob {
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--yr-sky, #38bdf8) 50%, transparent),
    0 6px 18px rgba(0, 0, 0, 0.5);
}
.oj-yard-pad-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.4rem;
  text-align: center;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: rgba(226, 232, 240, 0.7);
  pointer-events: none;
  z-index: 1;
}
.oj-yard-pad-col {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: min(34vw, 7rem);
}
.oj-yard-pad-mast {
  display: flex;
  gap: 0.35rem;
}
.oj-yard-pad-btn {
  appearance: none;
  border: none;
  border-radius: 1rem;
  min-height: 3.2rem;
  font-weight: 900;
  font-size: 0.7rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  color: #0f172a;
  cursor: pointer;
  touch-action: none;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}
.oj-yard-pad-btn--lift {
  background: linear-gradient(160deg, #7dd3fc, #0ea5e9);
  color: #0f172a;
}
.oj-yard-pad-tools {
  pointer-events: auto;
  display: flex;
  gap: 0.35rem;
}
.oj-yard-pad-mini {
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(2, 6, 23, 0.82);
  color: #e2e8f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}
.oj-yard-pad-mini:active { color: var(--yr-sky, #38bdf8); }

/* Settings sheet */
.oj-yard-settings {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}
.oj-yard-settings:not([hidden]) { pointer-events: auto; }
.oj-yard-settings[hidden] { display: none !important; }
.oj-yard-settings-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  margin: 0;
  padding: 0;
  background: rgba(2, 6, 23, 0.62);
  backdrop-filter: blur(4px);
  cursor: pointer;
}
.oj-yard-settings-sheet {
  position: relative;
  z-index: 1;
  width: min(100%, 22rem);
  max-height: min(78dvh, 32rem);
  border-radius: 1.25rem 1.25rem 0 0;
  background: linear-gradient(180deg, #0f172a 0%, #0b1220 100%);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-bottom: none;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@media (min-width: 560px) {
  .oj-yard-settings { align-items: center; }
  .oj-yard-settings-sheet {
    border-radius: 1.15rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    margin: 1rem;
  }
}
.oj-yard-settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem 0.65rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}
.oj-yard-settings-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 900;
  color: #f8fafc;
}
.oj-yard-settings-close {
  appearance: none;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.9);
  color: #e2e8f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.oj-yard-settings-body {
  padding: 0.85rem 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.oj-yard-settings-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.oj-yard-settings-field--row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}
.oj-yard-settings-label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
}
.oj-yard-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0.25rem;
  border-radius: 0.85rem;
  background: rgba(2, 6, 23, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.18);
}
.oj-yard-seg-btn {
  appearance: none;
  border: 0;
  border-radius: 0.65rem;
  min-height: 2.55rem;
  font-weight: 800;
  font-size: 0.88rem;
  color: #cbd5e1;
  background: transparent;
  cursor: pointer;
}
.oj-yard-seg-btn.is-on {
  background: linear-gradient(160deg, var(--yr-gold-soft), var(--yr-gold));
  color: #0f172a;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}
.oj-yard-settings-select {
  appearance: none;
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(2, 6, 23, 0.85);
  color: #f8fafc;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.7rem 0.85rem;
  min-height: 2.7rem;
}
.oj-yard-toggle {
  appearance: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 4.6rem;
  height: 2.2rem;
  padding: 0 0.55rem 0 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(51, 65, 85, 0.85);
  color: #e2e8f0;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.78rem;
}
.oj-yard-toggle-knob {
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 999px;
  background: #94a3b8;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, background 0.15s ease;
}
.oj-yard-toggle.is-on {
  background: color-mix(in srgb, var(--yr-sky, #38bdf8) 35%, #0f172a);
  border-color: color-mix(in srgb, var(--yr-sky, #38bdf8) 50%, transparent);
}
.oj-yard-toggle.is-on .oj-yard-toggle-knob {
  background: var(--yr-gold, #fbbf24);
  transform: translateX(1.35rem);
}
.oj-yard-settings-range {
  width: 100%;
  accent-color: var(--yr-gold, #fbbf24);
  height: 1.5rem;
}
.oj-yard-settings-note {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.4;
  color: #64748b;
  font-weight: 600;
}
.oj-yard-settings-foot {
  padding: 0.65rem 1rem max(0.85rem, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}
.oj-yard-settings-foot .oj-yard-btn {
  width: 100%;
  justify-content: center;
}

@media (min-width: 821px) and (pointer: fine) {
  .oj-yard-touch { display: none !important; }
}

/* Side panel */
.oj-yard-side {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.oj-yard-panel {
  border-radius: 1.15rem;
  border: 1px solid var(--yr-line);
  background: linear-gradient(165deg, rgba(17, 24, 39, 0.92), rgba(10, 16, 28, 0.96));
  padding: 0.95rem 1.05rem;
}
.oj-yard-panel h3 {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--yr-dim);
}
.oj-yard-panel--brand h3 {
  color: var(--yr-gold-soft);
  letter-spacing: 0.06em;
  font-size: 0.82rem;
  text-transform: none;
}
.oj-yard-code {
  font-family: ui-monospace, monospace;
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  color: var(--yr-gold);
}
.oj-yard-meta {
  font-size: 0.82rem;
  color: var(--yr-dim);
  line-height: 1.45;
  margin: 0.35rem 0 0;
}
.oj-yard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}
.oj-yard-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.oj-yard-list li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.5rem;
  border-radius: 0.7rem;
  background: rgba(2, 6, 23, 0.45);
  font-size: 0.86rem;
  font-weight: 700;
  flex-wrap: wrap;
}
.oj-yard-list li.is-you {
  border: 1px solid color-mix(in srgb, var(--yr-sky) 45%, transparent);
}
.oj-yard-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  flex-shrink: 0;
}
.oj-yard-score-tag {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: var(--yr-lime);
  font-size: 0.78rem;
}
.oj-yard-lobby {
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.65rem;
  border-radius: 0.7rem;
  border: 1px solid var(--yr-line);
  background: rgba(2, 6, 23, 0.4);
  color: var(--yr-text);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  margin-bottom: 0.35rem;
}
.oj-yard-lobby:hover { border-color: color-mix(in srgb, var(--yr-gold) 50%, transparent); }

.oj-yard-podium-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.65rem;
  margin: 0.35rem 0;
  border-radius: 0.65rem;
  background: rgba(2, 6, 23, 0.5);
  font-weight: 800;
}
.oj-yard-podium-place {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  background: var(--yr-gold);
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

/* Immersive / phone full stage - fill the handset, no card chrome */
.oj-yard-stage--immersive,
.oj-yard-stage.is-fs.oj-yard-stage--immersive {
  position: fixed !important;
  inset: 0 !important;
  z-index: 10050;
  width: 100vw !important;
  width: 100dvw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  min-height: 100dvh !important;
  aspect-ratio: auto !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  background: #0a0f18 !important;
}
.oj-yard-stage--immersive canvas#oj-yard-canvas {
  width: 100% !important;
  height: 100% !important;
  pointer-events: auto !important;
  touch-action: none !important;
}
.oj-yard-stage--immersive .oj-yard-touch {
  padding-bottom: max(0.55rem, env(safe-area-inset-bottom));
}

/* Drop the permanent scrollbar gutter reserved by marketing chrome */
html:has(body.oj-yard-racing),
html:has(body.oj-yard-playing),
html:has(body.oj-yard-in-session) {
  scrollbar-gutter: auto;
}
/* While in lobby / race: no page scrollbar fighting the 3D view */
body.oj-yard-in-session {
  overscroll-behavior: none;
}
body.oj-yard-in-session .oj-yard-wrap {
  padding-bottom: 1rem;
}
body.oj-yard-playing,
body.oj-yard-racing {
  overflow: hidden !important;
  overscroll-behavior: none;
  height: 100dvh;
  max-height: 100dvh;
}
/* Fullscreen / immersive also blocks touch-scroll of the page */
body.oj-yard-playing {
  touch-action: none;
}
/* Active shift: focus the stage, hide side rail so the page doesn't grow a scrollbar */
body.oj-yard-racing .oj-yard-side {
  display: none !important;
}
body.oj-yard-racing .oj-yard-shell {
  grid-template-columns: 1fr !important;
}
body.oj-yard-racing .oj-yard-wrap {
  max-width: none;
  padding: 0.5rem 0.75rem 0.65rem;
  overflow: hidden;
}
/* Desktop racing: keep a large stage without page chrome noise */
body.oj-yard-racing .oj-yard-stage {
  max-height: calc(100dvh - 4.5rem);
  min-height: min(70vh, 36rem);
  aspect-ratio: 16 / 10;
}
/* Hide any residual scrollbar chrome inside the game shell */
.oj-yard-stage,
.oj-yard-overlay,
.oj-yard-shell {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.oj-yard-stage::-webkit-scrollbar,
.oj-yard-overlay::-webkit-scrollbar,
.oj-yard-shell::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

@media (max-width: 820px), (pointer: coarse) {
  .oj-yard-wrap {
    padding: 0.5rem 0.65rem 1.25rem;
  }
  .oj-yard-stage {
    min-height: min(58vh, 28rem);
    aspect-ratio: 4 / 5;
    border-radius: 1rem;
  }
  .oj-yard-stage:has(#oj-yard-overlay-home:not([hidden])) {
    min-height: min(72dvh, 36rem);
    max-height: min(82dvh, 40rem);
    aspect-ratio: auto;
  }
  /* Shift in progress: stage is the whole phone (matches immersive) */
  body.oj-yard-racing .oj-yard-wrap {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
  }
  body.oj-yard-racing .oj-yard-shell {
    gap: 0 !important;
  }
  body.oj-yard-racing .oj-yard-stage,
  body.oj-yard-racing .oj-yard-stage.is-racing {
    position: fixed !important;
    inset: 0 !important;
    z-index: 10050 !important;
    width: 100vw !important;
    width: 100dvw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: none !important;
    max-height: none !important;
    min-height: 100dvh !important;
    aspect-ratio: auto !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
  }
  /* Hide site marketing chrome under the game */
  body.oj-yard-racing .oj-mkt-nav,
  body.oj-yard-playing .oj-mkt-nav,
  body.oj-yard-racing header,
  body.oj-yard-playing header,
  body.oj-yard-racing .oj-yard-titlebar,
  body.oj-yard-playing .oj-yard-titlebar {
    display: none !important;
  }
  .oj-yard-end-btn {
    top: max(3.2rem, calc(env(safe-area-inset-top) + 2.75rem));
    bottom: auto;
    left: max(0.5rem, env(safe-area-inset-left));
    padding: 0.4rem 0.55rem;
    font-size: 0.65rem;
    z-index: 16;
  }
  .oj-yard-legend { display: none; }
  .oj-yard-game-badge {
    display: none !important;
  }
  /* Touch controls: compact like City Racer */
  .oj-yard-pad--stick,
  .oj-yard-pad--steer {
    width: min(30vw, 6.25rem);
    height: min(30vw, 6.25rem);
  }
  .oj-yard-pad-knob {
    width: 1.85rem;
    height: 1.85rem;
    margin: -0.925rem 0 0 -0.925rem;
  }
  .oj-yard-pad-mini {
    width: 2.25rem;
    height: 2.25rem;
  }
}
