:root {
  color-scheme: dark;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  background: #0d1220;
  color: #eff3fa;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  padding: 20px;
  min-height: 100vh;
  background: radial-gradient(ellipse at top, #233252 0, #0d1220 75%);
}
main {
  max-width: 1080px;
  margin: auto;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 15px;
}
h1 {
  font-size: clamp(23px, 4vw, 34px);
  margin: 0;
  color: #e2ef85;
}
h1 span {
  font-size: 13px;
  color: #b8c3d5;
}
button {
  font: inherit;
  background: #293954;
  color: white;
  border: 1px solid #536985;
  border-radius: 7px;
  padding: 11px 14px;
  cursor: pointer;
}
button:hover:not(:disabled) {
  background: #3d5579;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
.primary {
  background: #507239;
  border-color: #a4ca77;
}
.danger {
  background: #603c44;
  border-color: #9c636f;
}
button:focus-visible,
input:focus-visible {
  outline: 2px solid #e2ef85;
}
#scene {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 960/390;
  background: #172943;
  border: 3px solid #556f87;
  border-radius: 12px;
  image-rendering: pixelated;
}
.layout {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 14px;
  margin-top: 14px;
}
.panel {
  background: #141e2f;
  border: 1px solid #334761;
  border-radius: 10px;
  padding: 16px;
}
.panel h2 {
  margin: 0 0 12px;
  font-size: 16px;
  color: #e2ef85;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.metric {
  background: #18263b;
  padding: 11px;
  border: 1px solid #324761;
  border-radius: 9px;
}
.metric strong {
  font-size: 25px;
  display: block;
}
.metric small {
  font-size: 11px;
  color: #aebdce;
}
.controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 13px;
}
label {
  display: block;
  color: #aebdce;
  font-size: 13px;
  margin-bottom: 6px;
}
input[type='range'] {
  width: 100%;
  accent-color: #adcf83;
}
#status {
  min-height: 3em;
  white-space: pre-wrap;
  line-height: 1.45;
  font-size: 12px;
  color: #b6c5d8;
}
.row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  margin: 9px 0;
}
.bar {
  background: #283b51;
  height: 12px;
  border-radius: 10px;
  overflow: hidden;
}
.fill {
  height: 100%;
  background: #94bd63;
  transition: width 0.2s;
}
.bar.enemy .fill {
  background: #e5877a;
}
.small {
  font-size: 12px;
  color: #aebdce;
  line-height: 1.6;
}
.pill {
  padding: 4px 7px;
  background: #273956;
  border-radius: 5px;
}
.switch {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #eff3fa;
}
.switch input {
  accent-color: #adcf83;
}
.note {
  margin: 12px 0 0;
  color: #b7c3d3;
  font-size: 12px;
  line-height: 1.65;
}
#log {
  height: 360px;
  resize: vertical;
  min-height: 180px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.7;
  color: #bfccd8;
}
a {
  color: #cbe58f;
}
footer {
  font-size: 11px;
  color: #aab6c5;
  margin-top: 14px;
}
@media (max-width: 740px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  body {
    padding: 12px;
  }
}
/* 3D prototype presentation. Existing sensor/debug panels stay below the ride view. */
:root {
  background: #132c28;
  color: #eeeedd;
}
body {
  background: radial-gradient(ellipse at top, #35584c, #112722 85%);
}
main {
  max-width: 1320px;
}
header {
  padding: 10px 0;
}
h1 {
  letter-spacing: 0.08em;
  color: #e2e9b8;
}
h1 span {
  display: block;
  margin-top: 7px;
  font-size: 10px;
  color: #bed1b9;
  letter-spacing: 0.14em;
}
.world-frame {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #708e75;
  background: #b9d1c5;
  box-shadow: 0 20px 70px #0004;
}
#scene {
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  display: block;
  border: 0;
  border-radius: 0;
  image-rendering: auto;
}
.world-title {
  position: absolute;
  left: 30px;
  top: 28px;
  pointer-events: none;
  color: #203b32;
  text-shadow: 0 1px #fff5;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 0.22em;
}
.world-title h2 {
  margin: 7px 0;
  font-family: Georgia, serif;
  font-weight: normal;
  font-size: clamp(22px, 3.7vw, 48px);
}
.world-title p {
  font-size: 11px;
  margin-top: 7px;
}
.world-bottom {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 15px;
  display: flex;
  gap: 12px;
  align-items: center;
  background: #102d25dc;
  border: 1px solid #b2cda34a;
  border-radius: 9px;
  padding: 9px 14px;
  color: #eff2da;
  font-size: 12px;
}
.world-bottom > span {
  flex: 1;
}
.world-bottom label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 10px;
  margin: 0;
  color: #dce9d1;
}
.world-bottom button {
  font-size: 10px;
  padding: 6px 10px;
}
select {
  background: #294b3f;
  color: #ecf1d9;
  border: 1px solid #6a8a6b;
  padding: 5px;
  border-radius: 4px;
}
.world-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 40px;
  text-align: center;
  background: #193e34dd;
  color: #edf2dd;
}
.world-loading[hidden] {
  display: none;
}
.enemy-label {
  position: absolute;
  transform: translate(-50%, -100%);
  pointer-events: none;
  font-size: 11px;
  background: #163128d9;
  border: 1px solid #acc092;
  border-radius: 6px;
  padding: 6px 9px;
  color: #f3f2da;
  min-width: 90px;
  text-align: center;
}
.enemy-label > div {
  height: 4px;
  background: #2c4839;
  margin-top: 5px;
}
.enemy-label i {
  display: block;
  height: 100%;
  background: #e3b56d;
}
.panel {
  background: #172f29;
  border-color: #48604c;
}
.metric {
  background: #203d32;
  border-color: #50694d;
}
.metric strong {
  color: #e4edbe;
}
.panel h2 {
  color: #dce8b8;
}
button {
  background: #304f40;
  border-color: #6c8967;
}
button:hover:not(:disabled) {
  background: #41684e;
}
.primary {
  background: #697b42;
  border-color: #bbd195;
}
.pill {
  background: #365542;
  color: #e1e7c4;
}
.layout {
  grid-template-columns: 1.6fr 1fr;
}
.world-frame:fullscreen {
  display: grid;
  place-items: center;
  border-radius: 0;
}
.world-frame:fullscreen #scene {
  height: 100%;
  aspect-ratio: auto;
}
@media (max-width: 740px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .world-title {
    top: 14px;
    left: 15px;
  }
  .world-title p {
    display: none;
  }
  .world-bottom {
    font-size: 10px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    padding: 6px 8px;
  }
  .world-bottom label {
    display: none;
  }
  #scene {
    aspect-ratio: 4/3;
  }
  .world-bottom button {
    padding: 4px 6px;
  }
}

