/* ==========================================================================
   PARKING LOT V1 — A Stab The Finger Game
   Visual Theme: Top-Down Asphalt, Yellow Striping, Bold Signage & The Goose
   ========================================================================== */

:root {
  --bg-dark: #0f1218;
  --asphalt: #1d222c;
  --asphalt-deep: #151922;
  --asphalt-card: #232936;
  --curb-gray: #384152;
  --line-yellow: #facc15;
  --line-yellow-dim: rgba(250, 204, 21, 0.45);
  --line-white: #f1f5f9;
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-dim: #94a3b8;

  --accent-blue: #38bdf8;
  --accent-green: #22c55e;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --accent-purple: #c084fc;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.45;
  min-height: 100vh;
}

button {
  font-family: inherit;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--line-yellow);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

/* Top Site Header */
.site-header {
  background: var(--asphalt-deep);
  border-bottom: 2px solid var(--curb-gray);
  padding: 10px 18px;
}

.header-inner {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brand-group {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.site-title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--line-yellow);
  text-transform: uppercase;
}

.brand-link {
  color: var(--accent-blue);
  font-size: 0.88rem;
  text-decoration: none;
  font-weight: 600;
}

.brand-link:hover {
  text-decoration: underline;
}

.header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.btn-nav {
  background: var(--asphalt-card);
  color: var(--text-main);
  border: 1px solid var(--curb-gray);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-nav:hover {
  background: #2e3646;
  border-color: var(--line-yellow);
}

/* Main App Container */
.app-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 16px 18px 36px;
}

/* ==========================================================================
   SCREEN 1: MENU / LOT & MODIFIER SELECTION
   ========================================================================== */

.hero-banner {
  background: linear-gradient(135deg, #1b2230 0%, #121620 100%);
  border: 2px solid var(--curb-gray);
  border-left: 6px solid var(--line-yellow);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-text h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  color: var(--text-main);
}

.hero-text p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.96rem;
}

.setup-section {
  margin-bottom: 20px;
}

.section-heading {
  margin: 0 0 10px;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--line-yellow);
  display: flex;
  align-items: center;
  gap: 8px;
}

.lot-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.lot-card {
  background: var(--asphalt-card);
  color: var(--text-main);
  border: 2px solid var(--curb-gray);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.lot-card:hover {
  border-color: #64748b;
}

.lot-card.is-selected {
  border-color: var(--line-yellow);
  background: #272f40;
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.25);
}

.lot-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.lot-badge {
  display: inline-block;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-blue);
  font-weight: 700;
}

.lot-title {
  margin: 2px 0 0;
  font-size: 1.25rem;
  color: var(--text-main);
}

.lot-dims {
  background: var(--asphalt-deep);
  border: 1px solid var(--curb-gray);
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.76rem;
  color: var(--line-yellow);
  font-weight: 700;
  white-space: nowrap;
}

.lot-desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.lot-atmosphere {
  margin: 0;
  font-size: 0.83rem;
  font-style: italic;
  color: var(--text-dim);
  background: rgba(15, 18, 24, 0.45);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--curb-gray);
}

.lot-card-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--curb-gray);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Modifier Cards */
.modifier-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.mod-card {
  background: var(--asphalt-card);
  color: var(--text-main);
  border: 2px solid var(--curb-gray);
  border-radius: var(--radius-md);
  padding: 13px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.mod-card:hover {
  border-color: #64748b;
}

.mod-card.is-selected {
  border-color: var(--accent-blue);
  background: #233044;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

.mod-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.mod-name {
  font-weight: 800;
  font-size: 0.98rem;
}

.mod-bonus {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-blue);
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.mod-desc {
  margin: 0;
  font-size: 0.83rem;
  color: var(--text-muted);
}

.mod-effect {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--line-yellow);
}

/* Lot Preview & Enter CTA */
.launch-bar {
  background: var(--asphalt-card);
  border: 2px solid var(--curb-gray);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  gap: 10px 22px;
  flex: 1;
}

.preview-item {
  display: flex;
  flex-direction: column;
}

.preview-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.preview-val {
  font-size: 0.94rem;
  color: var(--text-main);
}

.accent-text {
  color: var(--line-yellow) !important;
}

.btn-primary {
  background: var(--line-yellow);
  color: #0f172a;
  border: 2px solid #fef08a;
  border-radius: var(--radius-md);
  padding: 14px 26px;
  font-size: 1.08rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 4px 14px rgba(250, 204, 21, 0.25);
  transition: transform 0.1s ease, background 0.12s ease;
}

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

.btn-primary:active {
  transform: translateY(0);
}

/* ==========================================================================
   SCREEN 2: ACTIVE GAMEPLAY (HUD + TOP-DOWN LOT + SPACE INSPECTOR)
   ========================================================================== */

.game-hud-bar {
  background: var(--asphalt-card);
  border: 2px solid var(--curb-gray);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 1.6fr auto;
  align-items: center;
  gap: 14px;
}

.hud-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hud-eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  font-weight: 700;
}

