.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) auto;
  align-items: center;
  gap: 0.5rem;
  min-height: 3.15rem;
  padding: 0.7rem 0.85rem;
  border-radius: 0.45rem;
  background: #18303d;
  color: #c6d8e2;
  font-size: 0.85rem;
}

.profit-card strong {
  color: #ffffff;
}

.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: 4.4rem minmax(0, 1fr) 5.8rem;
  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 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.6rem;
}

.custom-switch-row input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.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-panel {
  min-width: 0;
  padding: 0;
  border-radius: 0.45rem;
  overflow: hidden;
  background: #071c27;
}

.road-scroll {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 1rem;
  scrollbar-color: #496c7d #0a202b;
}

.road-world {
  --runner-step: 0;
  position: relative;
  width: 116rem;
  height: 30rem;
  border-radius: 0.45rem 0.45rem 0 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 5.5rem 0 / 4rem 100%,
    linear-gradient(180deg, rgba(255, 255, 255, 0.055) 3.3rem, transparent 3.3rem) 5.5rem 2rem / 4rem 6.5rem,
    #0a2030;
}

.start-zone {
  position: absolute;
  left: 1.1rem;
  top: 4.5rem;
  width: 4.1rem;
  height: 4.1rem;
  border-radius: 999px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  place-items: center;
  background: #193747;
  border: 0.35rem solid #294959;
  box-shadow: 0 0.5rem 1.2rem rgba(0, 0, 0, 0.26);
}

.start-light {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: #244253;
  box-shadow: inset 0 0 0 0.22rem #122734;
}

.start-light.active {
  background: #ffd12f;
}

.lane-track {
  position: absolute;
  left: 6rem;
  top: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(20, 5.125rem);
}

.road-lane {
  position: relative;
  min-width: 5.125rem;
  border-left: 1px dashed rgba(171, 207, 226, 0.08);
}

.road-lane::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 4.6rem;
  width: 0.3rem;
  height: 20.5rem;
  transform: translateX(-50%);
  border-radius: 999px;
  background: repeating-linear-gradient(
    to bottom,
    rgba(157, 190, 207, 0.18) 0,
    rgba(157, 190, 207, 0.18) 1.35rem,
    transparent 1.35rem,
    transparent 3.9rem
  );
}

.road-lane.passed {
  background: linear-gradient(180deg, rgba(34, 209, 158, 0.05), rgba(34, 209, 158, 0.1));
}

.road-lane.danger {
  background: linear-gradient(180deg, rgba(255, 37, 83, 0.05), rgba(255, 37, 83, 0.14));
}

.lane-marker {
  position: absolute;
  left: 50%;
  bottom: 4.9rem;
  width: 3.1rem;
  height: 2.05rem;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #193442;
  border: 0.24rem solid #284756;
  color: #5d7d8e;
  font-weight: 950;
  font-size: 0.82rem;
}

.road-lane.passed .lane-marker {
  border-color: #23d49d;
  color: #dffdf4;
}

.road-lane.danger .lane-marker {
  border-color: #ff2854;
  color: #ffffff;
}

