.chicken-body {
  min-height: 100vh;
  background: #0b202c;
}

.chicken-body [hidden] {
  display: none !important;
}

.chicken-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
  padding: 0.75rem max(1rem, calc((100vw - 1280px) / 2));
  background: #142d3a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.chicken-topbar .brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.chicken-topbar h1,
.chicken-topbar p {
  margin: 0;
}

.chicken-topbar h1 {
  font-size: 1.35rem;
  line-height: 1.1;
}

.chicken-topbar p {
  color: var(--muted);
  font-size: 0.82rem;
}

.chicken-topbar .status-strip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chicken-topbar .status-strip > div {
  padding: 0.45rem 0.8rem;
  border-radius: 0.45rem;
  background: #0f2633;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.chicken-topbar .button {
  min-height: 2.75rem;
  border-radius: 0.45rem;
}

.chicken-layout {
  display: grid;
  grid-template-columns: 18rem minmax(0, 1fr);
  gap: 0;
  max-width: 1280px;
  min-height: calc(100vh - 4.25rem);
  margin: 0 auto;
  padding: 1.25rem 0;
}

.chicken-layout.stats-open {
  grid-template-columns: 18rem 18rem minmax(0, 1fr);
}

.chicken-body .live-stats-drawer {
  display: none;
  min-height: 100%;
  min-width: 18rem;
  padding: 1rem;
  background: #203946;
  border-radius: 0.35rem 0 0 0.35rem;
}

.chicken-layout.stats-open .live-stats-drawer {
  display: block;
}

.chicken-body .live-stats-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2rem;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.chicken-body .live-stats-header h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
  white-space: nowrap;
}

.chicken-body .live-stats-header h2 span,
.chicken-body .credit-dot {
  display: inline-grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 0.3rem;
  background: #28d59f;
  color: #03150f;
  font-size: 0.58rem;
  font-weight: 950;
}

.chicken-body .credit-dot {
  width: 1rem;
  height: 1rem;
  margin-left: 0.25rem;
  font-size: 0.42rem;
  vertical-align: 0.12rem;
}

.chicken-body .live-stats-header .icon-button,
.chicken-body .stats-filter-row .icon-button {
  min-width: 2rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  font-size: 1rem;
}

.chicken-body .stats-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2rem;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 0.85rem;
}

.chicken-body .stats-filter-row select {
  width: 100%;
  min-width: 0;
}

.chicken-body .live-stats-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0.85rem;
  margin-bottom: 0.85rem;
  border-radius: 0.45rem;
  background: #18303d;
}

.chicken-body .live-stats-metrics > div {
  min-width: 0;
  min-height: 3.5rem;
  padding: 0.2rem 0.7rem;
}

.chicken-body .live-stats-metrics > div:nth-child(odd) {
  border-right: 1px solid #3d5b6e;
}

.chicken-body .live-stats-metrics strong {
  display: inline-block;
  max-width: 100%;
  margin-top: 0.05rem;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.chicken-body .stats-chart {
  height: 13.75rem;
  padding: 0.8rem;
  border-radius: 0.45rem;
  background: #102532;
  overflow: hidden;
}

.chicken-body .stats-chart svg {
  display: block;
  width: 100%;
  height: 100%;
}

.chicken-body .chart-fill {
  fill: rgba(20, 244, 106, 0.22);
}

.chicken-body .chart-loss-fill {
  fill: rgba(255, 40, 84, 0.24);
}

.chicken-body .chart-line {
  fill: none;
  stroke: #14f46a;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chicken-body .chart-loss-line {
  fill: none;
  stroke: #ff2854;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chicken-body .chart-zero {
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 2;
}

.chicken-controls {
  display: flex;
  flex-direction: column;
  background: #203946;
  border-radius: 0.35rem 0 0 0.35rem;
}

.chicken-bet-panel {
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.chicken-bet-panel .segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0.25rem;
  border-radius: 999px;
  background: #0d2330;
}

.chicken-bet-panel .segmented button {
  min-height: 2.25rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #c8dce8;
  font-weight: 800;
  cursor: pointer;
}

.chicken-bet-panel .segmented button.active {
  background: #6f8fa1;
  color: #061924;
}

.chicken-bet-panel input,
.chicken-bet-panel select,
.verifier-panel input,
.stats-filter-row select {
  width: 100%;
  min-height: 2.6rem;
  border: 1px solid #335368;
  border-radius: 0.45rem;
  padding: 0.65rem 0.75rem;
  background: #0d202b;
  color: #f3fbff;
}

.mode-panel {
  display: grid;
  gap: 0.7rem;
}

.manual-panel {
  grid-template-columns: 1fr;
}

.bet-action {
  width: 100%;
  min-height: 2.75rem;
  border-radius: 0.45rem;
  font-weight: 900;
}

.profit-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
  min-height: 3.15rem;
  padding: 0;
  border-radius: 0.45rem;
  background: transparent;
  color: #c6d8e2;
  font-size: 0.85rem;
}

