/* Stuck in Traffic - Mootsmog site chrome (matches One Stroke / Sliding / hub) */

:root {
  --bg: #FDF0D5;
  --bg-deep: #F5E4C4;
  --panel: #ffffff;
  --panel-2: #F7EBD0;
  --text: #2C2416;
  --muted: #7A6A52;
  --accent: #249D8F;
  --accent-2: #1A7A6F;
  --gold: #E9C46A;
  --coral: #E76F51;
  --border: rgba(36, 157, 143, 0.35);
  --ok: #249D8F;
  --danger: #E76F51;
  --yellow: #e6b800;
  --yellow-soft: #fff6c8;
  --radius: 16px;
  --shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 10px 30px rgba(36, 157, 143, 0.12),
    0 2px 8px rgba(44, 36, 22, 0.06);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    system-ui, sans-serif;

  /* Parking lot (board surface - keeps readable contrast for cars) */
  --lot: #2a3340;
  --lot-inner: #343e4d;
  --tile: #4a5566;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
  min-height: 100%;
  min-height: 100dvh;
  background-color: var(--bg-deep);
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  min-height: 100dvh;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

body {
  line-height: 1.4;
  background-color: var(--bg-deep);
  /* Page paper from /shared/notebook-bg.css */
  user-select: none;
  -webkit-user-select: none;
}

.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: calc(16px + var(--safe-top)) 16px calc(40px + var(--safe-bottom));
}

header.hero {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 18px;
}

.nav-home {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
}

.nav-home:hover {
  color: var(--accent-2);
}

header.hero h1 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
  letter-spacing: 0.02em;
  color: var(--text);
}

header.hero .sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 4px;
  font-weight: 500;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(
    135deg,
    rgba(255, 214, 0, 0.28),
    rgba(36, 157, 143, 0.12)
  );
  border: 1px solid rgba(230, 184, 0, 0.4);
  color: var(--accent-2);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  box-shadow: var(--shadow);
}

.layout {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 300px);
  gap: 16px;
  align-items: start;
}

@media (max-width: 820px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .side-panel {
    order: 2;
  }
}

.panel {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
}

.board-wrap {
  display: flex;
  flex-direction: column;
}

.stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.stat-chip {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  min-width: 88px;
}

.stat-chip .label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}

