:root {
  --ink: #17202a;
  --muted: #5f6b7a;
  --paper: #fbfcf7;
  --panel: #ffffff;
  --line: #d7dfde;
  --road: #263345;
  --road-line: #f7d36d;
  --home: #50a675;
  --work: #2e6ea6;
  --accent: #e0634f;
  --accent-2: #f2b84b;
  --good: #288a5a;
  --bad: #b94b4b;
  --freeway: #2d8bd2;
  --side: #31a879;
  --tile: #f3d89b;
  --shadow: 0 16px 40px rgba(23, 32, 42, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(242,184,75,0.18), transparent 22%),
    radial-gradient(circle at 88% 18%, rgba(45,139,210,0.16), transparent 25%),
    linear-gradient(180deg, #eef7f4, #dbeae5);
  font-family: Arial, Helvetica, sans-serif;
}

body:has(.game-main) {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: #e9efed;
  padding: 0.72rem 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(23, 32, 42, 0.14);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-good {
  background: var(--good);
  color: white;
}

.btn-bad {
  background: var(--bad);
  color: white;
}

.btn-small {
  padding: 0.48rem 0.62rem;
  font-size: 0.88rem;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem clamp(1rem, 3vw, 2rem);
  background: rgba(255, 252, 244, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.4), transparent 32%),
    conic-gradient(from 180deg, var(--home), var(--accent-2), var(--accent), var(--work), var(--home));
  display: grid;
  place-items: center;
  color: white;
  font-weight: 900;
  box-shadow:
    inset 0 0 0 4px rgba(255,255,255,0.55),
    0 9px 18px rgba(23,32,42,0.16);
}

.brand h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2.6vw, 2.2rem);
  letter-spacing: 0;
  color: #162235;
  text-shadow: 0 2px 0 rgba(242,184,75,0.26);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.nav button {
  background: transparent;
  border: 1px solid var(--line);
}

.nav button.active {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

.main {
  padding: clamp(0.6rem, 1.2vw, 1rem);
}

.game-main {
  padding-bottom: 0;
  overflow: hidden;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  gap: 0.45rem;
  align-items: start;
  transition: grid-template-columns 260ms ease;
}

.game-layout.trivia-collapsed {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.game-layout.trivia-expanded {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 410px);
  gap: 1rem;
}

.stage,
.panel,
.modal-card,
.editor-card,
.setup-card {
  background: rgba(255,255,255,0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stage {
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,252,244,0.94));
}

.side-panel {
  position: sticky;
  top: 92px;
  min-width: 0;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: start;
  overflow: hidden;
}

.trivia-rail {
  min-height: 220px;
  display: grid;
  place-items: center;
  gap: 0.4rem;
  padding: 0.7rem 0.25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,248,232,0.94));
  box-shadow: var(--shadow);
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.trivia-rail span {
  color: var(--ink);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.trivia-rail strong {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.side-panel-content {
  min-width: 0;
  width: 0;
  max-width: 0;
  visibility: hidden;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(22px);
  transition: opacity 200ms ease, transform 260ms ease;
}

.trivia-expanded .side-panel {
  grid-template-columns: 0 minmax(0, 1fr);
  overflow: visible;
}

.trivia-expanded .trivia-rail {
  opacity: 0;
  pointer-events: none;
}

.trivia-expanded .side-panel-content {
  width: auto;
  max-width: none;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.trivia-collapsed .side-panel {
  position: fixed;
  right: 0.75rem;
  top: 62%;
  z-index: 15;
  width: 46px;
  grid-template-columns: 46px 0;
  transform: translateY(-50%);
}

.trivia-collapsed .trivia-rail {
  min-height: 164px;
  opacity: 0.82;
}

.trivia-collapsed .side-panel-content {
  display: none;
}

.stage-header {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}

.stage-header .board-tools {
  justify-self: end;
}

.board-tools {
  display: grid;
  grid-template-columns: 42px 68px 42px 76px 86px;
  gap: 0.35rem;
  align-items: center;
}

.board-tools button {
  min-height: 42px;
  padding: 0.45rem 0.5rem;
}

.board-tools .view-toggle.active {
  background: var(--road);
  color: white;
}

.headline h2,
.panel h2,
.setup-card h2,
.editor-card h2 {
  margin: 0;
  font-size: 1.05rem;
}

.headline p,
.small-note,
.muted {
  color: var(--muted);
}

.headline p {
  margin: 0.25rem 0 0;
}

.clock {
  min-width: 142px;
  padding: 0.65rem 1rem;
  text-align: center;
  color: white;
  background: var(--road);
  border-radius: 8px;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,0.16);
}

.clock span {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  color: #cdd8db;
  font-weight: 900;
}

.clock strong {
  display: block;
  font-size: clamp(1.55rem, 3vw, 2.3rem);
  line-height: 1;
}

.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 0.75rem;
  font-weight: 900;
  background: #f7faf8;
}

.map-wrap {
  position: relative;
  height: clamp(460px, 58vh, 620px);
  overflow: auto;
  overscroll-behavior: contain;
  background:
    linear-gradient(180deg, #bfe8f1 0%, #e6f6f0 44%, #acd98d 100%);
  scrollbar-color: var(--road) #dce8e4;
  scrollbar-width: thin;
  cursor: grab;
  user-select: none;
}

.trivia-collapsed .map-wrap {
  height: clamp(430px, calc(100dvh - 214px), 700px);
}

.trivia-expanded .map-wrap {
  height: clamp(360px, calc(100dvh - 354px), 500px);
}

.map-wrap.dragging {
  cursor: grabbing;
}

.board-roll-overlay {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background:
    radial-gradient(circle at 50% 35%, rgba(255,255,255,0.3), transparent 30%),
    rgba(23, 32, 42, 0.5);
}

.board-roll-card {
  width: min(720px, 92%);
  max-height: calc(100% - 2rem);
  overflow: auto;
  padding: 1rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.96);
  box-shadow: 0 24px 60px rgba(23, 32, 42, 0.36);
  text-align: center;
}

.board-roll-card h2 {
  margin: 0 0 0.75rem;
}

.rolling-dice {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  min-height: 78px;
  animation: rollingDiceOut 400ms ease 950ms both;
}

.die-face.rolling {
  animation: diceTumble 850ms ease-in-out infinite;
}

.die-face.rolling.delay {
  animation-delay: 120ms;
}

.board-roll-results,
.roll-next-note {
  opacity: 0;
  animation: revealRollResults 260ms ease 1.15s both;
}

.board-roll-results .roll-team {
  min-height: 156px;
}

.roll-next-note {
  display: grid;
  justify-items: center;
  gap: 0.65rem;
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-weight: 900;
}

.roll-next-note p {
  margin: 0;
}

.roll-next-note button {
  min-width: 190px;
}

.map-wrap.view-3d {
  background:
    radial-gradient(circle at 48% 15%, rgba(255,255,255,0.82), transparent 34%),
    linear-gradient(180deg, #a8dded 0%, #dff6ed 48%, #93ca72 100%);
}

.map-wrap::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}

.map-wrap::-webkit-scrollbar-track {
  background: #dce8e4;
}

.map-wrap::-webkit-scrollbar-thumb {
  background: var(--road);
  border: 3px solid #dce8e4;
  border-radius: 999px;
}

.map-scale-frame {
  position: relative;
  width: calc(2250px * var(--board-zoom));
  height: calc(1650px * var(--board-zoom));
  margin-left: auto;
  margin-right: auto;
}

.map-canvas {
  position: relative;
  width: 2250px;
  height: 1650px;
  transform: scale(var(--board-zoom));
  transform-origin: 0 0;
  transform-style: preserve-3d;
  overflow: hidden;
  background:
    radial-gradient(circle at 10% 18%, rgba(255,255,255,0.78), transparent 10%),
    radial-gradient(circle at 82% 12%, rgba(255,245,184,0.68), transparent 12%),
    radial-gradient(circle at 18% 83%, rgba(82,178,93,0.28), transparent 16%),
    radial-gradient(circle at 78% 70%, rgba(68,159,196,0.14), transparent 17%),
    linear-gradient(180deg, #e9f7ff 0%, #d9f1de 43%, #b7dd8b 100%);
  border: 12px solid rgba(255,255,255,0.78);
  box-shadow: inset 0 0 0 5px rgba(23, 32, 42, 0.08);
}

.view-3d .map-canvas {
  transform: scale(var(--board-zoom));
  transform-origin: 0 0;
  border-radius: 28px;
  box-shadow:
    0 12px 0 #8ea9a5,
    0 26px 48px rgba(23, 32, 42, 0.24);
}

.view-3d .map-canvas::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 28px;
  background:
    radial-gradient(circle at 22% 22%, rgba(255,255,255,0.42), transparent 18%),
    linear-gradient(135deg, rgba(255,255,255,0.18), rgba(23,32,42,0.04));
  pointer-events: none;
}

.map-scenery {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.map-zone {
  position: absolute;
  border: 4px solid rgba(255,255,255,0.78);
  border-radius: 32px;
  box-shadow:
    inset 0 0 0 3px rgba(23, 32, 42, 0.05),
    0 18px 30px rgba(23, 32, 42, 0.08);
}

.map-zone span {
  position: absolute;
  left: 22px;
  top: 18px;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  color: rgba(23, 32, 42, 0.72);
  background: rgba(255,255,255,0.72);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.zone-neighborhood {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.18) 25%, transparent 25%) 0 0 / 64px 64px,
    #f6d58f;
}

.zone-park {
  background:
    radial-gradient(circle at 24% 35%, rgba(255,255,255,0.32), transparent 16%),
    radial-gradient(circle at 72% 68%, rgba(255,255,255,0.24), transparent 14%),
    #82c96a;
}

.zone-downtown {
  background:
    linear-gradient(90deg, rgba(255,255,255,0.24) 1px, transparent 1px) 0 0 / 56px 56px,
    #9bc6db;
}

.zone-office {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.32), rgba(255,255,255,0.06)),
    #b9b0dd;
}