.profit-card strong {
  color: #ffffff;
}

.profit-card > strong { display: block; min-height: 42px; padding: 9px 10px; border: 2px solid #3c5464; border-radius: 6px; background: #0f212e; font-size: 14px; }
.profit-card > span { color: #b1c3d1; font-size: 13px; font-weight: 600; }
.profit-card > span strong { color: inherit; }
.chicken-body .chicken-bet-panel .segmented { margin-bottom: 0; }
.chicken-body #goBtn { background: #3b5667; box-shadow: none; }
.chicken-body #goBtn:hover:not(:disabled) { background: #4c6879; }

.auto-panel {
  gap: 0.75rem;
}

.auto-advanced {
  display: grid;
  gap: 0.7rem;
}

.auto-rule {
  margin: 0;
  padding: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.45rem;
}

.auto-rule legend {
  padding: 0 0.35rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.auto-rule-row {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) 4rem;
  gap: 0.35rem;
  align-items: center;
}

.auto-rule-row button,
.auto-rule-row label {
  min-width: 0;
  min-height: 2.35rem;
  border-radius: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #0f2532;
  color: #dcecf4;
  font-weight: 800;
}

.auto-rule-row button {
  cursor: pointer;
}

.auto-rule-row button.active {
  background: #6f8fa1;
  color: #061924;
}

.auto-rule-row label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.25rem;
  padding: 0 0.4rem;
  color: #e9f5fb;
}

.auto-rule-row input {
  width: 100%;
  min-width: 0;
  min-height: 2rem;
  padding: 0.35rem 0.2rem;
  border: 0;
  background: transparent;
  color: #ffffff;
  font-weight: 900;
  text-align: left;
}

.auto-rule-row input:focus {
  outline: 2px solid #62b7ff;
  outline-offset: 0;
}

.auto-rule-row span {
  padding-right: 0.15rem;
  color: #d9eaf2;
  font-weight: 900;
}

.auto-pacing {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: end;
}

.custom-switch-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.6rem;
}

.custom-switch-row input {
  position: absolute;
  right: 0;
  z-index: 1;
  opacity: 0;
  width: 2.5rem;
  height: 1.35rem;
  min-height: 0;
  margin: 0;
  cursor: pointer;
}