.stat-chip .value {
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.hint-bar {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 12px;
  min-height: 1.3em;
  line-height: 1.45;
}

.board-root {
  position: relative;
  margin: 0 auto;
  touch-action: none;
}

/* ── Parking lot board ── */

.lot {
  position: relative;
  border-radius: 16px;
  background: var(--lot);
  box-shadow:
    0 0 0 1px rgba(36, 157, 143, 0.22),
    0 0 0 3px rgba(230, 184, 0, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 10px 28px rgba(44, 36, 22, 0.2);
  overflow: hidden;
  border: 2px solid rgba(90, 140, 150, 0.45);
}

.lot-inner {
  position: absolute;
  inset: 6px;
  border-radius: 11px;
  background: var(--lot-inner);
  pointer-events: none;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.22),
    inset 0 0 18px rgba(0, 0, 0, 0.12);
}

.tile {
  position: absolute;
  border-radius: 5px;
  background: var(--tile);
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.lot-border {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  z-index: 6;
}

.lot-border svg {
  display: block;
  overflow: visible;
}

.exit-band {
  position: relative;
  pointer-events: none;
  z-index: 1;
}

.exit-ramp {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: #6b5200;
  background: linear-gradient(180deg, #fff8d6, #ffe566 55%, #f0c84a);
  border: 2.5px solid #e6b800;
  border-top: none;
  border-radius: 0 0 12px 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow:
    0 4px 12px rgba(44, 36, 22, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

/* ── Vehicles ── */

.vehicle {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  cursor: grab;
  touch-action: none;
  will-change: transform;
  border-radius: 22%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  color: #fff;
}

.vehicle.is-hero {
  display: grid;
  place-items: center;
  color: #111;
  font-weight: 700;
  text-shadow: none;
}

.vehicle.is-hero .v-arrow {
  filter: none;
}

.v-id {
  line-height: 1;
  pointer-events: none;
}

.v-arrow {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
  opacity: 0.95;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.4));
}

.vehicle.is-h .v-arrow:first-child {
  left: 10%;
  top: 50%;
  transform: translateY(-50%);
  border-top: 0.28em solid transparent;
  border-bottom: 0.28em solid transparent;
  border-right: 0.42em solid rgba(255, 255, 255, 0.95);
}

.vehicle.is-h .v-arrow:last-child {
  right: 10%;
  top: 50%;
  transform: translateY(-50%);
  border-top: 0.28em solid transparent;
  border-bottom: 0.28em solid transparent;
  border-left: 0.42em solid rgba(255, 255, 255, 0.95);
}

.vehicle.is-v .v-arrow:first-child {
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  border-left: 0.28em solid transparent;
  border-right: 0.28em solid transparent;
  border-bottom: 0.42em solid rgba(255, 255, 255, 0.95);
}

.vehicle.is-v .v-arrow:last-child {
  bottom: 10%;
  left: 50%;
  transform: translateX(-50%);
  border-left: 0.28em solid transparent;
  border-right: 0.28em solid transparent;
  border-top: 0.42em solid rgba(255, 255, 255, 0.95);
}

.vehicle.is-hero.is-h .v-arrow:first-child {
  border-right-color: #111;
}

.vehicle.is-hero.is-h .v-arrow:last-child {
  border-left-color: #111;
}

.vehicle.is-hero.is-v .v-arrow:first-child {
  border-bottom-color: #111;
}

.vehicle.is-hero.is-v .v-arrow:last-child {
  border-top-color: #111;
}

.vehicle.is-dragging {
  cursor: grabbing;
  z-index: 6;
  transition: none;
  filter: brightness(1.05);
}

.vehicle.is-hero {
  border-color: rgba(255, 255, 255, 0.65);
  box-shadow:
    0 2px 8px rgba(230, 184, 0, 0.35),
    0 0 0 1px rgba(230, 184, 0, 0.25);
}

.vehicle.exiting {
  opacity: 0.35;
}

/* ── Toolbar / status ── */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

button {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.08s ease;
}

button:hover {
  border-color: var(--accent-2);
  background: #E8D4A8;
}

button:active {
  transform: scale(0.98);
}

button.primary {
  background: linear-gradient(180deg, #3DB5A3 0%, var(--accent) 55%, var(--accent-2) 100%);
  color: #ffffff;
  border-color: #e08a50;
}

button.primary:hover {
  background: linear-gradient(180deg, #4ac4b2 0%, #2aafa0 55%, #1A7A6F 100%);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.status {
  margin-top: 10px;
  min-height: 1.4em;
  font-size: 0.92rem;
  color: var(--muted);
}

.status.ok { color: var(--ok); }

.status.err,
.status.bad { color: var(--coral, var(--danger)); }

.status.info {
  color: var(--accent-2);
}

/* ── Side panel ── */

.side-panel h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: var(--text);
}

.howto {
  margin: 0 0 14px;
  padding-left: 1.2em;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.92rem;
}

.howto strong {
  color: var(--text);
}

.howto li + li {
  margin-top: 6px;
}

.side-meta {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.muted {
  color: var(--muted);
}

.tiny {
  font-size: 0.78rem;
}

.mono {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.footnote {
  margin: 12px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
}

/* ── Win modal ── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 43, 51, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(340px, 100%);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  text-align: center;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 20px 50px rgba(44, 36, 22, 0.22);
}

.modal-card .emoji {
  font-size: 2.6rem;
  line-height: 1;
}

.modal-card h2 {
  margin: 8px 0 10px;
  color: var(--text);
  font-size: 1.35rem;
}

.stars {
  font-size: 1.5rem;
  letter-spacing: 0.08em;
  color: var(--yellow);
  margin-bottom: 8px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.modal-card .muted {
  margin: 0;
}

.modal-card .mono {
  margin: 10px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.modal-actions .primary {
  width: 100%;
}

.modal-card .link {
  display: inline-block;
  margin-top: 4px;
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}

.modal-card .link:hover {
  text-decoration: underline;
}


/* Headings: Waukegan LDO (see /fonts/waukegan-ldo.css) */
h1, h2 {
  font-family: "Waukegan LDO", "Eurostile", "Arial Narrow", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Puzzle info box under How to play (matches One Stroke) */
.side-meta {
  background: var(--panel-2, rgba(0, 0, 0, 0.04));
  border: 1px solid var(--border, rgba(0, 0, 0, 0.08));
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.88rem;
  color: var(--muted, #5a6a72);
  margin: 0 0 12px;
}
.side-meta dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  margin: 0;
}
.side-meta dt {
  color: var(--muted, #5a6a72);
  font-weight: 500;
}
.side-meta dd {
  margin: 0;
  color: var(--text, #1a2a30);
  font-weight: 600;
}


/* PALETTE-RICH OVERRIDES */
button.primary,
.btn-primary,
#btn-check.primary {
  background: linear-gradient(180deg, #3DB5A3 0%, var(--accent) 55%, var(--accent-2) 100%) !important;
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  color: #fff !important;
  box-shadow: 0 6px 16px rgba(36, 157, 143, 0.28);
}
button.primary:hover,
.btn-primary:hover {
  filter: brightness(1.05);
}
#btn-share-x,
#btn-share-x-win,
#btn-share,
.btn-x-share {
  background: linear-gradient(180deg, var(--gold) 0%, #D4A84A 100%) !important;
  border-color: color-mix(in srgb, var(--gold) 60%, #8a6a20) !important;
  color: #2C2416 !important;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(233, 196, 106, 0.35);
}
.status.bad,
.bad {
  color: var(--coral, #E76F51) !important;
}
.status.ok,
.ok {
  color: var(--accent) !important;
}
.progress > span,
.progress-bar,
#progress-bar,
#question-timer-fill {
  background: linear-gradient(90deg, var(--accent), var(--gold)) !important;
}
.hero .badge,
.badge {
  color: var(--accent-2);
  border-color: color-mix(in srgb, var(--gold) 45%, var(--border));
  background: color-mix(in srgb, var(--gold) 18%, var(--panel));
}
a.nav-home {
  color: var(--accent-2);
}
a.nav-home:hover {
  color: var(--coral);
}


/* CORAL-EMPHASIS */
button:not(.primary):not(.btn-primary):hover {
  border-color: #E76F51 !important;
  color: #C9543A !important;
}
#btn-clear,
#btn-skip,
#btn-reset,
button[id*="clear"],
button[id*="reset"],
button[id*="skip"] {
  border-color: color-mix(in srgb, #E76F51 40%, var(--border)) !important;
  color: #C9543A !important;
}
#btn-clear:hover,
#btn-reset:hover,
#btn-skip:hover {
  background: color-mix(in srgb, #E76F51 14%, var(--panel)) !important;
}
.cell.wrong,
.wrong,
.is-wrong,
[data-wrong="1"] {
  background: #F8C4B4 !important;
  box-shadow: inset 0 0 0 2px #E76F51 !important;
}
.timer,
#timer,
.stat-chip .value {
  color: #C9543A;
}
.clue-current,
.hint-bar {
  border-left: 3px solid #E76F51;
}
.modal-actions #btn-close-modal,
#btn-close-modal,
#btn-close-win {
  border-color: color-mix(in srgb, #E76F51 45%, var(--border)) !important;
  color: #C9543A !important;
}
a.btn-link {
  border-color: color-mix(in srgb, #E76F51 35%, var(--border)) !important;
  color: #C9543A !important;
}
a.btn-link:hover {
  background: color-mix(in srgb, #E76F51 12%, #FFFBF3) !important;
}