.landmark {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  color: rgba(23, 32, 42, 0.76);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.landmark i {
  display: block;
  width: 74px;
  height: 58px;
  border: 4px solid rgba(255,255,255,0.9);
  border-radius: 12px 12px 8px 8px;
  background: #ffffff;
  box-shadow:
    inset 0 -10px 0 rgba(23, 32, 42, 0.08),
    0 12px 18px rgba(23, 32, 42, 0.16);
}

.landmark.home i {
  background:
    linear-gradient(135deg, transparent 46%, #d65b52 47% 54%, transparent 55%) 0 -16px / 100% 44px no-repeat,
    linear-gradient(90deg, #ffd97a 0 42%, #ffffff 43% 57%, #ffd97a 58% 100%);
}

.landmark.coffee i {
  width: 66px;
  border-radius: 14px 14px 22px 22px;
  background:
    linear-gradient(90deg, transparent 72%, #ffffff 73% 100%),
    linear-gradient(180deg, #f4c37c 0 45%, #9e7049 46% 100%);
}

.landmark.gas i {
  width: 58px;
  border-radius: 10px;
  background:
    linear-gradient(90deg, #ffffff 0 70%, transparent 71% 100%),
    linear-gradient(180deg, #f76f63 0 22%, #ffffff 23% 100%);
}

.landmark.traffic i {
  width: 38px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 25%, #e0634f 0 7px, transparent 8px),
    radial-gradient(circle at 50% 50%, #f2b84b 0 7px, transparent 8px),
    radial-gradient(circle at 50% 75%, #50a675 0 7px, transparent 8px),
    #263345;
}

.landmark.parking i {
  background:
    linear-gradient(180deg, #f7fbff 0 18%, #5f8fc3 19% 100%);
}

.landmark.office i {
  height: 78px;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.55) 10px, transparent 10px 22px) 12px 12px / 34px 20px repeat,
    #4f78a8;
}

.road-svg {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transform: translateZ(5px);
}

.route-line {
  fill: none;
  stroke: #5c6d76;
  stroke-width: 3.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 13px 5px rgba(23, 32, 42, 0.22));
}

.route-line.selected-route {
  filter:
    drop-shadow(0 0 7px rgba(255,255,255,0.95))
    drop-shadow(0 14px 6px rgba(23, 32, 42, 0.26));
}

.route-line.freeway {
  stroke: var(--freeway);
}

.route-line.side {
  stroke: var(--side);
}

.route-dash {
  fill: none;
  stroke: rgba(255,255,255,0.82);
  stroke-width: 0.58;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1 2.25;
}

.route-dash.freeway {
  stroke: #dff2ff;
}

.route-dash.side {
  stroke: #fff1bb;
}

.view-3d .route-line {
  stroke-width: 4.1;
  filter: drop-shadow(0 14px 5px rgba(23, 32, 42, 0.28));
}

.view-3d .route-line.freeway {
  stroke: #56a7ef;
}

.view-3d .route-line.side {
  stroke: #52b990;
}

.view-3d .route-dash {
  stroke: rgba(255, 255, 255, 0.86);
  stroke-width: 0.62;
  stroke-dasharray: 1 2.15;
  filter: drop-shadow(0 2px 1px rgba(23, 32, 42, 0.18));
}

.route-sign {
  position: absolute;
  z-index: 8;
  transform: translate(-50%, -50%);
  min-width: 136px;
  padding: 0.48rem 0.62rem;
  border-radius: 12px;
  border: 3px solid white;
  color: white;
  text-align: center;
  box-shadow:
    inset 0 -5px 0 rgba(23, 32, 42, 0.12),
    0 10px 16px rgba(23, 32, 42, 0.22);
  pointer-events: none;
}

.route-sign em {
  display: block;
  margin-bottom: 0.12rem;
  font-style: normal;
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  opacity: 0.88;
  text-transform: uppercase;
}

.route-sign.freeway {
  background: #285f9f;
}

.route-sign.side {
  background: #2e7d67;
}

.route-sign strong,
.route-sign span {
  display: block;
  line-height: 1.05;
}

.route-sign strong {
  font-size: 0.8rem;
  text-transform: uppercase;
}

.route-sign span {
  margin-top: 0.14rem;
  font-size: 0.66rem;
  font-weight: 900;
  opacity: 0.9;
}

.view-3d .route-sign {
  transform: translate(-50%, -50%) translateZ(54px);
}

.space {
  position: absolute;
  z-index: 7;
  width: 86px;
  height: 76px;
  margin: -38px 0 0 -43px;
  border-radius: 20px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  place-items: center;
  padding: 0.22rem 0.3rem 0.36rem;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.95), rgba(244,248,246,0.94));
  border: 4px solid #ffffff;
  box-shadow:
    inset 0 -8px 0 rgba(23, 32, 42, 0.08),
    0 9px 0 rgba(91, 112, 118, 0.34),
    0 16px 20px rgba(23, 32, 42, 0.18);
  font-size: 0.76rem;
  font-weight: 900;
  text-align: center;
  color: var(--ink);
}

.space.occupied-space {
  border-color: rgba(255,255,255,0.98);
  box-shadow:
    inset 0 -8px 0 rgba(23, 32, 42, 0.08),
    0 9px 0 rgba(91, 112, 118, 0.34),
    0 16px 20px rgba(23, 32, 42, 0.22),
    var(--space-glow);
}

.space strong {
  position: relative;
  z-index: 2;
  display: block;
  max-width: 100%;
  overflow: hidden;
  font-size: 0.6rem;
  line-height: 1;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-number {
  position: absolute;
  left: 7px;
  top: 6px;
  z-index: 3;
  min-width: 20px;
  padding: 0.1rem 0.2rem;
  border-radius: 999px;
  color: rgba(23,32,42,0.78);
  background: rgba(255,255,255,0.78);
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 1;
}

.tile-icon {
  position: relative;
  z-index: 2;
  display: block;
  width: 30px;
  height: 25px;
  margin-top: 0.55rem;
}

.tile-icon::before,
.tile-icon::after {
  content: "";
  position: absolute;
  display: block;
}

.view-3d .space {
  transform: translateZ(34px);
  border-radius: 20px;
  background:
    radial-gradient(circle at 34% 26%, #ffffff 0 18%, rgba(255,255,255,0.88) 19% 46%, rgba(218,228,229,0.95) 47% 100%);
  border-color: rgba(255,255,255,0.92);
  box-shadow:
    inset 0 -10px 0 rgba(23, 32, 42, 0.12),
    0 14px 0 #aebebe,
    0 24px 24px rgba(23, 32, 42, 0.24);
}

.view-3d .space.occupied-space {
  border-color: rgba(255,255,255,1);
  box-shadow:
    inset 0 -10px 0 rgba(23, 32, 42, 0.12),
    0 14px 0 #aebebe,
    0 24px 24px rgba(23, 32, 42, 0.3),
    var(--space-glow);
}

.view-3d .space.choice {
  background:
    radial-gradient(circle at 34% 26%, #fffdfa 0 18%, #ffe9a8 19% 52%, #f2b84b 53% 100%);
}

.view-3d .space.home {
  background:
    radial-gradient(circle at 34% 26%, #ffffff 0 18%, #9ee6ba 19% 52%, #50a675 53% 100%);
}

.view-3d .space.work {
  background:
    radial-gradient(circle at 34% 26%, #ffffff 0 18%, #9fcfff 19% 52%, #2e6ea6 53% 100%);
}

.space.choice {
  border-color: #ffffff;
  background:
    radial-gradient(circle at 30% 22%, rgba(255,255,255,0.92), transparent 22%),
    linear-gradient(180deg, #ffe58f, #f2b84b);
}

.tile-choice .tile-icon {
  width: 30px;
  height: 30px;
  border: 4px solid rgba(23,32,42,0.65);
  border-radius: 50%;
}

.tile-choice .tile-icon::before {
  left: 10px;
  top: 5px;
  width: 4px;
  height: 13px;
  border-radius: 999px;
  background: rgba(23,32,42,0.65);
}

.tile-choice .tile-icon::after {
  left: 10px;
  bottom: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(23,32,42,0.65);
}

.space.freeway-space {
  border-color: #ffffff;
  background:
    radial-gradient(circle at 30% 22%, rgba(255,255,255,0.92), transparent 22%),
    linear-gradient(180deg, #93d7ff, #2d8bd2);
  color: white;
}

.tile-freeway .tile-icon::before,
.tile-side .tile-icon::before {
  left: 2px;
  top: 9px;
  width: 27px;
  height: 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.86);
}

.tile-freeway .tile-icon::after,
.tile-side .tile-icon::after {
  left: 8px;
  top: 12px;
  width: 15px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.65;
}

.space.side-space {
  border-color: #ffffff;
  background:
    radial-gradient(circle at 30% 22%, rgba(255,255,255,0.92), transparent 22%),
    linear-gradient(180deg, #90e1b7, #31a879);
  color: white;
}

.space.home {
  border-color: var(--home);
  background:
    radial-gradient(circle at 30% 22%, rgba(255,255,255,0.92), transparent 22%),
    linear-gradient(180deg, #9ee6ba, #50a675);
  color: white;
}

.tile-home .tile-icon::before {
  left: 4px;
  top: 11px;
  width: 24px;
  height: 17px;
  border-radius: 4px;
  background: rgba(255,255,255,0.95);
}

.tile-home .tile-icon::after {
  left: 2px;
  top: 2px;
  width: 27px;
  height: 27px;
  transform: rotate(45deg);
  border-radius: 3px;
  background: #e0634f;
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
}

.space.work {
  border-color: var(--work);
  background:
    radial-gradient(circle at 30% 22%, rgba(255,255,255,0.92), transparent 22%),
    linear-gradient(180deg, #9fcfff, #2e6ea6);
  color: white;
}

.tile-work .tile-icon::before {
  left: 6px;
  top: 1px;
  width: 20px;
  height: 30px;
  border-radius: 4px 4px 2px 2px;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.72) 4px, transparent 4px 9px) 4px 6px / 12px 8px repeat,
    rgba(255,255,255,0.92);
}

.space.merge {
  border-color: #ffffff;
  background:
    radial-gradient(circle at 30% 22%, rgba(255,255,255,0.92), transparent 22%),
    linear-gradient(180deg, #dbe3e7, #8b9aa8);
}

.tile-coffee {
  background:
    radial-gradient(circle at 30% 22%, rgba(255,255,255,0.92), transparent 22%),
    linear-gradient(180deg, #9ee6ba, #50a675);
}

.tile-coffee .tile-icon::before {
  left: 5px;
  top: 8px;
  width: 20px;
  height: 16px;
  border-radius: 4px 4px 10px 10px;
  background: rgba(255,255,255,0.9);
}

.tile-coffee .tile-icon::after {
  right: 2px;
  top: 10px;
  width: 9px;
  height: 9px;
  border: 3px solid rgba(255,255,255,0.9);
  border-left: 0;
  border-radius: 0 9px 9px 0;
}

.tile-construction {
  background:
    radial-gradient(circle at 30% 22%, rgba(255,255,255,0.92), transparent 22%),
    linear-gradient(180deg, #ffb46a, #e0634f);
}

.tile-construction .tile-icon::before {
  left: 6px;
  top: 4px;
  width: 20px;
  height: 26px;
  background: rgba(255,255,255,0.92);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.tile-construction .tile-icon::after {
  left: 12px;
  top: 11px;
  width: 8px;
  height: 13px;
  background: var(--accent);
  box-shadow: 0 7px 0 var(--accent);
}

.tile-gas {
  background:
    radial-gradient(circle at 30% 22%, rgba(255,255,255,0.92), transparent 22%),
    linear-gradient(180deg, #ff9f8f, #c94848);
  color: white;
}

.tile-gas .tile-icon::before {
  left: 6px;
  top: 4px;
  width: 17px;
  height: 25px;
  border-radius: 4px;
  background: rgba(255,255,255,0.92);
}

.tile-gas .tile-icon::after {
  right: 4px;
  top: 10px;
  width: 11px;
  height: 14px;
  border: 4px solid rgba(255,255,255,0.92);
  border-left: 0;
  border-bottom: 0;
  border-radius: 0 8px 0 0;
}

.tile-parking {
  background:
    radial-gradient(circle at 30% 22%, rgba(255,255,255,0.92), transparent 22%),
    linear-gradient(180deg, #9fcfff, #2e6ea6);
  color: white;
}

.tile-parking .tile-icon::before {
  left: 4px;
  top: 3px;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(255,255,255,0.92);
}

.tile-parking .tile-icon::after {
  content: "P";
  left: 11px;
  top: 5px;
  color: #2e6ea6;
  font-size: 1rem;
  font-weight: 900;
}

.tile-traffic {
  background:
    radial-gradient(circle at 30% 22%, rgba(255,255,255,0.72), transparent 22%),
    linear-gradient(180deg, #596574, #263345);
  color: white;
}

.tile-traffic .tile-icon::before {
  left: 10px;
  top: 1px;
  width: 13px;
  height: 28px;
  border-radius: 7px;
  background:
    radial-gradient(circle at 50% 20%, #e0634f 0 3px, transparent 4px),
    radial-gradient(circle at 50% 50%, #f2b84b 0 3px, transparent 4px),
    radial-gradient(circle at 50% 80%, #50a675 0 3px, transparent 4px),
    rgba(255,255,255,0.9);
}

.tile-errand {
  background:
    radial-gradient(circle at 30% 22%, rgba(255,255,255,0.92), transparent 22%),
    linear-gradient(180deg, #c5a3f0, #8a5bb7);
  color: white;
}

.tile-errand .tile-icon::before {
  left: 5px;
  top: 10px;
  width: 23px;
  height: 16px;
  border-radius: 4px;
  background: rgba(255,255,255,0.92);
}

.tile-errand .tile-icon::after {
  left: 11px;
  top: 3px;
  width: 10px;
  height: 12px;
  border: 3px solid rgba(255,255,255,0.92);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
}

.tile-park {
  background:
    radial-gradient(circle at 30% 22%, rgba(255,255,255,0.92), transparent 22%),
    linear-gradient(180deg, #b8e487, #69aa48);
}

.tile-park .tile-icon::before {
  left: 6px;
  top: 3px;
  width: 22px;
  height: 20px;
  border-radius: 50% 50% 45% 45%;
  background: rgba(255,255,255,0.92);
}

.tile-park .tile-icon::after {
  left: 14px;
  top: 19px;
  width: 5px;
  height: 11px;
  border-radius: 999px;
  background: rgba(91,74,51,0.76);
}

.space-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, 43px);
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.team-piece {
  position: absolute;
  z-index: 9;
  width: 42px;
  height: 25px;
  margin: -13px 0 0 -21px;
  border-radius: 14px 16px 9px 9px;
  display: grid;
  place-items: center;
  color: white;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.48), transparent 28%),
    var(--team-color);
  font-size: 0.72rem;
  font-weight: 900;
  border: 2px solid white;
  box-shadow:
    inset -3px -4px 6px rgba(0,0,0,0.22),
    inset 3px 3px 5px rgba(255,255,255,0.38),
    0 8px 12px rgba(23, 32, 42, 0.3);
  transition: left 620ms cubic-bezier(0.2, 0.8, 0.2, 1), top 620ms cubic-bezier(0.2, 0.8, 0.2, 1), transform 160ms ease, filter 180ms ease;
}

.team-piece::before,
.team-piece::after {
  content: "";
  position: absolute;
}

.team-piece::before {
  left: 10px;
  top: -7px;
  width: 21px;
  height: 13px;
  border-radius: 12px 12px 2px 2px;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.74) 0 44%, rgba(255,255,255,0.34) 45% 100%),
    var(--team-color);
  border: 2px solid white;
  border-bottom: 0;
}

.team-piece::after {
  left: 6px;
  bottom: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #17202a;
  box-shadow: 22px 0 0 #17202a;
}

.team-piece span {
  position: relative;
  z-index: 2;
  line-height: 1;
}

.view-3d .team-piece {
  transform: translateZ(72px);
  background:
    radial-gradient(circle at 30% 24%, rgba(255,255,255,0.96) 0 14%, rgba(255,255,255,0.36) 15% 28%, transparent 29%),
    radial-gradient(circle at 68% 76%, rgba(0,0,0,0.26), transparent 36%),
    var(--team-color);
  box-shadow:
    inset -5px -7px 8px rgba(0,0,0,0.22),
    inset 3px 3px 5px rgba(255,255,255,0.42),
    0 8px 0 rgba(23, 32, 42, 0.2),
    0 18px 18px rgba(23, 32, 42, 0.28);
}

.team-piece.current {
  transform: scale(1.18);
  outline: 5px solid rgba(242, 184, 75, 0.45);
  animation: tokenPulse 900ms ease-in-out infinite alternate;
}

.view-3d .team-piece.current {
  transform: translateZ(82px) scale(1.18);
}

.team-piece.driving {
  z-index: 12;
  filter: drop-shadow(0 0 12px rgba(255, 191, 63, 0.72));
}

.team-piece.driving::before {
  animation: carCabBounce 320ms ease-in-out infinite alternate;
}

.team-piece.driving::after {
  animation: wheelShuffle 180ms linear infinite;
}

@keyframes tokenPulse {
  from { box-shadow: inset -3px -4px 6px rgba(0,0,0,0.22), inset 3px 3px 5px rgba(255,255,255,0.38), 0 8px 12px rgba(23, 32, 42, 0.3); }
  to { box-shadow: inset -3px -4px 6px rgba(0,0,0,0.22), inset 3px 3px 5px rgba(255,255,255,0.38), 0 0 22px rgba(242,184,75,0.85); }
}

@keyframes carCabBounce {
  from { transform: translateY(0); }
  to { transform: translateY(-2px); }
}

@keyframes wheelShuffle {
  from { transform: translateY(0); }
  50% { transform: translateY(1px); }
  to { transform: translateY(0); }
}

.dice-panel {
  border: 1px solid rgba(23, 32, 42, 0.12);
  border-radius: 8px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 10px 18px rgba(23, 32, 42, 0.1);
  min-height: 120px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.45rem;
  padding: 0.75rem;
}

.dice-panel > span {
  display: block;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.map-wrap > .dice-panel {
  position: sticky;
  left: 14px;
  top: 14px;
  z-index: 35;
  width: 136px;
  min-height: 0;
  margin: 14px 0 -132px 14px;
  padding: 0.58rem;
  border: 1px solid rgba(23, 32, 42, 0.16);
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(8px);
}

.map-wrap > .dice-panel > span {
  font-size: 0.58rem;
}

.map-wrap > .dice-panel .die-face {
  width: 48px;
  height: 48px;
  border-radius: 12px;
}

.map-wrap > .dice-panel .btn-small {
  width: 100%;
  padding: 0.45rem 0.42rem;
  font-size: 0.78rem;
}

.die-face {
  position: relative;
  width: 62px;
  height: 62px;
  border-radius: 14px;
  --pip-size: 10px;
  --pip-low: 26%;
  --pip-mid: 50%;
  --pip-high: 74%;
  background:
    radial-gradient(circle at 28% 22%, rgba(255,255,255,0.98), transparent 20%),
    linear-gradient(145deg, #ffffff, #e7edf0);
  border: 3px solid white;
  box-shadow:
    inset 0 -8px 0 rgba(23, 32, 42, 0.1),
    0 10px 16px rgba(23, 32, 42, 0.22);
}

.die-face.rolled {
  animation: dicePop 420ms ease both;
}

.pip {
  position: absolute;
  width: var(--pip-size);
  height: var(--pip-size);
  border-radius: 50%;
  background: var(--road);
  opacity: 0;
  transform: translate(-50%, -50%);
}

.pip-1 { left: var(--pip-low); top: var(--pip-low); }
.pip-2 { left: var(--pip-high); top: var(--pip-low); }
.pip-3 { left: var(--pip-low); top: var(--pip-mid); }
.pip-4 { left: var(--pip-high); top: var(--pip-mid); }
.pip-5 { left: var(--pip-low); top: var(--pip-high); }
.pip-6 { left: var(--pip-high); top: var(--pip-high); }
.pip-7 { left: var(--pip-mid); top: var(--pip-mid); }

.value-1 .pip-7,
.value-2 .pip-1,
.value-2 .pip-6,
.value-3 .pip-1,
.value-3 .pip-7,
.value-3 .pip-6,
.value-4 .pip-1,
.value-4 .pip-2,
.value-4 .pip-5,
.value-4 .pip-6,
.value-5 .pip-1,
.value-5 .pip-2,
.value-5 .pip-7,
.value-5 .pip-5,
.value-5 .pip-6,
.value-6 .pip-1,
.value-6 .pip-2,
.value-6 .pip-3,
.value-6 .pip-4,
.value-6 .pip-5,
.value-6 .pip-6 {
  opacity: 1;
}

@keyframes dicePop {
  0% { transform: rotate(-16deg) scale(0.82); }
  55% { transform: rotate(10deg) scale(1.12); }
  100% { transform: rotate(0) scale(1); }
}

@keyframes cardReveal {
  0% { transform: translateY(12px) rotate(-2deg); opacity: 0.15; }
  100% { transform: translateY(0) rotate(0); opacity: 1; }
}

@keyframes diceTumble {
  0% { transform: rotate(-18deg) translateY(0) scale(0.92); }
  35% { transform: rotate(22deg) translateY(-8px) scale(1.06); }
  70% { transform: rotate(-10deg) translateY(3px) scale(0.98); }
  100% { transform: rotate(18deg) translateY(0) scale(1.02); }
}

@keyframes rollingDiceOut {
  to { opacity: 0; transform: translateY(-8px) scale(0.92); }
}

@keyframes revealRollResults {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel {
  padding: 1rem;
}

.panel + .panel {
  margin-top: 1rem;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.round-progress {
  display: grid;
  gap: 0.18rem;
  margin-top: 0.75rem;
  padding: 0.68rem 0.75rem;
  border: 1px solid rgba(23, 32, 42, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(242,184,75,0.18), transparent 44%),
    #fff8e8;
}

.round-progress span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.round-progress strong {
  font-size: 0.98rem;
}

.resolution-log {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.75rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid rgba(23, 32, 42, 0.1);
  border-radius: 8px;
  background: #f7faf8;
}

.resolution-log > span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.resolution-log div {
  display: grid;
  gap: 0.1rem;
}

.resolution-log strong {
  font-size: 0.84rem;
}

.resolution-log em {
  color: var(--muted);
  font-size: 0.76rem;
  font-style: normal;
}

.team-list {
  display: grid;
  gap: 0.5rem;
}

.team-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfa;
}

.team-row > div:last-child {
  display: grid;
  justify-items: end;
  gap: 0.12rem;
}

.team-row small {
  color: var(--muted);
  font-weight: 700;
}

.team-answer-state {
  font-size: 0.78rem;
  font-weight: 900;
}

.team-response-controls {
  display: grid;
  gap: 0.28rem;
  min-width: 128px;
}

.response-check {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  min-height: 30px;
  padding: 0.28rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 900;
}

.response-check input {
  width: auto;
}

.response-check.correct:has(input:checked) {
  border-color: var(--good);
  background: #e8f6ee;
}

.response-check.incorrect:has(input:checked) {
  border-color: var(--bad);
  background: #faeaea;
}

.team-row.current {
  border-color: var(--accent);
  box-shadow: inset 4px 0 0 var(--accent);
}

.team-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.question-box {
  margin-top: 0.72rem;
  padding: 0.72rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
}

.question-box h3 {
  margin: 0 0 0.55rem;
  font-size: 1.04rem;
  line-height: 1.25;
}

.choices {
  display: grid;
  gap: 0.38rem;
  margin: 0.58rem 0;
}

.choice-line {
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  gap: 0.5rem;
  align-items: start;
  padding: 0.46rem 0.52rem;
  border-radius: 8px;
  background: white;
  border: 1px solid var(--line);
}

.choice-line.correct {
  border-color: var(--good);
  background: #e8f6ee;
}

.question-response-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.45rem;
}

.team-answer-card {
  display: grid;
  grid-template-columns: 26px minmax(0, 0.9fr) minmax(118px, 1.2fr);
  align-items: center;
  gap: 0.34rem;
  min-height: 48px;
  padding: 0.34rem 0.4rem;
  border: 2px solid color-mix(in srgb, var(--team-color) 65%, white);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(247,250,248,0.94));
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--team-color) 18%, transparent),
    0 10px 20px rgba(23, 32, 42, 0.12);
}

.team-answer-card > strong {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: white;
  background: var(--team-color);
  box-shadow: inset 0 -5px 0 rgba(0,0,0,0.14);
  font-size: 0.74rem;
}

.team-answer-card > span {
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.answer-picks {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.22rem;
}

.answer-pick {
  display: grid;
  justify-items: center;
  gap: 0.1rem;
  padding: 0.2rem 0.16rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-size: 0.58rem;
  font-weight: 900;
}

.answer-pick input {
  width: auto;
  margin: 0;
}

.answer-pick i {
  position: relative;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.answer-pick.correct i {
  background: var(--good);
}

.answer-pick.correct i::before {
  content: "";
  width: 8px;
  height: 5px;
  border: 2px solid white;
  border-top: 0;
  border-right: 0;
  transform: rotate(-45deg);
}

.answer-pick.incorrect i {
  background: var(--bad);
}

.answer-pick.incorrect i::before,
.answer-pick.incorrect i::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 2px;
  border-radius: 999px;
  background: white;
}

.answer-pick.incorrect i::before {
  transform: rotate(45deg);
}

.answer-pick.incorrect i::after {
  transform: rotate(-45deg);
}

.answer-pick.selected {
  border-color: currentColor;
  box-shadow: inset 0 -4px 0 rgba(23, 32, 42, 0.08);
}

.answer-actions,
.control-grid,
.manual-grid,
.setup-grid,
.editor-grid,
.card-grid,
.form-row {
  display: grid;
  gap: 0.6rem;
}

.answer-actions {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 0.62rem;
}

.board-response-dock {
  display: grid;
  padding: 0.38rem 0.52rem 0.46rem;
  border-top: 1px solid rgba(23, 32, 42, 0.1);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.94), rgba(246,251,249,0.92));
}

.board-response-dock .question-response-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.resolve-btn {
  grid-column: auto;
}

.control-grid {
  grid-template-columns: repeat(2, 1fr);
}

.manual-grid {
  grid-template-columns: repeat(4, 1fr);
  align-items: end;
}

.manual-grid input {
  min-width: 0;
}

label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 0.68rem 0.72rem;
}

textarea {
  min-height: 82px;
  resize: vertical;
}

.setup-wrap,
.admin-wrap {
  max-width: 1200px;
  margin: 0 auto;
}

.setup-grid {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  align-items: start;
}

.setup-card,
.editor-card {
  padding: 1rem;
}

.setup-card + .setup-card {
  margin-top: 1rem;
}

.team-inputs {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.check-list {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.check-item {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfa;
  color: var(--ink);
}

.check-item input {
  width: auto;
}

.how-preview {
  line-height: 1.5;
  font-size: 1.05rem;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.admin-tabs button.active {
  background: var(--ink);
  color: white;
}

.admin-save-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 1rem;
  padding: 0.72rem 0.82rem;
  border: 1px solid rgba(124,82,47,0.34);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.82), rgba(255,247,223,0.72));
  box-shadow: inset 0 -5px 0 rgba(23, 32, 42, 0.06);
}

.admin-save-row div {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.admin-save-row strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.admin-save-row span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.admin-save-row button {
  min-width: 104px;
}

.editor-grid {
  grid-template-columns: 320px 1fr;
  align-items: start;
}

.list-box {
  display: grid;
  gap: 0.5rem;
}

.list-button {
  text-align: left;
  background: #f7faf8;
  border: 1px solid var(--line);
}

.list-button.active {
  background: var(--road);
  color: white;
}

.question-editor,
.card-editor {
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfa;
}

.question-editor + .question-editor,
.card-editor + .card-editor {
  margin-top: 0.75rem;
}

.four-choices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

.card-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.banner {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  background: #fff3cf;
  border: 1px solid #e7c265;
  font-weight: 900;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(23, 32, 42, 0.46);
}

.modal-card {
  width: min(620px, 100%);
  padding: 1rem;
}

.modal-card h2 {
  margin: 0 0 0.5rem;
}

.roll-backdrop {
  background:
    radial-gradient(circle at 50% 26%, rgba(242,184,75,0.26), transparent 30%),
    rgba(23, 32, 42, 0.58);
}

.roll-card {
  width: min(860px, 100%);
  overflow: hidden;
}

.roll-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.roll-team {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  min-height: 190px;
  padding: 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(23, 32, 42, 0.12);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.94), rgba(255,248,232,0.94));
  box-shadow: 0 10px 18px rgba(23, 32, 42, 0.14);
}

.roll-team strong {
  text-align: center;
}

.roll-team b {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: white;
  background: var(--team-color);
  box-shadow: inset 0 -5px 0 rgba(0,0,0,0.14);
}

.roll-die {
  width: 66px;
  height: 66px;
}

.team-mini-car {
  position: relative;
  width: 54px;
  height: 30px;
  margin-top: 0.2rem;
  border-radius: 16px 18px 9px 9px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.45), transparent 30%),
    var(--team-color);
  border: 2px solid white;
  box-shadow: 0 8px 12px rgba(23, 32, 42, 0.22);
}

.team-mini-car::before {
  content: "";
  position: absolute;
  left: 14px;
  top: -9px;
  width: 26px;
  height: 15px;
  border-radius: 12px 12px 2px 2px;
  background: rgba(255,255,255,0.72);
  border: 2px solid white;
  border-bottom: 0;
}

.team-mini-car::after {
  content: "";
  position: absolute;
  left: 8px;
  bottom: -5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #17202a;
  box-shadow: 29px 0 0 #17202a;
}

.settings-card {
  width: min(780px, 100%);
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr);
  gap: 1rem;
  margin-top: 1rem;
}

.settings-grid section {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfa;
}

.settings-grid h3 {
  margin: 0 0 0.75rem;
}

.audio-master {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem 0.7rem;
  align-items: center;
  font-weight: 900;
}

.audio-master input {
  grid-column: 1 / -1;
  width: 100%;
}

.audio-master span {
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  color: #17202a;
  background: #ffdf88;
  font-size: 0.78rem;
}

.audio-toggle-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.8rem;
}

.audio-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.72);
  font-weight: 800;
}

.audio-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--good);
}

.card-reveal-backdrop {
  background:
    radial-gradient(circle at 50% 20%, rgba(242,184,75,0.18), transparent 34%),
    rgba(23, 32, 42, 0.58);
}

.card-reveal-modal {
  width: min(960px, 100%);
}

.assigned-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.assigned-card {
  position: relative;
  min-height: 244px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  box-shadow: none;
  transform: none;
}

.assigned-card:hover {
  transform: translateY(-2px);
}

.assigned-card:disabled {
  opacity: 1;
}

.card-order {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: white;
  background: var(--road);
  font-size: 0.8rem;
  font-weight: 900;
}

.card-team {
  position: absolute;
  left: 44px;
  right: 10px;
  top: 12px;
  z-index: 2;
  overflow: hidden;
  color: white;
  font-size: 0.76rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assigned-card-face {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 0.35rem;
  min-height: 244px;
  padding: 3rem 0.8rem 0.8rem;
  border: 4px solid white;
  border-radius: 8px;
  color: white;
  box-shadow:
    inset 0 -12px 0 rgba(23, 32, 42, 0.14),
    0 16px 24px rgba(23, 32, 42, 0.22);
}

.assigned-card.positive .assigned-card-face {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.26), transparent 38%),
    var(--good);
}

.assigned-card.oops .assigned-card-face {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.26), transparent 38%),
    var(--bad);
}

.assigned-card:not(.revealed) .assigned-card-face {
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.14) 0 10px, transparent 10px 20px),
    linear-gradient(135deg, rgba(255,255,255,0.18), transparent 42%),
    color-mix(in srgb, var(--good) 50%, var(--bad));
}

.assigned-card-face b {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.assigned-card-face strong {
  font-size: 1rem;
  line-height: 1.15;
}

.assigned-card-face p {
  margin: 0;
  color: rgba(255,255,255,0.86);
  font-size: 0.82rem;
  line-height: 1.32;
}

.assigned-card-face em {
  justify-self: start;
  padding: 0.24rem 0.5rem;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255,255,255,0.9);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 900;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

.route-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}

.route-card {
  display: grid;
  gap: 0.35rem;
  text-align: left;
  background: #f7faf8;
  border: 1px solid var(--line);
}

.route-card strong {
  font-size: 1.12rem;
}

.route-card span {
  color: var(--muted);
  font-weight: 700;
}

.endgame-backdrop {
  z-index: 70;
  background:
    radial-gradient(circle at 50% 22%, rgba(255,191,63,0.34), transparent 28%),
    rgba(23, 32, 42, 0.66);
}

.endgame-card {
  position: relative;
  width: min(820px, 100%);
  overflow: hidden;
  padding: 1.2rem;
  border: 4px solid rgba(255,247,223,0.92);
  color: #17202a;
  background:
    linear-gradient(180deg, rgba(255,247,223,0.98), rgba(255,232,169,0.94));
  box-shadow: 0 28px 70px rgba(23,32,42,0.38);
}

.endgame-card.some-missed {
  background:
    linear-gradient(180deg, rgba(255,247,223,0.98), rgba(232,239,237,0.96));
}

.endgame-burst {
  position: absolute;
  inset: -25% -10% auto auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  opacity: 0.64;
  background:
    radial-gradient(circle, rgba(255,255,255,0.82) 0 8%, transparent 9%),
    conic-gradient(from 14deg, #ffbf3f, #50a675, #2e6ea6, #e0634f, #ffbf3f);
  filter: blur(0.2px);
  animation: endgameSpin 3200ms linear infinite;
}

.endgame-kicker {
  display: inline-grid;
  margin-bottom: 0.45rem;
  padding: 0.28rem 0.58rem;
  border-radius: 999px;
  color: #fff7df;
  background: #263345;
  font-size: 0.78rem;
  font-weight: 1000;
  text-transform: uppercase;
}

.endgame-card h2 {
  position: relative;
  margin: 0;
  max-width: 650px;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 0.95;
}

.endgame-card p {
  position: relative;
  max-width: 620px;
  margin: 0.65rem 0 1rem;
  color: #4f5d66;
  font-weight: 800;
}

.endgame-results {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 0.75rem;
}

.endgame-results section {
  display: grid;
  gap: 0.45rem;
  padding: 0.75rem;
  border: 2px solid rgba(23,32,42,0.12);
  border-radius: 8px;
  background: rgba(255,255,255,0.62);
}

.endgame-results h3 {
  margin: 0 0 0.25rem;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.made-it-list h3 {
  color: var(--good);
}

.missed-it-list h3 {
  color: var(--bad);
}

.end-team-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.6rem;
  border-left: 8px solid var(--team-color);
  border-radius: 8px;
  background: #fffdf4;
  box-shadow: inset 0 -4px 0 rgba(23,32,42,0.06);
}

.end-team-row b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.end-team-row span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.endgame-actions {
  position: relative;
}

@keyframes endgameSpin {
  to { transform: rotate(360deg); }
}

/* Board-game polish pass */
:root {
  --panel: #fff7df;
  --line: #d7b66d;
  --accent: #e85f3f;
  --accent-2: #ffbf3f;
  --shadow: 0 18px 34px rgba(22, 24, 34, 0.18);
}

body {
  background:
    linear-gradient(90deg, rgba(38, 51, 69, 0.08) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(0deg, rgba(38, 51, 69, 0.06) 1px, transparent 1px) 0 0 / 56px 56px,
    radial-gradient(circle at 18% 14%, rgba(255, 191, 63, 0.26), transparent 22%),
    radial-gradient(circle at 88% 8%, rgba(46, 110, 166, 0.24), transparent 25%),
    linear-gradient(135deg, #f5e2b7 0%, #c9eadf 46%, #8fc774 100%);
}

button {
  border: 2px solid rgba(23, 32, 42, 0.18);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.46), transparent 42%),
    #fff0c7;
  box-shadow:
    inset 0 -5px 0 rgba(23, 32, 42, 0.12),
    0 7px 0 rgba(23, 32, 42, 0.1),
    0 14px 20px rgba(23, 32, 42, 0.12);
  text-transform: none;
}

button:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 -5px 0 rgba(23, 32, 42, 0.12),
    0 9px 0 rgba(23, 32, 42, 0.1),
    0 18px 24px rgba(23, 32, 42, 0.16);
}

button:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 -2px 0 rgba(23, 32, 42, 0.14),
    0 3px 0 rgba(23, 32, 42, 0.1),
    0 9px 14px rgba(23, 32, 42, 0.12);
}

button:disabled {
  background: #d9ded9;
  color: #7a827d;
}

.btn-primary {
  color: #17202a;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.38), transparent 40%),
    linear-gradient(180deg, #ffd15f, #ef6b45);
  border-color: rgba(116, 53, 26, 0.28);
}

.topbar {
  background:
    linear-gradient(90deg, #17202a, #263345 54%, #1d5d72);
  border-bottom: 4px solid #ffbf3f;
  box-shadow: 0 14px 30px rgba(23, 32, 42, 0.22);
}

.brand-mark {
  border-radius: 18px;
  color: #17202a;
  background:
    radial-gradient(circle at 35% 30%, #fff8d9 0 17%, transparent 18%),
    conic-gradient(from 210deg, #50a675, #ffbf3f, #e85f3f, #2e6ea6, #50a675);
}

.brand h1 {
  color: #fff7df;
  font-size: clamp(1.5rem, 3vw, 2.45rem);
  text-shadow: 0 3px 0 rgba(0,0,0,0.28), 0 0 18px rgba(255,191,63,0.28);
}

.brand .small-note {
  color: #ffdf88;
  font-weight: 800;
}

.nav button {
  color: #fff7df;
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.28);
}

.nav button.active {
  color: #17202a;
  background:
    linear-gradient(180deg, #fff5c9, #ffbf3f);
  border-color: #fff7df;
  box-shadow:
    inset 0 -5px 0 rgba(23,32,42,0.12),
    0 0 22px rgba(255,191,63,0.38);
}

.stage,
.panel,
.modal-card,
.editor-card,
.setup-card {
  border: 3px solid rgba(255, 247, 223, 0.72);
  background:
    linear-gradient(180deg, rgba(255,247,223,0.98), rgba(244,226,185,0.95));
  box-shadow:
    0 10px 0 rgba(126, 93, 46, 0.2),
    var(--shadow);
}

.setup-wrap {
  max-width: 1220px;
}

.lobby-hero {
  display: grid;
  gap: 0.45rem;
  margin: 0 auto 1rem;
  padding: 1.1rem 1.2rem;
  border: 4px solid rgba(255,247,223,0.8);
  border-radius: 18px;
  color: #fff7df;
  background:
    linear-gradient(135deg, rgba(255,191,63,0.22), transparent 44%),
    linear-gradient(90deg, #17202a, #24485b);
  box-shadow: 0 16px 34px rgba(23,32,42,0.2);
}

.lobby-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lobby-logo span {
  display: grid;
  place-items: center;
  min-width: 74px;
  min-height: 52px;
  border-radius: 14px;
  color: #17202a;
  background: linear-gradient(180deg, #fff7df, #ffbf3f);
  font-weight: 1000;
  box-shadow: inset 0 -6px 0 rgba(23,32,42,0.14);
}

.lobby-logo h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.95;
  text-shadow: 0 4px 0 rgba(0,0,0,0.28);
}

.lobby-hero p {
  margin: 0;
  color: #ffdf88;
  font-size: 1.15rem;
  font-weight: 900;
}

.setup-grid {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
}

.setup-card h2,
.panel h2,
.editor-card h2 {
  color: #17202a;
  font-size: 1.18rem;
  letter-spacing: 0;
}

.team-garage {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.garage-card {
  position: relative;
  grid-template-columns: auto 1fr;
  align-items: center;
  padding: 0.78rem;
  border: 2px solid color-mix(in srgb, var(--team-color) 55%, white);
  border-radius: 14px;
  color: var(--ink);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--team-color) 18%, white), #fff9e9);
  box-shadow: inset 0 -6px 0 rgba(23,32,42,0.08);
}

.garage-card input {
  grid-column: 1 / -1;
  margin-top: 0.25rem;
}

.garage-car {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  height: 34px;
  border: 3px solid white;
  border-radius: 18px 20px 10px 10px;
  color: white;
  background: var(--team-color);
  box-shadow: 0 8px 12px rgba(23,32,42,0.2);
}

.garage-car i {
  font-style: normal;
  font-weight: 1000;
}

.garage-copy {
  display: grid;
  gap: 0.1rem;
}

.garage-copy strong,
.deck-card strong,
.route-option strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.garage-copy em,
.deck-card em,
.route-option em {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 800;
}

.deck-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.deck-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  border: 2px solid rgba(23,32,42,0.13);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(80,166,117,0.13), transparent 42%),
    #fff9e9;
}

.deck-card input,
.route-option input {
  accent-color: var(--good);
}

.deck-card:has(input:checked) {
  border-color: var(--good);
  box-shadow: 0 0 0 4px rgba(80,166,117,0.16), inset 0 -6px 0 rgba(80,166,117,0.12);
}

.deck-card span {
  display: grid;
}

.setup-collapse {
  padding: 0;
  overflow: hidden;
}

.setup-collapse summary {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.75rem;
  min-height: 58px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  list-style: none;
  color: var(--ink);
  font-weight: 1000;
}

.setup-collapse summary::-webkit-details-marker {
  display: none;
}

.setup-collapse summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #17202a;
  background: #ffbf3f;
  box-shadow: inset 0 -4px 0 rgba(23,32,42,0.12);
}

.setup-collapse[open] summary::after {
  content: "-";
}

.setup-collapse summary span {
  font-size: 1.05rem;
}

.setup-collapse summary em {
  justify-self: end;
  color: var(--muted);
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 900;
}

.setup-collapse .check-list,
.setup-collapse .win-rules {
  margin: 0;
  padding: 0 1rem 1rem;
}

.compact-rules button {
  margin: 0 1rem 1rem;
}

.route-select {
  display: grid;
  gap: 0.55rem;
  margin: 0.8rem 0;
}

.route-option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem;
  border: 2px solid rgba(23,32,42,0.13);
  border-radius: 14px;
  background: #fff9e9;
}

.route-option.selected,
.route-option:has(input:checked) {
  border-color: #2e6ea6;
  background:
    linear-gradient(90deg, rgba(46,110,166,0.18), transparent),
    #fff9e9;
  box-shadow: 0 0 0 4px rgba(46,110,166,0.13);
}

.route-option span {
  display: grid;
}

.route-option b {
  color: #2e6ea6;
  font-size: 0.72rem;
}

.start-commute {
  width: 100%;
  min-height: 58px;
  margin-top: 0.4rem;
  font-size: 1.08rem;
}

.win-rules {
  display: grid;
  gap: 0.45rem;
  margin: 0.8rem 0 1rem;
}

.win-rules span {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 0.5rem;
  padding: 0.48rem 0.55rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.48);
  font-weight: 900;
}

.win-rules b {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: white;
  background: var(--road);
}

.stage {
  border-color: rgba(255,247,223,0.86);
  background:
    linear-gradient(180deg, rgba(255,247,223,0.92), rgba(205,234,224,0.8));
}

.stage-header {
  border-bottom: 4px solid rgba(255,191,63,0.45);
  background:
    linear-gradient(90deg, rgba(255,247,223,0.98), rgba(255,232,169,0.88));
}

.clock {
  min-width: 174px;
  background:
    linear-gradient(180deg, #263345, #17202a);
  border: 3px solid rgba(255,247,223,0.88);
  box-shadow: inset 0 -6px 0 rgba(0,0,0,0.22), 0 10px 16px rgba(23,32,42,0.22);
}

.clock span {
  color: #ffdf88;
}

.clock-spotlight {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(23,32,42,0.34), rgba(23,32,42,0) 44%);
  animation: clockBackdropIn 260ms ease both;
}

.spotlight-clock {
  min-width: min(520px, 82vw);
  padding: 1.25rem 2rem;
  border-width: 5px;
  transform-origin: center;
  animation: clockZoomIn 360ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.spotlight-clock span {
  font-size: 1rem;
}

.spotlight-clock strong {
  font-size: clamp(3.2rem, 9vw, 6.2rem);
}

.clock-roll-number {
  display: block;
  min-width: 5.4ch;
  overflow: hidden;
  transform-origin: center bottom;
}

.spotlight-clock.rolling .clock-roll-number {
  animation: clockNumberRoll 900ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes clockZoomIn {
  from { opacity: 0; transform: translateY(-18px) scale(0.42); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes clockBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes clockNumberRoll {
  0% { opacity: 0; transform: translateY(-115%) rotateX(58deg); filter: blur(2px); }
  35% { opacity: 1; transform: translateY(16%) rotateX(-12deg); filter: blur(0); }
  60% { transform: translateY(-6%) rotateX(7deg); }
  100% { opacity: 1; transform: translateY(0) rotateX(0deg); filter: blur(0); }
}

.status-pill {
  border: 2px solid rgba(23,32,42,0.18);
  background: #fff9e9;
  box-shadow: inset 0 -5px 0 rgba(23,32,42,0.08);
}

.trivia-collapsed .side-panel {
  display: none;
}

.game-layout.trivia-expanded {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
}

.review-panel {
  color: #fff7df;
  background:
    linear-gradient(180deg, rgba(38,51,69,0.98), rgba(23,32,42,0.98));
  border-color: rgba(255,247,223,0.56);
}

.review-panel h2 {
  color: #fff7df;
}

.review-panel .muted {
  color: #d8e3df;
}

.review-panel .btn-small {
  color: #17202a;
}

.round-progress {
  border: 2px solid rgba(255,191,63,0.38);
  background:
    linear-gradient(135deg, rgba(255,191,63,0.22), transparent 46%),
    rgba(255,247,223,0.08);
}

.round-progress span {
  color: #ffdf88;
}

.round-progress strong {
  color: #fff7df;
}

.game-question-card {
  border: 2px solid rgba(255,247,223,0.38);
  background:
    radial-gradient(circle at 10% 0%, rgba(255,191,63,0.18), transparent 22%),
    #fff7df;
  color: var(--ink);
}

.category-badge {
  display: inline-grid;
  width: max-content;
  margin-bottom: 0.45rem;
  padding: 0.32rem 0.55rem;
  border-radius: 999px;
  color: #17202a;
  background: #ffbf3f;
  font-size: 0.72rem;
  font-weight: 1000;
  text-transform: uppercase;
}

.choice-line {
  border: 2px solid rgba(23,32,42,0.12);
  background: rgba(255,255,255,0.78);
  box-shadow: inset 0 -4px 0 rgba(23,32,42,0.06);
}

.choice-line strong {
  color: #2e6ea6;
}

.choice-line.correct {
  border-color: var(--good);
  background: #dff6e8;
  box-shadow: 0 0 0 4px rgba(80,166,117,0.16);
}

.answer-reveal {
  display: grid;
  gap: 0.25rem;
  margin-top: 0.62rem;
  padding: 0.62rem;
  border: 2px solid rgba(80,166,117,0.45);
  border-radius: 12px;
  background: #e6f7e9;
}

.answer-reveal strong {
  color: var(--good);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.answer-reveal span {
  font-weight: 1000;
}

.answer-reveal p {
  margin: 0;
  color: var(--muted);
}

.answer-actions {
  grid-template-columns: 0.9fr 0.9fr 1.2fr;
}

.resolve-btn.ready {
  animation: readyPulse 900ms ease-in-out infinite alternate;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.4), transparent 42%),
    linear-gradient(180deg, #7fd99d, #288a5a);
  color: white;
}

.resolve-helper {
  margin: 0.55rem 0 0;
  color: #7a5a24;
  font-size: 0.82rem;
  font-weight: 900;
}

.resolve-helper.ready {
  color: var(--good);
}

@keyframes readyPulse {
  from { box-shadow: inset 0 -5px 0 rgba(23,32,42,0.12), 0 0 0 rgba(80,166,117,0); }
  to { box-shadow: inset 0 -5px 0 rgba(23,32,42,0.12), 0 0 22px rgba(80,166,117,0.62); }
}

.board-response-dock {
  padding: 0.45rem 0.55rem;
  background:
    linear-gradient(180deg, rgba(255,247,223,0.92), rgba(255,232,169,0.84));
}

.board-response-dock .question-response-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.team-answer-card {
  grid-template-columns: 30px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  align-items: center;
  gap: 0.12rem 0.42rem;
  min-height: 86px;
  padding: 0.4rem;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--team-color) 15%, white), #fff9e9);
}

.team-answer-card > strong {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.team-answer-card > em {
  grid-column: 2;
  grid-row: 2;
  color: var(--muted);
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 900;
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-response-name {
  grid-column: 2;
  grid-row: 1;
  line-height: 1.05;
  white-space: nowrap;
}

.answer-picks {
  grid-column: 1 / -1;
  grid-row: 3;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.28rem;
  margin-top: 0.22rem;
}

.answer-pick {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  justify-items: start;
  min-height: 34px;
  padding: 0.18rem 0.28rem;
  border: 2px solid rgba(23,32,42,0.12);
  background: rgba(255,255,255,0.8);
  font-size: 0.62rem;
  line-height: 1;
}

.answer-pick input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.answer-pick span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.answer-pick.correct.selected {
  background: #e4f7ec;
  color: var(--good);
}

.answer-pick.incorrect.selected {
  background: #fce4df;
  color: var(--bad);
}

.map-wrap > .dice-panel {
  width: 158px;
  margin-bottom: -150px;
  border: 3px solid rgba(255,247,223,0.9);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,247,223,0.96), rgba(255,232,169,0.94));
}

.map-wrap > .dice-panel > span {
  color: #17202a;
  font-size: 0.66rem;
}

.map-wrap > .dice-panel .die-face {
  width: 58px;
  height: 58px;
  --pip-size: 9px;
  --pip-low: 27%;
  --pip-high: 73%;
}

.map-wrap > .dice-panel .btn-small {
  min-height: 34px;
  color: #17202a;
  font-size: 0.88rem;
}

.board-roll-card {
  border: 4px solid rgba(255,247,223,0.86);
  background:
    radial-gradient(circle at 50% 0%, rgba(255,191,63,0.28), transparent 26%),
    linear-gradient(180deg, #fff7df, #f4e2b9);
}

.board-roll-card h2 {
  font-size: 2rem;
}

.roll-team {
  border: 2px solid color-mix(in srgb, var(--team-color) 50%, white);
}

.assigned-card {
  border-radius: 16px;
}

.assigned-card.positive .assigned-card-face {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.18), transparent 44%),
    #21854f;
}

.assigned-card.oops .assigned-card-face {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.18), transparent 44%),
    #b93832;
}

.assigned-card.positive:not(.revealed) .assigned-card-face {
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.11) 0 12px, transparent 12px 24px),
    linear-gradient(135deg, rgba(255,255,255,0.18), transparent 44%),
    #21854f;
}

.assigned-card.oops:not(.revealed) .assigned-card-face {
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.11) 0 12px, transparent 12px 24px),
    linear-gradient(135deg, rgba(255,255,255,0.18), transparent 44%),
    #b93832;
}

.assigned-card-face {
  color: #ffffff;
  text-shadow: 0 2px 0 rgba(23,32,42,0.24);
}