.custom-switch-row input:focus-visible + .switch-control { outline: 2px solid #8bc4e5; outline-offset: 3px; }

.switch-control {
  position: relative;
  flex: 0 0 auto;
  width: 2.5rem;
  height: 1.35rem;
  border-radius: 999px;
  background: #39566a;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.switch-control::after {
  content: "";
  position: absolute;
  top: 0.18rem;
  left: 0.18rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #9eb5c3;
  transition: transform 0.16s ease, background 0.16s ease;
}

.custom-switch-row input:checked + .switch-control {
  background: #2778d8;
}

.custom-switch-row input:checked + .switch-control::after {
  transform: translateX(1.12rem);
  background: #ffffff;
}

.chicken-note {
  display: grid;
  gap: 0.25rem;
  padding: 0.85rem;
  border-radius: 0.45rem;
  background: #14303e;
  color: #bfd3df;
  font-size: 0.8rem;
  line-height: 1.45;
}

.chicken-note strong {
  color: #dff5ff;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.72rem;
}

.tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.text-button {
  min-height: 2.1rem;
  padding: 0.4rem 0.65rem;
  border: 0;
  border-radius: 0.35rem;
  background: #314d60;
  color: #e3f2f8;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.text-button[aria-pressed="true"] {
  background: #1a8fff;
  color: #ffffff;
}

.chicken-stage {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 1rem;
  padding: 0 1.25rem;
}

.chicken-stage > * {
  min-width: 0;
}

/* Road geometry is shared by the lane grid, markers and moving token. */
.road-panel {
  --lane-width: 135px;
  --start-width: 160px;
  --lane-count: 19;
  --lane-accent: #5fe5fa;
  position: relative;
  height: clamp(420px, calc(100svh - 190px), 630px);
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0 8px 0 0;
  overflow: hidden;
  background: #0f212e;
  box-shadow: none;
}
.road-scroll {
  width: 100%; height: 100%; min-width: 0;
  overflow-x: auto; overflow-y: hidden; padding: 0;
  scrollbar-width: thin; scrollbar-color: #2f4553 #0f212e;
}
.road-world {
  position: relative;
  width: calc(var(--start-width) + var(--lane-count) * var(--lane-width) + 24px);
  height: 100%; min-height: 100%;
  background: #0f212e;
}
.road-pavement {
  position: absolute; inset: 0 auto 0 0; width: var(--start-width);
  background: #10232e;
}
.road-pavement::before {
  content: ""; position: absolute; inset: 0 0 0 auto; width: 31px;
  background: repeating-linear-gradient(to bottom, #263e49 0 91px, #1b303c 92px 98px, #304854 99px 105px, #10232e 106px 111px);
}
.road-crossing {
  position: absolute; left: 0; right: 0; top: calc(60% - 42px); height: 73px;
  background: repeating-linear-gradient(to right, #304a57 0 25px, #10232e 26px 32px);
  border-top: 7px solid #10232e; border-bottom: 7px solid #10232e;
}
.road-shrub { position: absolute; width: 120px; left: 0; top: calc(60% + 76px); }
.start-zone {
  position: absolute; left: 16px; top: 12%; width: 100px; height: 55px;
  border: 7px solid #304753; border-radius: 40px;
  display: flex; align-items: center; justify-content: space-around;
  background: #122731; z-index: 2; box-shadow: 0 4px 0 #0b1c26;
}
.start-zone::before {
  content: ""; position: absolute; top: 49px; left: 32px; width: 22px; height: 103px;
  background: #304753; border-radius: 0 0 9px 9px; box-shadow: 4px 2px 0 #0c1d27;
}
.start-zone::after {
  content: ""; position: absolute; top: 143px; left: 14px; width: 59px; height: 35px;
  border-radius: 50%; background: #2c4552; box-shadow: 0 10px 0 #29414e,0 15px 0 #0c1d27;
}
.start-light { width: 32px; height: 34px; border: 4px solid #0e2632; border-radius: 50%; background: #1f3d4d; box-shadow: inset 3px 2px 0 #34515f; }
.start-light.active { background: #ffcb06; box-shadow: inset -6px -3px 0 #e99816,inset 3px 3px 0 #ffe868; }
.start-light::after { content: ""; display: block; width: 7px; height: 7px; margin: 3px 0 0 4px; border-radius: 50%; background: #fff; opacity: .12; }
.start-light.active::after { opacity: .9; }
.lane-track { position: absolute; left: var(--start-width); top: 0; bottom: 0; display: grid; grid-template-columns: repeat(var(--lane-count), var(--lane-width)); }
.road-lane { position: relative; width: var(--lane-width); height: 100%; }
.road-lane::before {
  content: ""; position: absolute; right: 0; top: 16px; bottom: 0; width: 4px;
  background: repeating-linear-gradient(to bottom,#1c3340 0 20px,transparent 21px 47px);
  border-radius: 3px; opacity: .65;
}
.lane-marker {
  position: absolute; left: 50%; top: calc(60% - 28px); transform: translateX(-50%);
  width: 84px; height: 59px; background: url('../assets/chicken/grate.svg') center / contain no-repeat;
}
.lane-marker::after {
  content: ""; position: absolute; inset: 17px 26px 18px; opacity: 0;
  background: #172f3c; border-radius: 50%;
  clip-path: polygon(0 30%,30% 30%,45% 10%,70% 15%,80% 35%,100% 45%,80% 55%,75% 80%,30% 80%,10% 60%);
}
.road-lane.passed .lane-marker::after { opacity: 1; }
.lane-barrier {
  position: absolute; left: 50%; top: calc(60% - 90px); width: 76px; height: 19px;
  transform: translateX(-50%) scaleY(0); transform-origin: center bottom;
  border: 4px solid #3a5361; border-bottom-width: 7px; border-radius: 9px;
  background: repeating-linear-gradient(125deg,#fff 0 8px,var(--lane-accent) 9px 17px);
  box-shadow: 0 3px 0 #0a1b25;
  transition: transform 160ms ease-out;
  z-index: 3;
}
.lane-barrier::after { content: ""; position: absolute; left: 3px; right: 3px; top: 10px; height: 16px; border-left: 11px solid #2b414b; border-right: 11px solid #2b414b; border-radius: 0 0 5px 5px; }
.road-lane.passed .lane-barrier { transform: translateX(-50%) scaleY(1); }
.vehicle {
  position: absolute; left: 50%; top: -180px; width: 60px; height: 116px;
  transform: translateX(-50%); background: url('../assets/chicken/car.svg') center / contain no-repeat;
  filter: var(--vehicle-filter, none); pointer-events: none; z-index: 2;
}
.vehicle.bus { height: 158px; background-image: url('../assets/chicken/bus.svg'); }
.vehicle.truck { height: 136px; width: 64px; background-image: url('../assets/chicken/truck.svg'); }
.vehicle.decorative { animation: chicken-drive var(--traffic-duration, 8s) linear infinite; animation-delay: var(--vehicle-delay, 0s); }
.road-lane.passed .vehicle.decorative { animation: none; top: calc(60% - 212px); }
.road-lane.passed .vehicle.bus { top: calc(60% - 254px); }
.road-lane.passed .vehicle.truck { top: calc(60% - 232px); }
.vehicle.crash { display: none; z-index: 7; }
.road-lane.danger.loss-collision .vehicle.crash { display: block; animation: chicken-collision var(--ending-duration, 800ms) linear both; }
.road-lane.danger .vehicle.decorative { visibility: hidden; }
@keyframes chicken-drive { from { top: -180px; } to { top: calc(100% + 180px); } }
@keyframes chicken-collision { 0% { top: calc(60% - 200px); } 65% { top: calc(60% + 40px); } 100% { top: calc(60% + 280px); } }
.chicken-token {
  --runner-x: 74px;
  position: absolute; left: 0; top: calc(60% - 66px); width: 80px; height: 80px;
  transform: translateX(calc(var(--runner-x) - 40px));
  transition: transform 360ms cubic-bezier(.2,.7,.2,1);
  z-index: 6; pointer-events: none;
}
.chicken-token img { display: block; width: 100%; height: 100%; }
.chicken-token .chicken-roast { display: none; }
.chicken-token.hit.loss-fire .chicken-alive { display: none; }
.chicken-token.hit.loss-fire .chicken-roast { display: block; }
.chicken-token.hit.loss-collision .chicken-alive { transform: translateY(22px) rotate(80deg) scale(.9,.7); }
.chicken-token.hit.loss-grate .chicken-alive { opacity: 0; }
.lane-hole { display: none; position: absolute; left: 50%; top: calc(60% - 16px); width: 64px; height: 34px; transform: translateX(-50%); border-radius: 50%; background: #081b25; }
.road-lane.danger.loss-grate .lane-hole { display: block; }
.road-world.loss-animating .road-lane.loss-grate .lane-marker { z-index: 7; animation: chicken-lid var(--ending-duration, 800ms) ease-in-out both; }
.road-world.loss-animating .chicken-token.loss-grate .chicken-alive { animation: chicken-fall var(--ending-duration, 800ms) ease-in both; }
@keyframes chicken-lid { 0%,100% { transform: translateX(-50%); } 25%,65% { transform: translate(-50%,-63px) scaleY(.8) rotate(-16deg); } }
@keyframes chicken-fall { 0%,25% { transform: none; opacity: 1; } 65% { transform: translateY(32px) rotate(160deg) scale(.4); opacity: 1; } 85%,100% { transform: translateY(52px) rotate(180deg) scale(.1); opacity: 0; } }
.chicken-token.hop { animation: chicken-hop 360ms ease-out; }
@keyframes chicken-hop { 0%,100% { margin-top: 0; } 45% { margin-top: -24px; } 80% { margin-top: 2px; } }
.lane-flame { display: none; position: absolute; top: calc(60% - 106px); left: calc(50% - 28px); width: 56px; height: 110px; z-index: 8; transform-origin: center bottom; }
.road-world.loss-animating .road-lane.danger.loss-fire .lane-flame {
  display: block; animation: chicken-flame var(--ending-duration, 800ms) ease-in-out both;
  background: radial-gradient(ellipse at 50% 95%,#fffab2 0 18%,#ffdc28 23% 37%,#ff961a 45% 62%,#f15317 70%,transparent 73%);
  clip-path: polygon(8% 100%,0 60%,18% 76%,13% 35%,35% 61%,51% 0,65% 50%,85% 25%,80% 70%,100% 52%,90% 100%);
}
@keyframes chicken-flame { 0% { transform: scaleY(.05); opacity: 0; } 20%,70% { transform: scaleY(1); opacity: 1; } 40%,60% { transform: scaleY(.85) scaleX(1.1); } 100% { transform: scaleY(.1); opacity: 0; } }
.multiplier-rail {
  position: absolute; top: calc(60% + 44px); left: var(--start-width);
  display: grid; grid-template-columns: repeat(var(--lane-count),var(--lane-width));
  pointer-events: none;
}
.multiplier-chip {
  display: grid; place-items: center; min-width: 0; height: 38px;
  margin: 0 15px; padding: 0 5px; border-radius: 16px;
  background: #2f4553; color: #e5eef5; font-size: 13px; font-weight: 750; white-space: nowrap;
}
.multiplier-chip.passed { background: #263c49; color: #a8becb; }
.multiplier-chip.current { background: var(--lane-accent); color: #10222e; }
.multiplier-chip.loss { background: #f22e56; color: #fff; }
.chicken-win-overlay {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  display: grid; justify-items: center; gap: 18px; min-width: 150px; padding: 23px 22px;
  border: 5px solid #00e701; border-radius: 15px; background: #172e3a; color: #00e701;
  box-shadow: 0 4px 0 rgba(0,0,0,.2); pointer-events: none; z-index: 9;
}
.chicken-win-overlay strong { font-size: 23px; font-weight: 750; }
.chicken-win-overlay span { border-top: 3px solid #3c5360; padding-top: 15px; font-size: 16px; font-weight: 750; }
.road-world.is-fast *, .road-world.is-fast .chicken-token { transition: none; animation: none; }
.road-world.no-ambient .vehicle.decorative { display: none; }
.chicken-result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.chicken-result-grid > div,
.history-panel,
.verifier-panel {
  padding: 1rem;
  border-radius: 0.45rem;
  background: #132d3a;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.chicken-result-grid strong {
  display: block;
  margin-top: 0.25rem;
  overflow-wrap: anywhere;
  font-size: 1.15rem;
}

.verifier-panel {
  color: #d7eaf2;
}

.verifier-panel summary {
  cursor: pointer;
  font-weight: 900;
}

.verifier-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.verifier-grid code {
  display: block;
  min-height: 2.6rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.45rem;
  background: #0d202b;
  border: 1px solid #335368;
  color: #e6f4fb;
  overflow-wrap: anywhere;
}

.verifier-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0.9rem 0;
}

#resultOutput {
  min-height: 12rem;
  max-height: 31rem;
  overflow: auto;
  padding: 1rem;
  border-radius: 0.45rem;
  background: #091c27;
  color: #e5f7ff;
  font-size: 0.78rem;
  line-height: 1.45;
}

.history-panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.history-table-wrap {
  overflow-x: auto;
}

.history-panel table {
  width: 100%;
  border-collapse: collapse;
}

.history-panel th,
.history-panel td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  text-align: left;
  white-space: nowrap;
}

.profit-positive {
  color: #14f46a;
}

.profit-negative {
  color: #ff5776;
}

.info-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(4, 13, 18, 0.72);
}

.info-dialog {
  width: min(36rem, 100%);
  border-radius: 0.55rem;
  background: #19313e;
  color: #dbeef7;
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.35);
}

.info-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2.25rem;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
}

.info-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.info-tabs {
  display: flex;
  width: max-content;
  max-width: calc(100% - 2rem);
  margin: 0 auto 0.75rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: #0d2330;
}

.info-tabs button {
  min-width: 8rem;
  min-height: 2.35rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #d6e7ef;
  font-weight: 900;
  cursor: pointer;
}

.info-tabs button.active {
  background: #6f8fa1;
  color: #061924;
}

.info-panel {
  padding: 0 1.25rem 1.25rem;
  line-height: 1.6;
}

.info-panel ol {
  margin: 0;
  padding-left: 1.2rem;
}

.max-list {
  display: grid;
  gap: 0.55rem;
}

.max-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.45rem;
  background: #102734;
}

@media (max-width: 1080px) {
  .chicken-topbar,
  .chicken-topbar .status-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .chicken-topbar .status-strip {
    width: 100%;
  }

  .chicken-layout,
  .chicken-layout.stats-open {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .chicken-body .live-stats-drawer {
    border-radius: 0;
  }

  .chicken-controls {
    border-radius: 0;
  }

  .chicken-bet-panel {
    position: static;
  }

  .chicken-stage {
    padding: 1rem;
  }

  .chicken-result-grid,
  .verifier-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .chicken-topbar {
    padding: 0.75rem;
  }

  .chicken-topbar .status-strip > div,
  .chicken-topbar .button {
    width: 100%;
  }

  .chicken-result-grid,
  .verifier-grid {
    grid-template-columns: 1fr;
  }

  .auto-rule-row {
    grid-template-columns: 1fr;
  }

  .auto-pacing {
    grid-template-columns: 1fr;
  }

  .road-scroll {
    padding: 0.75rem;
  }

  .road-world {
    height: 100%;
  }

  .info-tabs {
    width: calc(100% - 2rem);
  }

  .info-tabs button {
    min-width: 0;
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vehicle.decorative,
  .chicken-token,
  .chicken-token.hop,
  .chicken-token.hit {
    animation: none;
    transition: none;
  }
}

/* 8-decimal live stats layout fix */
.chicken-body .live-stats-metrics {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.chicken-body .live-stats-metrics > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 0.18rem;
  padding-right: 0.55rem;
  padding-left: 0.55rem;
}

.chicken-body .live-stats-metrics > div:nth-child(1) {
  order: 1;
}

.chicken-body .live-stats-metrics > div:nth-child(3) {
  order: 2;
}

.chicken-body .live-stats-metrics > div:nth-child(2) {
  order: 3;
}

.chicken-body .live-stats-metrics > div:nth-child(4) {
  order: 4;
}

.chicken-body .live-stats-metrics > div:nth-child(1),
.chicken-body .live-stats-metrics > div:nth-child(3) {
  grid-column: 1 / -1;
  border-right: 0;
}

.chicken-body .live-stats-metrics > div:nth-child(1),
.chicken-body .live-stats-metrics > div:nth-child(3) {
  border-bottom: 1px solid rgba(177, 186, 211, 0.22);
}

.chicken-body .live-stats-metrics .label {
  grid-column: 1 / -1;
}

.chicken-body .live-stats-metrics strong {
  grid-column: 1;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: normal;
  word-break: normal;
  white-space: nowrap;
  font-size: clamp(0.86rem, 3.1vw, 1.06rem);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.chicken-body .live-stats-metrics .credit-dot {
  grid-column: 2;
  align-self: center;
  justify-self: end;
  flex: 0 0 auto;
  width: 0.95rem;
  height: 0.95rem;
  margin-left: 0;
  font-size: 0.4rem;
  vertical-align: 0;
}
/* /8-decimal live stats layout fix */

/* Keep the road beside its controls until the shared mobile breakpoint. */
@media (min-width: 761px) {
  .chicken-layout, .chicken-layout.stats-open { grid-template-columns: 18rem minmax(0,1fr); }
}
@media (max-width: 760px) {
  .road-panel { --lane-width: 100px; --start-width: 110px; height: 370px; border-radius: 8px; }
  .road-scroll { padding: 0; }
  .road-pavement::before { width: 22px; }
  .road-crossing { height: 59px; top: calc(60% - 32px); }
  .road-shrub { width: 88px; top: calc(60% + 70px); }
  .start-zone { transform: scale(.7); transform-origin: left top; left: 7px; top: 8%; }
  .lane-marker { width: 70px; height: 49px; top: calc(60% - 23px); }
  .lane-barrier { width: 65px; top: calc(60% - 76px); }
  .chicken-token { width: 68px; height: 68px; top: calc(60% - 56px); transform: translateX(calc(var(--runner-x) - 34px)); }
  .vehicle { width: 50px; }
  .multiplier-rail { top: calc(60% + 37px); }
  .multiplier-chip { height: 30px; margin: 0 6px; font-size: 11px; }
  .chicken-win-overlay { min-width: 126px; padding: 16px; gap: 12px; }
  .chicken-win-overlay strong { font-size: 21px; }
  .chicken-win-overlay span { font-size: 14px; padding-top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .road-world *, .road-world .chicken-token { animation: none !important; transition: none !important; }
  .vehicle.decorative { display: none; }
}

.road-world.loss-animating .chicken-token.loss-collision .chicken-alive { animation: chicken-flatten var(--ending-duration, 800ms) linear both; }
@keyframes chicken-flatten { 0%,45% { transform: none; } 65%,100% { transform: translateY(22px) rotate(80deg) scale(.9,.7); } }