.world-hud {
  position: absolute;
  right: 20px;
  top: 24px;
  display: flex;
  gap: 8px;
  color: #203a30;
  font-size: 9px;
}
.world-hud span {
  background: #eef0d4cb;
  border: 1px solid #fff6;
  border-radius: 7px;
  padding: 8px 11px;
}
.world-hud b {
  display: block;
  font-size: 19px;
  margin-bottom: 2px;
}
@media (max-width: 740px) {
  .world-hud {
    top: 74px;
    right: 12px;
    gap: 4px;
  }
  .world-hud span {
    padding: 5px 8px;
  }
  .world-hud b {
    font-size: 15px;
  }
}

.training-panel {
  margin: 16px 0;
}
.training-panel input[type='number'] {
  width: 86px;
}
.ability-slots {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.ability-slots label {
  display: grid;
  gap: 6px;
}
.training-panel details {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid #587360;
  border-radius: 8px;
}
#gameOver {
  padding: 16px;
  background: #4b2c32;
  color: white;
}
[hidden] {
  display: none !important;
}

.training-hud {
  position: absolute;
  left: 18px;
  bottom: 65px;
  display: grid;
  gap: 4px;
  padding: 10px 14px;
  background: #152f29e8;
  color: #fff;
  border-radius: 8px;
  pointer-events: none;
}
.game-over-overlay {
  position: absolute;
  z-index: 5;
  top: 20%;
  left: 10%;
  right: 10%;
  border-radius: 12px;
  box-shadow: 0 10px 40px #0008;
}
@media (max-width: 600px) {
  .world-title {
    display: none;
  }
  .training-hud {
    left: 8px;
    bottom: 76px;
    font-size: 12px;
  }
  .game-over-overlay {
    left: 3%;
    right: 3%;
    top: 8%;
  }
}