.assigned-card-face p {
  color: rgba(255,255,255,0.94);
  font-weight: 800;
}

.assigned-card-face strong {
  font-weight: 1000;
}

@media (max-width: 980px) {
  .game-layout,
  .setup-grid,
  .editor-grid {
    grid-template-columns: 1fr;
  }

  .game-layout.trivia-collapsed {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .game-layout.trivia-collapsed .side-panel {
    top: 50%;
    grid-template-columns: 46px 0;
  }

  .game-layout.trivia-collapsed .trivia-rail {
    min-height: 164px;
  }

  .stage-header {
    grid-template-columns: 1fr;
  }

  .map-wrap {
    height: 500px;
  }

  .trivia-collapsed .map-wrap {
    height: clamp(400px, calc(100dvh - 238px), 600px);
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    justify-content: flex-start;
  }

  .answer-actions,
  .control-grid,
  .manual-grid,
  .route-choice-grid,
  .four-choices {
    grid-template-columns: 1fr;
  }

  .space {
    width: 72px;
    height: 66px;
    margin: -33px 0 0 -36px;
    font-size: 0.62rem;
  }

  .space-label {
    transform: translate(-50%, 39px);
  }

  .stage-header {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* Final roll overlay and car direction pass. Keep after all theme overrides. */
.board-roll-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: clamp(0.75rem, 2vw, 1.25rem);
  overflow: auto;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 216, 107, 0.42), transparent 28%),
    rgba(16, 25, 39, 0.66);
}

.board-roll-card {
  width: min(760px, calc(100vw - 2rem));
  max-height: min(760px, calc(100dvh - 2rem));
  overflow: auto;
  margin: auto;
  border: 5px solid #fff7df;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 216, 107, 0.36), transparent 28%),
    linear-gradient(180deg, #fff7df, #f4c878);
}

.board-roll-card h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.team-piece {
  transform: scaleX(-1);
  transform-origin: center;
}

.view-3d .team-piece {
  transform: translateZ(72px) scaleX(-1);
}

.team-piece.current {
  transform: scaleX(-1) scale(1.18);
}

.view-3d .team-piece.current {
  transform: translateZ(82px) scaleX(-1) scale(1.18);
}

.team-piece span {
  transform: scaleX(-1);
}

/* Scorecard HUD: card movement points break ties for on-time teams. */
.score-card {
  position: sticky;
  left: 14px;
  top: 14px;
  z-index: 38;
  width: min(232px, calc(100% - 28px));
  margin: 14px 0 0 14px;
  padding: 0.62rem;
  border: 4px solid #fff7df;
  border-radius: 16px;
  color: #17202a;
  background:
    radial-gradient(circle at 18% 0, rgba(255,216,107,0.32), transparent 36%),
    linear-gradient(180deg, rgba(255,247,223,0.96), rgba(255,232,169,0.94));
  box-shadow:
    inset 0 -7px 0 rgba(124,82,47,0.15),
    0 10px 0 rgba(16,25,39,0.14),
    0 20px 24px rgba(16,25,39,0.22);
  backdrop-filter: blur(8px);
}

.score-card-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.score-card-title span {
  color: #1d2a3a;
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.score-card-title strong {
  color: #6b5124;
  font-size: 0.66rem;
  font-weight: 950;
  text-transform: uppercase;
}

.score-list {
  display: grid;
  gap: 0.28rem;
}

.score-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.36rem;
  min-height: 34px;
  padding: 0.26rem 0.34rem;
  border: 2px solid color-mix(in srgb, var(--team-color) 58%, white);
  border-radius: 10px;
  background: rgba(255,255,255,0.82);
  box-shadow: inset 0 -3px 0 rgba(16,25,39,0.08);
}

.score-row b {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: white;
  background: var(--team-color);
  font-size: 0.68rem;
}

.score-row span {
  overflow: hidden;
  color: #101927;
  font-size: 0.72rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-row strong {
  color: #101927;
  font-size: 0.86rem;
  font-weight: 950;
}

.score-row em {
  grid-column: 2 / -1;
  margin-top: -0.2rem;
  color: #2e6ea6;
  font-size: 0.58rem;
  font-style: normal;
  font-weight: 950;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.score-row.finished {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.88), rgba(232,246,238,0.9));
}

.map-wrap > .dice-panel {
  top: 194px;
  margin-top: 10px;
}

/* Final identity patch clock cleanup. */
.stage-header .clock {
  display: grid;
  align-content: center;
  min-height: 76px;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}

.stage-header .clock span {
  line-height: 1.1;
  margin-bottom: 0.14rem;
}

.stage-header .clock strong {
  line-height: 0.96;
}

/* True final PNG art pass. Keep this block at EOF so no older identity layer wins. */
.lobby-hero {
  min-height: clamp(250px, 22vw, 330px);
  background:
    linear-gradient(90deg, rgba(255, 246, 220, 0.1), rgba(255, 246, 220, 0.34) 38%, rgba(255, 246, 220, 0.12)),
    url("assets/png-art/late-to-work-hero-boardgame.png") center / cover no-repeat,
    #f3dfb6;
}

.lobby-hero::before {
  opacity: 0.18;
  mix-blend-mode: screen;
}

.lobby-hero .mascot-lobby,
.lobby-hero .flying-paper,
.lobby-hero .coffee-splash {
  display: none;
}

.lobby-logo,
.lobby-hero p,
.lobby-tagline {
  max-width: min(640px, 52vw);
}

.lobby-logo span {
  color: #17202a;
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 247, 223, 0.65), transparent 34%),
    linear-gradient(180deg, #f2c459, #d7953d);
  box-shadow:
    2px 2px 0 rgba(168, 67, 47, 0.55),
    -2px -1px 0 rgba(54, 126, 121, 0.32),
    inset 0 -4px 0 rgba(93, 65, 32, 0.18);
}

.lobby-logo h2 {
  color: #17202a;
  text-shadow:
    3px 3px 0 rgba(168, 67, 47, 0.32),
    -2px -1px 0 rgba(54, 126, 121, 0.32),
    0 8px 0 rgba(255, 247, 223, 0.52);
}

.lobby-tagline,
.lobby-hero p {
  color: #26384f;
  text-shadow:
    2px 2px 0 rgba(255, 247, 223, 0.78),
    -1px 0 0 rgba(213, 149, 61, 0.24);
}

.lobby-tagline {
  color: #8a352d;
}

/* True final board-game title-banner pass. Keep this block at EOF so no older identity layer wins. */
.lobby-hero {
  min-height: clamp(250px, 22vw, 330px);
  background:
    linear-gradient(90deg, rgba(255, 246, 220, 0.1), rgba(255, 246, 220, 0.34) 38%, rgba(255, 246, 220, 0.12)),
    url("assets/png-art/late-to-work-hero-boardgame.png") center / cover no-repeat,
    #f3dfb6;
}

.lobby-hero::before {
  opacity: 0.18;
  mix-blend-mode: screen;
}

.lobby-hero .mascot-lobby,
.lobby-hero .flying-paper,
.lobby-hero .coffee-splash {
  display: none;
}

.lobby-logo,
.lobby-hero p,
.lobby-tagline {
  max-width: min(640px, 52vw);
}

.lobby-logo span {
  color: #17202a;
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 247, 223, 0.65), transparent 34%),
    linear-gradient(180deg, #f2c459, #d7953d);
  box-shadow:
    2px 2px 0 rgba(168, 67, 47, 0.55),
    -2px -1px 0 rgba(54, 126, 121, 0.32),
    inset 0 -4px 0 rgba(93, 65, 32, 0.18);
}

.lobby-logo h2 {
  color: #17202a;
  text-shadow:
    3px 3px 0 rgba(168, 67, 47, 0.32),
    -2px -1px 0 rgba(54, 126, 121, 0.32),
    0 8px 0 rgba(255, 247, 223, 0.52);
}

.lobby-hero p {
  color: #26384f;
  text-shadow:
    2px 2px 0 rgba(255, 247, 223, 0.78),
    -1px 0 0 rgba(213, 149, 61, 0.24);
}

.lobby-tagline {
  color: #8a352d;
  text-shadow:
    2px 2px 0 rgba(255, 247, 223, 0.78),
    -1px 0 0 rgba(54, 126, 121, 0.2);
}

/* True final team choice PNG character models. */
.garage-card {
  grid-template-columns: 88px minmax(0, 1fr);
}

.garage-avatar {
  width: 78px;
  height: 92px;
  overflow: hidden;
  border-radius: 14px;
  background:
    radial-gradient(circle at 45% 18%, rgba(255, 247, 223, 0.72), transparent 34%),
    linear-gradient(180deg, rgba(255, 247, 223, 0.94), rgba(241, 219, 174, 0.76)),
    color-mix(in srgb, var(--team-color) 12%, #fff7df);
}

.garage-avatar .mascot-avatar {
  width: 100%;
  height: 100%;
  margin: 0;
  background-position: center top;
  background-size: auto 176px;
  filter:
    drop-shadow(0 9px 5px rgba(16, 25, 39, 0.22))
    saturate(0.96)
    contrast(1.02);
}

.garage-avatar .mascot-sleepy-sam-ready {
  background-image: url("assets/team-models/sleepy-sam.png");
}

.garage-avatar .mascot-caffeinated-casey-ready {
  background-image: url("assets/team-models/caffeinated-casey.png");
}

.garage-avatar .mascot-last-minute-lee-ready {
  background-image: url("assets/team-models/last-minute-lee.png");
}

.garage-avatar .mascot-new-hire-nora-ready {
  background-image: url("assets/team-models/new-hire-nora.png");
}

.garage-avatar .mascot-professional-pat-ready {
  background-image: url("assets/team-models/professional-pat.png");
}

/* EOF car readability override: colored outline ring, no blended aura. */
.team-piece,
.view-3d .team-piece {
  --car-glow-rgb: 224, 99, 79;
  width: 96px !important;
  height: 58px !important;
  margin: -29px 0 0 -48px !important;
  border: 0 !important;
  border-radius: 0 !important;
  overflow: visible !important;
  isolation: isolate;
  z-index: 24;
  background: transparent url("assets/board-png/car-team-1.png") center / contain no-repeat !important;
  box-shadow: none !important;
  filter: drop-shadow(0 12px 7px rgba(16, 25, 39, 0.38)) !important;
}

.team-piece.team-car-1,
.team-mini-car.team-car-1 {
  --car-glow-rgb: 224, 99, 79;
  background-image: url("assets/board-png/car-team-1.png") !important;
}

.team-piece.team-car-2,
.team-mini-car.team-car-2 {
  --car-glow-rgb: 46, 110, 166;
  background-image: url("assets/board-png/car-team-2.png") !important;
}

.team-piece.team-car-3,
.team-mini-car.team-car-3 {
  --car-glow-rgb: 80, 166, 117;
  background-image: url("assets/board-png/car-team-3.png") !important;
}

.team-piece.team-car-4,
.team-mini-car.team-car-4 {
  --car-glow-rgb: 132, 85, 181;
  background-image: url("assets/board-png/car-team-4.png") !important;
}

.team-piece.team-car-5,
.team-mini-car.team-car-5 {
  --car-glow-rgb: 216, 149, 61;
  background-image: url("assets/board-png/car-team-5.png") !important;
}

.team-piece::before,
.view-3d .team-piece::before {
  content: "";
  position: absolute;
  inset: 4px 6px 5px;
  z-index: 1;
  display: block !important;
  border: 4px solid rgb(var(--car-glow-rgb)) !important;
  border-radius: 19px 22px 15px 15px;
  background: transparent !important;
  box-shadow:
    0 0 0 2px rgba(255, 247, 223, 0.92),
    0 0 0 4px rgba(var(--car-glow-rgb), 0.34),
    0 0 8px rgba(var(--car-glow-rgb), 0.72) !important;
  filter: none !important;
  opacity: 1 !important;
  pointer-events: none;
}

.team-piece.current::before,
.view-3d .team-piece.current::before {
  border-width: 5px !important;
  box-shadow:
    0 0 0 2px rgba(255, 247, 223, 0.96),
    0 0 0 5px rgba(var(--car-glow-rgb), 0.48),
    0 0 10px rgba(var(--car-glow-rgb), 0.86),
    0 0 0 8px rgba(255, 216, 107, 0.2) !important;
}

.team-piece::after,
.view-3d .team-piece::after {
  content: "";
  position: absolute;
  left: -28px;
  top: 50%;
  z-index: 0;
  display: block !important;
  width: 28px;
  height: 7px;
  border: 0 !important;
  border-radius: 999px;
  background: rgb(var(--car-glow-rgb)) !important;
  box-shadow: 0 0 0 2px rgba(255, 247, 223, 0.72) !important;
  opacity: 0;
  transform: translateY(-50%);
  pointer-events: none;
}

.team-piece.driving,
.view-3d .team-piece.driving {
  filter: drop-shadow(0 14px 8px rgba(16, 25, 39, 0.4)) !important;
}

.team-piece.driving::after {
  opacity: 0.92;
}

.team-piece.driving span::after {
  display: none !important;
}

.team-piece span {
  position: absolute;
  left: 50%;
  top: 48%;
  z-index: 2;
  transform: translate(-50%, -50%) scaleX(-1) !important;
}

.team-mini-car {
  --car-glow-rgb: 224, 99, 79;
  filter: drop-shadow(0 8px 5px rgba(16, 25, 39, 0.28)) !important;
}

.space.occupied-space,
.view-3d .space.occupied-space {
  animation: none !important;
  box-shadow:
    inset 0 -10px 0 rgba(124, 82, 47, 0.18),
    inset 0 0 0 3px rgba(16, 25, 39, 0.18),
    0 0 0 4px rgba(255, 247, 223, 0.95),
    0 0 0 7px rgba(16, 25, 39, 0.22),
    0 12px 0 #8b6746,
    0 22px 22px rgba(16, 25, 39, 0.34) !important;
}

/* True final car readability pass: crisp team borders, not hazy aura. */
.team-piece,
.view-3d .team-piece {
  --car-glow-rgb: 224, 99, 79;
  width: 96px !important;
  height: 58px !important;
  margin: -29px 0 0 -48px !important;
  border: 0 !important;
  border-radius: 0 !important;
  overflow: visible !important;
  isolation: isolate;
  z-index: 24;
  background: transparent url("assets/board-png/car-team-1.png") center / contain no-repeat !important;
  box-shadow: none !important;
  filter:
    drop-shadow(0 12px 7px rgba(16, 25, 39, 0.38)) !important;
}

.team-piece.team-car-1,
.team-mini-car.team-car-1 {
  --car-glow-rgb: 224, 99, 79;
  background-image: url("assets/board-png/car-team-1.png") !important;
}

.team-piece.team-car-2,
.team-mini-car.team-car-2 {
  --car-glow-rgb: 46, 110, 166;
  background-image: url("assets/board-png/car-team-2.png") !important;
}

.team-piece.team-car-3,
.team-mini-car.team-car-3 {
  --car-glow-rgb: 80, 166, 117;
  background-image: url("assets/board-png/car-team-3.png") !important;
}

.team-piece.team-car-4,
.team-mini-car.team-car-4 {
  --car-glow-rgb: 132, 85, 181;
  background-image: url("assets/board-png/car-team-4.png") !important;
}

.team-piece.team-car-5,
.team-mini-car.team-car-5 {
  --car-glow-rgb: 216, 149, 61;
  background-image: url("assets/board-png/car-team-5.png") !important;
}

.team-piece::before,
.view-3d .team-piece::before {
  content: "";
  position: absolute;
  inset: 4px 6px 5px;
  z-index: 1;
  display: block !important;
  border: 4px solid rgb(var(--car-glow-rgb)) !important;
  border-radius: 19px 22px 15px 15px;
  background: transparent !important;
  box-shadow:
    0 0 0 2px rgba(255, 247, 223, 0.92),
    0 0 0 4px rgba(var(--car-glow-rgb), 0.34),
    0 0 8px rgba(var(--car-glow-rgb), 0.72) !important;
  filter: none !important;
  opacity: 1 !important;
  pointer-events: none;
}

.team-piece.current::before,
.view-3d .team-piece.current::before {
  border-width: 5px !important;
  box-shadow:
    0 0 0 2px rgba(255, 247, 223, 0.96),
    0 0 0 5px rgba(var(--car-glow-rgb), 0.48),
    0 0 10px rgba(var(--car-glow-rgb), 0.86),
    0 0 0 8px rgba(255, 216, 107, 0.2) !important;
}

.team-piece::after,
.view-3d .team-piece::after {
  content: "";
  position: absolute;
  left: -28px;
  top: 50%;
  z-index: 0;
  display: block !important;
  width: 28px;
  height: 7px;
  border: 0 !important;
  border-radius: 999px;
  background: rgb(var(--car-glow-rgb)) !important;
  box-shadow: 0 0 0 2px rgba(255, 247, 223, 0.72) !important;
  opacity: 0;
  transform: translateY(-50%);
  pointer-events: none;
}

.team-piece.driving,
.view-3d .team-piece.driving {
  filter:
    drop-shadow(0 14px 8px rgba(16, 25, 39, 0.4)) !important;
}

.team-piece.driving::after {
  opacity: 0.92;
}

.team-piece.driving span::after {
  display: none !important;
}

.team-piece span {
  position: absolute;
  left: 50%;
  top: 48%;
  z-index: 2;
  transform: translate(-50%, -50%) scaleX(-1) !important;
}

.team-mini-car {
  --car-glow-rgb: 224, 99, 79;
  filter:
    drop-shadow(0 0 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 8px 5px rgba(16, 25, 39, 0.28)) !important;
}

.space.occupied-space,
.view-3d .space.occupied-space {
  animation: none !important;
  box-shadow:
    inset 0 -10px 0 rgba(124, 82, 47, 0.18),
    inset 0 0 0 3px rgba(16, 25, 39, 0.18),
    0 0 0 4px rgba(255, 247, 223, 0.95),
    0 0 0 7px rgba(16, 25, 39, 0.22),
    0 12px 0 #8b6746,
    0 22px 22px rgba(16, 25, 39, 0.34) !important;
}

/* Definitive PNG car glow pass. Keep at EOF so older car-body CSS cannot win. */
.team-piece,
.view-3d .team-piece {
  --car-glow-rgb: 224, 99, 79;
  width: 96px !important;
  height: 58px !important;
  margin: -29px 0 0 -48px !important;
  border: 0 !important;
  border-radius: 0 !important;
  overflow: visible !important;
  isolation: isolate;
  z-index: 24;
  background: transparent url("assets/board-png/car-team-1.png") center / contain no-repeat !important;
  box-shadow: none !important;
  filter:
    drop-shadow(0 0 5px rgba(var(--car-glow-rgb), 1))
    drop-shadow(0 0 13px rgba(var(--car-glow-rgb), 0.95))
    drop-shadow(0 0 26px rgba(var(--car-glow-rgb), 0.72))
    drop-shadow(0 12px 7px rgba(16, 25, 39, 0.38)) !important;
}

.team-piece.team-car-1,
.team-mini-car.team-car-1 {
  --car-glow-rgb: 224, 99, 79;
  background-image: url("assets/board-png/car-team-1.png") !important;
}

.team-piece.team-car-2,
.team-mini-car.team-car-2 {
  --car-glow-rgb: 46, 110, 166;
  background-image: url("assets/board-png/car-team-2.png") !important;
}

.team-piece.team-car-3,
.team-mini-car.team-car-3 {
  --car-glow-rgb: 80, 166, 117;
  background-image: url("assets/board-png/car-team-3.png") !important;
}

.team-piece.team-car-4,
.team-mini-car.team-car-4 {
  --car-glow-rgb: 132, 85, 181;
  background-image: url("assets/board-png/car-team-4.png") !important;
}

.team-piece.team-car-5,
.team-mini-car.team-car-5 {
  --car-glow-rgb: 216, 149, 61;
  background-image: url("assets/board-png/car-team-5.png") !important;
}

.team-piece::before,
.view-3d .team-piece::before {
  content: "";
  position: absolute;
  inset: -15px -22px -14px;
  z-index: -1;
  display: block !important;
  border: 0 !important;
  border-radius: 999px;
  background:
    radial-gradient(ellipse at 50% 55%,
      rgba(var(--car-glow-rgb), 0.98) 0%,
      rgba(var(--car-glow-rgb), 0.66) 34%,
      rgba(var(--car-glow-rgb), 0.28) 58%,
      transparent 78%);
  box-shadow: none !important;
  filter: blur(4px);
  opacity: 1;
  pointer-events: none;
}

.team-piece::after,
.view-3d .team-piece::after {
  content: "";
  position: absolute;
  left: -38px;
  top: 50%;
  z-index: -1;
  display: block !important;
  width: 44px;
  height: 11px;
  border: 0 !important;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(var(--car-glow-rgb), 0.84));
  box-shadow: 0 0 18px rgba(var(--car-glow-rgb), 0.62) !important;
  opacity: 0;
  transform: translateY(-50%);
  pointer-events: none;
}

.team-piece.current,
.view-3d .team-piece.current {
  filter:
    drop-shadow(0 0 10px rgba(var(--car-glow-rgb), 1))
    drop-shadow(0 0 20px rgba(var(--car-glow-rgb), 0.95))
    drop-shadow(0 0 36px rgba(var(--car-glow-rgb), 0.72))
    drop-shadow(0 0 16px rgba(255, 216, 107, 0.7))
    drop-shadow(0 14px 8px rgba(16, 25, 39, 0.38)) !important;
}

.team-piece.current::before {
  opacity: 1;
  transform: scale(1.14);
}

.team-piece.driving,
.view-3d .team-piece.driving {
  filter:
    drop-shadow(0 0 12px rgba(var(--car-glow-rgb), 1))
    drop-shadow(0 0 24px rgba(var(--car-glow-rgb), 0.98))
    drop-shadow(0 0 44px rgba(var(--car-glow-rgb), 0.82))
    drop-shadow(0 14px 8px rgba(16, 25, 39, 0.4)) !important;
}

.team-piece.driving::after,
.team-piece.driving span::after {
  opacity: 1;
  background: linear-gradient(90deg, transparent, rgba(var(--car-glow-rgb), 0.94)) !important;
}

.team-piece span {
  position: absolute;
  left: 50%;
  top: 48%;
  z-index: 2;
  transform: translate(-50%, -50%) scaleX(-1) !important;
  background: rgba(255, 247, 223, 0.94);
  color: #101927;
}

.team-mini-car {
  --car-glow-rgb: 224, 99, 79;
  filter:
    drop-shadow(0 0 8px rgba(var(--car-glow-rgb), 0.82))
    drop-shadow(0 8px 5px rgba(16, 25, 39, 0.28)) !important;
}

.space.occupied-space,
.view-3d .space.occupied-space {
  animation: none !important;
  box-shadow:
    inset 0 -10px 0 rgba(124, 82, 47, 0.18),
    inset 0 0 0 3px rgba(16, 25, 39, 0.18),
    0 0 0 4px rgba(255, 247, 223, 0.95),
    0 0 0 7px rgba(16, 25, 39, 0.22),
    0 12px 0 #8b6746,
    0 22px 22px rgba(16, 25, 39, 0.34) !important;
}

/* Board PNG pass: hand-inked square faces and team car sprites. */
.space,
.view-3d .space {
  border: 0;
  background: url("assets/board-png/tile-normal.png") center / 100% 100% no-repeat !important;
  box-shadow:
    0 0 0 4px rgba(255, 247, 223, 0.52),
    0 0 0 7px rgba(31, 42, 54, 0.18),
    0 18px 22px rgba(16, 25, 39, 0.28);
}

.space::before {
  display: none;
}

.district-neighborhood,
.view-3d .district-neighborhood {
  background-image: url("assets/board-png/tile-neighborhood.png") !important;
}

.district-coffee-row,
.view-3d .district-coffee-row {
  background-image: url("assets/board-png/tile-coffee-row.png") !important;
}

.district-downtown,
.view-3d .district-downtown {
  background-image: url("assets/board-png/tile-downtown.png") !important;
}

.district-office-district,
.district-office,
.view-3d .district-office-district,
.view-3d .district-office {
  background-image: url("assets/board-png/tile-office.png") !important;
}

.space.home,
.view-3d .space.home {
  background-image: url("assets/board-png/tile-home.png") !important;
}

.space.work,
.view-3d .space.work {
  background-image: url("assets/board-png/tile-work.png") !important;
}

.space.choice,
.view-3d .space.choice {
  background-image: url("assets/board-png/tile-choice.png") !important;
}