.hud-lot-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}

.hud-sub {
  font-size: 0.8rem;
  color: var(--accent-blue);
  font-weight: 600;
}

.hud-timer-value {
  font-family: "Courier New", Courier, monospace;
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--line-yellow);
  letter-spacing: 0.05em;
}

/* Patience Meter */
.patience-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.82rem;
}

.patience-bar-track {
  height: 12px;
  background: var(--asphalt-deep);
  border: 1px solid var(--curb-gray);
  border-radius: 999px;
  overflow: hidden;
  margin: 3px 0;
}

.patience-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #4ade80);
  transition: width 0.2s ease, background 0.2s ease;
}

.patience-bar-fill.is-warning {
  background: linear-gradient(90deg, #f59e0b, #facc15);
}

.patience-bar-fill.is-critical {
  background: linear-gradient(90deg, #dc2626, #ef4444);
}

.patience-event-log {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-tool {
  background: var(--asphalt-deep);
  color: var(--text-main);
  border: 1px solid var(--curb-gray);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 700;
}

.btn-tool.is-active {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--accent-amber);
  color: var(--line-yellow);
}

/* Main Gameplay Split Layout (Board + Side Inspector + Goose Bar) */
.game-main-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

.lot-board-wrapper {
  background: var(--asphalt);
  border: 3px solid var(--curb-gray);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.55);
}

/* Storefront Entrance Header */
.storefront-banner {
  background: #141923;
  border: 2px solid #475569;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
}

.storefront-building {
  background: linear-gradient(90deg, #1e293b, #334155, #1e293b);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--line-yellow);
  border-bottom: 1px solid #475569;
}

.storefront-building.bottom-building {
  border-top: 1px solid #475569;
  border-bottom: none;
}

.storefront-building.perimeter-banner {
  background: linear-gradient(90deg, #111827, #1f2937, #111827);
  color: #94a3b8;
}

.layout-template-badge {
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid rgba(250, 204, 21, 0.4);
  color: #fde047;
  letter-spacing: 0.05em;
  font-weight: 800;
  text-transform: uppercase;
}

.storefront-banner.bottom-banner {
  margin-top: 10px;
  margin-bottom: 0;
  border-top: 2px solid #475569;
}

.concourse-lane {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  margin: 10px 0;
  background: linear-gradient(90deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
  border: 1px dashed rgba(250, 204, 21, 0.5);
  border-radius: var(--radius-sm);
  color: var(--line-yellow);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.concourse-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fde047;
}

.concourse-info {
  font-size: 0.68rem;
  color: var(--text-dim);
  font-weight: 600;
}

/* Lot Layout Container with Side Flanks */
.lot-layout-container {
  display: flex;
  gap: 8px;
  align-items: stretch;
  width: 100%;
}

.lot-rows-container {
  flex: 1;
  min-width: 0;
}

.side-flank {
  display: flex;
  gap: 6px;
  align-items: stretch;
}

.vertical-access-lane {
  width: 32px;
  background: var(--asphalt-deep);
  border-left: 1px dashed rgba(255, 255, 255, 0.18);
  border-right: 1px dashed rgba(255, 255, 255, 0.18);
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  padding: 10px 0;
  color: var(--line-yellow);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  user-select: none;
}

.vertical-access-lane .lane-arrow-up,
.vertical-access-lane .lane-arrow-down {
  font-size: 0.85rem;
  opacity: 0.8;
}

.vertical-access-lane .lane-text-v {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  color: var(--text-dim);
  font-size: 0.62rem;
  white-space: nowrap;
  letter-spacing: 0.12em;
}

.side-building-facade {
  width: 82px;
  background: #141923;
  border: 2px solid #475569;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.side-facade-header {
  background: linear-gradient(180deg, #1e293b, #334155);
  color: var(--line-yellow);
  font-size: 0.62rem;
  font-weight: 900;
  text-align: center;
  padding: 6px 2px;
  border-bottom: 1px solid #475569;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.side-facade-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  padding: 6px 4px;
  background: #0f141c;
  gap: 6px;
}

.side-curb-slot {
  text-align: center;
  padding: 5px 2px;
  border-radius: 4px;
  font-size: 0.62rem;
  color: var(--text-dim);
  background: transparent;
}

.side-curb-slot.is-door {
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid var(--accent-green);
  color: #86efac;
  font-weight: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.side-curb-slot.is-door .door-icon {
  font-size: 1.1rem;
}

.side-curb-slot.is-door .door-title {
  font-size: 0.58rem;
  line-height: 1.1;
  letter-spacing: 0.04em;
}

.storefront-doors-row {
  display: grid;
  gap: 6px;
  padding: 5px 6px;
  background: #0f141c;
}

.storefront-col {
  text-align: center;
  font-size: 0.7rem;
  padding: 3px 4px;
  border-radius: 4px;
  color: var(--text-dim);
}

.storefront-col.is-entrance-door {
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid var(--accent-green);
  color: #86efac;
  font-weight: 800;
}

/* Driving Lanes & Parking Rows */
.driving-lane {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 10px;
  margin: 5px 0;
  background: var(--asphalt-deep);
  border-top: 1px dashed rgba(255, 255, 255, 0.14);
  border-bottom: 1px dashed rgba(255, 255, 255, 0.14);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

.lane-arrows {
  color: var(--line-yellow-dim);
}

.parking-row {
  display: grid;
  gap: 6px;
  margin-bottom: 6px;
}

/* Individual Parking Stall Button */
.parking-stall {
  min-height: 78px;
  background: #222834;
  color: var(--text-main);
  border: 2px solid var(--line-yellow-dim);
  border-top: 3px solid var(--line-yellow);
  border-radius: 5px;
  padding: 5px 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  position: relative;
  transition: transform 0.08s ease, border-color 0.12s ease, background 0.12s ease;
}

.parking-stall:hover {
  border-color: var(--line-yellow);
  background: #2a3242;
}

.stall-top-bar,
.stall-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  width: 100%;
  font-size: 0.68rem;
}

.stall-id {
  font-weight: 800;
  color: var(--text-main);
}

.stall-est {
  color: var(--text-dim);
  font-size: 0.64rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Uninspected Stall */
.stall-unknown {
  background: repeating-linear-gradient(
    -45deg,
    #222834,
    #222834 8px,
    #1e2430 8px,
    #1e2430 16px
  );
}

.stall-center-unknown {
  text-align: center;
  margin: 4px 0;
}

.inspect-icon {
  display: inline-block;
  background: rgba(56, 189, 248, 0.14);
  color: var(--accent-blue);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.72rem;
  font-weight: 700;
}

.stall-flagged {
  border-color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.14);
}

.stall-center-flag {
  text-align: center;
  font-weight: 900;
  font-size: 0.75rem;
  color: var(--line-yellow);
}

/* Safe Available Stall */
.stall-safe {
  background: rgba(20, 83, 45, 0.28);
  border-color: #4ade80;
}

.stall-safe.is-selected {
  border-color: var(--line-yellow);
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.45);
  background: rgba(34, 197, 94, 0.34);
}

.stall-safe-body {
  text-align: center;
  margin: 3px 0;
}

/* Star Rating Display */
.star-rating {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  letter-spacing: 0.5px;
  vertical-align: baseline;
}

.star-filled.gold    { color: #ffd700; }
.star-filled.green   { color: #52d273; }
.star-filled.cyan    { color: #36c9ff; }
.star-filled.orange  { color: #ff9d3a; }
.star-filled.red     { color: #ff5a5a; }

.star-empty {
  color: rgba(255, 255, 255, 0.15);
}

/* Quality Badges */
.quality-pill,
.quality-badge-large {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.7rem;
}

.quality-badge-large {
  font-size: 0.82rem;
  padding: 4px 10px;
}

.quality-premium {
  background: rgba(255, 215, 0, 0.18);
  color: #ffd700;
  border: 1px solid #ffd700;
}

.quality-excellent {
  background: rgba(82, 210, 115, 0.18);
  color: #52d273;
  border: 1px solid #52d273;
}

.quality-acceptable {
  background: rgba(54, 201, 255, 0.18);
  color: #36c9ff;
  border: 1px solid #36c9ff;
}

.quality-legal {
  background: rgba(255, 157, 58, 0.18);
  color: #ff9d3a;
  border: 1px solid #ff9d3a;
}

.quality-unfortunate {
  background: rgba(255, 90, 90, 0.18);
  color: #ff5a5a;
  border: 1px solid #ff5a5a;
}

/* Clue Number Badge */
.clue-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 0.72rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.clue-zero {
  background: rgba(34, 197, 94, 0.25);
  color: #86efac;
  border: 1px solid rgba(74, 222, 128, 0.5);
}

.clue-low {
  background: rgba(56, 189, 248, 0.28);
  color: #bae6fd;
  border: 1px solid rgba(56, 189, 248, 0.55);
}

.clue-med {
  background: rgba(245, 158, 11, 0.3);
  color: #fde047;
  border: 1px solid rgba(250, 204, 21, 0.55);
}

.clue-high {
  background: rgba(239, 68, 68, 0.34);
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.6);
}

.badge-trouble {
  background: rgba(239, 68, 68, 0.22);
  color: #fca5a5;
  border: 1px solid #ef4444;
}

.badge-neutral {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  border: 1px solid #64748b;
}

/* Occupied, Blocked & Hazard Stalls */
.stall-occupied {
  background: #1a1f29;
  border-color: #475569;
}

.stall-landmark {
  opacity: 0.94;
}

.stall-bad-parker {
  background: rgba(185, 28, 28, 0.18);
  border-color: #f87171;
}

.stall-blocked {
  background: rgba(217, 119, 6, 0.16);
  border-color: #fb923c;
}

.stall-hazard {
  background: rgba(220, 38, 38, 0.24);
  border-color: #ef4444;
}

.is-focused-clue {
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.55);
}

.stall-art-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
  min-height: 44px;
}

.stall-art {
  width: 68px;
  height: 44px;
}

.assessment-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Right Column: Goose Bar + Space Inspector */
.game-side-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.goose-widget {
  background: var(--asphalt-card);
  border: 2px solid var(--curb-gray);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.goose-avatar {
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  background: var(--asphalt-deep);
  border-radius: var(--radius-sm);
  border: 1px solid var(--curb-gray);
  display: flex;
  align-items: center;
  justify-content: center;
}

.goose-svg {
  width: 52px;
  height: 52px;
}

@media (prefers-reduced-motion: no-preference) {
  .goose-mood-honk {
    animation: gooseBounce 0.35s ease-in-out 2;
  }
  .goose-mood-flap {
    animation: gooseRock 0.4s ease-in-out 2;
  }
}

@keyframes gooseBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px) scale(1.05); }
}

@keyframes gooseRock {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-6deg); }
  75% { transform: rotate(6deg); }
}

.goose-text-col {
  flex: 1;
}

.goose-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}

.goose-title {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: var(--line-yellow);
  text-transform: uppercase;
}

.btn-honk {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--curb-gray);
  border-radius: 4px;
  font-size: 0.68rem;
  padding: 1px 6px;
}

.btn-honk:hover {
  color: var(--line-yellow);
  border-color: var(--line-yellow);
}

.goose-speech {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-main);
  font-style: italic;
}

