:root {
  color-scheme: dark;
  --ink: #f8f5e7;
  --muted: #c9c0a0;
  --panel: #21362f;
  --panel-2: #17241f;
  --panel-3: #2e4d42;
  --line: #6e896e;
  --accent: #e5b74e;
  --accent-2: #65c0aa;
  --danger: #d8644a;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(33, 54, 47, 0.92), rgba(88, 82, 49, 0.38)),
    repeating-linear-gradient(0deg, #111d19 0, #111d19 3px, #14251f 3px, #14251f 6px);
  color: var(--ink);
  font-family: "Trebuchet MS", Verdana, Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  color: #172015;
  background: var(--accent);
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.5);
  opacity: 0.65;
}

.game-shell {
  width: min(1180px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 18px 0 24px;
}

.top-bar,
.objective-panel,
.play-area {
  width: 100%;
}

.top-bar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 2px 14px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--accent-2);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2.1rem, 7vw, 4.2rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: 1rem;
  letter-spacing: 0;
}

.season-readout {
  display: grid;
  gap: 3px;
  justify-items: end;
  min-width: 150px;
}

.season-readout span,
.panel-head span {
  color: var(--muted);
  font-size: 0.9rem;
}

.season-readout strong {
  font-size: 1.45rem;
  color: var(--accent);
}

.objective-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 36, 31, 0.92);
  box-shadow: var(--shadow);
}

.objective-panel p {
  max-width: 840px;
  margin-bottom: 0;
  color: #ede7ca;
  line-height: 1.45;
}

#restartButton {
  flex: 0 0 auto;
  min-width: 108px;
  padding: 12px 14px;
  border-radius: 6px;
  font-weight: 800;
}

.play-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 16px;
  margin-top: 16px;
}

.park-panel,
.control-panel {
  border: 2px solid var(--line);
  border-radius: 8px;
  background: rgba(28, 48, 41, 0.94);
  box-shadow: var(--shadow);
}

.park-panel {
  min-width: 0;
  padding: 14px;
}

.control-panel {
  padding: 14px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.panel-head h2 {
  margin-bottom: 0;
}

#parkCanvas {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  height: auto;
  border: 2px solid #0d1714;
  border-radius: 6px;
  background: #213a2e;
  image-rendering: pixelated;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.stats-grid div {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(201, 192, 160, 0.35);
  border-radius: 6px;
  background: var(--panel-2);
}

.stats-grid span,
.control-row span,
.ride-name,
.log-list {
  color: var(--muted);
}

.stats-grid span,
.control-row span {
  display: block;
  margin-bottom: 4px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.stats-grid strong {
  font-size: 1.25rem;
  color: var(--ink);
}

.control-grid {
  display: grid;
  gap: 10px;
}

.control-row {
  display: grid;
  grid-template-columns: 76px minmax(120px, 1fr) 54px;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px;
  border: 1px solid rgba(201, 192, 160, 0.35);
  border-radius: 6px;
  background: #182920;
}

.control-row span {
  margin-bottom: 0;
}

.control-row strong {
  text-align: right;
  color: var(--accent);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent-2);
}

.ride-list {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.ride-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid rgba(201, 192, 160, 0.35);
  border-radius: 6px;
  background: #16251d;
}

.ride-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  font-weight: 800;
}

.ride-status {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 700;
}

.meter {
  height: 9px;
  border-radius: 999px;
  background: #09100d;
  overflow: hidden;
}

.meter span {
  display: block;
  height: 100%;
  width: 50%;
  background: var(--accent-2);
}

.ride-card button {
  min-height: 38px;
  border-radius: 6px;
  font-size: 0.86rem;
  font-weight: 800;
}

.primary-action {
  width: 100%;
  min-height: 52px;
  border-radius: 6px;
  background: var(--accent);
  font-size: 1.05rem;
  font-weight: 900;
}

.report-box {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(201, 192, 160, 0.35);
  border-radius: 6px;
  background: #111d18;
}

.report-box p {
  margin-bottom: 10px;
  color: #f0e8ca;
  line-height: 1.4;
}

.log-list {
  display: grid;
  gap: 7px;
  max-height: 168px;
  margin: 0;
  padding-left: 20px;
  overflow: auto;
  line-height: 1.35;
}

.win {
  color: #9be089;
}

.loss {
  color: #ff987e;
}

@media (max-width: 920px) {
  .play-area {
    grid-template-columns: 1fr;
  }

  .control-panel {
    order: -1;
  }
}

@media (max-width: 640px) {
  .game-shell {
    width: min(100% - 16px, 1180px);
    padding-top: 10px;
  }

  .top-bar,
  .objective-panel,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .season-readout {
    justify-items: start;
  }

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

  .control-row {
    grid-template-columns: 68px minmax(90px, 1fr) 48px;
    gap: 8px;
  }

  .ride-card {
    grid-template-columns: 1fr;
  }
}