.space.occupied-space,
.view-3d .space.occupied-space {
  box-shadow:
    0 0 0 4px rgba(255, 247, 223, 0.78),
    0 0 0 7px rgba(31, 42, 54, 0.2),
    0 0 28px color-mix(in srgb, var(--occupant-1, #ffd86b) 82%, transparent),
    0 0 52px color-mix(in srgb, var(--occupant-2, var(--occupant-1, #ffd86b)) 62%, transparent),
    0 22px 24px rgba(16, 25, 39, 0.34);
}

.tile-art {
  width: 42px;
  height: 36px;
  filter:
    drop-shadow(0 2px 0 rgba(255, 247, 223, 0.65))
    drop-shadow(0 4px 3px rgba(16, 25, 39, 0.24))
    saturate(0.86)
    contrast(0.96);
  opacity: 0.9;
}

.team-piece,
.view-3d .team-piece {
  width: 68px;
  height: 40px;
  margin: -20px 0 0 -34px;
  border: 0;
  border-radius: 0;
  background: url("assets/board-png/car-team-1.png") center / contain no-repeat !important;
  box-shadow: none;
  filter: drop-shadow(0 8px 5px rgba(16, 25, 39, 0.34));
}

.team-piece::before,
.team-piece::after {
  display: none;
}

.team-piece.team-car-1 {
  background-image: url("assets/board-png/car-team-1.png") !important;
}

.team-piece.team-car-2 {
  background-image: url("assets/board-png/car-team-2.png") !important;
}

.team-piece.team-car-3 {
  background-image: url("assets/board-png/car-team-3.png") !important;
}

.team-piece.team-car-4 {
  background-image: url("assets/board-png/car-team-4.png") !important;
}

.team-piece.team-car-5 {
  background-image: url("assets/board-png/car-team-5.png") !important;
}

.team-piece.current {
  filter:
    drop-shadow(0 0 10px rgba(255, 216, 107, 0.8))
    drop-shadow(0 10px 6px rgba(16, 25, 39, 0.32));
}

.team-piece.driving {
  filter:
    drop-shadow(0 0 12px rgba(255, 216, 107, 0.95))
    drop-shadow(0 0 18px rgba(22, 167, 90, 0.55))
    drop-shadow(0 10px 6px rgba(16, 25, 39, 0.34));
}

.team-piece span {
  right: 5px;
  top: 2px;
  width: 20px;
  height: 20px;
  border: 2px solid #fff7df;
  background: #1f2a36;
  box-shadow: 0 2px 0 rgba(16, 25, 39, 0.28);
}

.team-mini-car {
  width: 68px;
  height: 40px;
  border: 0;
  border-radius: 0;
  background: url("assets/board-png/car-team-1.png") center / contain no-repeat !important;
  box-shadow: none;
  filter: drop-shadow(0 8px 5px rgba(16, 25, 39, 0.28));
}

.team-mini-car::before,
.team-mini-car::after {
  display: none;
}

.team-mini-car.team-car-1 {
  background-image: url("assets/board-png/car-team-1.png") !important;
}

.team-mini-car.team-car-2 {
  background-image: url("assets/board-png/car-team-2.png") !important;
}

.team-mini-car.team-car-3 {
  background-image: url("assets/board-png/car-team-3.png") !important;
}

.team-mini-car.team-car-4 {
  background-image: url("assets/board-png/car-team-4.png") !important;
}

.team-mini-car.team-car-5 {
  background-image: url("assets/board-png/car-team-5.png") !important;
}

/* Final readability pass: bigger cars, team-colored motion, PNG character models everywhere. */
.team-piece,
.view-3d .team-piece {
  width: 92px;
  height: 56px;
  margin: -28px 0 0 -46px;
  filter:
    drop-shadow(0 0 5px color-mix(in srgb, var(--team-color) 72%, transparent))
    drop-shadow(0 10px 7px rgba(16, 25, 39, 0.38));
}

.team-piece.current {
  filter:
    drop-shadow(0 0 10px color-mix(in srgb, var(--team-color) 90%, transparent))
    drop-shadow(0 0 18px rgba(255, 216, 107, 0.72))
    drop-shadow(0 12px 8px rgba(16, 25, 39, 0.36));
}

.team-piece.driving {
  filter:
    drop-shadow(0 0 14px color-mix(in srgb, var(--team-color) 96%, transparent))
    drop-shadow(0 0 24px color-mix(in srgb, var(--team-color) 68%, transparent))
    drop-shadow(0 12px 8px rgba(16, 25, 39, 0.38));
}

.team-piece.driving::after {
  display: block;
  content: "";
  position: absolute;
  left: -34px;
  top: 50%;
  width: 42px;
  height: 10px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, transparent, color-mix(in srgb, var(--team-color) 92%, #fff7df));
  transform: translateY(-50%);
  opacity: 0.9;
  filter: blur(0.2px);
}

.team-mini-car {
  width: 82px;
  height: 50px;
  filter:
    drop-shadow(0 0 6px color-mix(in srgb, var(--team-color) 72%, transparent))
    drop-shadow(0 8px 5px rgba(16, 25, 39, 0.28));
}

.team-model-sleepy-sam,
.team-model-caffeinated-casey,
.team-model-last-minute-lee,
.team-model-new-hire-nora,
.team-model-professional-pat {
  background-position: center top;
  background-repeat: no-repeat;
  background-size: contain;
}

.team-model-sleepy-sam {
  background-image: url("assets/team-models/sleepy-sam.png") !important;
}

.team-model-caffeinated-casey {
  background-image: url("assets/team-models/caffeinated-casey.png") !important;
}

.team-model-last-minute-lee {
  background-image: url("assets/team-models/last-minute-lee.png") !important;
}

.team-model-new-hire-nora {
  background-image: url("assets/team-models/new-hire-nora.png") !important;
}

.team-model-professional-pat {
  background-image: url("assets/team-models/professional-pat.png") !important;
}

.mascot-header,
.mascot-stage,
.mascot-panel,
.mascot-response,
.mascot-card,
.mascot-how,
.mascot-endgame {
  filter:
    drop-shadow(0 8px 6px rgba(16, 25, 39, 0.22))
    saturate(0.96)
    contrast(1.02);
}

.mascot-header,
.mascot-stage,
.mascot-panel,
.mascot-response,
.mascot-card,
.mascot-how {
  background-size: auto 148%;
}

.mascot-endgame {
  background-size: contain;
}

/* Final in-game PNG mascot framing: crop to readable portraits outside setup garage. */
.topbar-mascot .mascot-header,
.header-reaction .mascot-stage,
.challenge-mascot .mascot-panel,
.team-answer-card .mascot-response,
.assigned-card .mascot-card,
.how-steps .mascot-how {
  background-position: center 5%;
  background-size: auto 190%;
}

.topbar-mascot .mascot-header,
.header-reaction .mascot-stage {
  transform-origin: center;
}

.endgame-mascot-wrap .mascot-endgame {
  background-position: center top;
  background-size: auto 118%;
}

/* Team choice PNG character models: board-game illustration style. */
.garage-card {
  grid-template-columns: 88px minmax(0, 1fr);
}

.garage-avatar {
  width: 78px;
  height: 92px;
  overflow: hidden;
  border-radius: 14px;
  background:
    radial-gradient(circle at 45% 18%, rgba(255, 247, 223, 0.72), transparent 34%),
    linear-gradient(180deg, rgba(255, 247, 223, 0.94), rgba(241, 219, 174, 0.76)),
    color-mix(in srgb, var(--team-color) 12%, #fff7df);
}

.garage-avatar .mascot-avatar {
  width: 100%;
  height: 100%;
  margin: 0;
  background-position: center top;
  background-size: auto 176px;
  filter:
    drop-shadow(0 9px 5px rgba(16, 25, 39, 0.22))
    saturate(0.96)
    contrast(1.02);
}

.garage-avatar .mascot-sleepy-sam-ready {
  background-image: url("assets/team-models/sleepy-sam.png");
}

.garage-avatar .mascot-caffeinated-casey-ready {
  background-image: url("assets/team-models/caffeinated-casey.png");
}

.garage-avatar .mascot-last-minute-lee-ready {
  background-image: url("assets/team-models/last-minute-lee.png");
}

.garage-avatar .mascot-new-hire-nora-ready {
  background-image: url("assets/team-models/new-hire-nora.png");
}

.garage-avatar .mascot-professional-pat-ready {
  background-image: url("assets/team-models/professional-pat.png");
}

/* Upscale artwork pass: keep the same references, but present them like board-game key art. */
.mascot {
  filter:
    drop-shadow(0 12px 10px rgba(16, 25, 39, 0.2))
    saturate(0.94)
    contrast(1.05);
}

.lobby-hero {
  isolation: isolate;
  min-height: 245px;
  border-width: 3px;
  border-color: rgba(255, 247, 223, 0.78);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 216, 107, 0.22), transparent 30%),
    linear-gradient(90deg, rgba(16, 25, 39, 0.96), rgba(29, 65, 75, 0.94)),
    #17202a;
  box-shadow:
    inset 0 0 0 1px rgba(255, 247, 223, 0.22),
    inset 0 -24px 48px rgba(0, 0, 0, 0.16),
    0 18px 34px rgba(16, 25, 39, 0.22);
}

.lobby-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 247, 223, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 247, 223, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 50% 46%, rgba(255, 247, 223, 0.08), transparent 32%);
  background-size: 44px 44px, 44px 44px, auto;
  opacity: 0.56;
}

.lobby-logo,
.lobby-hero p,
.lobby-tagline {
  z-index: 3;
}

.lobby-logo span {
  min-width: 68px;
  min-height: 50px;
  border: 2px solid rgba(255, 247, 223, 0.72);
  border-radius: 12px;
  background:
    radial-gradient(circle at 30% 18%, rgba(255, 255, 255, 0.78), transparent 34%),
    linear-gradient(180deg, #fff0a6, #f0a83f);
  box-shadow:
    inset 0 -5px 0 rgba(92, 64, 31, 0.18),
    0 8px 14px rgba(0, 0, 0, 0.18);
}

.lobby-logo h2 {
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.36),
    0 10px 18px rgba(0, 0, 0, 0.24);
}

.lobby-tagline,
.lobby-hero p {
  color: #ffe28d;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.34);
}

.mascot-lobby {
  z-index: 1;
  width: clamp(132px, 17vw, 198px);
  height: clamp(132px, 17vw, 198px);
  opacity: 0.88;
  filter:
    drop-shadow(0 18px 14px rgba(0, 0, 0, 0.32))
    saturate(0.92)
    contrast(1.04);
}

.mascot-lobby-left {
  left: clamp(6px, 5vw, 82px);
  bottom: 2px;
}

.mascot-lobby-right {
  right: clamp(8px, 5vw, 72px);
  bottom: 0;
}

.flying-paper,
.coffee-splash {
  opacity: 0.48;
  filter: saturate(0.82);
}

.garage-avatar {
  border-radius: 14px;
  background:
    radial-gradient(circle at 36% 18%, rgba(255, 255, 255, 0.72), transparent 28%),
    linear-gradient(180deg, rgba(255, 247, 223, 0.9), rgba(255, 247, 223, 0.66)),
    color-mix(in srgb, var(--team-color) 14%, #fff7df);
  box-shadow:
    inset 0 -5px 0 rgba(16, 25, 39, 0.1),
    0 8px 14px rgba(16, 25, 39, 0.14);
}

.mascot-avatar {
  filter:
    drop-shadow(0 8px 7px rgba(16, 25, 39, 0.18))
    saturate(0.94)
    contrast(1.04);
}

.topbar-mascot,
.header-reaction,
.challenge-mascot {
  border-style: solid;
  box-shadow:
    inset 0 -4px 0 rgba(16, 25, 39, 0.12),
    0 8px 16px rgba(16, 25, 39, 0.14);
}

/* PNG art pass: polished raster hero art replaces the rough vector scene. */
.lobby-hero {
  min-height: clamp(250px, 22vw, 330px);
  background:
    linear-gradient(90deg, rgba(16, 25, 39, 0.18), rgba(16, 25, 39, 0.04) 44%, rgba(16, 25, 39, 0.12)),
    url("assets/png-art/late-to-work-hero-upscale.png") center / cover no-repeat,
    #17202a;
}

.lobby-hero::before {
  opacity: 0.18;
  mix-blend-mode: screen;
}

.lobby-hero .mascot-lobby,
.lobby-hero .flying-paper,
.lobby-hero .coffee-splash {
  display: none;
}

.lobby-logo,
.lobby-hero p,
.lobby-tagline {
  max-width: min(640px, 52vw);
}

/* Late to Work identity patch: exhausted commuters, morning chaos, game-lobby energy. */
:root {
  --late-cream: #fff4d0;
  --late-ink: #17202a;
  --late-navy: #1d2b3a;
  --late-gold: #ffd764;
  --late-orange: #ef7448;
  --late-red: #dc4f43;
  --late-green: #49aa68;
}

.topbar {
  grid-template-columns: auto minmax(180px, 360px) auto;
  gap: clamp(0.75rem, 2vw, 1.35rem);
  align-items: center;
}

.topbar-mascot {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  padding: 0.3rem 0.7rem 0.3rem 0.25rem;
  border: 2px solid rgba(255, 247, 223, 0.28);
  border-radius: 999px;
  color: var(--late-cream);
  background: rgba(255, 247, 223, 0.08);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.14);
}

.topbar-mascot span {
  overflow: hidden;
  color: #ffdf88;
  font-size: 0.78rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mascot {
  display: block;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
}

.mascot-header {
  width: 66px;
  height: 66px;
  filter: drop-shadow(0 8px 6px rgba(0, 0, 0, 0.24));
  animation: mascotBob 1800ms ease-in-out infinite;
}

.lobby-hero {
  position: relative;
  min-height: 255px;
  padding: 1.65rem clamp(1rem, 4vw, 3rem);
  overflow: hidden;
  border-color: rgba(255, 247, 223, 0.92);
  background:
    radial-gradient(circle at 24% 12%, rgba(255, 215, 100, 0.28), transparent 24%),
    radial-gradient(circle at 84% 18%, rgba(73, 170, 104, 0.24), transparent 26%),
    linear-gradient(90deg, rgba(23, 32, 42, 0.94), rgba(33, 72, 91, 0.92)),
    linear-gradient(135deg, #17202a, #24485b);
}

.lobby-chaos {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.mascot-lobby {
  position: absolute;
  z-index: 1;
  width: clamp(145px, 20vw, 235px);
  height: clamp(145px, 20vw, 235px);
  filter: drop-shadow(0 16px 12px rgba(0, 0, 0, 0.26));
}

.mascot-lobby-left {
  left: clamp(-14px, 3vw, 54px);
  bottom: -18px;
  animation: mascotRun 1050ms ease-in-out infinite;
}

.mascot-lobby-right {
  right: clamp(-18px, 3vw, 42px);
  bottom: -20px;
  transform: scaleX(-1);
  animation: mascotOops 1500ms ease-in-out infinite;
}

.lobby-logo,
.lobby-hero p,
.lobby-tagline {
  position: relative;
  z-index: 2;
  max-width: 720px;
  margin-inline: auto;
  text-align: center;
}

.lobby-logo {
  justify-content: center;
}

.lobby-logo h2 {
  letter-spacing: 0;
  text-transform: none;
}

.lobby-tagline {
  display: block;
  color: #fff0a6;
  font-size: clamp(1rem, 2vw, 1.35rem);
  font-weight: 1000;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.22);
}

.flying-paper,
.coffee-splash {
  position: absolute;
  z-index: 0;
  display: block;
  opacity: 0.82;
}

.flying-paper {
  width: 42px;
  height: 32px;
  border: 3px solid #fff7df;
  border-radius: 5px;
  background:
    linear-gradient(#2f7fbf 0 0) 10px 10px / 21px 3px no-repeat,
    linear-gradient(#49aa68 0 0) 10px 18px / 16px 3px no-repeat,
    rgba(255, 247, 223, 0.92);
  box-shadow: 0 9px 8px rgba(0, 0, 0, 0.18);
}

.paper-one {
  left: 31%;
  top: 24px;
  transform: rotate(-14deg);
  animation: paperFloat 3000ms ease-in-out infinite;
}

.paper-two {
  right: 26%;
  top: 70px;
  transform: rotate(16deg);
  animation: paperFloat 2600ms ease-in-out infinite reverse;
}

.coffee-splash {
  right: 16%;
  bottom: 52px;
  width: 70px;
  height: 42px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 12% 45%, #8b5d3b 0 6px, transparent 7px),
    radial-gradient(circle at 42% 58%, #8b5d3b 0 12px, transparent 13px),
    radial-gradient(circle at 76% 36%, #8b5d3b 0 8px, transparent 9px);
}

.garage-card {
  grid-template-columns: 72px minmax(0, 1fr);
  overflow: hidden;
}

.garage-avatar {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 3px solid #fff7df;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.85), transparent 24%),
    color-mix(in srgb, var(--team-color) 20%, #fff7df);
  box-shadow: inset 0 -6px 0 rgba(23, 32, 42, 0.12), 0 8px 10px rgba(23, 32, 42, 0.15);
}

.mascot-avatar {
  width: 76px;
  height: 76px;
}

.garage-card select {
  grid-column: 1 / -1;
  min-height: 34px;
  margin-top: 0.32rem;
  border: 2px solid rgba(23, 32, 42, 0.16);
  border-radius: 10px;
  color: var(--late-ink);
  background: rgba(255, 247, 223, 0.86);
  font-weight: 850;
}

.stage-header {
  grid-template-columns: auto auto minmax(190px, 1fr) auto;
  min-height: 78px;
  overflow: visible;
}

.header-reaction {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  padding: 0.18rem 0.6rem 0.18rem 0.12rem;
  border: 3px solid color-mix(in srgb, var(--team-color) 36%, #fff7df);
  border-radius: 999px;
  background:
    radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.82), transparent 28%),
    linear-gradient(180deg, rgba(255, 247, 223, 0.95), rgba(255, 229, 158, 0.9));
  box-shadow: inset 0 -5px 0 rgba(23, 32, 42, 0.12), 0 8px 12px rgba(23, 32, 42, 0.12);
}

.mascot-stage {
  width: 60px;
  height: 60px;
  margin: 0;
  animation: mascotBob 1650ms ease-in-out infinite;
}

.header-reaction span {
  overflow: hidden;
  color: #5e4521;
  font-size: 0.76rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.challenge-mascot {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
  margin: 0.2rem 0 0.7rem;
  padding: 0.4rem 0.55rem;
  border: 2px dashed rgba(255, 215, 100, 0.58);
  border-radius: 16px;
  color: #fff4d0;
  background: rgba(255, 215, 100, 0.1);
}

.mascot-panel {
  width: 82px;
  height: 82px;
  margin: -10px 0;
}

.challenge-mascot span {
  color: #ffdf88;
  font-size: 0.8rem;
  font-weight: 900;
}

.team-answer-card {
  grid-template-columns: 26px 48px minmax(0, 1fr) !important;
}

.mascot-response {
  width: 52px;
  height: 52px;
  grid-row: span 2;
  margin: -4px 0;
}

.team-answer-card .answer-picks {
  grid-column: 1 / -1;
}

.assigned-card {
  position: relative;
}

.mascot-card {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 64px;
  height: 64px;
  opacity: 0.9;
}

.assigned-card-face {
  padding-right: 64px;
}

.how-card {
  width: min(920px, calc(100vw - 2rem));
}

.how-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 1rem;
}

.how-steps > div {
  display: grid;
  justify-items: center;
  gap: 0.28rem;
  padding: 0.65rem;
  border: 2px solid rgba(23, 32, 42, 0.12);
  border-radius: 16px;
  background: rgba(255, 247, 223, 0.75);
  text-align: center;
  box-shadow: inset 0 -5px 0 rgba(23, 32, 42, 0.08);
}

.mascot-how {
  width: 92px;
  height: 92px;
}

.how-steps strong {
  color: var(--late-ink);
  font-size: 0.82rem;
  font-weight: 1000;
}

.how-steps span {
  color: #596575;
  font-size: 0.72rem;
  font-weight: 800;
}

.endgame-card {
  overflow: hidden;
}

.endgame-mascot-wrap {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 0.1rem;
  margin: -0.45rem auto 0.5rem;
  text-align: center;
}

.mascot-endgame {
  width: 150px;
  height: 150px;
  margin-bottom: -0.4rem;
  animation: mascotCelebrate 1100ms ease-in-out 2;
}

.endgame-mascot-wrap strong {
  color: var(--late-ink);
  font-size: clamp(1.45rem, 4vw, 2.5rem);
  font-weight: 1000;
  line-height: 1;
}

.endgame-mascot-wrap span {
  color: #6a4b20;
  font-weight: 950;
}

.clock {
  transition: border-color 220ms ease, box-shadow 220ms ease, background 220ms ease;
}

.urgency-alert .clock {
  border-color: #ffdf88;
  box-shadow: 0 0 0 4px rgba(255, 215, 100, 0.16), 0 12px 18px rgba(23, 32, 42, 0.2);
}

.urgency-nervous .clock {
  border-color: #f2a849;
  animation: clockPulse 1400ms ease-in-out infinite;
}

.urgency-panic .clock {
  border-color: #e85f4a;
  background: linear-gradient(180deg, #402536, #17202a);
  animation: clockPulse 850ms ease-in-out infinite;
}

.urgency-late .clock {
  border-color: #dc4f43;
  background: linear-gradient(180deg, #5d1f2a, #17202a);
  box-shadow: 0 0 0 6px rgba(220, 79, 67, 0.2), 0 16px 24px rgba(23, 32, 42, 0.24);
}

.urgency-panic .mascot-stage,
.urgency-panic .mascot-header {
  animation: mascotRun 700ms ease-in-out infinite;
}

.urgency-late .mascot-stage,
.urgency-late .mascot-header {
  animation: mascotOops 900ms ease-in-out infinite;
}

.game-layout .stage {
  overflow: visible;
}

.game-layout .stage-header .clock {
  align-self: center;
  margin-block: 0;
}

.btn-primary,
.start-commute,
.roll-next-note .btn-primary {
  border-radius: 14px 18px 12px 18px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}

.review-panel {
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 215, 100, 0.12), transparent 24%),
    linear-gradient(180deg, #26384f, #17202a);
}

.review-panel h2 {
  color: #fff4d0;
}

@keyframes mascotBob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-5px) rotate(1deg); }
}

@keyframes mascotRun {
  0%, 100% { transform: translateX(0) rotate(-3deg); }
  50% { transform: translateX(5px) translateY(-4px) rotate(2deg); }
}

@keyframes mascotOops {
  0%, 100% { transform: rotate(-2deg); }
  45% { transform: rotate(5deg) translateY(-3px); }
}

@keyframes mascotCelebrate {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  45% { transform: translateY(-10px) rotate(-4deg); }
}

@keyframes paperFloat {
  0%, 100% { transform: translateY(0) rotate(-12deg); }
  50% { transform: translateY(12px) rotate(18deg); }
}

@keyframes clockPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.035); }
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .topbar-mascot {
    display: none;
  }

  .stage-header {
    grid-template-columns: 1fr;
  }

  .header-reaction {
    display: none;
  }

  .how-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mascot-lobby {
    opacity: 0.65;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mascot,
  .flying-paper,
  .clock {
    animation: none !important;
  }
}

/* Illustrated commute assets: tiny scenes support the route without overpowering it. */
.space.tile-illustrated,
.view-3d .space.tile-illustrated {
  background:
    radial-gradient(circle at 22% 14%, rgba(255, 255, 255, 0.86), transparent 18%),
    linear-gradient(180deg, var(--district-tile-top, #ffe1a2), var(--district-tile-bottom, #eab763));
}

.district-neighborhood {
  --district-tile-top: #ffe6a8;
  --district-tile-bottom: #e9bd67;
}

.district-coffee-row {
  --district-tile-top: #ffd99b;
  --district-tile-bottom: #c98f55;
}

.district-downtown {
  --district-tile-top: #b9e0ee;
  --district-tile-bottom: #78abc5;
}

.district-office-district,
.district-office {
  --district-tile-top: #d5cfff;
  --district-tile-bottom: #9487cb;
}

.tile-art {
  position: absolute;
  left: 50%;
  top: 53%;
  z-index: 1;
  width: 70px;
  height: 66px;
  display: block;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 7px 4px rgba(16, 25, 39, 0.24));
  pointer-events: none;
}

.space.home .tile-art,
.space.work .tile-art,
.space.choice .tile-art {
  width: 76px;
  height: 70px;
  top: 48%;
}

.space.occupied-space .tile-art {
  opacity: 0.48;
  transform: translate(-50%, -50%) scale(0.88);
}

.space.tile-illustrated strong {
  display: none;
}

.space.home strong,
.space.work strong,
.space.choice strong {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 5px;
  z-index: 3;
  padding: 0.08rem 0.2rem;
  border-radius: 999px;
  color: #17202a;
  background: rgba(255, 247, 223, 0.84);
  font-size: 0.56rem;
  text-align: center;
}

.map-scenery .landmark {
  opacity: 0.72;
}

.map-scenery .landmark-art {
  display: block;
  width: 112px;
  height: 96px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  filter:
    saturate(0.94)
    drop-shadow(0 10px 7px rgba(16, 25, 39, 0.22));
}

.map-scenery .landmark.home .landmark-art,
.map-scenery .landmark.work .landmark-art {
  width: 124px;
  height: 110px;
}

.map-scenery .landmark span {
  margin-top: -0.2rem;
  padding: 0.16rem 0.42rem;
  border: 2px solid rgba(255, 247, 223, 0.75);
  border-radius: 999px;
  color: #17202a;
  background: rgba(255, 247, 223, 0.78);
  box-shadow: 0 4px 8px rgba(16, 25, 39, 0.12);
  font-size: 0.58rem;
  line-height: 1;
}

/* Board-first final layer: keep this after the presentation theme. */
.map-canvas {
  background:
    radial-gradient(circle at 14% 16%, rgba(255, 247, 223, 0.36), transparent 12%),
    radial-gradient(circle at 84% 16%, rgba(255, 216, 107, 0.16), transparent 13%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px) 0 0 / 96px 96px,
    linear-gradient(0deg, rgba(16, 25, 39, 0.05) 1px, transparent 1px) 0 0 / 96px 96px,
    linear-gradient(180deg, #d8f0e6 0%, #c7e2bd 52%, #94c66b 100%);
}

.map-canvas::after {
  opacity: 0.14;
}

.map-zone {
  isolation: isolate;
  opacity: 0.86;
  border-color: rgba(255, 247, 223, 0.54);
  box-shadow:
    inset 0 0 0 4px rgba(16, 25, 39, 0.04),
    0 10px 0 rgba(16, 25, 39, 0.06),
    0 18px 24px rgba(16, 25, 39, 0.08);
}

.zone-neighborhood,
.zone-park,
.zone-downtown,
.zone-office,
.zone-stripmall,
.zone-parking {
  background-image: none !important;
  background-size: auto !important;
}

.zone-neighborhood {
  --zone-art: url("assets/zones/neighborhood.png");
  background: #d8c98c !important;
}

.zone-park {
  --zone-art: url("assets/zones/park.png");
  background: #8fcd64 !important;
}

.zone-downtown {
  --zone-art: url("assets/zones/downtown.png");
  background: #9ec9d7 !important;
}

.zone-office {
  --zone-art: url("assets/zones/work-district.png");
  background: #b8b2d5 !important;
}

.zone-stripmall {
  --zone-art: url("assets/zones/coffee-row.png");
  background: #d7af78 !important;
}

.zone-parking {
  --zone-art: url("assets/zones/coffee-row-patio.png");
  background: #cdaa76 !important;
}

.zone-neighborhood::after,
.zone-park::after,
.zone-downtown::after,
.zone-office::after,
.zone-stripmall::after,
.zone-parking::after {
  content: "";
  position: absolute;
  inset: 14%;
  z-index: 0;
  border-radius: 22px;
  background-image: var(--zone-art);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.2;
  filter: saturate(0.78) contrast(0.82);
  pointer-events: none;
}

.zone-neighborhood::before,
.zone-park::before,
.zone-downtown::before,
.zone-office::before,
.zone-stripmall::before,
.zone-parking::before {
  z-index: 1;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 247, 223, 0.22), transparent 24%),
    linear-gradient(180deg, rgba(255, 247, 223, 0.14), rgba(16, 25, 39, 0.04));
}

.zone-neighborhood span,
.zone-park span,
.zone-downtown span,
.zone-office span,
.zone-stripmall span,
.zone-parking span {
  z-index: 2;
  opacity: 0.72;
  transform: scale(0.88);
  transform-origin: left top;
}

.road-svg {
  z-index: 7;
  filter:
    drop-shadow(0 6px 0 rgba(255, 247, 223, 0.82))
    drop-shadow(0 18px 10px rgba(16, 25, 39, 0.42));
}

.route-line,
.view-3d .route-line {
  stroke: #101927;
  stroke-width: 7.2;
  filter: none;
}

.route-dash,
.view-3d .route-dash {
  stroke: #ffe070;
  stroke-width: 1.08;
  stroke-dasharray: 1.15 2.25;
  opacity: 0.98;
}

.space {
  z-index: 10;
  border-color: #fff7df;
  box-shadow:
    inset 0 -10px 0 rgba(124, 82, 47, 0.18),
    inset 0 0 0 3px rgba(16, 25, 39, 0.18),
    0 0 0 4px rgba(255, 247, 223, 0.9),
    0 0 0 7px rgba(16, 25, 39, 0.2),
    0 12px 0 #8b6746,
    0 22px 22px rgba(16, 25, 39, 0.34);
}

.view-3d .space {
  box-shadow:
    inset 0 -12px 0 rgba(124, 82, 47, 0.2),
    inset 0 0 0 3px rgba(16, 25, 39, 0.18),
    0 0 0 4px rgba(255, 247, 223, 0.9),
    0 0 0 7px rgba(16, 25, 39, 0.2),
    0 16px 0 #8b6746,
    0 28px 28px rgba(16, 25, 39, 0.38);
}

.space.occupied-space,
.view-3d .space.occupied-space {
  box-shadow:
    inset 0 -10px 0 rgba(124, 82, 47, 0.18),
    inset 0 0 0 3px rgba(16, 25, 39, 0.18),
    0 0 0 4px rgba(255, 247, 223, 0.95),
    0 0 0 7px rgba(16, 25, 39, 0.22),
    0 0 28px color-mix(in srgb, var(--occupant-1, #ffd86b) 78%, transparent),
    0 0 48px color-mix(in srgb, var(--occupant-2, var(--occupant-1, #ffd86b)) 58%, transparent),
    0 12px 0 #8b6746,
    0 24px 24px rgba(16, 25, 39, 0.38);
}

.landmark {
  z-index: 4;
  opacity: 0.68;
  transform: translate(-50%, -50%) scale(0.72);
}

.landmark i {
  filter: saturate(0.82) contrast(0.9);
}

.team-piece {
  z-index: 14;
}

/* Keep roll results in the visible viewport, not inside the scrolled board. */
.board-roll-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: clamp(0.75rem, 2vw, 1.25rem);
  overflow: auto;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 216, 107, 0.42), transparent 28%),
    rgba(16, 25, 39, 0.66);
}

.board-roll-card {
  width: min(760px, calc(100vw - 2rem));
  max-height: min(760px, calc(100dvh - 2rem));
  overflow: auto;
  margin: auto;
  border: 5px solid #fff7df;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 216, 107, 0.36), transparent 28%),
    linear-gradient(180deg, #fff7df, #f4c878);
}

.board-roll-card h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
}

/* The car artwork now faces down-route while the team number stays readable. */
.team-piece {
  transform: scaleX(-1);
  transform-origin: center;
}

.view-3d .team-piece {
  transform: translateZ(72px) scaleX(-1);
}

.team-piece.current {
  transform: scaleX(-1) scale(1.18);
}

.view-3d .team-piece.current {
  transform: translateZ(82px) scaleX(-1) scale(1.18);
}

.team-piece span {
  transform: scaleX(-1);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* Final board-first override: the scenery is flavor, the commute path is the star. */
.map-canvas {
  background:
    radial-gradient(circle at 14% 16%, rgba(255, 247, 223, 0.36), transparent 12%),
    radial-gradient(circle at 84% 16%, rgba(255, 216, 107, 0.16), transparent 13%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px) 0 0 / 96px 96px,
    linear-gradient(0deg, rgba(16, 25, 39, 0.05) 1px, transparent 1px) 0 0 / 96px 96px,
    linear-gradient(180deg, #d8f0e6 0%, #c7e2bd 52%, #94c66b 100%);
}

.map-canvas::after {
  opacity: 0.14;
}

.map-zone {
  isolation: isolate;
  opacity: 0.86;
  border-color: rgba(255, 247, 223, 0.54);
  box-shadow:
    inset 0 0 0 4px rgba(16, 25, 39, 0.04),
    0 10px 0 rgba(16, 25, 39, 0.06),
    0 18px 24px rgba(16, 25, 39, 0.08);
}

.zone-neighborhood,
.zone-park,
.zone-downtown,
.zone-office,
.zone-stripmall,
.zone-parking {
  background-image: none !important;
  background-size: auto !important;
}

.zone-neighborhood {
  --zone-art: url("assets/zones/neighborhood.png");
  background: #d8c98c !important;
}

.zone-park {
  --zone-art: url("assets/zones/park.png");
  background: #8fcd64 !important;
}

.zone-downtown {
  --zone-art: url("assets/zones/downtown.png");
  background: #9ec9d7 !important;
}

.zone-office {
  --zone-art: url("assets/zones/work-district.png");
  background: #b8b2d5 !important;
}

.zone-stripmall {
  --zone-art: url("assets/zones/coffee-row.png");
  background: #d7af78 !important;
}

.zone-parking {
  --zone-art: url("assets/zones/coffee-row-patio.png");
  background: #cdaa76 !important;
}

.zone-neighborhood::after,
.zone-park::after,
.zone-downtown::after,
.zone-office::after,
.zone-stripmall::after,
.zone-parking::after {
  content: "";
  position: absolute;
  inset: 14%;
  z-index: 0;
  border-radius: 22px;
  background-image: var(--zone-art);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.2;
  filter: saturate(0.78) contrast(0.82);
  pointer-events: none;
}

.zone-neighborhood::before,
.zone-park::before,
.zone-downtown::before,
.zone-office::before,
.zone-stripmall::before,
.zone-parking::before {
  z-index: 1;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 247, 223, 0.22), transparent 24%),
    linear-gradient(180deg, rgba(255, 247, 223, 0.14), rgba(16, 25, 39, 0.04));
}

.zone-neighborhood span,
.zone-park span,
.zone-downtown span,
.zone-office span,
.zone-stripmall span,
.zone-parking span {
  z-index: 2;
  opacity: 0.72;
  transform: scale(0.88);
  transform-origin: left top;
}

.road-svg {
  z-index: 7;
  filter:
    drop-shadow(0 6px 0 rgba(255, 247, 223, 0.82))
    drop-shadow(0 18px 10px rgba(16, 25, 39, 0.42));
}

.route-line,
.view-3d .route-line {
  stroke: #101927;
  stroke-width: 7.2;
  filter: none;
}

.route-dash,
.view-3d .route-dash {
  stroke: #ffe070;
  stroke-width: 1.08;
  stroke-dasharray: 1.15 2.25;
  opacity: 0.98;
}

.space {
  z-index: 10;
  border-color: #fff7df;
  box-shadow:
    inset 0 -10px 0 rgba(124, 82, 47, 0.18),
    inset 0 0 0 3px rgba(16, 25, 39, 0.18),
    0 0 0 4px rgba(255, 247, 223, 0.9),
    0 0 0 7px rgba(16, 25, 39, 0.2),
    0 12px 0 #8b6746,
    0 22px 22px rgba(16, 25, 39, 0.34);
}

.view-3d .space {
  box-shadow:
    inset 0 -12px 0 rgba(124, 82, 47, 0.2),
    inset 0 0 0 3px rgba(16, 25, 39, 0.18),
    0 0 0 4px rgba(255, 247, 223, 0.9),
    0 0 0 7px rgba(16, 25, 39, 0.2),
    0 16px 0 #8b6746,
    0 28px 28px rgba(16, 25, 39, 0.38);
}

.space.occupied-space,
.view-3d .space.occupied-space {
  box-shadow:
    inset 0 -10px 0 rgba(124, 82, 47, 0.18),
    inset 0 0 0 3px rgba(16, 25, 39, 0.18),
    0 0 0 4px rgba(255, 247, 223, 0.95),
    0 0 0 7px rgba(16, 25, 39, 0.22),
    0 0 28px color-mix(in srgb, var(--occupant-1, #ffd86b) 78%, transparent),
    0 0 48px color-mix(in srgb, var(--occupant-2, var(--occupant-1, #ffd86b)) 58%, transparent),
    0 12px 0 #8b6746,
    0 24px 24px rgba(16, 25, 39, 0.38);
}

.landmark {
  z-index: 4;
  opacity: 0.68;
  transform: translate(-50%, -50%) scale(0.72);
}

.landmark i {
  filter: saturate(0.82) contrast(0.9);
}

.team-piece {
  z-index: 14;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* Final roll overlay and car direction pass. Keep after all theme overrides. */
.board-roll-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: clamp(0.75rem, 2vw, 1.25rem);
  overflow: auto;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 216, 107, 0.42), transparent 28%),
    rgba(16, 25, 39, 0.66);
}

.board-roll-card {
  width: min(760px, calc(100vw - 2rem));
  max-height: min(760px, calc(100dvh - 2rem));
  overflow: auto;
  margin: auto;
  border: 5px solid #fff7df;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 216, 107, 0.36), transparent 28%),
    linear-gradient(180deg, #fff7df, #f4c878);
}

.board-roll-card h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.team-piece {
  transform: scaleX(-1);
  transform-origin: center;
}

.view-3d .team-piece {
  transform: translateZ(72px) scaleX(-1);
}

.team-piece.current {
  transform: scaleX(-1) scale(1.18);
}

.view-3d .team-piece.current {
  transform: translateZ(82px) scaleX(-1) scale(1.18);
}

.team-piece span {
  transform: scaleX(-1);
}

/* Final board-first override: keep the route and spaces visually dominant. */
.map-canvas {
  background:
    radial-gradient(circle at 14% 16%, rgba(255,247,223,0.42), transparent 12%),
    radial-gradient(circle at 84% 16%, rgba(255,216,107,0.18), transparent 13%),
    linear-gradient(90deg, rgba(255,255,255,0.12) 1px, transparent 1px) 0 0 / 96px 96px,
    linear-gradient(0deg, rgba(16,25,39,0.05) 1px, transparent 1px) 0 0 / 96px 96px,
    linear-gradient(180deg, #d6f0e6 0%, #c6e2bd 52%, #94c66b 100%);
}

.map-canvas::after {
  opacity: 0.18;
}

.map-zone {
  isolation: isolate;
  opacity: 0.9;
  border-color: rgba(255,247,223,0.62);
  box-shadow:
    inset 0 0 0 4px rgba(16,25,39,0.05),
    0 10px 0 rgba(16,25,39,0.07),
    0 18px 24px rgba(16,25,39,0.1);
}

.zone-neighborhood,
.zone-park,
.zone-downtown,
.zone-office,
.zone-stripmall,
.zone-parking {
  background-image: none !important;
  background-size: auto !important;
}

.zone-neighborhood { --zone-art: url("assets/zones/neighborhood.png"); background: #d6c786 !important; }
.zone-park { --zone-art: url("assets/zones/park.png"); background: #8fcf65 !important; }
.zone-downtown { --zone-art: url("assets/zones/downtown.png"); background: #9dc9d8 !important; }
.zone-office { --zone-art: url("assets/zones/work-district.png"); background: #b8b2d5 !important; }
.zone-stripmall { --zone-art: url("assets/zones/coffee-row.png"); background: #d9b27a !important; }
.zone-parking { --zone-art: url("assets/zones/coffee-row-patio.png"); background: #cfae79 !important; }

.zone-neighborhood::after,
.zone-park::after,
.zone-downtown::after,
.zone-office::after,
.zone-stripmall::after,
.zone-parking::after {
  content: "";
  position: absolute;
  inset: 11%;
  z-index: 0;
  border-radius: 22px;
  background-image: var(--zone-art);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.22;
  filter: saturate(0.82) contrast(0.84);
  pointer-events: none;
}

.zone-neighborhood::before,
.zone-park::before,
.zone-downtown::before,
.zone-office::before,
.zone-stripmall::before,
.zone-parking::before {
  z-index: 1;
  background:
    radial-gradient(circle at 18% 12%, rgba(255,247,223,0.24), transparent 24%),
    linear-gradient(180deg, rgba(255,247,223,0.16), rgba(16,25,39,0.05));
}

.zone-neighborhood span,
.zone-park span,
.zone-downtown span,
.zone-office span,
.zone-stripmall span,
.zone-parking span {
  z-index: 2;
  opacity: 0.78;
  transform: scale(0.92);
  transform-origin: left top;
}

.road-svg {
  z-index: 6;
  filter:
    drop-shadow(0 6px 0 rgba(255,247,223,0.76))
    drop-shadow(0 18px 10px rgba(16,25,39,0.38));
}

.route-line,
.view-3d .route-line {
  stroke: #101927;
  stroke-width: 6.8;
  filter: none;
}

.route-dash,
.view-3d .route-dash {
  stroke: #ffe070;
  stroke-width: 1.05;
  stroke-dasharray: 1.1 2.2;
  opacity: 0.96;
}

.space {
  z-index: 9;
  border-color: #fff7df;
  box-shadow:
    inset 0 -10px 0 rgba(124,82,47,0.18),
    inset 0 0 0 3px rgba(16,25,39,0.16),
    0 0 0 4px rgba(16,25,39,0.2),
    0 12px 0 #8b6746,
    0 22px 22px rgba(16,25,39,0.32);
}

.view-3d .space {
  box-shadow:
    inset 0 -12px 0 rgba(124,82,47,0.2),
    inset 0 0 0 3px rgba(16,25,39,0.16),
    0 0 0 4px rgba(16,25,39,0.2),
    0 16px 0 #8b6746,
    0 28px 28px rgba(16,25,39,0.36);
}

.landmark {
  z-index: 4;
  opacity: 0.72;
  transform: translate(-50%, -50%) scale(0.78);
}

.team-piece {
  z-index: 13;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* Board-first readability pass: scenery supports the track instead of competing with it. */
.map-canvas {
  background:
    radial-gradient(circle at 14% 16%, rgba(255,247,223,0.42), transparent 12%),
    radial-gradient(circle at 84% 16%, rgba(255,216,107,0.18), transparent 13%),
    linear-gradient(90deg, rgba(255,255,255,0.12) 1px, transparent 1px) 0 0 / 96px 96px,
    linear-gradient(0deg, rgba(16,25,39,0.05) 1px, transparent 1px) 0 0 / 96px 96px,
    linear-gradient(180deg, #d6f0e6 0%, #c6e2bd 52%, #94c66b 100%);
}

.map-canvas::after {
  opacity: 0.22;
}

.map-zone {
  isolation: isolate;
  opacity: 0.92;
  border-color: rgba(255,247,223,0.62);
  box-shadow:
    inset 0 0 0 4px rgba(16,25,39,0.05),
    0 10px 0 rgba(16,25,39,0.07),
    0 18px 24px rgba(16,25,39,0.1);
}

.zone-neighborhood,
.zone-park,
.zone-downtown,
.zone-office,
.zone-stripmall,
.zone-parking {
  background-image: none !important;
  background-size: auto !important;
}

.zone-neighborhood { --zone-art: url("assets/zones/neighborhood.png"); background: #d6c786 !important; }
.zone-park { --zone-art: url("assets/zones/park.png"); background: #8fcf65 !important; }
.zone-downtown { --zone-art: url("assets/zones/downtown.png"); background: #9dc9d8 !important; }
.zone-office { --zone-art: url("assets/zones/work-district.png"); background: #b8b2d5 !important; }
.zone-stripmall { --zone-art: url("assets/zones/coffee-row.png"); background: #d9b27a !important; }
.zone-parking { --zone-art: url("assets/zones/coffee-row-patio.png"); background: #cfae79 !important; }

.zone-neighborhood::after,
.zone-park::after,
.zone-downtown::after,
.zone-office::after,
.zone-stripmall::after,
.zone-parking::after {
  content: "";
  position: absolute;
  inset: 10%;
  z-index: 0;
  border-radius: 22px;
  background-image: var(--zone-art);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.24;
  filter: saturate(0.88) contrast(0.86);
  pointer-events: none;
}

.zone-neighborhood::before,
.zone-park::before,
.zone-downtown::before,
.zone-office::before,
.zone-stripmall::before,
.zone-parking::before {
  z-index: 1;
  background:
    radial-gradient(circle at 18% 12%, rgba(255,247,223,0.24), transparent 24%),
    linear-gradient(180deg, rgba(255,247,223,0.16), rgba(16,25,39,0.05));
}

.zone-neighborhood span,
.zone-park span,
.zone-downtown span,
.zone-office span,
.zone-stripmall span,
.zone-parking span {
  z-index: 2;
  opacity: 0.82;
  transform: scale(0.92);
  transform-origin: left top;
}

.road-svg {
  z-index: 6;
  filter:
    drop-shadow(0 6px 0 rgba(255,247,223,0.72))
    drop-shadow(0 18px 10px rgba(16,25,39,0.38));
}

.route-line,
.view-3d .route-line {
  stroke: #101927;
  stroke-width: 6.8;
  filter: none;
}

.route-dash,
.view-3d .route-dash {
  stroke: #ffe070;
  stroke-width: 1.05;
  stroke-dasharray: 1.1 2.2;
  opacity: 0.95;
}

.space {
  z-index: 9;
  border-color: #fff7df;
  box-shadow:
    inset 0 -10px 0 rgba(124,82,47,0.18),
    inset 0 0 0 3px rgba(16,25,39,0.16),
    0 0 0 4px rgba(16,25,39,0.2),
    0 12px 0 #8b6746,
    0 22px 22px rgba(16,25,39,0.32);
}

.view-3d .space {
  box-shadow:
    inset 0 -12px 0 rgba(124,82,47,0.2),
    inset 0 0 0 3px rgba(16,25,39,0.16),
    0 0 0 4px rgba(16,25,39,0.2),
    0 16px 0 #8b6746,
    0 28px 28px rgba(16,25,39,0.36);
}

.landmark {
  z-index: 4;
  opacity: 0.78;
  transform: translate(-50%, -50%) scale(0.82);
}

.view-3d .route-sign {
  opacity: 0.88;
}

.team-piece {
  z-index: 13;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* Quirky commute board-game presentation pass */
:root {
  --ink: #101927;
  --muted: #5a6472;
  --panel: #fff4d2;
  --line: #7c522f;
  --road: #1d2a3a;
  --road-line: #ffd86b;
  --home: #25a75a;
  --work: #1f73c9;
  --accent: #e95d34;
  --accent-2: #ffbf2f;
  --good: #16a75a;
  --bad: #d83a32;
  --freeway: #188ee8;
  --side: #21b26f;
  --tile: #f7d99b;
  --shadow: 0 22px 44px rgba(16, 25, 39, 0.24);
}

body {
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(16,25,39,0.1) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(0deg, rgba(16,25,39,0.08) 1px, transparent 1px) 0 0 / 48px 48px,
    radial-gradient(circle at 16% 12%, rgba(255,191,47,0.34), transparent 22%),
    radial-gradient(circle at 84% 6%, rgba(24,142,232,0.26), transparent 24%),
    linear-gradient(135deg, #f0c778 0%, #b9dfc4 48%, #78ba62 100%);
}

.topbar {
  color: #fff7df;
  background:
    linear-gradient(180deg, rgba(29,42,58,0.98), rgba(16,25,39,0.98));
  border-bottom: 5px solid var(--accent-2);
  box-shadow: 0 12px 22px rgba(16,25,39,0.24);
}

.brand-mark {
  border-radius: 18px;
  background:
    radial-gradient(circle at 34% 26%, rgba(255,255,255,0.78), transparent 16%),
    conic-gradient(from 185deg, var(--home), var(--accent-2), var(--accent), var(--work), var(--home));
  box-shadow:
    inset 0 0 0 4px rgba(255,255,255,0.55),
    0 10px 0 rgba(0,0,0,0.16),
    0 18px 24px rgba(0,0,0,0.22);
}

.brand h1 {
  color: #fff7df;
  text-shadow: 0 3px 0 rgba(0,0,0,0.3), 0 0 18px rgba(255,191,47,0.3);
}

.brand .small-note {
  color: #ffdc76;
  font-weight: 1000;
}

.nav button.active,
.btn-primary,
.start-commute {
  color: #17202a;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.42), transparent 38%),
    linear-gradient(180deg, #ffe27a, #ff9d2e);
  border-color: #fff1b2;
}

.main.game-main {
  background:
    radial-gradient(circle at 18% 18%, rgba(255,247,223,0.42), transparent 18%),
    linear-gradient(135deg, rgba(16,25,39,0.14), rgba(255,247,223,0.16));
}

.stage {
  border: 4px solid rgba(255,247,223,0.88);
  background:
    linear-gradient(180deg, rgba(255,245,214,0.95), rgba(255,222,140,0.74));
  box-shadow: var(--shadow);
}

.stage-header {
  border-bottom: 5px solid rgba(255,191,47,0.75);
  background:
    linear-gradient(90deg, #1d2a3a 0 18%, #fff0bd 18% 100%);
}

.status-pill {
  border: 3px solid rgba(16,25,39,0.18);
  color: #17202a;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.5), transparent 44%),
    #fff7df;
  box-shadow: inset 0 -6px 0 rgba(16,25,39,0.09), 0 8px 0 rgba(16,25,39,0.08);
}

.clock {
  border: 4px solid #fff7df;
  background:
    radial-gradient(circle at 50% 0, rgba(255,216,107,0.24), transparent 46%),
    linear-gradient(180deg, #283a50, #101927);
  box-shadow:
    inset 0 -8px 0 rgba(0,0,0,0.28),
    0 12px 18px rgba(16,25,39,0.34);
}

.map-wrap,
.map-wrap.view-3d {
  background:
    linear-gradient(90deg, rgba(29,42,58,0.08) 1px, transparent 1px) 0 0 / 68px 68px,
    linear-gradient(0deg, rgba(29,42,58,0.06) 1px, transparent 1px) 0 0 / 68px 68px,
    linear-gradient(180deg, #99dff1 0%, #bfead7 43%, #7fbe5e 100%);
}

.trivia-collapsed .map-wrap {
  height: clamp(470px, calc(100dvh - 198px), 740px);
}

.trivia-expanded .map-wrap {
  height: clamp(386px, calc(100dvh - 320px), 530px);
}

.map-canvas {
  border: 16px solid rgba(255,247,223,0.94);
  background:
    radial-gradient(circle at 9% 12%, rgba(255,255,255,0.62), transparent 9%),
    radial-gradient(circle at 84% 12%, rgba(255,221,106,0.42), transparent 13%),
    radial-gradient(circle at 16% 86%, rgba(37,167,90,0.36), transparent 16%),
    linear-gradient(90deg, rgba(255,255,255,0.16) 1px, transparent 1px) 0 0 / 82px 82px,
    linear-gradient(0deg, rgba(16,25,39,0.08) 1px, transparent 1px) 0 0 / 82px 82px,
    linear-gradient(180deg, #cfedf4 0%, #d9efcf 47%, #9ac66e 100%);
  box-shadow:
    inset 0 0 0 7px rgba(16,25,39,0.12),
    inset 0 0 80px rgba(16,25,39,0.12),
    0 18px 0 #6d8b84,
    0 36px 58px rgba(16,25,39,0.32);
}

.map-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.5;
  background:
    radial-gradient(circle at 18% 24%, rgba(124,82,47,0.1) 0 2px, transparent 3px),
    radial-gradient(circle at 68% 34%, rgba(124,82,47,0.09) 0 2px, transparent 3px),
    radial-gradient(circle at 42% 72%, rgba(124,82,47,0.12) 0 2px, transparent 3px);
  background-size: 120px 120px, 150px 150px, 170px 170px;
}

.map-zone {
  border: 5px solid rgba(255,247,223,0.88);
  box-shadow:
    inset 0 0 0 4px rgba(16,25,39,0.08),
    0 18px 0 rgba(16,25,39,0.1),
    0 26px 30px rgba(16,25,39,0.16);
}

.map-zone span {
  color: #17202a;
  background: #fff7df;
  border: 2px solid rgba(16,25,39,0.12);
  box-shadow: 0 4px 0 rgba(16,25,39,0.12);
}

.zone-neighborhood {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.2) 25%, transparent 25%) 0 0 / 54px 54px,
    linear-gradient(45deg, transparent 46%, rgba(255,255,255,0.22) 47% 53%, transparent 54%) 0 0 / 80px 80px,
    #f1c66f;
}

.zone-park {
  background:
    radial-gradient(circle at 20% 26%, rgba(255,255,255,0.32), transparent 13%),
    radial-gradient(circle at 68% 70%, rgba(255,255,255,0.22), transparent 15%),
    #63b94d;
}

.zone-downtown {
  background:
    linear-gradient(90deg, rgba(255,255,255,0.28) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(0deg, rgba(255,255,255,0.16) 1px, transparent 1px) 0 0 / 44px 44px,
    #76b7d8;
}

.zone-office {
  background:
    linear-gradient(90deg, rgba(255,255,255,0.22) 12px, transparent 12px 28px) 12px 0 / 58px 42px,
    #9a91cc;
}

.zone-stripmall {
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.25) 0 32px, transparent 32px 64px),
    #dca75d;
}

.zone-parking {
  background:
    linear-gradient(90deg, rgba(255,255,255,0.38) 2px, transparent 2px) 0 0 / 42px 100%,
    #6d879d;
}

.zone-neighborhood,
.zone-park,
.zone-downtown,
.zone-office,
.zone-stripmall,
.zone-parking {
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.zone-neighborhood::before,
.zone-park::before,
.zone-downtown::before,
.zone-office::before,
.zone-stripmall::before,
.zone-parking::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 18% 12%, rgba(255,247,223,0.2), transparent 28%),
    linear-gradient(180deg, rgba(16,25,39,0), rgba(16,25,39,0.12));
  pointer-events: none;
}

.zone-neighborhood span,
.zone-park span,
.zone-downtown span,
.zone-office span,
.zone-stripmall span,
.zone-parking span {
  z-index: 1;
}

.zone-neighborhood {
  background-image:
    linear-gradient(180deg, rgba(255,247,223,0.05), rgba(124,82,47,0.08)),
    url("assets/zones/neighborhood.png");
}

.zone-park {
  background-image:
    linear-gradient(180deg, rgba(255,247,223,0.04), rgba(16,25,39,0.08)),
    url("assets/zones/park.png");
}

.zone-downtown {
  background-image:
    linear-gradient(180deg, rgba(255,247,223,0.03), rgba(16,25,39,0.12)),
    url("assets/zones/downtown.png");
}

.zone-office {
  background-image:
    linear-gradient(180deg, rgba(255,247,223,0.03), rgba(16,25,39,0.1)),
    url("assets/zones/work-district.png");
}

.zone-stripmall {
  background-image:
    linear-gradient(180deg, rgba(255,247,223,0.03), rgba(16,25,39,0.1)),
    url("assets/zones/coffee-row.png");
}

.zone-parking {
  background-image:
    linear-gradient(180deg, rgba(255,247,223,0.03), rgba(16,25,39,0.1)),
    url("assets/zones/coffee-row-patio.png");
}

.landmark i {
  border: 5px solid #fff7df;
  box-shadow:
    inset 0 -10px 0 rgba(16,25,39,0.12),
    0 10px 0 rgba(16,25,39,0.16),
    0 18px 18px rgba(16,25,39,0.22);
}

.landmark.alarm i {
  width: 58px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #fff7df 0 22px, transparent 23px),
    conic-gradient(from 0deg, #e95d34 0 25%, #ffbf2f 25% 50%, #1f73c9 50% 75%, #16a75a 75% 100%);
}

.landmark.cone i {
  width: 58px;
  background:
    linear-gradient(90deg, transparent 0 24%, #fff7df 25% 34%, transparent 35% 65%, #fff7df 66% 75%, transparent 76%),
    linear-gradient(180deg, transparent 0 10%, #e95d34 11% 70%, #7c522f 71% 100%);
  clip-path: polygon(50% 0, 82% 78%, 100% 78%, 100% 100%, 0 100%, 0 78%, 18% 78%);
}

.landmark.sign i {
  width: 80px;
  height: 52px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 45%, rgba(16,25,39,0.45) 46% 54%, transparent 55%) center 38px / 100% 28px no-repeat,
    linear-gradient(180deg, #1f73c9, #175da4);
}

.landmark.tree i {
  width: 66px;
  height: 64px;
  border-radius: 50% 50% 42% 42%;
  background:
    linear-gradient(90deg, transparent 43%, #7c522f 44% 56%, transparent 57%) 0 38px / 100% 28px no-repeat,
    radial-gradient(circle at 36% 44%, #8fd36b 0 15px, transparent 16px),
    radial-gradient(circle at 62% 36%, #5caf49 0 18px, transparent 19px),
    radial-gradient(circle at 50% 62%, #3d943c 0 18px, transparent 19px);
}

.route-line {
  stroke: #445968;
  stroke-width: 5.2;
  filter: drop-shadow(0 17px 6px rgba(16,25,39,0.32));
}

.route-dash {
  stroke: #fff7df;
  stroke-width: 0.8;
  stroke-dasharray: 1.4 2.6;
}

.view-3d .route-line {
  stroke-width: 5.5;
}

.space {
  width: 96px;
  height: 82px;
  margin: -41px 0 0 -48px;
  border-radius: 18px;
  color: #1d2a3a;
  background:
    radial-gradient(circle at 24% 18%, rgba(255,255,255,0.9), transparent 18%),
    linear-gradient(135deg, rgba(255,255,255,0.15) 0 12%, transparent 13% 38%, rgba(124,82,47,0.08) 39% 41%, transparent 42%),
    linear-gradient(180deg, #ffe1a2, #eab763);
  border: 5px solid #fff7df;
  box-shadow:
    inset 0 -10px 0 rgba(124,82,47,0.18),
    inset 0 0 0 2px rgba(124,82,47,0.16),
    0 12px 0 #9b7650,
    0 22px 22px rgba(16,25,39,0.28);
}

.space::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 2px dashed rgba(124,82,47,0.3);
  border-radius: 12px;
  pointer-events: none;
}

.view-3d .space {
  background:
    radial-gradient(circle at 24% 18%, rgba(255,255,255,0.95), transparent 18%),
    linear-gradient(135deg, rgba(255,255,255,0.2) 0 12%, transparent 13% 40%, rgba(124,82,47,0.1) 41% 43%, transparent 44%),
    linear-gradient(180deg, #ffe2a6, #e8b25d);
  box-shadow:
    inset 0 -12px 0 rgba(124,82,47,0.2),
    inset 0 0 0 2px rgba(124,82,47,0.16),
    0 16px 0 #9b7650,
    0 28px 28px rgba(16,25,39,0.32);
}

.space strong {
  color: #1d2a3a;
  font-size: 0.68rem;
}

.tile-number {
  left: 8px;
  top: 7px;
  color: #fff7df;
  background: #1d2a3a;
  border: 2px solid #fff7df;
  box-shadow: 0 3px 0 rgba(16,25,39,0.2);
}

.space.home,
.view-3d .space.home {
  background:
    radial-gradient(circle at 24% 18%, rgba(255,255,255,0.95), transparent 18%),
    linear-gradient(180deg, #7ee596, #16a75a);
}

.space.work,
.view-3d .space.work {
  background:
    radial-gradient(circle at 24% 18%, rgba(255,255,255,0.95), transparent 18%),
    linear-gradient(180deg, #83c7ff, #1f73c9);
}

.space.choice,
.view-3d .space.choice {
  background:
    radial-gradient(circle at 24% 18%, rgba(255,255,255,0.95), transparent 18%),
    linear-gradient(180deg, #ffe76b, #e88f2e);
}

.space.occupied-space,
.view-3d .space.occupied-space {
  animation: occupiedBoardGlow 900ms ease-in-out infinite alternate;
}

.tile-icon {
  width: 36px;
  height: 31px;
  filter: drop-shadow(0 2px 0 rgba(16,25,39,0.22));
}

.team-piece {
  width: 54px;
  height: 31px;
  margin: -16px 0 0 -27px;
  border-radius: 18px 20px 10px 10px;
  border: 3px solid #fff7df;
  box-shadow:
    inset -5px -6px 8px rgba(0,0,0,0.24),
    inset 4px 4px 6px rgba(255,255,255,0.42),
    0 8px 0 rgba(16,25,39,0.22),
    0 18px 18px rgba(16,25,39,0.34);
}

.team-piece::before {
  left: 13px;
  top: -10px;
  width: 27px;
  height: 17px;
  border: 3px solid #fff7df;
  border-bottom: 0;
}

.team-piece::after {
  left: 7px;
  bottom: -5px;
  width: 10px;
  height: 10px;
  box-shadow: 30px 0 0 #101927;
}

.team-piece.driving {
  filter: drop-shadow(0 0 12px rgba(255,216,107,0.95)) drop-shadow(0 0 18px rgba(22,167,90,0.55));
}

.team-piece.driving span::after {
  content: "";
  position: absolute;
  left: -28px;
  top: 50%;
  width: 24px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(22,167,90,0.9));
  transform: translateY(-50%);
}

.map-wrap > .dice-panel {
  width: 178px;
  margin-bottom: -172px;
  border: 4px solid #fff7df;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0, rgba(255,216,107,0.38), transparent 42%),
    linear-gradient(180deg, #fff7df, #ffd876);
  box-shadow:
    inset 0 -8px 0 rgba(124,82,47,0.18),
    0 10px 0 rgba(16,25,39,0.14),
    0 20px 24px rgba(16,25,39,0.24);
}

.map-wrap > .dice-panel > span {
  color: #1d2a3a;
  font-size: 0.72rem;
}

.map-wrap > .dice-panel .die-face {
  width: 72px;
  height: 72px;
  --pip-size: 12px;
  --pip-low: 27%;
  --pip-mid: 50%;
  --pip-high: 73%;
}

.die-face {
  background:
    radial-gradient(circle at 28% 20%, rgba(255,255,255,0.98), transparent 20%),
    linear-gradient(145deg, #ffffff 0%, #f0f3f3 54%, #c9d3d7 100%);
  border: 4px solid #fff7df;
  box-shadow:
    inset -7px -9px 0 rgba(16,25,39,0.11),
    inset 5px 5px 0 rgba(255,255,255,0.9),
    0 10px 0 rgba(16,25,39,0.16),
    0 18px 22px rgba(16,25,39,0.24);
}

.die-face.rolling {
  animation: diceTumble 520ms ease-in-out infinite, diceBlur 220ms linear infinite alternate;
}

.pip {
  background: #101927;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.18);
}

.board-roll-overlay {
  background:
    radial-gradient(circle at 50% 30%, rgba(255,216,107,0.42), transparent 28%),
    rgba(16,25,39,0.66);
}

.board-roll-card {
  border: 5px solid #fff7df;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,216,107,0.36), transparent 28%),
    linear-gradient(180deg, #fff7df, #f4c878);
}

.board-roll-card h2,
.card-reveal-modal h2 {
  color: #1d2a3a;
  font-size: clamp(2rem, 4vw, 3rem);
  text-shadow: 0 3px 0 rgba(255,255,255,0.72);
}

.roll-team {
  border: 3px solid color-mix(in srgb, var(--team-color) 64%, white);
  background:
    radial-gradient(circle at 50% 0, color-mix(in srgb, var(--team-color) 18%, transparent), transparent 45%),
    linear-gradient(180deg, #fffdf4, #f3ddb0);
}

.roll-team b {
  width: auto;
  min-width: 74px;
  padding: 0 0.55rem;
  border-radius: 999px;
  background: var(--team-color);
  animation: resultBurst 650ms ease both;
}

.card-reveal-backdrop {
  background:
    radial-gradient(circle at 50% 14%, rgba(255,216,107,0.32), transparent 34%),
    rgba(16,25,39,0.72);
}

.card-reveal-modal {
  border: 5px solid #fff7df;
  background:
    radial-gradient(circle at 18% 0, rgba(255,216,107,0.32), transparent 28%),
    linear-gradient(180deg, #fff1bd, #e8b868);
}

.assigned-card {
  perspective: 900px;
}

.assigned-card::before,
.assigned-card::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -9px;
  height: 18px;
  border-radius: 0 0 12px 12px;
  background: rgba(16,25,39,0.16);
  transform: rotate(-2deg);
}

.assigned-card::after {
  bottom: -15px;
  opacity: 0.6;
  transform: rotate(2deg);
}

.assigned-card-face {
  position: relative;
  z-index: 1;
  border: 5px solid #fff7df;
  min-height: 264px;
  padding: 3.25rem 1rem 0.9rem;
  text-shadow: none;
  transform-style: preserve-3d;
  box-shadow:
    inset 0 -14px 0 rgba(16,25,39,0.18),
    0 14px 0 rgba(16,25,39,0.16),
    0 26px 28px rgba(16,25,39,0.28);
}

.assigned-card.positive .assigned-card-face {
  background:
    radial-gradient(circle at 82% 14%, rgba(255,255,255,0.36), transparent 18%),
    radial-gradient(circle at 18% 78%, rgba(255,255,255,0.22), transparent 20%),
    linear-gradient(135deg, #22c76a, #106b3a);
}

.assigned-card.oops .assigned-card-face {
  background:
    radial-gradient(circle at 82% 14%, rgba(255,255,255,0.28), transparent 18%),
    repeating-linear-gradient(-45deg, rgba(255,216,107,0.16) 0 12px, transparent 12px 24px),
    linear-gradient(135deg, #e84a3e, #8f211e);
}

.assigned-card.safe .assigned-card-face {
  background:
    radial-gradient(circle at 82% 14%, rgba(255,255,255,0.3), transparent 18%),
    repeating-linear-gradient(-45deg, rgba(255,255,255,0.12) 0 12px, transparent 12px 24px),
    linear-gradient(135deg, #2e6ea6, #1d2a3a);
}

.assigned-card.positive:not(.revealed) .assigned-card-face {
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.18) 0 16%, transparent 17%),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.16) 0 12px, transparent 12px 24px),
    linear-gradient(135deg, #22c76a, #106b3a);
}

.assigned-card.oops:not(.revealed) .assigned-card-face {
  background:
    radial-gradient(circle at 50% 50%, rgba(255,216,107,0.2) 0 16%, transparent 17%),
    repeating-linear-gradient(45deg, rgba(255,216,107,0.18) 0 12px, transparent 12px 24px),
    linear-gradient(135deg, #e84a3e, #8f211e);
}

.assigned-card.safe:not(.revealed) .assigned-card-face {
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.16) 0 16%, transparent 17%),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.12) 0 12px, transparent 12px 24px),
    linear-gradient(135deg, #2e6ea6, #1d2a3a);
}

.assigned-card.revealed .assigned-card-face {
  animation: cardFlipPop 560ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.assigned-card.positive.revealed .assigned-card-face {
  box-shadow:
    inset 0 -14px 0 rgba(16,25,39,0.18),
    0 0 0 6px rgba(22,167,90,0.18),
    0 0 34px rgba(22,167,90,0.46),
    0 26px 28px rgba(16,25,39,0.28);
}

.assigned-card.oops.revealed .assigned-card-face {
  animation: cardFlipPop 560ms cubic-bezier(0.2, 0.8, 0.2, 1) both, warningPulse 760ms ease-in-out 1;
}

.assigned-card-face strong {
  font-size: 1.18rem;
  line-height: 1.1;
}

.assigned-card-face p {
  color: rgba(255,255,255,0.95);
  font-size: 0.92rem;
}

.assigned-card-face em {
  padding: 0.36rem 0.72rem;
  color: #101927;
  background: #fff7df;
  border: 2px solid rgba(16,25,39,0.14);
  font-size: 0.95rem;
}

.resolve-btn.ready,
.card-reveal-modal button[data-action="resolve-assigned-cards"]:not(:disabled) {
  animation: readyPulse 720ms ease-in-out infinite alternate;
  color: #17202a;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.45), transparent 42%),
    linear-gradient(180deg, #ffe66b, #ff8f2e);
}

.answer-pick.correct.selected {
  animation: correctFlash 520ms ease both;
}

.answer-pick.incorrect.selected {
  animation: incorrectShake 420ms ease both;
}

.endgame-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 3px dashed rgba(124,82,47,0.28);
  border-radius: 10px;
  pointer-events: none;
}

@keyframes occupiedBoardGlow {
  from { filter: saturate(1); }
  to { filter: saturate(1.25) drop-shadow(0 0 10px rgba(255,216,107,0.52)); }
}

@keyframes diceBlur {
  from { filter: blur(0) saturate(1); }
  to { filter: blur(0.5px) saturate(1.35); }
}

@keyframes resultBurst {
  0% { opacity: 0; transform: scale(0.64) rotate(-8deg); }
  58% { opacity: 1; transform: scale(1.12) rotate(4deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes cardFlipPop {
  0% { transform: rotateY(78deg) translateY(10px) scale(0.92); }
  62% { transform: rotateY(-8deg) translateY(-5px) scale(1.04); }
  100% { transform: rotateY(0) translateY(0) scale(1); }
}

@keyframes warningPulse {
  0%, 100% { filter: none; }
  35% { filter: drop-shadow(0 0 18px rgba(216,58,50,0.8)); transform: translateX(-4px); }
  62% { transform: translateX(4px); }
}

@keyframes correctFlash {
  0% { box-shadow: 0 0 0 rgba(22,167,90,0); }
  48% { box-shadow: 0 0 0 6px rgba(22,167,90,0.22); }
  100% { box-shadow: 0 0 0 rgba(22,167,90,0); }
}

@keyframes incorrectShake {
  0%, 100% { transform: translateX(0); }
  28% { transform: translateX(-3px); }
  56% { transform: translateX(3px); }
  78% { transform: translateX(-1px); }
}

@media (max-width: 760px) {
  .space {
    width: 82px;
    height: 74px;
    margin: -37px 0 0 -41px;
  }

  .endgame-results {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* Board-first true final layer: scenery stays quiet, the commute route stays loud. */
.map-canvas {
  background:
    radial-gradient(circle at 14% 16%, rgba(255, 247, 223, 0.36), transparent 12%),
    radial-gradient(circle at 84% 16%, rgba(255, 216, 107, 0.16), transparent 13%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px) 0 0 / 96px 96px,
    linear-gradient(0deg, rgba(16, 25, 39, 0.05) 1px, transparent 1px) 0 0 / 96px 96px,
    linear-gradient(180deg, #d8f0e6 0%, #c7e2bd 52%, #94c66b 100%);
}

.map-canvas::after {
  opacity: 0.14;
}

.map-zone {
  isolation: isolate;
  opacity: 0.86;
  border-color: rgba(255, 247, 223, 0.54);
  box-shadow:
    inset 0 0 0 4px rgba(16, 25, 39, 0.04),
    0 10px 0 rgba(16, 25, 39, 0.06),
    0 18px 24px rgba(16, 25, 39, 0.08);
}

.zone-neighborhood,
.zone-park,
.zone-downtown,
.zone-office,
.zone-stripmall,
.zone-parking {
  background-image: none !important;
  background-size: auto !important;
}

.zone-neighborhood {
  --zone-art: url("assets/zones/neighborhood.png");
  background: #d8c98c !important;
}

.zone-park {
  --zone-art: url("assets/zones/park.png");
  background: #8fcd64 !important;
}

.zone-downtown {
  --zone-art: url("assets/zones/downtown.png");
  background: #9ec9d7 !important;
}

.zone-office {
  --zone-art: url("assets/zones/work-district.png");
  background: #b8b2d5 !important;
}

.zone-stripmall {
  --zone-art: url("assets/zones/coffee-row.png");
  background: #d7af78 !important;
}

.zone-parking {
  --zone-art: url("assets/zones/coffee-row-patio.png");
  background: #cdaa76 !important;
}

.zone-neighborhood::after,
.zone-park::after,
.zone-downtown::after,
.zone-office::after,
.zone-stripmall::after,
.zone-parking::after {
  content: "";
  position: absolute;
  inset: 14%;
  z-index: 0;
  border-radius: 22px;
  background-image: var(--zone-art);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.2;
  filter: saturate(0.78) contrast(0.82);
  pointer-events: none;
}

.zone-neighborhood::before,
.zone-park::before,
.zone-downtown::before,
.zone-office::before,
.zone-stripmall::before,
.zone-parking::before {
  z-index: 1;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 247, 223, 0.22), transparent 24%),
    linear-gradient(180deg, rgba(255, 247, 223, 0.14), rgba(16, 25, 39, 0.04));
}

.zone-neighborhood span,
.zone-park span,
.zone-downtown span,
.zone-office span,
.zone-stripmall span,
.zone-parking span {
  z-index: 2;
  opacity: 0.72;
  transform: scale(0.88);
  transform-origin: left top;
}

.road-svg {
  z-index: 7;
  filter:
    drop-shadow(0 6px 0 rgba(255, 247, 223, 0.82))
    drop-shadow(0 18px 10px rgba(16, 25, 39, 0.42));
}

.route-line,
.view-3d .route-line {
  stroke: #101927;
  stroke-width: 7.2;
  filter: none;
}

.route-dash,
.view-3d .route-dash {
  stroke: #ffe070;
  stroke-width: 1.08;
  stroke-dasharray: 1.15 2.25;
  opacity: 0.98;
}

.space {
  z-index: 10;
  border-color: #fff7df;
  box-shadow:
    inset 0 -10px 0 rgba(124, 82, 47, 0.18),
    inset 0 0 0 3px rgba(16, 25, 39, 0.18),
    0 0 0 4px rgba(255, 247, 223, 0.9),
    0 0 0 7px rgba(16, 25, 39, 0.2),
    0 12px 0 #8b6746,
    0 22px 22px rgba(16, 25, 39, 0.34);
}

.view-3d .space {
  box-shadow:
    inset 0 -12px 0 rgba(124, 82, 47, 0.2),
    inset 0 0 0 3px rgba(16, 25, 39, 0.18),
    0 0 0 4px rgba(255, 247, 223, 0.9),
    0 0 0 7px rgba(16, 25, 39, 0.2),
    0 16px 0 #8b6746,
    0 28px 28px rgba(16, 25, 39, 0.38);
}

.space.occupied-space,
.view-3d .space.occupied-space {
  box-shadow:
    inset 0 -10px 0 rgba(124, 82, 47, 0.18),
    inset 0 0 0 3px rgba(16, 25, 39, 0.18),
    0 0 0 4px rgba(255, 247, 223, 0.95),
    0 0 0 7px rgba(16, 25, 39, 0.22),
    0 0 28px color-mix(in srgb, var(--occupant-1, #ffd86b) 78%, transparent),
    0 0 48px color-mix(in srgb, var(--occupant-2, var(--occupant-1, #ffd86b)) 58%, transparent),
    0 12px 0 #8b6746,
    0 24px 24px rgba(16, 25, 39, 0.38);
}

.landmark {
  z-index: 4;
  opacity: 0.68;
  transform: translate(-50%, -50%) scale(0.72);
}

.landmark i {
  filter: saturate(0.82) contrast(0.9);
}

.team-piece {
  z-index: 14;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
/* Final roll overlay and car direction pass. Keep after all theme overrides. */
.board-roll-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: clamp(0.75rem, 2vw, 1.25rem);
  overflow: auto;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 216, 107, 0.42), transparent 28%),
    rgba(16, 25, 39, 0.66);
}

.board-roll-card {
  width: min(760px, calc(100vw - 2rem));
  max-height: min(760px, calc(100dvh - 2rem));
  overflow: auto;
  margin: auto;
  border: 5px solid #fff7df;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 216, 107, 0.36), transparent 28%),
    linear-gradient(180deg, #fff7df, #f4c878);
}

.board-roll-card h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.team-piece {
  transform: scaleX(-1);
  transform-origin: center;
}

.view-3d .team-piece {
  transform: translateZ(72px) scaleX(-1);
}

.team-piece.current {
  transform: scaleX(-1) scale(1.18);
}

.view-3d .team-piece.current {
  transform: translateZ(82px) scaleX(-1) scale(1.18);
}

.team-piece span {
  transform: scaleX(-1);
}

/* True final scorecard placement. Keep after all board HUD overrides. */
.score-card {
  position: sticky;
  left: 14px;
  top: 14px;
  z-index: 38;
  width: min(232px, calc(100% - 28px));
  margin: 14px 0 0 14px;
}

.map-wrap > .dice-panel {
  top: 194px;
  margin-top: 10px;
}

/* True final identity patch clock cleanup. */
.stage-header .clock {
  display: grid;
  align-content: center;
  min-height: 76px;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}

.stage-header .clock span {
  line-height: 1.1;
  margin-bottom: 0.14rem;
}

.stage-header .clock strong {
  line-height: 0.96;
}

/* True final board-game title-banner pass. Keep this block at EOF so no older identity layer wins. */
.lobby-hero {
  min-height: clamp(250px, 22vw, 330px);
  background:
    linear-gradient(90deg, rgba(255, 246, 220, 0.1), rgba(255, 246, 220, 0.34) 38%, rgba(255, 246, 220, 0.12)),
    url("assets/png-art/late-to-work-hero-boardgame.png") center / cover no-repeat,
    #f3dfb6;
}

.lobby-hero::before {
  opacity: 0.18;
  mix-blend-mode: screen;
}

.lobby-hero .mascot-lobby,
.lobby-hero .flying-paper,
.lobby-hero .coffee-splash {
  display: none;
}

.lobby-logo,
.lobby-hero p,
.lobby-tagline {
  max-width: min(640px, 52vw);
}

.lobby-logo span {
  color: #17202a;
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 247, 223, 0.65), transparent 34%),
    linear-gradient(180deg, #f2c459, #d7953d);
  box-shadow:
    2px 2px 0 rgba(168, 67, 47, 0.55),
    -2px -1px 0 rgba(54, 126, 121, 0.32),
    inset 0 -4px 0 rgba(93, 65, 32, 0.18);
}

.lobby-logo h2 {
  color: #17202a;
  text-shadow:
    3px 3px 0 rgba(168, 67, 47, 0.32),
    -2px -1px 0 rgba(54, 126, 121, 0.32),
    0 8px 0 rgba(255, 247, 223, 0.52);
}

.lobby-hero p {
  color: #26384f;
  text-shadow:
    2px 2px 0 rgba(255, 247, 223, 0.78),
    -1px 0 0 rgba(213, 149, 61, 0.24);
}

.lobby-tagline {
  color: #8a352d;
  text-shadow:
    2px 2px 0 rgba(255, 247, 223, 0.78),
    -1px 0 0 rgba(54, 126, 121, 0.2);
}

/* True final team choice PNG character models. */
.garage-card {
  grid-template-columns: 88px minmax(0, 1fr);
}

.garage-avatar {
  width: 78px;
  height: 92px;
  overflow: hidden;
  border-radius: 14px;
  background:
    radial-gradient(circle at 45% 18%, rgba(255, 247, 223, 0.72), transparent 34%),
    linear-gradient(180deg, rgba(255, 247, 223, 0.94), rgba(241, 219, 174, 0.76)),
    color-mix(in srgb, var(--team-color) 12%, #fff7df);
}

.garage-avatar .mascot-avatar {
  width: 100%;
  height: 100%;
  margin: 0;
  background-position: center top;
  background-size: auto 176px;
  filter:
    drop-shadow(0 9px 5px rgba(16, 25, 39, 0.22))
    saturate(0.96)
    contrast(1.02);
}

.garage-avatar .mascot-sleepy-sam-ready {
  background-image: url("assets/team-models/sleepy-sam.png");
}

.garage-avatar .mascot-caffeinated-casey-ready {
  background-image: url("assets/team-models/caffeinated-casey.png");
}

.garage-avatar .mascot-last-minute-lee-ready {
  background-image: url("assets/team-models/last-minute-lee.png");
}

.garage-avatar .mascot-new-hire-nora-ready {
  background-image: url("assets/team-models/new-hire-nora.png");
}

.garage-avatar .mascot-professional-pat-ready {
  background-image: url("assets/team-models/professional-pat.png");
}

/* EOF car readability override: colored outline ring, no blended aura. */
.team-piece,
.view-3d .team-piece {
  --car-glow-rgb: 224, 99, 79;
  width: 96px !important;
  height: 58px !important;
  margin: -29px 0 0 -48px !important;
  border: 0 !important;
  border-radius: 0 !important;
  overflow: visible !important;
  isolation: isolate;
  z-index: 24;
  background: transparent url("assets/board-png/car-team-1.png") center / contain no-repeat !important;
  box-shadow: none !important;
  filter: drop-shadow(0 12px 7px rgba(16, 25, 39, 0.38)) !important;
}

.team-piece.team-car-1,
.team-mini-car.team-car-1 {
  --car-glow-rgb: 224, 99, 79;
  background-image: url("assets/board-png/car-team-1.png") !important;
}

.team-piece.team-car-2,
.team-mini-car.team-car-2 {
  --car-glow-rgb: 46, 110, 166;
  background-image: url("assets/board-png/car-team-2.png") !important;
}

.team-piece.team-car-3,
.team-mini-car.team-car-3 {
  --car-glow-rgb: 80, 166, 117;
  background-image: url("assets/board-png/car-team-3.png") !important;
}

.team-piece.team-car-4,
.team-mini-car.team-car-4 {
  --car-glow-rgb: 132, 85, 181;
  background-image: url("assets/board-png/car-team-4.png") !important;
}

.team-piece.team-car-5,
.team-mini-car.team-car-5 {
  --car-glow-rgb: 216, 149, 61;
  background-image: url("assets/board-png/car-team-5.png") !important;
}

.team-piece::before,
.view-3d .team-piece::before {
  content: "";
  position: absolute;
  inset: 4px 6px 5px;
  z-index: 1;
  display: block !important;
  border: 4px solid rgb(var(--car-glow-rgb)) !important;
  border-radius: 19px 22px 15px 15px;
  background: transparent !important;
  box-shadow:
    0 0 0 2px rgba(255, 247, 223, 0.92),
    0 0 0 4px rgba(var(--car-glow-rgb), 0.34),
    0 0 8px rgba(var(--car-glow-rgb), 0.72) !important;
  filter: none !important;
  opacity: 1 !important;
  pointer-events: none;
}

.team-piece.current::before,
.view-3d .team-piece.current::before {
  border-width: 5px !important;
  box-shadow:
    0 0 0 2px rgba(255, 247, 223, 0.96),
    0 0 0 5px rgba(var(--car-glow-rgb), 0.48),
    0 0 10px rgba(var(--car-glow-rgb), 0.86),
    0 0 0 8px rgba(255, 216, 107, 0.2) !important;
}

.team-piece::after,
.view-3d .team-piece::after {
  content: "";
  position: absolute;
  left: -28px;
  top: 50%;
  z-index: 0;
  display: block !important;
  width: 28px;
  height: 7px;
  border: 0 !important;
  border-radius: 999px;
  background: rgb(var(--car-glow-rgb)) !important;
  box-shadow: 0 0 0 2px rgba(255, 247, 223, 0.72) !important;
  opacity: 0;
  transform: translateY(-50%);
  pointer-events: none;
}

.team-piece.driving,
.view-3d .team-piece.driving {
  filter: drop-shadow(0 14px 8px rgba(16, 25, 39, 0.4)) !important;
}

.team-piece.driving::after {
  opacity: 0.92;
}

.team-piece.driving span::after {
  display: none !important;
}

.team-piece span {
  position: absolute;
  left: 50%;
  top: 48%;
  z-index: 2;
  transform: translate(-50%, -50%) scaleX(-1) !important;
}

.team-mini-car {
  --car-glow-rgb: 224, 99, 79;
  filter: drop-shadow(0 8px 5px rgba(16, 25, 39, 0.28)) !important;
}

.space.occupied-space,
.view-3d .space.occupied-space {
  animation: none !important;
  box-shadow:
    inset 0 -10px 0 rgba(124, 82, 47, 0.18),
    inset 0 0 0 3px rgba(16, 25, 39, 0.18),
    0 0 0 4px rgba(255, 247, 223, 0.95),
    0 0 0 7px rgba(16, 25, 39, 0.22),
    0 12px 0 #8b6746,
    0 22px 22px rgba(16, 25, 39, 0.34) !important;
}

.team-piece.current,
.view-3d .team-piece.current {
  filter: drop-shadow(0 14px 8px rgba(16, 25, 39, 0.38)) !important;
}

/* Final response-card layout: names first, reaction PNGs on the right. */
.board-response-dock .question-response-grid {
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)) !important;
  gap: 0.42rem !important;
}

.team-answer-card {
  position: relative;
  grid-template-columns: 28px minmax(0, 1fr) 52px !important;
  grid-template-rows: auto auto auto;
  align-items: center;
  min-height: 86px;
  padding: 0.42rem 0.5rem 0.44rem !important;
  gap: 0.1rem 0.34rem !important;
}

.team-answer-card > strong {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.team-response-name,
.team-answer-card > span.team-response-name {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
  font-size: clamp(0.64rem, 0.82vw, 0.76rem);
  line-height: 1.05;
}

.team-answer-card > em {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
}

.team-answer-card .mascot-response {
  grid-column: 3;
  grid-row: 1 / span 2;
  justify-self: end;
  align-self: end;
  width: 52px;
  height: 66px;
  margin: 8px 0 -8px;
  background-position: center bottom !important;
  background-size: auto 112% !important;
  filter:
    drop-shadow(0 9px 6px rgba(16, 25, 39, 0.24))
    saturate(0.98)
    contrast(1.03);
}

.team-answer-card .answer-picks {
  grid-column: 1 / -1;
  grid-row: 3;
}

.team-answer-card .team-model-sleepy-sam.mascot-sleepy-sam-correct {
  background-image: url("assets/team-reactions/sleepy-sam-correct.png") !important;
}

.team-answer-card .team-model-sleepy-sam.mascot-sleepy-sam-incorrect {
  background-image: url("assets/team-reactions/sleepy-sam-incorrect.png") !important;
}

.team-answer-card .team-model-caffeinated-casey.mascot-caffeinated-casey-correct {
  background-image: url("assets/team-reactions/caffeinated-casey-correct.png") !important;
}

.team-answer-card .team-model-caffeinated-casey.mascot-caffeinated-casey-incorrect {
  background-image: url("assets/team-reactions/caffeinated-casey-incorrect.png") !important;
}

.team-answer-card .team-model-last-minute-lee.mascot-last-minute-lee-correct {
  background-image: url("assets/team-reactions/last-minute-lee-correct.png") !important;
}

.team-answer-card .team-model-last-minute-lee.mascot-last-minute-lee-incorrect {
  background-image: url("assets/team-reactions/last-minute-lee-incorrect.png") !important;
}

.team-answer-card .team-model-new-hire-nora.mascot-new-hire-nora-correct {
  background-image: url("assets/team-reactions/new-hire-nora-correct.png") !important;
}

.team-answer-card .team-model-new-hire-nora.mascot-new-hire-nora-incorrect {
  background-image: url("assets/team-reactions/new-hire-nora-incorrect.png") !important;
}

.team-answer-card .team-model-professional-pat.mascot-professional-pat-correct {
  background-image: url("assets/team-reactions/professional-pat-correct.png") !important;
}

.team-answer-card .team-model-professional-pat.mascot-professional-pat-incorrect {
  background-image: url("assets/team-reactions/professional-pat-incorrect.png") !important;
}

/* Final car silhouette glow: follow the PNG vehicle outline, not a separate ring. */
.team-piece,
.view-3d .team-piece {
  filter:
    drop-shadow(1px 0 0 rgb(var(--car-glow-rgb)))
    drop-shadow(-1px 0 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 1px 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 -1px 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 0 5px rgba(var(--car-glow-rgb), 0.92))
    drop-shadow(0 12px 7px rgba(16, 25, 39, 0.38)) !important;
}

.team-piece.current,
.view-3d .team-piece.current {
  filter:
    drop-shadow(1.5px 0 0 rgb(var(--car-glow-rgb)))
    drop-shadow(-1.5px 0 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 1.5px 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 -1.5px 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 0 6px rgba(var(--car-glow-rgb), 0.96))
    drop-shadow(0 14px 8px rgba(16, 25, 39, 0.38)) !important;
}

.team-piece.driving,
.view-3d .team-piece.driving {
  filter:
    drop-shadow(1.5px 0 0 rgb(var(--car-glow-rgb)))
    drop-shadow(-1.5px 0 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 1.5px 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 -1.5px 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 0 8px rgba(var(--car-glow-rgb), 1))
    drop-shadow(0 14px 8px rgba(16, 25, 39, 0.4)) !important;
}

.team-piece::before,
.view-3d .team-piece::before,
.team-piece.current::before,
.view-3d .team-piece.current::before {
  display: none !important;
  content: none !important;
}

.team-piece::after,
.view-3d .team-piece::after {
  background: rgb(var(--car-glow-rgb)) !important;
  box-shadow:
    0 0 0 2px rgba(255, 247, 223, 0.72),
    0 0 7px rgba(var(--car-glow-rgb), 0.68) !important;
}

.team-piece span,
.view-3d .team-piece span {
  width: 18px !important;
  height: 18px !important;
  border: 2px solid rgba(255, 247, 223, 0.95) !important;
  border-radius: 50% !important;
  background: rgba(16, 25, 39, 0.86) !important;
  color: #fff7df !important;
  box-shadow: 0 2px 3px rgba(16, 25, 39, 0.34) !important;
  font-size: 0.54rem !important;
  line-height: 1 !important;
}

/* Force the cleaned car PNGs to load; older cached files had rectangle backing. */
.team-piece.team-car-1,
.team-mini-car.team-car-1 {
  background-image: url("assets/board-png/car-team-1.png?v=clean-cars-1") !important;
}

.team-piece.team-car-2,
.team-mini-car.team-car-2 {
  background-image: url("assets/board-png/car-team-2.png?v=clean-cars-1") !important;
}

.team-piece.team-car-3,
.team-mini-car.team-car-3 {
  background-image: url("assets/board-png/car-team-3.png?v=clean-cars-1") !important;
}

.team-piece.team-car-4,
.team-mini-car.team-car-4 {
  background-image: url("assets/board-png/car-team-4.png?v=clean-cars-1") !important;
}

.team-piece.team-car-5,
.team-mini-car.team-car-5 {
  background-image: url("assets/board-png/car-team-5.png?v=clean-cars-1") !important;
}

.space.occupied-space,
.view-3d .space.occupied-space {
  animation: none !important;
  border-color: #fff7df !important;
  box-shadow:
    inset 0 -10px 0 rgba(124, 82, 47, 0.18),
    inset 0 0 0 3px rgba(16, 25, 39, 0.18),
    0 0 0 4px rgba(255, 247, 223, 0.95),
    0 0 0 7px rgba(16, 25, 39, 0.22),
    0 12px 0 #8b6746,
    0 22px 22px rgba(16, 25, 39, 0.34) !important;
}

/* Use real PNG image alpha for the car glow; backgrounds filter as rectangles. */
.team-piece,
.view-3d .team-piece,
.team-piece.current,
.view-3d .team-piece.current,
.team-piece.driving,
.view-3d .team-piece.driving {
  background: none !important;
  background-image: none !important;
  filter: none !important;
}

.team-car-sprite {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  filter:
    drop-shadow(1px 0 0 rgb(var(--car-glow-rgb)))
    drop-shadow(-1px 0 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 1px 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 -1px 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 0 5px rgba(var(--car-glow-rgb), 0.9))
    drop-shadow(0 12px 7px rgba(16, 25, 39, 0.38));
}

.team-piece.current .team-car-sprite {
  filter:
    drop-shadow(1.5px 0 0 rgb(var(--car-glow-rgb)))
    drop-shadow(-1.5px 0 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 1.5px 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 -1.5px 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 0 6px rgba(var(--car-glow-rgb), 0.96))
    drop-shadow(0 14px 8px rgba(16, 25, 39, 0.38));
}

.team-piece.driving .team-car-sprite {
  filter:
    drop-shadow(1.5px 0 0 rgb(var(--car-glow-rgb)))
    drop-shadow(-1.5px 0 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 1.5px 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 -1.5px 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 0 8px rgba(var(--car-glow-rgb), 1))
    drop-shadow(0 14px 8px rgba(16, 25, 39, 0.4));
}

.team-piece span,
.view-3d .team-piece span {
  z-index: 2;
}

/* Presentation pass: Don't Be Late to Work identity, setup controls, mall zone, and clearer PNG outlines. */
.topbar {
  grid-template-columns: minmax(0, 1fr) auto;
}

.topbar-mascot {
  display: none !important;
}

.brand h1 {
  display: flex;
  align-items: baseline;
  gap: 0.34rem;
  flex-wrap: wrap;
}

.brand-kicker {
  font-size: 0.46em;
  line-height: 1;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  color: #ffd968;
  text-shadow:
    0 2px 0 rgba(12, 22, 36, 0.55),
    0 0 10px rgba(255, 217, 104, 0.22);
}

.lobby-logo h2 {
  display: flex;
  align-items: baseline;
  gap: 0.42rem;
  flex-wrap: wrap;
}

.lobby-logo h2 small {
  font-size: 0.34em;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffd968;
  text-shadow: 0 2px 0 rgba(12, 22, 36, 0.54);
}

.team-count-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.72rem;
}

.team-count-label {
  min-width: 5.5rem;
  color: #253449;
  font-weight: 950;
  letter-spacing: 0.01em;
  text-align: center;
}

.team-count-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 3px solid rgba(255, 247, 223, 0.96);
  border-radius: 50%;
  color: #fff7df;
  cursor: pointer;
  font-size: 1.45rem;
  font-weight: 950;
  line-height: 1;
  box-shadow:
    0 4px 0 rgba(73, 54, 35, 0.3),
    0 9px 14px rgba(16, 25, 39, 0.22);
}

.team-count-btn > span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  line-height: 1;
  transform: translateY(-1px);
}

.team-count-btn.add {
  background: linear-gradient(180deg, #42c87d, #218f58);
}

.team-count-btn.remove {
  background: linear-gradient(180deg, #ef7668, #bf3e37);
}

.team-count-btn:disabled {
  cursor: not-allowed;
  filter: grayscale(0.65);
  opacity: 0.48;
}

.zone-mall {
  --zone-art: url("assets/zones/mall.png?v=mall-1");
  background:
    linear-gradient(135deg, rgba(255, 247, 223, 0.54), rgba(183, 137, 78, 0.22)),
    #cfa96d !important;
}

.zone-neighborhood::after,
.zone-park::after,
.zone-downtown::after,
.zone-office::after,
.zone-stripmall::after,
.zone-mall::after {
  inset: 2%;
  background-image: var(--zone-art);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 118% auto;
  opacity: 0.34;
  filter: saturate(0.95) contrast(1.08);
  transform: scale(1.08);
}

.zone-neighborhood span,
.zone-park span,
.zone-downtown span,
.zone-office span,
.zone-stripmall span,
.zone-mall span {
  opacity: 0.88;
}

.team-answer-card .team-model-sleepy-sam.mascot-sleepy-sam-correct,
.header-reaction .team-model-sleepy-sam.mascot-sleepy-sam-correct {
  background-image: url("assets/team-reactions/sleepy-sam-correct.png?v=reaction-2") !important;
}

.team-answer-card .team-model-sleepy-sam.mascot-sleepy-sam-incorrect,
.header-reaction .team-model-sleepy-sam.mascot-sleepy-sam-incorrect {
  background-image: url("assets/team-reactions/sleepy-sam-incorrect.png?v=reaction-2") !important;
}

.team-answer-card .team-model-caffeinated-casey.mascot-caffeinated-casey-correct,
.header-reaction .team-model-caffeinated-casey.mascot-caffeinated-casey-correct {
  background-image: url("assets/team-reactions/caffeinated-casey-correct.png?v=reaction-2") !important;
}

.team-answer-card .team-model-caffeinated-casey.mascot-caffeinated-casey-incorrect,
.header-reaction .team-model-caffeinated-casey.mascot-caffeinated-casey-incorrect {
  background-image: url("assets/team-reactions/caffeinated-casey-incorrect.png?v=reaction-2") !important;
}

.team-answer-card .team-model-last-minute-lee.mascot-last-minute-lee-correct,
.header-reaction .team-model-last-minute-lee.mascot-last-minute-lee-correct {
  background-image: url("assets/team-reactions/last-minute-lee-correct.png?v=reaction-2") !important;
}

.team-answer-card .team-model-last-minute-lee.mascot-last-minute-lee-incorrect,
.header-reaction .team-model-last-minute-lee.mascot-last-minute-lee-incorrect {
  background-image: url("assets/team-reactions/last-minute-lee-incorrect.png?v=reaction-2") !important;
}

.team-answer-card .team-model-new-hire-nora.mascot-new-hire-nora-correct,
.header-reaction .team-model-new-hire-nora.mascot-new-hire-nora-correct {
  background-image: url("assets/team-reactions/new-hire-nora-correct.png?v=reaction-2") !important;
}

.team-answer-card .team-model-new-hire-nora.mascot-new-hire-nora-incorrect,
.header-reaction .team-model-new-hire-nora.mascot-new-hire-nora-incorrect {
  background-image: url("assets/team-reactions/new-hire-nora-incorrect.png?v=reaction-2") !important;
}

.team-answer-card .team-model-professional-pat.mascot-professional-pat-correct,
.header-reaction .team-model-professional-pat.mascot-professional-pat-correct {
  background-image: url("assets/team-reactions/professional-pat-correct.png?v=reaction-2") !important;
}

.team-answer-card .team-model-professional-pat.mascot-professional-pat-incorrect,
.header-reaction .team-model-professional-pat.mascot-professional-pat-incorrect {
  background-image: url("assets/team-reactions/professional-pat-incorrect.png?v=reaction-2") !important;
}

.team-car-sprite {
  filter:
    drop-shadow(1.8px 0 0 rgb(var(--car-glow-rgb)))
    drop-shadow(-1.8px 0 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 1.8px 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 -1.8px 0 rgb(var(--car-glow-rgb)))
    drop-shadow(1.2px 1.2px 0 rgba(var(--car-glow-rgb), 0.96))
    drop-shadow(-1.2px -1.2px 0 rgba(var(--car-glow-rgb), 0.96))
    drop-shadow(0 0 9px rgba(var(--car-glow-rgb), 1))
    drop-shadow(0 0 16px rgba(var(--car-glow-rgb), 0.58))
    drop-shadow(0 12px 7px rgba(16, 25, 39, 0.38)) !important;
}

.team-piece.current .team-car-sprite {
  filter:
    drop-shadow(2.25px 0 0 rgb(var(--car-glow-rgb)))
    drop-shadow(-2.25px 0 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 2.25px 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 -2.25px 0 rgb(var(--car-glow-rgb)))
    drop-shadow(1.5px 1.5px 0 rgba(var(--car-glow-rgb), 1))
    drop-shadow(-1.5px -1.5px 0 rgba(var(--car-glow-rgb), 1))
    drop-shadow(0 0 12px rgba(var(--car-glow-rgb), 1))
    drop-shadow(0 0 22px rgba(var(--car-glow-rgb), 0.68))
    drop-shadow(0 14px 8px rgba(16, 25, 39, 0.4)) !important;
}

.team-piece.driving .team-car-sprite {
  filter:
    drop-shadow(2.4px 0 0 rgb(var(--car-glow-rgb)))
    drop-shadow(-2.4px 0 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 2.4px 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 -2.4px 0 rgb(var(--car-glow-rgb)))
    drop-shadow(1.7px 1.7px 0 rgba(var(--car-glow-rgb), 1))
    drop-shadow(-1.7px -1.7px 0 rgba(var(--car-glow-rgb), 1))
    drop-shadow(0 0 14px rgba(var(--car-glow-rgb), 1))
    drop-shadow(0 0 26px rgba(var(--car-glow-rgb), 0.72))
    drop-shadow(0 14px 8px rgba(16, 25, 39, 0.42)) !important;
}

/* Gameplay HUD and traveling neon car border. */
.board-hud {
  position: sticky;
  left: 14px;
  top: 14px;
  z-index: 38;
  width: 0;
  height: 0;
  overflow: visible;
  pointer-events: none;
}

.board-hud-inner {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: max-content;
}

.board-hud .score-card,
.board-hud .dice-panel {
  position: static !important;
  margin: 0 !important;
  pointer-events: auto;
}

.board-hud .score-card {
  width: 232px;
}

.board-hud .dice-panel {
  width: 178px;
}

.team-car-sprite {
  filter: drop-shadow(0 10px 6px rgba(16, 25, 39, 0.42)) !important;
}

.team-car-neon {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  filter:
    brightness(0)
    drop-shadow(2.4px 0 0 rgb(var(--car-glow-rgb)))
    drop-shadow(-2.4px 0 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 2.4px 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 -2.4px 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 0 5px rgba(var(--car-glow-rgb), 0.72));
  animation: neonBorderTravel 1.45s linear infinite;
}

.team-piece.current .team-car-neon,
.team-piece.driving .team-car-neon {
  animation-duration: 0.86s;
}

@keyframes neonBorderTravel {
  0% {
    filter: brightness(0) drop-shadow(2.4px 0 0 rgb(var(--car-glow-rgb))) drop-shadow(-2.4px 0 0 rgb(var(--car-glow-rgb))) drop-shadow(0 2.4px 0 rgb(var(--car-glow-rgb))) drop-shadow(0 -2.4px 0 rgb(var(--car-glow-rgb))) drop-shadow(-5px -2px 2px rgba(var(--car-glow-rgb), 0.98));
  }
  25% {
    filter: brightness(0) drop-shadow(2.4px 0 0 rgb(var(--car-glow-rgb))) drop-shadow(-2.4px 0 0 rgb(var(--car-glow-rgb))) drop-shadow(0 2.4px 0 rgb(var(--car-glow-rgb))) drop-shadow(0 -2.4px 0 rgb(var(--car-glow-rgb))) drop-shadow(5px -2px 2px rgba(var(--car-glow-rgb), 0.98));
  }
  50% {
    filter: brightness(0) drop-shadow(2.4px 0 0 rgb(var(--car-glow-rgb))) drop-shadow(-2.4px 0 0 rgb(var(--car-glow-rgb))) drop-shadow(0 2.4px 0 rgb(var(--car-glow-rgb))) drop-shadow(0 -2.4px 0 rgb(var(--car-glow-rgb))) drop-shadow(5px 3px 2px rgba(var(--car-glow-rgb), 0.98));
  }
  75% {
    filter: brightness(0) drop-shadow(2.4px 0 0 rgb(var(--car-glow-rgb))) drop-shadow(-2.4px 0 0 rgb(var(--car-glow-rgb))) drop-shadow(0 2.4px 0 rgb(var(--car-glow-rgb))) drop-shadow(0 -2.4px 0 rgb(var(--car-glow-rgb))) drop-shadow(-5px 3px 2px rgba(var(--car-glow-rgb), 0.98));
  }
  100% {
    filter: brightness(0) drop-shadow(2.4px 0 0 rgb(var(--car-glow-rgb))) drop-shadow(-2.4px 0 0 rgb(var(--car-glow-rgb))) drop-shadow(0 2.4px 0 rgb(var(--car-glow-rgb))) drop-shadow(0 -2.4px 0 rgb(var(--car-glow-rgb))) drop-shadow(-5px -2px 2px rgba(var(--car-glow-rgb), 0.98));
  }
}

.zone-mall {
  --zone-art: url("assets/zones/mall.png?v=mall-2");
}

@media (max-width: 640px) {
  .board-hud-inner {
    gap: 8px;
  }

  .board-hud .score-card {
    width: 190px;
  }

  .board-hud .dice-panel {
    width: 146px;
  }
}

body:has(.game-layout) {
  overflow-x: hidden;
}

.game-layout,
.game-layout .stage,
.drive-canvas-shell,
.board-response-dock {
  min-width: 0;
  max-width: 100%;
}

.board-response-dock {
  overflow: hidden;
}

/* Reaction reset: the route tiles stay quiet while the district art carries the setting. */
.space .tile-art,
.space .tile-icon {
  display: none !important;
}

.zone-mall {
  --zone-art: none;
  background:
    linear-gradient(rgba(255, 247, 223, 0.32), rgba(255, 247, 223, 0.4)),
    url("assets/zones/mall.png?v=mall-3") center / cover no-repeat !important;
}

.zone-mall::after {
  content: none !important;
  display: none !important;
}

.board-response-dock .question-response-grid {
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)) !important;
}

.board-response-dock .question-response-grid:has(.team-answer-card:nth-child(4)) {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.team-answer-card {
  grid-template-columns: 28px minmax(0, 1fr) 68px !important;
  min-height: 96px;
  overflow: hidden;
}

.team-answer-card .mascot-response {
  width: 60px;
  height: 82px;
  margin: 1px 0 -5px;
  background-position: center bottom !important;
  background-size: contain !important;
  filter: drop-shadow(0 7px 5px rgba(16, 25, 39, 0.24));
}

.team-answer-card .team-model-sleepy-sam.mascot-sleepy-sam-correct,
.header-reaction .team-model-sleepy-sam.mascot-sleepy-sam-correct {
  background-image: url("assets/team-reactions/sleepy-sam-correct.png?v=reaction-3") !important;
}

.team-answer-card .team-model-sleepy-sam.mascot-sleepy-sam-incorrect,
.header-reaction .team-model-sleepy-sam.mascot-sleepy-sam-incorrect {
  background-image: url("assets/team-reactions/sleepy-sam-incorrect.png?v=reaction-3") !important;
}

.team-answer-card .team-model-caffeinated-casey.mascot-caffeinated-casey-correct,
.header-reaction .team-model-caffeinated-casey.mascot-caffeinated-casey-correct {
  background-image: url("assets/team-reactions/caffeinated-casey-correct.png?v=reaction-3") !important;
}

.team-answer-card .team-model-caffeinated-casey.mascot-caffeinated-casey-incorrect,
.header-reaction .team-model-caffeinated-casey.mascot-caffeinated-casey-incorrect {
  background-image: url("assets/team-reactions/caffeinated-casey-incorrect.png?v=reaction-3") !important;
}

.team-answer-card .team-model-last-minute-lee.mascot-last-minute-lee-correct,
.header-reaction .team-model-last-minute-lee.mascot-last-minute-lee-correct {
  background-image: url("assets/team-reactions/last-minute-lee-correct.png?v=reaction-3") !important;
}

.team-answer-card .team-model-last-minute-lee.mascot-last-minute-lee-incorrect,
.header-reaction .team-model-last-minute-lee.mascot-last-minute-lee-incorrect {
  background-image: url("assets/team-reactions/last-minute-lee-incorrect.png?v=reaction-3") !important;
}

.team-answer-card .team-model-new-hire-nora.mascot-new-hire-nora-correct,
.header-reaction .team-model-new-hire-nora.mascot-new-hire-nora-correct {
  background-image: url("assets/team-reactions/new-hire-nora-correct.png?v=reaction-3") !important;
}

.team-answer-card .team-model-new-hire-nora.mascot-new-hire-nora-incorrect,
.header-reaction .team-model-new-hire-nora.mascot-new-hire-nora-incorrect {
  background-image: url("assets/team-reactions/new-hire-nora-incorrect.png?v=reaction-3") !important;
}

.team-answer-card .team-model-professional-pat.mascot-professional-pat-correct,
.header-reaction .team-model-professional-pat.mascot-professional-pat-correct {
  background-image: url("assets/team-reactions/professional-pat-correct.png?v=reaction-3") !important;
}

.team-answer-card .team-model-professional-pat.mascot-professional-pat-incorrect,
.header-reaction .team-model-professional-pat.mascot-professional-pat-incorrect {
  background-image: url("assets/team-reactions/professional-pat-incorrect.png?v=reaction-3") !important;
}

/* Car roster: active player identity. Human artwork remains available as an archived theme. */
.car-identity {
  position: relative;
  display: block;
  min-width: 0;
  background: transparent !important;
  isolation: isolate;
}

.car-identity > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  filter:
    drop-shadow(1px 0 0 rgb(var(--car-glow-rgb)))
    drop-shadow(-1px 0 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 1px 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 -1px 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 7px 5px rgba(16, 25, 39, 0.28));
}

.car-pose-correct > img,
.car-pose-luck > img,
.car-pose-arrived > img {
  transform: translateY(-3px) rotate(-1deg);
  filter:
    drop-shadow(1px 0 0 rgb(var(--car-glow-rgb)))
    drop-shadow(-1px 0 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 1px 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 -1px 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 0 8px rgba(35, 181, 105, 0.72))
    drop-shadow(0 8px 5px rgba(16, 25, 39, 0.28));
}

.car-pose-incorrect > img,
.car-pose-oops > img,
.car-pose-late > img {
  transform: translateY(3px) rotate(1deg);
  filter:
    saturate(0.78)
    drop-shadow(1px 0 0 rgb(var(--car-glow-rgb)))
    drop-shadow(-1px 0 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 1px 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 -1px 0 rgb(var(--car-glow-rgb)))
    drop-shadow(0 0 7px rgba(218, 72, 63, 0.64))
    drop-shadow(0 8px 5px rgba(16, 25, 39, 0.28));
}

.team-garage {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  align-items: stretch;
}

.garage-card {
  display: grid !important;
  grid-template-columns: 102px minmax(0, 1fr) !important;
  grid-template-rows: auto auto auto !important;
  align-items: center;
  gap: 0.42rem 0.62rem !important;
  min-width: 0;
  padding: 0.7rem !important;
}

.garage-avatar {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 96px !important;
  height: 72px !important;
  border: 3px solid color-mix(in srgb, var(--team-color) 64%, #fff7df) !important;
  border-radius: 8px !important;
  background:
    linear-gradient(180deg, rgba(255, 247, 223, 0.92), rgba(241, 219, 174, 0.72)),
    color-mix(in srgb, var(--team-color) 12%, #fff7df) !important;
  box-shadow: inset 0 -5px 0 rgba(16, 25, 39, 0.08), 0 6px 0 rgba(16, 25, 39, 0.12);
}

.garage-avatar .garage-car {
  width: 100%;
  height: 100%;
  padding: 5px;
}

.garage-copy {
  grid-column: 2;
  grid-row: 1;
}

.garage-card > input {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  width: 100%;
}

.garage-picks {
  grid-column: 1 / -1;
  grid-row: 3;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.46rem;
}

.garage-field {
  display: grid;
  gap: 0.24rem;
  min-width: 0;
}

.garage-field > span {
  color: #5a472b;
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.garage-field select {
  width: 100%;
  min-width: 0;
}

.lobby-hero .lobby-car {
  position: absolute;
  z-index: 1;
  width: clamp(170px, 22vw, 280px);
  height: clamp(86px, 12vw, 144px);
  opacity: 0.96;
}

.lobby-car-left {
  left: -3%;
  bottom: 0;
  transform: rotate(-3deg);
}

.lobby-car-right {
  right: -3%;
  bottom: 0;
  transform: scaleX(-1) rotate(-3deg);
}

.header-reaction .stage-car {
  width: 78px;
  height: 46px;
}

.challenge-mascot .panel-car {
  width: 94px;
  height: 56px;
}

.header-reaction {
  display: grid !important;
  grid-template-columns: 78px minmax(0, 1fr) !important;
  align-items: center;
  gap: 0.5rem !important;
}

.challenge-mascot {
  display: grid !important;
  grid-template-columns: 94px minmax(0, 1fr) !important;
  align-items: center;
  gap: 0.62rem !important;
}

.team-answer-card {
  grid-template-columns: 28px minmax(0, 1fr) 66px !important;
}

.team-answer-card .response-car {
  grid-column: 3;
  grid-row: 1 / span 2;
  justify-self: end;
  align-self: center;
  width: 64px;
  height: 48px;
}

.assigned-card .card-car {
  width: 112px;
  height: 66px;
  margin: 0 auto 0.35rem;
}

.endgame-mascot-wrap .endgame-car {
  width: min(280px, 42vw);
  height: min(142px, 22vw);
  margin: 0 auto;
}

.how-step .how-car,
.how-step .car-identity {
  width: 112px;
  height: 64px;
  margin: 0 auto 0.3rem;
}

.roll-team .team-mini-car {
  width: 112px !important;
  height: 60px !important;
  margin: 0 auto 0.2rem;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.roll-team .team-mini-car::before,
.roll-team .team-mini-car::after {
  content: none !important;
  display: none !important;
}

.score-row > span {
  display: grid;
  gap: 1px;
  line-height: 1.02;
}

.score-row > span small {
  color: #6c5a3d;
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 820px) {
  .team-garage {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 520px) {
  .garage-picks {
    grid-template-columns: 1fr;
  }

  .lobby-hero .lobby-car {
    width: 150px;
    height: 78px;
    opacity: 0.72;
  }
}

/* Setup identity pass: stacked title lockup, purposeful clock art, and shared tabletop backdrop. */
body:has(.setup-wrap),
.main:has(.setup-wrap) {
  background:
    linear-gradient(90deg, rgba(255, 247, 223, 0.055) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(0deg, rgba(255, 247, 223, 0.04) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(135deg, #51626b 0%, #3f535d 52%, #35464f 100%) !important;
}

.lobby-logo {
  align-items: center;
}

.lobby-logo h2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  justify-items: start;
  gap: 0.08rem;
  line-height: 0.86;
  text-align: left;
}

.lobby-logo h2 small {
  display: block;
  margin: 0 0 0.08rem 0.2rem;
  font-size: 0.3em;
  line-height: 1;
}

.lobby-hero::before {
  content: none !important;
  display: none !important;
}

/* Cohesive town pass: one living board, one race dashboard, quieter controls. */
.main.game-main {
  padding: 0.45rem;
  background: #344750 !important;
}

.game-layout {
  gap: 0.55rem;
}

.game-layout .stage {
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
}

.map-command-bar {
  min-height: 54px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  padding: 0.38rem 0.55rem 0.42rem;
  border: 0;
  color: #fff7df;
  background: #263345;
}

.stage-phase {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 900;
}

.stage-phase i {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: #f2b84b;
  box-shadow: 0 0 0 4px rgba(242, 184, 75, 0.16);
}

.stage-phase span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-command-bar .board-tools {
  display: flex;
  justify-self: end;
  gap: 0.28rem;
}

.map-command-bar .board-tools button {
  min-width: 40px;
  min-height: 36px;
  padding: 0.35rem 0.52rem;
  border: 1px solid #637487;
  border-radius: 4px;
  color: #fff7df;
  background: #35485c;
  box-shadow: none;
}

.map-command-bar .board-tools button:hover,
.map-command-bar .board-tools .view-toggle.active {
  border-color: #f2b84b;
  color: #17202a;
  background: #f2b84b;
}

.map-wrap,
.map-wrap.view-3d {
  height: clamp(500px, calc(100dvh - 170px), 790px);
  border: 0;
  background: #2d3d45 !important;
  box-shadow: inset 0 0 0 1px rgba(255, 247, 223, 0.12);
}

.trivia-expanded .map-wrap,
.trivia-expanded .map-wrap.view-3d {
  height: clamp(390px, calc(100dvh - 342px), 590px);
}

.map-scale-frame {
  padding: 0;
}

.map-canvas,
.view-3d .map-canvas {
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(255, 247, 223, 0.06) 1px, transparent 1px) 0 0 / 82px 82px,
    linear-gradient(0deg, rgba(23, 32, 42, 0.045) 1px, transparent 1px) 0 0 / 82px 82px,
    linear-gradient(180deg, #dceee6 0%, #c9e2c0 48%, #a6d17f 100%);
  box-shadow: none;
}

.view-3d .map-canvas::before {
  content: none;
}

.map-canvas::after {
  opacity: 0.08;
}

.map-zone,
.zone-neighborhood,
.zone-park,
.zone-downtown,
.zone-office,
.zone-stripmall,
.zone-mall {
  border: 0 !important;
  border-radius: 18px !important;
  background: transparent !important;
  box-shadow: none !important;
  opacity: 1 !important;
}

.zone-neighborhood::before,
.zone-park::before,
.zone-downtown::before,
.zone-office::before,
.zone-stripmall::before,
.zone-mall::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: var(--zone-wash, rgba(255, 247, 223, 0.18));
  opacity: 0.52;
}

.zone-neighborhood { --zone-wash: rgba(225, 194, 126, 0.34); }
.zone-park { --zone-wash: rgba(77, 160, 82, 0.2); }
.zone-downtown { --zone-wash: rgba(85, 155, 182, 0.22); }
.zone-office { --zone-wash: rgba(130, 112, 178, 0.2); }
.zone-stripmall { --zone-wash: rgba(180, 130, 72, 0.2); }
.zone-mall { --zone-wash: rgba(72, 139, 154, 0.18); }

.zone-neighborhood::after,
.zone-park::after,
.zone-downtown::after,
.zone-office::after,
.zone-stripmall::after,
.zone-mall::after {
  content: "" !important;
  display: block !important;
  position: absolute;
  inset: -3% !important;
  z-index: 0;
  border-radius: 18px !important;
  background-image: var(--zone-art) !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-size: cover !important;
  opacity: 0.3 !important;
  filter: saturate(0.82) contrast(0.88) !important;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 58%, transparent 100%);
  mask-image: radial-gradient(ellipse at center, #000 58%, transparent 100%);
  transform: none !important;
}

.map-zone > span {
  left: 14px;
  top: 12px;
  z-index: 2;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: rgba(23, 32, 42, 0.68);
  background: transparent;
  box-shadow: none;
  font-size: 0.7rem;
  letter-spacing: 0;
  text-shadow: 0 1px 0 rgba(255, 247, 223, 0.9);
  transform: none;
}

.road-svg {
  z-index: 7;
  filter:
    drop-shadow(0 3px 0 rgba(255, 239, 190, 0.82))
    drop-shadow(0 11px 8px rgba(16, 25, 39, 0.3));
}

.route-line,
.view-3d .route-line,
.route-line.freeway,
.route-line.side,
.view-3d .route-line.freeway,
.view-3d .route-line.side {
  stroke: #18242d;
  stroke-width: 6.35;
  filter: none;
}

.route-dash,
.view-3d .route-dash,
.route-dash.freeway,
.route-dash.side {
  stroke: #f5cf59;
  stroke-width: 0.72;
  stroke-dasharray: 1.4 2.8;
  opacity: 0.92;
  filter: none;
}

.road-world-details {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}

.crosswalk {
  position: absolute;
  width: 78px;
  height: 44px;
  border-radius: 4px;
  background: repeating-linear-gradient(90deg, rgba(255, 247, 223, 0.9) 0 8px, transparent 8px 15px);
  opacity: 0.78;
}

.crosswalk-home {
  left: 14.7%;
  top: 75.2%;
  transform: rotate(2deg);
}

.crosswalk-downtown {
  left: 73.3%;
  top: 47.8%;
  transform: rotate(90deg);
}

.street-arrow {
  position: absolute;
  color: rgba(255, 247, 223, 0.74);
  font-size: 2.25rem;
  font-weight: 900;
  line-height: 1;
}

.arrow-one { left: 42%; top: 64.5%; }
.arrow-two { left: 84%; top: 18%; transform: rotate(-8deg); }

.street-light {
  position: absolute;
  display: grid;
  gap: 3px;
  width: 22px;
  padding: 5px;
  border: 2px solid #fff7df;
  border-radius: 8px;
  background: #263345;
  box-shadow: 0 6px 6px rgba(16, 25, 39, 0.22);
}

.street-light i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5b6670;
}

.street-light i:first-child { --signal-color: #dc5448; animation: townSignal 8s steps(1, end) infinite; }
.street-light i:nth-child(2) { --signal-color: #f2b84b; animation: townSignal 8s steps(1, end) 2.5s infinite; }
.street-light i:last-child { --signal-color: #50a675; animation: townSignal 8s steps(1, end) 5s infinite; }
.light-one { left: 72.5%; top: 41%; }

.street-sign {
  position: absolute;
  left: 88%;
  top: 11%;
  padding: 0.2rem 0.36rem;
  border: 2px solid #fff7df;
  border-radius: 3px;
  color: #fff7df;
  background: #2e6ea6;
  font-size: 0.55rem;
  font-weight: 900;
}

.town-ambient {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.ambient-cloud {
  position: absolute;
  width: 110px;
  height: 28px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.26);
  filter: blur(1px);
  animation: townCloudDrift 24s ease-in-out infinite alternate;
}

.cloud-one { left: 12%; top: 8%; }
.cloud-two { left: 49%; top: 17%; animation-delay: -9s; }

.ambient-tree {
  position: absolute;
  width: 34px;
  height: 46px;
  border-radius: 48% 52% 42% 58%;
  background: #579852;
  box-shadow: inset -8px -8px 0 rgba(35, 103, 55, 0.2), 0 7px 5px rgba(16, 25, 39, 0.12);
  transform-origin: 50% 100%;
  animation: townTreeSway 4.8s ease-in-out infinite alternate;
}

.tree-one { left: 43%; top: 74%; }
.tree-two { left: 55%; top: 67%; animation-delay: -2s; }

.ambient-fountain {
  position: absolute;
  left: 68%;
  top: 69%;
  width: 74px;
  height: 28px;
  border: 5px solid rgba(255, 247, 223, 0.58);
  border-radius: 50%;
  background: rgba(77, 157, 186, 0.35);
}

.ambient-fountain b {
  position: absolute;
  left: 50%;
  bottom: 12px;
  width: 8px;
  height: 30px;
  border-radius: 50%;
  border-left: 4px solid rgba(223, 246, 255, 0.68);
  border-right: 4px solid rgba(223, 246, 255, 0.68);
  transform: translateX(-50%);
  animation: townFountain 1.8s ease-in-out infinite alternate;
}

.ambient-coffee-steam {
  position: absolute;
  left: 43%;
  top: 40%;
  width: 18px;
  height: 54px;
  border-left: 4px solid rgba(255, 247, 223, 0.5);
  border-radius: 50%;
  animation: coffeeSteam 3s ease-in-out infinite;
}

.space.normal,
.view-3d .space.normal {
  z-index: 10;
  width: 58px;
  height: 48px;
  margin: -24px 0 0 -29px;
  padding: 0;
  grid-template-rows: 1fr;
  border: 2px solid rgba(255, 226, 118, 0.88);
  border-radius: 10px;
  color: #fff7df;
  background: rgba(38, 51, 69, 0.92);
  box-shadow: 0 3px 0 rgba(16, 25, 39, 0.26), 0 5px 8px rgba(16, 25, 39, 0.18);
  transform: translateZ(18px);
}

.space.normal::before {
  content: none;
}

.space.normal .tile-number {
  position: static;
  min-width: 0;
  padding: 0;
  color: #fff7df;
  background: transparent;
  font-size: 0.72rem;
  line-height: 1;
}

.space.normal.occupied-space,
.view-3d .space.normal.occupied-space {
  border-color: #fff7df;
  box-shadow: 0 3px 0 rgba(16, 25, 39, 0.26), 0 5px 8px rgba(16, 25, 39, 0.18);
}

.space:not(.normal),
.view-3d .space:not(.normal) {
  border-width: 3px;
  border-radius: 14px;
  box-shadow: 0 7px 0 rgba(90, 66, 42, 0.28), 0 12px 16px rgba(16, 25, 39, 0.24);
}

.space:not(.normal).occupied-space,
.view-3d .space:not(.normal).occupied-space {
  box-shadow: 0 7px 0 rgba(90, 66, 42, 0.28), 0 12px 16px rgba(16, 25, 39, 0.24);
}

.route-sign {
  border-width: 2px;
  border-radius: 5px;
  box-shadow: 0 7px 8px rgba(23, 32, 42, 0.2);
}

.team-piece,
.view-3d .team-piece {
  z-index: 18;
  transition:
    left 620ms cubic-bezier(0.2, 0.78, 0.22, 1),
    top 620ms cubic-bezier(0.2, 0.78, 0.22, 1),
    transform 180ms ease;
}

.team-piece:not(.driving) .team-car-sprite {
  animation: carIdleTown 2.4s ease-in-out infinite;
}

.team-piece:nth-of-type(even):not(.driving) .team-car-sprite {
  animation-delay: -1.1s;
}

.team-piece.driving-forward .team-car-sprite {
  animation: carDriveTown 300ms ease-in-out infinite alternate;
}

.team-piece.driving-backward .team-car-sprite {
  animation: carBrakeTown 240ms ease-in-out infinite alternate;
  filter: saturate(0.82) drop-shadow(0 10px 6px rgba(16, 25, 39, 0.42)) !important;
}

.team-piece.driving-backward::after {
  content: "" !important;
  display: block !important;
  position: absolute;
  right: 74%;
  bottom: 5px;
  width: 28px;
  height: 3px;
  border-radius: 4px;
  background: rgba(38, 51, 69, 0.72);
  box-shadow: -11px -5px 0 rgba(38, 51, 69, 0.35);
  animation: brakeMark 460ms ease-out infinite;
}

.race-dashboard {
  position: sticky;
  left: 14px;
  top: 14px;
  z-index: 42;
  width: 222px;
  margin: 14px 0 -460px 14px;
  padding: 0.82rem;
  color: #fff7df;
  background: rgba(30, 43, 56, 0.94);
  border: 2px solid rgba(255, 247, 223, 0.5);
  border-radius: 6px;
  box-shadow: 0 12px 24px rgba(16, 25, 39, 0.28);
  backdrop-filter: blur(9px);
  pointer-events: auto;
}

.race-dashboard .clock {
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
}

.race-dashboard .clock span,
.dashboard-status span,
.dice-panel-copy span {
  display: block;
  color: #9fb1bd;
  font-size: 0.6rem;
  font-weight: 900;
  text-transform: uppercase;
}

.race-dashboard .clock strong {
  margin-top: 0.08rem;
  color: #fff7df;
  font-size: 2rem;
  line-height: 1;
}

.dashboard-status {
  margin-top: 0.48rem;
}

.dashboard-status strong {
  display: block;
  margin-top: 0.08rem;
  color: #f2b84b;
  font-size: 0.84rem;
}

.dashboard-divider {
  height: 1px;
  margin: 0.68rem 0;
  background: rgba(255, 247, 223, 0.18);
}

.race-dashboard .dice-panel {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  align-items: center;
  justify-items: stretch;
  gap: 0.48rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.dice-panel-copy strong {
  display: block;
  margin-top: 0.08rem;
  color: #fff7df;
  font-size: 0.82rem;
}

.race-dashboard .dice-panel .die-face {
  width: 50px;
  height: 50px;
  --pip-size: 8px;
  border-radius: 8px;
  box-shadow: inset 0 -5px 0 rgba(23, 32, 42, 0.1), 0 5px 8px rgba(0, 0, 0, 0.26);
}

.race-dashboard .dice-panel button {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 38px;
  border-radius: 4px;
  box-shadow: none;
}

.race-dashboard .score-card {
  position: static;
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #fff7df;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.race-dashboard .score-card-title {
  margin-bottom: 0.35rem;
}

.race-dashboard .score-card-title span {
  color: #fff7df;
  font-size: 0.66rem;
}

.race-dashboard .score-card-title strong {
  color: #9fb1bd;
  font-size: 0.55rem;
}

.race-dashboard .score-list {
  gap: 0;
}

.race-dashboard .score-row {
  min-height: 34px;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 0.38rem;
  padding: 0.3rem 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 247, 223, 0.12);
  border-radius: 0;
  color: #fff7df;
  background: transparent;
  box-shadow: none;
}

.race-dashboard .score-row:last-child {
  border-bottom: 0;
}

.race-dashboard .score-row span,
.race-dashboard .score-row strong {
  color: #fff7df;
}

.race-dashboard .score-row span small {
  display: none;
}

.race-dashboard .score-row em {
  color: #8fd7cf;
}

.board-hud,
.board-hud-inner {
  display: none !important;
}

.side-panel {
  filter: drop-shadow(0 10px 18px rgba(16, 25, 39, 0.18));
}

.side-panel .panel {
  border-radius: 6px;
  box-shadow: none;
}

.board-roll-overlay,
.modal-backdrop,
.card-reveal-modal {
  animation: stateFadeIn 180ms ease both;
}

.board-roll-card,
.card-reveal-modal .modal-card {
  animation: stateCardIn 240ms cubic-bezier(0.2, 0.8, 0.25, 1) both;
}

/* Setup is a roster sheet, not a stack of nested cards. */
.setup-wizard {
  border: 0;
  border-radius: 6px;
  background: #f3e5bf;
  box-shadow: 0 14px 28px rgba(16, 25, 39, 0.2);
}

.setup-flow-header {
  min-height: 98px;
  border-bottom-width: 4px;
}

.team-selection-stage {
  background: #f3e5bf;
}

.wizard-team-garage {
  gap: 0 1.4rem !important;
}

.wizard-team-garage .garage-card {
  min-height: 150px;
  padding: 0.9rem 0.2rem 1rem !important;
  border: 0 !important;
  border-top: 4px solid var(--team-color) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.wizard-team-garage .garage-card:nth-child(n + 3) {
  border-top-color: var(--team-color) !important;
}

.wizard-team-garage .garage-avatar {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.wizard-team-garage .garage-field select {
  min-height: 42px;
  border: 1px solid rgba(38, 51, 69, 0.25);
  border-radius: 4px;
  background: rgba(255, 248, 229, 0.72);
  box-shadow: none;
}

.drive-canvas-shell {
  display: grid;
  grid-template-columns: 222px minmax(0, 1fr);
  min-width: 0;
  background: #2d3d45;
}

.drive-canvas-shell .race-dashboard {
  position: relative;
  left: auto;
  top: auto;
  z-index: 42;
  width: auto;
  min-width: 0;
  height: max-content;
  margin: 12px 0 0 10px;
  align-self: start;
}

.drive-canvas-shell .map-wrap {
  min-width: 0;
}

.trivia-expanded .drive-canvas-shell {
  grid-template-columns: 194px minmax(0, 1fr);
}

.trivia-expanded .drive-canvas-shell .race-dashboard {
  margin-left: 8px;
  padding: 0.65rem;
}

.trivia-expanded .race-dashboard .clock strong {
  font-size: 1.65rem;
}

@media (max-width: 640px) {
  .drive-canvas-shell,
  .trivia-expanded .drive-canvas-shell {
    display: block;
  }

  .drive-canvas-shell .race-dashboard,
  .trivia-expanded .drive-canvas-shell .race-dashboard {
    width: auto;
    margin: 0;
    padding: 0.55rem 0.65rem;
    display: grid;
    grid-template-columns: auto minmax(130px, 1fr);
    gap: 0.45rem 0.75rem;
    border-width: 0 0 1px;
  }

  .race-dashboard .dashboard-clock,
  .race-dashboard .dashboard-status {
    margin: 0;
  }

  .race-dashboard .dashboard-divider {
    display: none;
  }

  .race-dashboard .dice-panel {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .race-dashboard .score-card {
    grid-column: 1 / -1;
  }

  .race-dashboard .score-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 0.75rem;
  }

  .drive-canvas-shell .map-wrap,
  .drive-canvas-shell .map-wrap.view-3d {
    height: calc(100dvh - 340px);
    min-height: 340px;
  }
}

.team-count-btn {
  box-shadow: 0 4px 8px rgba(16, 25, 39, 0.2);
}

.deck-picker-panel,
.commute-picker-panel {
  border: 0;
  border-radius: 4px;
  box-shadow: none;
}

@keyframes carIdleTown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@keyframes carDriveTown {
  from { transform: translateY(0) rotate(-0.8deg); }
  to { transform: translateY(-3px) rotate(0.8deg); }
}

@keyframes carBrakeTown {
  from { transform: translateX(-2px) rotate(-1deg); }
  to { transform: translateX(2px) rotate(1deg); }
}

@keyframes brakeMark {
  from { opacity: 0.7; transform: translateX(0) scaleX(0.6); }
  to { opacity: 0; transform: translateX(-14px) scaleX(1); }
}

@keyframes townCloudDrift {
  from { transform: translateX(-18px); }
  to { transform: translateX(26px); }
}

@keyframes townTreeSway {
  from { transform: rotate(-1.5deg); }
  to { transform: rotate(1.5deg); }
}

@keyframes townFountain {
  from { height: 23px; opacity: 0.5; }
  to { height: 34px; opacity: 0.82; }
}

@keyframes coffeeSteam {
  0% { opacity: 0; transform: translateY(8px) rotate(-4deg); }
  35% { opacity: 0.62; }
  100% { opacity: 0; transform: translateY(-18px) rotate(8deg); }
}

@keyframes townSignal {
  0%, 30% { background: var(--signal-color); box-shadow: 0 0 8px var(--signal-color); }
  31%, 100% { background: #5b6670; box-shadow: none; }
}

@keyframes stateFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes stateCardIn {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 900px) {
  .map-command-bar {
    grid-template-columns: 1fr;
  }

  .map-command-bar .board-tools {
    justify-self: start;
  }

  .race-dashboard {
    width: 196px;
    margin-bottom: -430px;
    padding: 0.68rem;
  }

  .race-dashboard .clock strong {
    font-size: 1.65rem;
  }
}

@media (max-width: 640px) {
  .main.game-main {
    padding: 0;
  }

  .stage-phase {
    display: none;
  }

  .map-command-bar {
    min-height: 46px;
    display: flex;
    justify-content: flex-end;
    padding: 0.28rem;
  }

  .map-command-bar .board-tools {
    max-width: 100%;
    overflow-x: auto;
  }

  .map-command-bar .board-tools button {
    flex: 0 0 auto;
    min-height: 36px;
  }

  .map-wrap,
  .map-wrap.view-3d {
    height: calc(100dvh - 168px);
  }

  .trivia-expanded .map-wrap,
  .trivia-expanded .map-wrap.view-3d {
    height: 390px;
  }

  .race-dashboard {
    width: 178px;
    margin: 8px 0 -390px 8px;
    padding: 0.58rem;
  }

  .dashboard-status {
    display: none;
  }

  .race-dashboard .score-row {
    min-height: 30px;
  }

  .race-dashboard .score-card-title strong {
    display: none;
  }

  .wizard-team-garage .garage-card {
    grid-template-columns: 82px minmax(0, 1fr) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ambient-cloud,
  .ambient-tree,
  .ambient-fountain b,
  .ambient-coffee-steam,
  .street-light i,
  .team-car-sprite {
    animation: none !important;
  }
}

/* Jellykid-style opening menu and two-step trainer setup. */
body:has(.home-screen) {
  overflow: hidden;
  background: #172231 !important;
}

.app-shell:has(.home-screen) {
  display: block;
  min-height: 100dvh;
}

.main.home-main {
  min-height: 100dvh;
  padding: 0;
  overflow: hidden;
}

.home-screen {
  position: relative;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(300px, 620px) minmax(250px, 390px);
  grid-template-rows: auto 1fr auto;
  align-items: center;
  justify-content: center;
  gap: 1.5rem clamp(2rem, 7vw, 7rem);
  overflow: hidden;
  padding: clamp(1.2rem, 4vw, 3rem) clamp(1.2rem, 6vw, 5rem);
  color: #fff7df;
  background-color: #172231;
  background-image:
    linear-gradient(90deg, rgba(255, 247, 223, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 247, 223, 0.035) 1px, transparent 1px);
  background-size: 52px 52px;
}

.home-screen::before {
  content: "";
  position: absolute;
  left: -8vw;
  right: -8vw;
  bottom: -23vh;
  height: 62vh;
  border-top: 7px solid #f2b84b;
  background: #263345;
  transform: rotate(-4deg);
  box-shadow: 0 -18px 48px rgba(8, 13, 21, 0.34);
}

.home-screen::after {
  content: "";
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: 14vh;
  height: 10px;
  opacity: 0.92;
  background: repeating-linear-gradient(90deg, #f7d36d 0 74px, transparent 74px 126px);
  transform: rotate(-4deg);
}

.jellykid-wordmark {
  position: relative;
  z-index: 3;
  grid-column: 1 / -1;
  justify-self: start;
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  color: #fff7df;
  font-weight: 1000;
  text-decoration: none;
}

.jellykid-wordmark span {
  font-size: 1rem;
}

.jellykid-wordmark b {
  color: #f2b84b;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.home-logo-lockup {
  position: relative;
  z-index: 4;
  grid-column: 1;
  grid-row: 2;
  align-self: start;
  display: grid;
  justify-items: start;
  padding-top: clamp(1rem, 8vh, 6rem);
}

.home-clock-logo {
  display: inline-flex;
  align-items: baseline;
  gap: 0.38rem;
  margin-bottom: 1rem;
  padding: 0.66rem 0.82rem 0.76rem;
  border: 3px solid #fff7df;
  border-radius: 6px;
  color: #17202a;
  background: #f2b84b;
  box-shadow: 7px 7px 0 #a83f2f;
  transform: rotate(-2deg);
}

.home-clock-logo b {
  font-size: 1.75rem;
  font-variant-numeric: tabular-nums;
}

.home-clock-logo i {
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 1000;
}

.home-logo-lockup h1 {
  display: grid;
  gap: 0.08em;
  margin: 0;
  color: #fff7df;
  line-height: 0.85;
  text-shadow: 6px 6px 0 #0d141e;
}

.home-logo-lockup h1 small {
  margin-left: 0.12em;
  color: #f2b84b;
  font-size: 2rem;
  line-height: 1;
  text-transform: uppercase;
}

.home-logo-lockup h1 span {
  font-size: 6.2rem;
  letter-spacing: 0;
}

.home-logo-lockup p {
  margin: 1.25rem 0 0;
  color: #8fd7cf;
  font-size: 1.2rem;
  font-weight: 900;
}

.home-menu-actions {
  position: relative;
  z-index: 5;
  grid-column: 2;
  grid-row: 2;
  align-self: center;
  display: grid;
  gap: 0.72rem;
  width: min(100%, 360px);
}

.home-menu-actions button {
  width: 100%;
  min-height: 54px;
  border-radius: 6px;
  font-size: 1rem;
  box-shadow: 0 6px 0 #0c131c, 0 14px 24px rgba(0, 0, 0, 0.26);
}

.home-play-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px !important;
  padding-inline: 1.35rem;
  color: #17202a;
  background: #f2b84b !important;
  border-color: #fff1bd !important;
  font-size: 1.38rem !important;
}

.home-play-button b {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff7df;
  background: #a83f2f;
}

.home-menu-button {
  color: #fff7df !important;
  background: #32465a !important;
  border-color: #60768a !important;
}

.home-menu-button.continue {
  color: #17202a !important;
  background: #8fd7cf !important;
}

.home-road-scene {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
}

.home-menu-car {
  position: absolute !important;
  width: clamp(165px, 19vw, 310px);
  height: clamp(88px, 11vw, 176px);
}

.home-menu-car-red {
  left: 8%;
  bottom: 5%;
  transform: rotate(-3deg);
}

.home-menu-car-blue {
  left: 34%;
  bottom: 10%;
  transform: rotate(-3deg);
}

.home-menu-car-green {
  left: 60%;
  bottom: 15%;
  transform: rotate(-3deg);
}

.home-menu-footer {
  position: relative;
  z-index: 4;
  grid-column: 1 / -1;
  grid-row: 3;
  align-self: end;
  justify-self: end;
  margin: 0;
  color: #fff1bd;
  font-size: 0.82rem;
  font-weight: 800;
}

.brand-home-button {
  padding: 0;
  border: 0;
  border-radius: 0;
  text-align: left;
  background: transparent !important;
  box-shadow: none !important;
}

.brand-home-button:hover {
  transform: none;
  box-shadow: none;
}

.setup-wizard {
  width: min(1180px, 100%);
  min-height: calc(100dvh - 126px);
  margin: 0 auto;
  padding: 0;
  border: 3px solid rgba(255, 247, 223, 0.84);
  border-radius: 8px;
  overflow: hidden;
  background: #f7e8c3;
  box-shadow: 0 18px 42px rgba(16, 25, 39, 0.28);
}

.setup-flow-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.2rem;
  min-height: 112px;
  padding: 1rem 1.25rem;
  color: #fff7df;
  background: #263345;
  border-bottom: 5px solid #f2b84b;
}

.setup-home-button,
.setup-secondary-button,
.manage-decks-button {
  color: #fff7df !important;
  background: #415466 !important;
  border-color: #718291 !important;
  box-shadow: 0 5px 0 rgba(16, 25, 39, 0.45) !important;
}

.setup-flow-title span,
.setup-eyebrow {
  color: #f2b84b;
  font-size: 0.68rem;
  font-weight: 1000;
  text-transform: uppercase;
}

.setup-flow-title h2,
.team-wizard-heading h3,
.deck-picker-heading h3,
.commute-picker-panel h3 {
  margin: 0.12rem 0 0;
  letter-spacing: 0;
}

.setup-flow-title h2 {
  color: #fff7df;
  font-size: 2rem;
}

.setup-flow-title p {
  margin: 0.2rem 0 0;
  color: #cbd7dc;
  font-size: 0.86rem;
}

.setup-progress {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.setup-progress li {
  display: grid;
  grid-template-columns: 28px auto;
  align-items: center;
  gap: 0.38rem;
  color: #9eabb3;
  font-size: 0.72rem;
  font-weight: 900;
}

.setup-progress b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid #718291;
  border-radius: 50%;
}

.setup-progress li.complete,
.setup-progress li.active {
  color: #fff7df;
}

.setup-progress li.complete b {
  color: #17202a;
  border-color: #f2b84b;
  background: #f2b84b;
}

.setup-progress li.active b {
  border-color: #8fd7cf;
  background: #268f8a;
}

.team-selection-stage,
.deck-selection-stage {
  padding: clamp(1rem, 2.5vw, 1.65rem);
}

.team-wizard-heading,
.deck-picker-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.team-wizard-heading h3,
.deck-picker-heading h3,
.commute-picker-panel h3 {
  color: #17202a;
  font-size: 1.15rem;
}

.wizard-team-garage {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 0.85rem;
}

.wizard-team-garage .garage-card {
  grid-template-columns: 112px minmax(0, 1fr) !important;
  grid-template-rows: auto auto !important;
  min-height: 178px;
  border-radius: 8px !important;
  padding: 0.85rem !important;
  background: #fff8e5 !important;
}

.wizard-team-garage .garage-team-number {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  color: #17202a;
  font-size: 1rem;
  font-weight: 1000;
}

.wizard-team-garage .garage-avatar {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 104px !important;
  height: 82px !important;
}

.wizard-team-garage .garage-picks {
  grid-column: 1 / -1;
  grid-row: 3;
}

.setup-flow-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 2px solid rgba(90, 71, 43, 0.16);
}

.setup-next-button,
.setup-flow-actions .start-commute {
  min-width: 245px;
}

.deck-selection-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(330px, 0.7fr);
  gap: 1rem;
}

.deck-picker-panel,
.commute-picker-panel {
  min-width: 0;
  padding: 1rem;
  border: 2px solid rgba(90, 71, 43, 0.16);
  border-radius: 8px;
  background: #fff8e5;
}

.deck-picker-heading > strong {
  flex: 0 0 auto;
  color: #268f8a;
  font-size: 0.76rem;
}

.wizard-deck-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.wizard-deck-card {
  grid-template-columns: 26px minmax(0, 1fr) !important;
  min-height: 78px;
  padding: 0.72rem;
  border-radius: 6px !important;
  cursor: pointer;
}

.wizard-deck-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.deck-check {
  display: grid !important;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid #8a969f;
  border-radius: 50%;
  background: #ffffff;
}

.wizard-deck-card.selected .deck-check {
  border-color: #268f8a;
  background: #268f8a;
}

.wizard-deck-card.selected .deck-check::after {
  content: "";
  width: 8px;
  height: 4px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg) translateY(-1px);
}

.manage-decks-button {
  margin-top: 0.8rem;
}

.commute-picker-panel .route-select {
  margin-top: 0.75rem;
}

.commute-picker-panel .route-option {
  border-radius: 6px;
  background: #fffdf6;
}

.setup-ready-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  margin-top: 0.85rem;
}

.setup-ready-summary span {
  padding: 0.5rem 0.35rem;
  border: 1px solid rgba(23, 32, 42, 0.14);
  border-radius: 4px;
  color: #5a472b;
  background: #f4e4bc;
  font-size: 0.68rem;
  font-weight: 900;
  text-align: center;
  text-transform: capitalize;
}

.deck-flow-actions {
  grid-column: 1 / -1;
  margin-top: 0;
}

@media (max-width: 900px) {
  body:has(.home-screen) {
    overflow: auto;
  }

  .home-screen {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto 1fr;
    align-content: start;
    gap: 1.2rem;
    min-height: 100dvh;
    padding-bottom: 220px;
  }

  .home-logo-lockup,
  .home-menu-actions {
    grid-column: 1;
    grid-row: auto;
  }

  .home-logo-lockup {
    padding-top: 0.4rem;
  }

  .home-logo-lockup h1 span {
    font-size: 5rem;
  }

  .home-logo-lockup h1 small {
    font-size: 1.7rem;
  }

  .home-menu-actions {
    align-self: start;
    width: min(100%, 460px);
  }

  .home-menu-footer {
    display: none;
  }

  .home-menu-car-red { left: 2%; }
  .home-menu-car-blue { left: 34%; }
  .home-menu-car-green { left: 67%; }

  .deck-selection-stage {
    grid-template-columns: 1fr;
  }

  .deck-flow-actions {
    grid-column: 1;
  }
}

@media (max-width: 720px) {
  .setup-flow-header {
    grid-template-columns: auto 1fr;
  }

  .setup-progress {
    grid-column: 1 / -1;
    justify-self: end;
  }

  .wizard-team-garage,
  .wizard-deck-list {
    grid-template-columns: 1fr !important;
  }

  .team-wizard-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .home-screen {
    padding: 1rem 1rem 190px;
  }

  .home-logo-lockup h1 span {
    font-size: 3.6rem;
  }

  .home-logo-lockup h1 small {
    font-size: 1.35rem;
  }

  .home-menu-car {
    width: 150px;
    height: 82px;
  }

  .home-menu-car-green {
    display: none;
  }

  .home-menu-car-red { left: 0; bottom: 4%; }
  .home-menu-car-blue { left: 48%; bottom: 9%; }

  .setup-flow-header {
    gap: 0.7rem;
    padding: 0.8rem;
  }

  .setup-flow-title p {
    display: none;
  }

  .setup-progress li {
    grid-template-columns: 26px auto;
  }

  .setup-flow-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .setup-next-button,
  .setup-flow-actions .start-commute {
    width: 100%;
    min-width: 0;
  }

  .wizard-team-garage .garage-card {
    grid-template-columns: 92px minmax(0, 1fr) !important;
  }

  .wizard-team-garage .garage-avatar {
    width: 86px !important;
    height: 68px !important;
  }

  .setup-ready-summary {
    grid-template-columns: 1fr;
  }
}

/* Stable roll dice: the square stays planted while randomized pips do the rolling. */
.board-roll-results,
.roll-next-note {
  opacity: 1;
  animation: none;
}

.board-roll-card .roll-die,
.board-roll-card .roll-die.rolling,
.board-roll-card .roll-die.rolled {
  width: 76px;
  height: 76px;
  border: 4px solid #fff7df;
  border-radius: 10px;
  background: #f4f7f5;
  box-shadow:
    inset 0 -7px 0 rgba(16, 25, 39, 0.11),
    0 0 0 3px #263345,
    0 9px 0 rgba(16, 25, 39, 0.16),
    0 16px 20px rgba(16, 25, 39, 0.22);
  transform: none !important;
  animation: none !important;
}

.board-roll-card .roll-die.rolling {
  box-shadow:
    inset 0 -7px 0 rgba(16, 25, 39, 0.11),
    0 0 0 3px #263345,
    0 9px 0 rgba(16, 25, 39, 0.16),
    0 16px 20px rgba(16, 25, 39, 0.22),
    0 0 22px color-mix(in srgb, var(--team-color) 52%, transparent);
}

.board-roll-card .roll-result-label {
  min-width: 94px;
  color: #fff7df;
  background: #53606d;
  animation: none;
}

.board-roll-card.roll-animation-complete .roll-result-label {
  background: var(--team-color);
}

.board-roll-card:not(.roll-animation-complete) .roll-next-note {
  visibility: visible;
  pointer-events: auto;
}

.board-roll-card:not(.roll-animation-complete) .roll-next-note button:disabled {
  color: #fff7df;
  background: #53606d;
  border-color: #76818c;
  box-shadow: 0 5px 0 #303a45;
  opacity: 1;
  cursor: wait;
}

/* Setup simplification: driver names are team names, with cleaner garage cards. */
.lobby-logo h2 small {
  color: #a83f2f;
  text-shadow:
    0 2px 0 rgba(255, 247, 223, 0.96),
    1px 0 0 rgba(255, 247, 223, 0.72);
}

.garage-card {
  grid-template-rows: auto auto !important;
}

.garage-avatar {
  grid-row: 1 !important;
}

.garage-copy {
  align-self: center;
}

.garage-copy strong {
  font-size: 1rem;
}

.garage-picks {
  grid-row: 2 !important;
}

.lobby-clock-doodle {
  position: absolute;
  z-index: 0;
  left: 11.5%;
  top: 14%;
  width: 104px;
  height: 104px;
  border: 4px solid rgba(23, 32, 42, 0.2);
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(23, 32, 42, 0.24) 0 5px, transparent 6px),
    rgba(255, 247, 223, 0.12);
  box-shadow:
    inset 0 0 0 5px rgba(255, 247, 223, 0.2),
    0 5px 0 rgba(168, 67, 47, 0.08);
  opacity: 0.72;
  pointer-events: none;
}

.lobby-clock-doodle::before,
.lobby-clock-doodle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 999px;
  background: rgba(23, 32, 42, 0.3);
  transform-origin: 50% 100%;
}

.lobby-clock-doodle::before {
  width: 4px;
  height: 31px;
  transform: translate(-50%, -100%) rotate(5deg);
}

.lobby-clock-doodle::after {
  width: 5px;
  height: 24px;
  transform: translate(-50%, -100%) rotate(118deg);
}

.lobby-clock-doodle i {
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 6%, rgba(23, 32, 42, 0.28) 0 3px, transparent 4px),
    radial-gradient(circle at 94% 50%, rgba(23, 32, 42, 0.28) 0 3px, transparent 4px),
    radial-gradient(circle at 50% 94%, rgba(23, 32, 42, 0.28) 0 3px, transparent 4px),
    radial-gradient(circle at 6% 50%, rgba(23, 32, 42, 0.28) 0 3px, transparent 4px);
}

@media (max-width: 700px) {
  .lobby-logo h2 {
    line-height: 0.92;
  }

  .lobby-clock-doodle {
    left: 7%;
    top: 18%;
    width: 76px;
    height: 76px;
  }

  .lobby-clock-doodle::before {
    height: 23px;
  }

  .lobby-clock-doodle::after {
    height: 18px;
  }
}

/* Cars-only lobby art. The previous human banner remains stored but is not active. */
.lobby-hero {
  min-height: clamp(250px, 22vw, 330px);
  background-color: #f3dfb6 !important;
  background-image:
    linear-gradient(rgba(255, 247, 223, 0.42), rgba(255, 247, 223, 0.18)),
    repeating-linear-gradient(90deg, transparent 0 78px, rgba(38, 143, 138, 0.12) 79px 81px),
    repeating-linear-gradient(0deg, transparent 0 54px, rgba(168, 67, 47, 0.1) 55px 57px) !important;
  background-position: center !important;
  background-size: auto !important;
}

.lobby-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.32;
  background:
    radial-gradient(circle at 16% 32%, transparent 0 52px, rgba(23, 32, 42, 0.16) 53px 55px, transparent 56px),
    radial-gradient(circle at 84% 72%, transparent 0 72px, rgba(23, 32, 42, 0.12) 73px 75px, transparent 76px);
  mix-blend-mode: multiply;
  pointer-events: none;
}

.lobby-hero .flying-paper,
.lobby-hero .coffee-splash {
  display: none !important;
}

/* The polished car PNGs face right by default, matching the route out of Home. */
.team-piece {
  transform: none;
}

.view-3d .team-piece {
  transform: translateZ(72px);
}

.team-piece.current {
  transform: scale(1.18);
}

.view-3d .team-piece.current {
  transform: translateZ(82px) scale(1.18);
}

.team-piece span {
  transform: none;
}

/* Gameplay quality-of-life pass: legible roll motion, timer controls, and a distinct table surface. */
.main.game-main {
  background:
    linear-gradient(90deg, rgba(255, 247, 223, 0.055) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(0deg, rgba(255, 247, 223, 0.04) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(135deg, #51626b 0%, #3f535d 52%, #35464f 100%) !important;
}

.map-wrap,
.map-wrap.view-3d {
  background:
    linear-gradient(90deg, rgba(255, 247, 223, 0.055) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(0deg, rgba(255, 247, 223, 0.04) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(135deg, #51626b 0%, #3f535d 52%, #35464f 100%) !important;
}

.rolling-dice {
  perspective: 520px;
}

.die-face.rolling {
  transform-style: preserve-3d;
  animation: diceTumbleQol 520ms cubic-bezier(0.45, 0, 0.25, 1) infinite !important;
}

.die-face.rolling.delay {
  animation-delay: -170ms !important;
}

@keyframes diceTumbleQol {
  0% { transform: translate3d(-6px, 4px, 0) rotateX(8deg) rotateY(-18deg) rotateZ(-12deg) scale(0.92); }
  24% { transform: translate3d(3px, -13px, 18px) rotateX(88deg) rotateY(32deg) rotateZ(18deg) scale(1.05); }
  52% { transform: translate3d(8px, -3px, 6px) rotateX(176deg) rotateY(78deg) rotateZ(-8deg) scale(0.98); }
  78% { transform: translate3d(-2px, -9px, 14px) rotateX(258deg) rotateY(118deg) rotateZ(14deg) scale(1.04); }
  100% { transform: translate3d(-6px, 4px, 0) rotateX(360deg) rotateY(162deg) rotateZ(-12deg) scale(0.92); }
}

.panel-title-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.question-timer-wrap {
  position: relative;
}

.question-timer-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  min-width: 44px;
  height: 42px;
  padding: 0.42rem 0.58rem;
  color: #17202a !important;
  background: #fff7df !important;
}

.question-timer-button.running {
  color: #fff7df !important;
  background:
    linear-gradient(#c83f38, #a92d2a) padding-box,
    conic-gradient(#ffb09f var(--timer-progress), rgba(16, 25, 39, 0.2) 0) border-box !important;
  border-color: transparent;
}

.question-timer-button.expired {
  color: #fff7df !important;
  background: #c83f38 !important;
  border-color: #ffb09f;
  animation: timerExpiredPulse 720ms ease-in-out 2;
}

.question-clock-icon {
  position: relative;
  display: block;
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.question-clock-icon::before,
.question-clock-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  border-radius: 2px;
  background: currentColor;
  transform-origin: 50% 100%;
}

.question-clock-icon::before {
  height: 6px;
  transform: translate(-50%, -100%) rotate(0deg);
}

.question-clock-icon::after {
  height: 5px;
  transform: translate(-50%, -100%) rotate(120deg);
}

.question-timer-button.running .question-clock-icon i {
  position: absolute;
  inset: -5px;
  border: 2px solid rgba(255, 176, 159, 0.58);
  border-radius: 50%;
  animation: timerTick 1s steps(1, end) infinite;
}

.question-timer-value {
  min-width: 2.2em;
  font-size: 0.76rem;
  font-weight: 1000;
  font-variant-numeric: tabular-nums;
}

.question-timer-value:empty {
  display: none;
}

.question-timer-menu {
  position: absolute;
  z-index: 30;
  right: 0;
  top: calc(100% + 8px);
  display: grid;
  grid-template-columns: repeat(2, minmax(74px, 1fr));
  gap: 0.4rem;
  width: 194px;
  padding: 0.55rem;
  border: 3px solid #fff7df;
  border-radius: 8px;
  background: #263345;
  box-shadow: 0 14px 28px rgba(16, 25, 39, 0.36);
}

.question-timer-menu button {
  min-height: 38px;
  padding: 0.45rem;
  color: #17202a;
  background: #fff0bd;
  box-shadow: none;
}

.question-timer-menu .question-timer-option.selected {
  border-color: #4c9acf;
  background: #dff2ff;
  box-shadow: inset 0 0 0 2px #2e6ea6;
}

.question-timer-menu .question-timer-start {
  color: #ffffff;
  background: linear-gradient(180deg, #35bd70, #16884c);
  border-color: #94e8b8;
}

.question-timer-menu .question-timer-start:disabled {
  color: #7b817d;
  background: #d7ddd8;
  border-color: #bbc3bd;
}

.card-reveal-modal button[data-action="reveal-all-assigned-cards"]:not(:disabled) {
  color: #fff7df;
  background: linear-gradient(180deg, #3976ad, #234e79);
  border-color: #9cc8ef;
}

@keyframes timerTick {
  0%, 49% { transform: scale(0.92); opacity: 0.45; }
  50%, 100% { transform: scale(1.08); opacity: 0.12; }
}

@keyframes timerExpiredPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 7px 0 rgba(23, 32, 42, 0.1); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 7px rgba(216, 58, 50, 0.22); }
}

@media (max-width: 520px) {
  .panel-title-row {
    align-items: flex-start;
  }

  .panel-title-actions {
    gap: 0.3rem;
  }
}

/* Keep the purposeful clock in place after the legacy lobby decoration rules. */
.lobby-hero::before {
  content: none !important;
  display: none !important;
}

/* Final hierarchy guard: later legacy layers must not rebuild the removed cards. */
.setup-wizard {
  border: 0;
  border-radius: 6px;
  background: #f3e5bf;
  box-shadow: 0 14px 28px rgba(16, 25, 39, 0.2);
}

.wizard-team-garage {
  gap: 0 1.4rem !important;
}

.wizard-team-garage .garage-card {
  min-height: 150px;
  padding: 0.9rem 0.2rem 1rem !important;
  border: 0 !important;
  border-top: 4px solid var(--team-color) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.wizard-team-garage .garage-avatar {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.wizard-team-garage .garage-field select {
  min-height: 42px;
  border: 1px solid rgba(38, 51, 69, 0.25);
  border-radius: 4px;
  background: rgba(255, 248, 229, 0.72);
  box-shadow: none;
}