/* Space Inspector Card */
.inspector-panel {
  background: var(--asphalt-card);
  border: 2px solid var(--curb-gray);
  border-radius: var(--radius-md);
  padding: 14px;
}

.inspector-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.inspector-eyebrow {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-blue);
  font-weight: 800;
}

.inspector-title {
  margin: 2px 0 0;
  font-size: 1.3rem;
}

.inspector-tagline {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

.inspector-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.metric-box {
  background: var(--asphalt-deep);
  border: 1px solid var(--curb-gray);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--text-dim);
}

.metric-val {
  font-size: 0.9rem;
}

.text-safe { color: #4ade80; }
.text-warn { color: #facc15; }
.text-danger { color: #f87171; }

.inspector-factors {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.inspector-factors h4 {
  margin: 0 0 3px;
  font-size: 0.76rem;
  color: var(--text-main);
  text-transform: uppercase;
}

.inspector-factors ul {
  margin: 0;
  padding-left: 18px;
}

.inspector-formula-preview {
  background: rgba(15, 18, 24, 0.6);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 10px;
}

.btn-commit {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
}

.commit-subtext {
  margin: 7px 0 0;
  font-size: 0.74rem;
  color: var(--text-dim);
  text-align: center;
}

.clue-legend-card {
  background: var(--asphalt-card);
  border: 1px solid var(--curb-gray);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.clue-legend-card strong {
  color: var(--line-yellow);
}

/* ==========================================================================
   SCREEN 3: RESULTS & REPLAY
   ========================================================================== */

.results-container {
  max-width: 960px;
  margin: 0 auto;
}

.results-banner {
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin-bottom: 14px;
  border: 2px solid var(--curb-gray);
}

.outcome-clean {
  background: linear-gradient(135deg, rgba(20, 83, 45, 0.55), #182232);
  border-color: #22c55e;
}

.outcome-awkward {
  background: linear-gradient(135deg, rgba(180, 83, 9, 0.45), #182232);
  border-color: #f59e0b;
}

.outcome-accident,
.outcome-severe {
  background: linear-gradient(135deg, rgba(153, 27, 27, 0.55), #182232);
  border-color: #ef4444;
}

.results-banner-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.results-badge {
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--line-yellow);
}

.new-best-pill {
  background: var(--line-yellow);
  color: #0f172a;
  font-weight: 900;
  font-size: 0.76rem;
  padding: 3px 10px;
  border-radius: 999px;
}

.results-outcome-title {
  margin: 0 0 6px;
  font-size: 1.65rem;
}

.results-outcome-msg {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--text-main);
}

.results-humor-summary {
  margin: 0;
  font-size: 0.95rem;
  color: #fef08a;
  font-style: italic;
}

.results-goose-box {
  background: var(--asphalt-card);
  border: 2px solid var(--curb-gray);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.results-goose-icon {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.goose-label {
  font-size: 0.72rem;
  font-weight: 900;
  color: var(--line-yellow);
  letter-spacing: 0.05em;
}

.results-goose-text p {
  margin: 3px 0 0;
  font-style: italic;
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.results-panel {
  background: var(--asphalt-card);
  border: 1px solid var(--curb-gray);
  border-radius: var(--radius-md);
  padding: 14px 18px;
}

.results-panel h3 {
  margin: 0 0 10px;
  font-size: 0.96rem;
  text-transform: uppercase;
  color: var(--accent-blue);
}

.breakdown-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.88rem;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
  padding-bottom: 4px;
}

.breakdown-row dt {
  color: var(--text-muted);
}

.breakdown-row dd {
  margin: 0;
  font-weight: 700;
}

.subtotal-row {
  border-top: 1px solid var(--curb-gray);
  padding-top: 6px;
}

.penalty-row dt,
.penalty-row dd {
  color: #f87171;
}

.final-score-row {
  border-top: 2px solid var(--line-yellow);
  padding-top: 8px;
  font-size: 1.15rem;
  color: var(--line-yellow);
}

.final-score-row dt {
  color: var(--line-yellow);
  font-weight: 900;
}

.incident-detail-row {
  flex-direction: column;
  gap: 4px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px dashed rgba(239, 68, 68, 0.3);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  margin-top: 4px;
}

.incident-detail-row dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 800;
  color: #fca5a5;
}

.incident-report-text {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
}

.results-records-strip {
  background: var(--asphalt-deep);
  border: 1px solid var(--curb-gray);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.results-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* ==========================================================================
   MODALS (HOW TO PLAY & LOCAL RECORDS)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 11, 16, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}

.modal-dialog {
  background: var(--asphalt-card);
  border: 2px solid var(--line-yellow);
  border-radius: var(--radius-lg);
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px 24px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--curb-gray);
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--line-yellow);
}

.records-summary-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.rec-stat-card {
  background: var(--asphalt-deep);
  border: 1px solid var(--curb-gray);
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rec-stat-card span {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.rec-stat-card strong {
  font-size: 1.15rem;
  color: var(--line-yellow);
}

.records-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-bottom: 16px;
}

.records-table th,
.records-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--curb-gray);
}

.records-table th {
  color: var(--accent-blue);
  font-size: 0.78rem;
  text-transform: uppercase;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (TABLET & MOBILE)
   ========================================================================== */

@media (max-width: 1080px) {
  .game-main-layout {
    grid-template-columns: 1fr;
  }
  .lot-cards-grid {
    grid-template-columns: 1fr;
  }
  .modifier-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .game-hud-bar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .modifier-cards-grid {
    grid-template-columns: 1fr;
  }
  .preview-grid {
    grid-template-columns: 1fr 1fr;
  }
  .game-hud-bar {
    grid-template-columns: 1fr;
  }
  .results-grid {
    grid-template-columns: 1fr;
  }
  .records-summary-cards {
    grid-template-columns: 1fr 1fr;
  }
  .lot-board-wrapper {
    padding: 6px;
    overflow-x: auto;
  }
  .parking-stall {
    min-height: 70px;
    padding: 4px;
  }
}

/* ---------- Global Leaderboard ---------- */
.modal-dialog-wide {
  max-width: 860px;
  width: min(860px, 96vw);
}

.global-scope-note {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.global-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

.global-filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.global-filters select,
.global-submit-form input[type='text'] {
  background: var(--asphalt-deep);
  color: var(--text-main);
  border: 1px solid var(--curb-gray);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font: inherit;
  font-size: 0.9rem;
  min-height: 40px;
}

.global-status {
  min-height: 1.4em;
  margin-bottom: 6px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.global-status.is-error {
  color: #fca5a5;
}

.global-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.global-table td.global-rank,
.global-table td.global-score {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.global-table td.global-score {
  color: var(--line-yellow);
}

.global-table td.global-nick {
  max-width: 190px;
  overflow-wrap: anywhere;
}

.global-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.global-pager .btn-nav:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.global-submit-panel {
  max-width: 760px;
  margin: 16px auto 0;
  padding: 14px 16px;
  background: var(--asphalt-card);
  border: 1px solid var(--curb-gray);
  border-radius: var(--radius-md);
}

.global-submit-panel h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.global-submit-summary {
  margin: 0 0 4px;
  font-weight: 800;
  color: var(--line-yellow);
}

.global-submit-note {
  margin: 0 0 10px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.global-submit-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 8px;
}

.global-submit-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 200px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.global-submit-form .btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.global-submit-msg {
  margin: 6px 0 10px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.global-submit-msg.is-success {
  color: #86efac;
}

.global-submit-msg.is-error {
  color: #fca5a5;
}

@media (max-width: 680px) {
  .global-table th,
  .global-table td {
    padding: 6px 6px;
    font-size: 0.78rem;
  }
  .global-filters select {
    width: 100%;
  }
  .global-filters label {
    flex: 1 1 100%;
  }
}

/* ==========================================================================
   GLOBAL LEADERBOARD PREFERENCE & AUTO-SUBMIT CONTROLS
   ========================================================================== */

.global-pref-card {
  background: var(--asphalt-card);
  border: 1px solid var(--curb-gray);
  border-left: 4px solid var(--line-yellow);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-top: 10px;
}

.global-pref-card-modal {
  margin-top: 0;
  margin-bottom: 14px;
  background: var(--asphalt-deep);
  border-left-color: var(--accent-blue);
}

.global-pref-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pref-toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  user-select: none;
}

.pref-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--line-yellow);
}

.pref-toggle-text {
  line-height: 1.3;
}

.pref-nickname-group {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--curb-gray);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nickname-field-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pref-field-label {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  min-width: 140px;
}

.nickname-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 240px;
}

.pref-nickname-input {
  flex: 1 1 auto;
  max-width: 260px;
  background: var(--asphalt-deep);
  border: 1px solid var(--curb-gray);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 7px 10px;
  font-size: 0.92rem;
  font-family: inherit;
  min-height: 38px;
}

.pref-nickname-input:focus {
  outline: none;
  border-color: var(--line-yellow);
  box-shadow: 0 0 0 2px var(--line-yellow-dim);
}

.pref-public-notice {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.pref-public-notice strong {
  color: var(--accent-amber);
}

.pref-feedback-msg {
  margin: 0;
  font-size: 0.82rem;
  color: var(--accent-red);
}

.global-submit-pref-row {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--curb-gray);
}