.vehicle {
  position: absolute;
  left: 50%;
  top: var(--vehicle-top, 2.5rem);
  width: 2.65rem;
  height: 4.45rem;
  transform: translateX(-50%);
  border-radius: 0.7rem 0.7rem 0.45rem 0.45rem;
  background: var(--vehicle-colour, #2087ff);
  box-shadow: 0 0.55rem 0.8rem rgba(0, 0, 0, 0.28);
  opacity: 0.85;
}

.vehicle::before {
  content: "";
  position: absolute;
  left: 0.45rem;
  top: 0.55rem;
  width: 1.75rem;
  height: 0.95rem;
  border-radius: 0.25rem;
  background: rgba(239, 250, 255, 0.82);
}

.vehicle::after {
  content: "";
  position: absolute;
  left: 0.35rem;
  bottom: 0.55rem;
  width: 1.95rem;
  height: 0.35rem;
  border-radius: 999px;
  background: rgba(5, 20, 29, 0.55);
}

.vehicle.decorative {
  animation: driveY 6.5s linear infinite;
  animation-delay: var(--vehicle-delay, 0s);
}

.road-lane:not(.danger) .vehicle.crash {
  display: none;
}

.road-lane.danger .vehicle.crash {
  display: block;
  top: 16rem;
  background: #ffd039;
  opacity: 1;
  animation: none;
}

@keyframes driveY {
  from {
    transform: translate(-50%, -7rem);
  }
  to {
    transform: translate(-50%, 30rem);
  }
}

.chicken-token {
  position: absolute;
  left: 2.6rem;
  bottom: 9.25rem;
  width: 3.45rem;
  height: 3.1rem;
  transform: translateX(calc(var(--runner-step) * 5.125rem));
  transition: transform 0.34s cubic-bezier(.2, .8, .2, 1);
  z-index: 5;
}

.token-body {
  position: absolute;
  left: 0.35rem;
  bottom: 0.25rem;
  width: 2.55rem;
  height: 2rem;
  border-radius: 60% 52% 52% 58%;
  background: #f7fbff;
  box-shadow: inset -0.25rem -0.2rem 0 rgba(199, 212, 218, 0.9), 0 0.45rem 0.7rem rgba(0, 0, 0, 0.25);
}

.token-body::before,
.token-body::after {
  content: "";
  position: absolute;
  bottom: -0.33rem;
  width: 0.16rem;
  height: 0.62rem;
  background: #f6a525;
}

.token-body::before {
  left: 0.95rem;
}

.token-body::after {
  right: 0.85rem;
}

.token-head {
  position: absolute;
  right: 0.05rem;
  top: 0.4rem;
  width: 1.25rem;
  height: 1.45rem;
  border-radius: 55% 55% 45% 45%;
  background: #ffffff;
  box-shadow: inset -0.12rem -0.15rem 0 #dce7ec;
}

.token-head::before {
  content: "";
  position: absolute;
  right: 0.28rem;
  top: 0.43rem;
  width: 0.16rem;
  height: 0.16rem;
  border-radius: 50%;
  background: #0c1c25;
}

.token-beak {
  position: absolute;
  right: -0.37rem;
  top: 1.15rem;
  width: 0;
  height: 0;
  border-left: 0.52rem solid #ffbd33;
  border-top: 0.22rem solid transparent;
  border-bottom: 0.22rem solid transparent;
}

.token-comb {
  position: absolute;
  right: 0.34rem;
  top: 0.13rem;
  width: 0.72rem;
  height: 0.42rem;
  border-radius: 999px 999px 0 0;
  background: #ff2854;
  box-shadow: -0.22rem 0.1rem 0 #ff2854;
}

.chicken-token.hop {
  animation: hop 0.34s ease;
}

.chicken-token.hit {
  animation: hitShake 0.45s ease;
}

@keyframes hop {
  0%,
  100% {
    margin-bottom: 0;
  }
  50% {
    margin-bottom: 1.1rem;
  }
}

@keyframes hitShake {
  0%,
  100% {
    margin-left: 0;
  }
  25% {
    margin-left: -0.35rem;
  }
  60% {
    margin-left: 0.35rem;
  }
}

.round-banner {
  position: absolute;
  left: 6rem;
  bottom: 1.3rem;
  min-width: 16rem;
  padding: 0.7rem 1rem;
  border-radius: 0.45rem;
  background: rgba(19, 45, 59, 0.95);
  color: #d8edf6;
  font-weight: 850;
  box-shadow: 0 0.6rem 1rem rgba(0, 0, 0, 0.24);
}

.round-banner.win {
  background: #0e6f55;
  color: #ffffff;
}

.round-banner.loss {
  background: #95233d;
  color: #ffffff;
}

.multiplier-rail {
  display: grid;
  grid-template-columns: repeat(20, 5.125rem);
  gap: 0;
  width: 116rem;
  padding-left: 6rem;
  padding-bottom: 1rem;
  background: #071c27;
}

.multiplier-chip {
  display: grid;
  place-items: center;
  min-height: 2.35rem;
  margin: 0.25rem 0.22rem 0;
  border-radius: 0.55rem;
  background: #263f4f;
  color: #e7f3f8;
  font-size: 0.77rem;
  font-weight: 950;
  white-space: nowrap;
}

.multiplier-chip.passed,
.multiplier-chip.current {
  background: #ffd12f;
  color: #061a25;
}

.multiplier-chip.loss {
  background: #ff2854;
  color: #ffffff;
}

.multiplier-chip.locked {
  opacity: 0.42;
}

.chicken-result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.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: 27rem;
  }

  .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;
  }
}
