* {
  box-sizing: border-box;
}
:root {
  font-family: Inter, Arial, sans-serif;
  color: #e5e9db;
  background: #101918;
  font-synthesis: none;
}
body {
  margin: 0;
  overflow: hidden;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
  border: 1px solid #46514a;
  background: #26332f;
  border-radius: 5px;
  transition:
    background 0.15s,
    transform 0.15s;
}
button:hover {
  background: #3a4b3e;
  border-color: #b3c574;
}
button:active {
  transform: translateY(1px);
}
button:focus-visible,
input:focus-visible {
  outline: 3px solid #d3f27b;
  outline-offset: 3px;
}
button:disabled {
  opacity: 0.33;
  cursor: not-allowed;
}
button.primary {
  background: #d2ec83;
  color: #19231a;
  border-color: #e4ffaa;
  font-weight: 800;
  letter-spacing: 1.3px;
  padding: 17px 24px;
  box-shadow: 0 4px 20px #c2f36c18;
}
button.primary:hover {
  background: #e3ffa0;
}
[hidden] {
  display: none !important;
}
#app {
  display: flex;
  height: 100dvh;
}
#field {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
#world {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  background: #404c46;
}
.field-header {
  position: absolute;
  top: 26px;
  left: 28px;
  right: 25px;
  display: flex;
  align-items: center;
  gap: 20px;
  pointer-events: none;
}
.badge {
  font-size: 10px;
  letter-spacing: 1.8px;
  color: #c8d999;
  border: 1px solid #a2b27755;
  padding: 9px;
  background: #1b2926df;
}
.field-header div {
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-shadow: 0 2px 3px #000;
}
.field-header b {
  font-size: 14px;
  letter-spacing: 2px;
}
.field-header div span {
  font-size: 11px;
  color: #c8cec2;
}
.field-header button {
  margin-left: auto;
  padding: 10px 13px;
  font-size: 11px;
  letter-spacing: 1px;
  background: #17241ee8;
  pointer-events: auto;
}
#objective {
  position: absolute;
  left: 28px;
  top: 91px;
  padding: 11px 14px;
  background: #15231ee8;
  color: #d5dfc0;
  border-left: 2px solid #c8df83;
  letter-spacing: 1.1px;
  font-size: 10px;
}
.live-dot,
.map-footer i {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d2ec83;
  margin-right: 9px;
  box-shadow: 0 0 9px #c9f275;
}
.map-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 47px;
  background: #101d1df0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 25px;
  font-size: 9px;
  letter-spacing: 1.2px;
  color: #a9b6a8;
  border-top: 1px solid #65705744;
}
.map-footer b {
  margin: 0 15px;
  color: #e0e7d2;
  font-size: 10px;
}
.map-footer button {
  width: 27px;
  height: 27px;
  font-size: 18px;
}
.map-footer span {
  display: flex;
  align-items: center;
}
#hud {
  width: 324px;
  flex-shrink: 0;
  background: linear-gradient(115deg, #202d29, #14201e);
  border-left: 1px solid #65735e66;
  padding: 24px 22px 12px;
  overflow-y: auto;
  scrollbar-width: thin;
  box-shadow: -10px 0 30px #0003;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  position: relative;
}
.brand img {
  width: 43px;
  height: 48px;
}
.brand div {
  font-size: 27px;
  font-weight: 950;
  line-height: 0.9;
  letter-spacing: 2px;
  color: #d8edab;
}
.brand div span {
  display: block;
  font-size: 18px;
  letter-spacing: 3.3px;
  margin-top: 5px;
}
.brand small {
  writing-mode: vertical-rl;
  font-size: 7px;
  letter-spacing: 1.5px;
  color: #8b9c8c;
  margin-left: auto;
}
.scenario {
  margin-top: 23px;
  border-bottom: 1px solid #61715755;
  padding-bottom: 17px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.scenario span {
  font-size: 8px;
  letter-spacing: 2px;
  color: #8d9e8b;
}
.scenario b {
  font-size: 12px;
  letter-spacing: 1.3px;
}
.section-label {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: 1.6px;
  color: #9ea995;
  margin: 19px 0 10px;
}
.section-label span {
  color: #cce187;
  font-size: 8px;
}
#minimap {
  width: 100%;
  height: 139px;
  background: #111b18;
  border: 1px solid #53614a;
  border-radius: 4px;
  cursor: crosshair;
}
.population {
  margin-bottom: 13px;
}
.population > div:first-child {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  letter-spacing: 1px;
}
.population strong {
  font-size: 20px;
  letter-spacing: 0;
}
.population span {
  color: #a5b0a5;
  font-size: 10px;
}
.male {
  color: #42b8ff;
}
.female {
  color: #ff65ad;
}
.meter {
  height: 7px;
  background: #091511;
  border-radius: 2px;
  margin: 6px 0 4px;
  overflow: hidden;
}
.meter i {
  height: 100%;
  display: block;
  background: currentColor;
  transition: width 0.3s;
}
.population small {
  font-size: 8px;
  letter-spacing: 0.4px;
  color: #94a491;
}
.population.danger .meter {
  animation: pulse 0.7s infinite;
}
.equipment-heading {
  border-top: 1px solid #61715755;
  padding-top: 17px;
  margin-top: 15px;
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 1.3px;
}
.equipment-heading span {
  color: #cce187;
  font-size: 8px;
}
#equipment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 12px;
}
.tool {
  position: relative;
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  padding: 8px;
  background: #27342e;
  border: 1px solid #52604766;
}
.tool img {
  width: 32px;
  height: 32px;
}
.tool .name {
  font-size: 9px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.3px;
}
.tool .count {
  position: absolute;
  right: 5px;
  top: 4px;
  font-size: 9px;
  color: #d8edab;
}
.tool.locked {
  opacity: 0.38;
}
.tool.selected {
  border-color: #d2ec83;
  background: #4e5d36;
  box-shadow: 0 0 0 1px #d2ec8355;
}
.tool.arrived {
  animation: arrival 0.9s;
}
.tool .unlock {
  display: block;
  font-size: 8px;
  color: #b2beaa;
  font-weight: 400;
}
#toolHint {
  min-height: 38px;
  font-size: 10px;
  line-height: 1.5;
  color: #a6b39f;
  padding-top: 10px;
}
.run-stats {
  display: flex;
  align-items: center;
  gap: 36px;
  border-top: 1px solid #61715755;
  padding-top: 14px;
}
.run-stats div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.run-stats small {
  font-size: 8px;
  letter-spacing: 1.4px;
  color: #92a28e;
}
.run-stats b {
  font:
    20px Consolas,
    monospace;
  letter-spacing: 1px;
}
.run-stats button {
  margin-left: auto;
  width: 29px;
  height: 30px;
}
.offline {
  font-size: 8px;
  letter-spacing: 1.3px;
  color: #8a9c7d;
  margin-top: 14px;
}
.modal {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #091310bb;
  backdrop-filter: blur(5px);
  padding: 25px;
}
.modal.menu {
  justify-content: flex-start;
  padding-left: 8%;
  background: linear-gradient(
    90deg,
    #091612f5 0%,
    #0d1b17d9 40%,
    #09161255 75%
  );
  backdrop-filter: blur(1px);
}
.panel {
  max-width: 700px;
  width: 100%;
  max-height: 94dvh;
  overflow: auto;
  padding: 35px;
  background: #182720;
  border: 1px solid #68755777;
  box-shadow: 0 22px 90px #0008;
  border-radius: 8px;
}
.menu .panel {
  background: none;
  border: 0;
  box-shadow: none;
  max-width: 550px;
  padding: 20px;
}
.eyebrow {
  color: #c7df8b;
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
}
.panel h1 {
  font-size: clamp(52px, 6.5vw, 100px);
  line-height: 0.88;
  letter-spacing: -4px;
  color: #e4efcc;
  margin: 28px 0 16px;
  font-weight: 950;
  text-shadow: 0 5px 0 #15251c;
}
.panel h1 span {
  color: #cde785;
}
.subtitle {
  letter-spacing: 5px;
  font-size: 12px;
  color: #cedab7;
  margin: 22px 0;
}
.panel h2 {
  font-size: 30px;
  letter-spacing: -0.7px;
}
.panel p {
  color: #abbca7;
  line-height: 1.7;
  font-size: 14px;
}
.menu .panel p {
  max-width: 360px;
}
.menu-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 28px;
  max-width: 360px;
}
.menu-actions .primary {
  grid-column: 1/-1;
}
.menu-actions button {
  padding: 12px;
  font-size: 11px;
  letter-spacing: 1px;
}
.text-button {
  border: 0;
  background: transparent !important;
  color: #90a584;
  font-size: 10px;
  padding: 14px 0;
}
.panel footer {
  border-top: 1px solid #52604766;
  margin-top: 20px;
  padding-top: 18px;
  font-size: 10px;
  color: #8b9b7e;
  letter-spacing: 1px;
}
.panel .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.actions button {
  padding: 12px 20px;
}
.guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.guide-item {
  display: flex;
  gap: 12px;
  padding: 10px;
  border: 1px solid #4e604555;
  border-radius: 4px;
}
.guide-item img {
  width: 36px;
  height: 36px;
}
.guide-item b {
  font-size: 12px;
}
.guide-item p {
  font-size: 11px;
  margin: 5px 0 0;
  line-height: 1.5;
}
.lesson {
  display: flex;
  gap: 15px;
  align-items: center;
  padding: 16px;
  background: #0e1e18;
  border-left: 3px solid #d2ec83;
  margin: 18px 0;
}
.lesson strong {
  font-size: 30px;
  white-space: nowrap;
}
.lesson p {
  margin: 0;
  font-size: 12px;
}
.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  border-bottom: 1px solid #56634b55;
  gap: 20px;
}
.setting input {
  accent-color: #cde785;
  max-width: 180px;
}
#toast {
  position: absolute;
  top: 145px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  background: #d2ec83;
  color: #1e2b19;
  padding: 12px 22px;
  font-size: 11px;
  letter-spacing: 1px;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 4;
  white-space: nowrap;
}
#toast.visible {
  opacity: 1;
}
#tutorial {
  position: absolute;
  bottom: 70px;
  left: 28px;
  background: #15271af5;
  border: 1px solid #9db86588;
  border-radius: 5px;
  max-width: 360px;
  padding: 16px 18px;
  font-size: 12px;
  line-height: 1.7;
  box-shadow: 0 8px 25px #0005;
}
#tutorial:empty {
  display: none;
}
#tutorial small {
  color: #cde785;
  letter-spacing: 2px;
  display: block;
  margin-bottom: 5px;
  font-size: 9px;
}
#tutorial button {
  padding: 6px 12px;
  font-size: 10px;
  margin: 10px 6px 0 0;
}
#contained {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  text-align: center;
  background: #15271af5;
  padding: 30px 40px;
  border: 1px solid #d2ec83;
  box-shadow: 0 0 100px #c3df5d25;
  width: min(90%, 520px);
}
#contained small {
  color: #cde785;
  font-size: 9px;
  letter-spacing: 3px;
}
#contained h2 {
  font-size: 26px;
  color: #d2ec83;
}
#contained p {
  font-size: 12px;
  color: #bdcbb0;
}
#debug {
  position: absolute;
  left: 10px;
  bottom: 50px;
  z-index: 25;
  background: #101b18ed;
  padding: 10px;
  width: 320px;
  max-height: 42vh;
  overflow: auto;
  font-size: 11px;
  border: 1px solid #9aaa78;
}
#debug button {
  margin: 3px;
  padding: 6px;
  font-size: 10px;
}
#debug label {
  display: inline-block;
  padding: 5px;
}
#debug select {
  background: #25382d;
  color: white;
}
.result-score {
  font:
    56px Consolas,
    monospace;
  color: #d2ec83;
}
.score-lines {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  font-size: 13px;
  color: #b7c4ac;
}
@keyframes pulse {
  50% {
    opacity: 0.4;
  }
}
@keyframes arrival {
  50% {
    background: #a9c36b;
    transform: scale(1.05);
  }
}
@media (min-height: 950px) {
  #minimap {
    height: 175px;
  }
  .tool {
    min-height: 74px;
  }
  .population {
    margin-bottom: 20px;
  }
}
@media (max-width: 1000px) {
  #hud {
    width: 280px;
    padding: 18px 16px;
  }
  .badge {
    display: none;
  }
  .field-header {
    left: 18px;
  }
  .map-footer {
    padding: 0 12px;
  }
  .map-footer span:last-child {
    font-size: 0;
  }
  .map-footer b {
    margin: 0 8px;
  }
  .tool {
    padding: 7px;
    gap: 5px;
  }
  .tool img {
    width: 27px;
    height: 27px;
  }
}
@media (max-width: 650px) {
  #app {
    display: block;
  }
  #field {
    height: calc(100dvh - 220px);
  }
  #hud {
    position: absolute;
    bottom: 0;
    height: 220px;
    width: 100%;
    padding: 10px 12px;
    border-top: 1px solid #6b7958;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 14px;
    overflow: hidden;
  }
  .brand,
  .scenario,
  .section-label,
  #minimap,
  .equipment-heading,
  .run-stats,
  .offline,
  #toolHint {
    display: none;
  }
  .population {
    margin: 0;
    height: 45px;
  }
  .population small {
    display: none;
  }
  .population strong {
    font-size: 16px;
  }
  #equipment {
    grid-column: 1/-1;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    margin: 5px 0 0;
    align-self: start;
  }
  .tool {
    height: 65px;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 5px 2px;
    align-items: center;
    text-align: center;
  }
  .tool img {
    height: 25px;
    width: 25px;
  }
  .tool .name {
    font-size: 8px;
  }
  .tool .unlock {
    font-size: 7px;
  }
  .map-footer {
    font-size: 7px;
    height: 36px;
  }
  .field-header {
    top: 15px;
    left: 14px;
    right: 14px;
  }
  .field-header b {
    font-size: 11px;
  }
  #objective {
    left: 14px;
    top: 65px;
    font-size: 8px;
    padding: 9px;
  }
  .modal.menu {
    padding: 18px;
    background: #091612cc;
    justify-content: center;
  }
  .panel {
    padding: 22px;
  }
  .panel h1 {
    font-size: 65px;
  }
  .panel h2 {
    font-size: 24px;
  }
  .guide-grid {
    grid-template-columns: 1fr;
  }
  .menu .panel {
    padding: 10px;
  }
  .panel p {
    font-size: 12px;
  }
  #tutorial {
    left: 14px;
    bottom: 50px;
    max-width: calc(100% - 28px);
  }
  #toast {
    top: 110px;
    font-size: 8px;
    max-width: 95%;
    white-space: normal;
    text-align: center;
  }
  #contained {
    padding: 22px;
  }
  #contained h2 {
    font-size: 20px;
  }
}
.reduced-motion *,
.reduced-motion *::before,
.reduced-motion *::after {
  animation: none !important;
  transition: none !important;
}
@media (min-width: 651px) and (max-height: 1000px) {
  #hud {
    padding: 16px 18px 10px;
  }
  .brand img {
    width: 36px;
    height: 39px;
  }
  .brand div {
    font-size: 24px;
  }
  .brand div span {
    font-size: 15px;
  }
  .scenario {
    margin-top: 13px;
    padding-bottom: 12px;
    gap: 5px;
  }
  .section-label {
    margin: 12px 0 8px;
  }
  #minimap {
    height: 110px;
  }
  .population {
    margin-bottom: 10px;
  }
  .equipment-heading {
    padding-top: 12px;
    margin-top: 10px;
  }
  #equipment {
    gap: 6px;
    margin-top: 9px;
  }
  .tool {
    min-height: 49px;
  }
  .tool img {
    width: 30px;
    height: 30px;
  }
  #toolHint {
    min-height: 34px;
    padding-top: 8px;
  }
  .run-stats {
    padding-top: 10px;
  }
  .offline {
    margin-top: 10px;
  }
}
@media (min-width: 651px) and (max-height: 790px) {
  #hud {
    padding: 12px 16px 8px;
  }
  .brand img {
    width: 32px;
    height: 33px;
  }
  .brand div {
    font-size: 20px;
  }
  .brand div span {
    font-size: 13px;
  }
  .scenario {
    margin-top: 10px;
    padding-bottom: 8px;
  }
  .scenario span {
    display: none;
  }
  .section-label {
    margin: 9px 0 6px;
  }
  #minimap {
    height: 80px;
  }
  .population {
    margin-bottom: 7px;
  }
  .population strong {
    font-size: 17px;
  }
  .equipment-heading {
    padding-top: 8px;
    margin-top: 8px;
  }
  .tool {
    min-height: 43px;
    padding: 5px;
  }
  .tool img {
    width: 27px;
    height: 27px;
  }
  #toolHint {
    font-size: 9px;
    min-height: 30px;
  }
  .run-stats {
    padding-top: 8px;
  }
  .run-stats b {
    font-size: 17px;
  }
  .offline {
    margin-top: 7px;
    font-size: 7px;
  }
}
#debug {
  left: auto;
  right: 334px;
  top: 145px;
  bottom: auto;
  width: 300px;
  max-height: 340px;
}
@media (max-width: 1000px) {
  #debug {
    right: 290px;
  }
}
@media (max-width: 650px) {
  #debug {
    right: 10px;
    top: 110px;
    max-height: 180px;
  }
}
.tool .name {
  font-size: 11px;
}
.tool .count {
  font-size: 10px;
}
.section-label,
.equipment-heading {
  font-size: 10px;
}
.population > div:first-child {
  font-size: 11px;
}
.population small {
  font-size: 10px;
}
.scenario b {
  font-size: 13px;
}
.run-stats small {
  font-size: 9px;
}
.offline {
  font-size: 9px;
}
@media (max-width: 650px) {
  .tool .name {
    font-size: 9px;
  }
  .tool .count {
    font-size: 9px;
  }
  .population > div:first-child {
    font-size: 11px;
  }
}
@media (min-width: 651px) and (max-height: 790px) {
  .population small {
    font-size: 8px;
  }
  .tool .name {
    font-size: 10px;
  }
  .offline {
    font-size: 8px;
  }
}
.brand small {
  position: absolute;
  right: 0;
  top: 4px;
  writing-mode: horizontal-tb;
  max-width: 57px;
  text-align: right;
  font-size: 7px;
  line-height: 1.6;
  letter-spacing: 1px;
}
@media (min-width: 651px) and (max-height: 790px) {
  .brand small {
    display: none;
  }
  .section-label {
    margin-top: 7px;
  }
  #minimap {
    height: 76px;
  }
  .scenario {
    margin-top: 7px;
  }
}
/* Risk / reward economy */
#wallet {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin: 8px 0;
  background: #0e1c15;
  border: 1px solid #a7c56b55;
  border-radius: 5px;
}
#wallet > div {
  display: flex;
  align-items: center;
  gap: 12px;
}
#wallet small {
  font-size: 10px;
  letter-spacing: 1px;
  color: #c1d491;
}
#cash {
  font:
    700 28px Consolas,
    monospace;
  color: #e0f7ad;
}
#income {
  font-size: 12px;
  color: #aace75;
  margin-left: auto;
}
#riskBonus {
  flex-basis: 100%;
  text-align: right;
}
#riskBonus.hot {
  color: #ffd477 !important;
  font-weight: 800;
}
.cash-tick #cash {
  animation: wallet-tick 0.3s;
}
.tool .unlock {
  font-size: 11px;
  font-weight: bold;
  color: #deebb6;
}
.tool.locked {
  opacity: 0.48;
}
#comboPayoff {
  position: absolute;
  z-index: 8;
  left: 50%;
  top: 23%;
  transform: translateX(-50%);
  min-width: 280px;
  max-width: 90%;
  padding: 17px 26px;
  background: #132119ef;
  border: 2px solid #cfdf90;
  border-radius: 7px;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 15px 65px #0008;
}
#comboPayoff small {
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 3px;
  color: #e6f3b6;
}
#comboPayoff strong {
  display: block;
  font:
    900 54px Consolas,
    monospace;
  color: #eafaaf;
  line-height: 1.1;
}
#comboPayoff b {
  display: block;
  font:
    700 32px Consolas,
    monospace;
  color: white;
}
#comboPayoff span {
  display: block;
  font-size: 11px;
  color: #dedabc;
  margin-top: 8px;
}
#comboPayoff[data-tier="huge"] {
  border-color: #ffc162;
  box-shadow: 0 0 70px #ffb54044;
}
#comboPayoff[data-tier="huge"] strong {
  color: #ffce7e;
  font-size: 70px;
}
#comboPayoff[data-tier="mass"] {
  border-color: #ffb480;
}
.setting select {
  background: #27382d;
  color: #e3ebd4;
  padding: 10px;
  border: 1px solid #788968;
  max-width: 60%;
}
@keyframes wallet-tick {
  50% {
    color: white;
    text-shadow: 0 0 14px #b8e474;
  }
}
@media (min-width: 651px) {
  #minimap {
    height: 85px;
  }
  .scenario {
    margin-top: 9px;
    padding-bottom: 8px;
  }
  .tool {
    min-height: 44px;
  }
  #equipment {
    gap: 5px;
  }
  #wallet {
    padding: 7px 10px;
  }
  #cash {
    font-size: 24px;
  }
  .run-stats {
    gap: 20px;
  }
  .run-stats b {
    font-size: 20px;
  }
}
@media (min-width: 651px) and (max-height: 790px) {
  #minimap {
    height: 56px;
  }
  .brand {
    display: none;
  }
  .population small {
    display: none;
  }
  .population {
    margin-bottom: 6px;
  }
  .tool {
    min-height: 40px;
  }
  #wallet {
    margin: 5px 0;
    padding: 5px 9px;
  }
  #riskBonus {
    flex-basis: auto;
    margin-left: auto;
    font-size: 9px;
  }
  #cash {
    font-size: 22px;
  }
  #toolHint {
    min-height: 26px;
  }
}
@media (max-width: 650px) {
  #field {
    height: calc(100dvh - 270px);
  }
  #hud {
    height: 270px;
    grid-template-rows: 38px 36px 1fr;
    row-gap: 3px;
  }
  #wallet {
    grid-column: 1/-1;
    grid-row: 2;
    margin: 0;
    padding: 2px 7px;
    flex-wrap: nowrap;
  }
  #wallet small,
  #income {
    font-size: 9px;
  }
  #cash {
    font-size: 20px;
  }
  #riskBonus {
    flex-basis: auto;
    font-size: 8px !important;
    margin-left: auto;
  }
  #equipment {
    grid-row: 3;
    grid-template-columns: repeat(6, 1fr);
    gap: 3px;
    margin: 3px 0;
  }
  .tool {
    height: 76px;
    padding: 4px 1px;
  }
  .tool .name {
    font-size: 8px;
  }
  .tool .unlock {
    font-size: 9px;
  }
  .tool img {
    height: 26px;
    width: 26px;
  }
  #comboPayoff {
    top: 21%;
    padding: 12px;
    min-width: 235px;
  }
  #comboPayoff strong {
    font-size: 40px;
  }
  #comboPayoff[data-tier="huge"] strong {
    font-size: 52px;
  }
  #comboPayoff b {
    font-size: 28px;
  }
  .run-stats {
    display: flex;
    position: absolute;
    top: 0;
    right: 10px;
    border: 0;
    padding: 0;
  }
  .run-stats > div:first-child,
  .run-stats > button {
    display: none;
  }
  .run-stats > div:nth-child(2) {
    display: none;
  }
}
#mobileScore {
  display: none;
}
@media (max-width: 650px) {
  #mobileScore {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font:
      14px Consolas,
      monospace;
    color: #edf3cf;
  }
  #mobileScore small {
    font: 7px Arial;
    letter-spacing: 1px;
  }
  #wallet {
    gap: 7px;
  }
  #wallet > div {
    gap: 5px;
  }
}
.combo-pop {
  animation: combo-pop 0.3s ease-out;
}
@keyframes combo-pop {
  0% {
    scale: 0.86;
    opacity: 0.3;
  }
  65% {
    scale: 1.06;
  }
  100% {
    scale: 1;
    opacity: 1;
  }
}
#breedingNotice {
  position: absolute;
  top: 115px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  background: #172832ef;
  border: 1px solid #ed83c1;
  color: #ffe1f3;
  padding: 10px 18px;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 1px;
  pointer-events: none;
  white-space: nowrap;
}
#barrierAction {
  position: absolute;
  bottom: 66px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9;
  background: #1a2e26f5;
  border: 1px solid #f2cb73;
  padding: 12px;
  white-space: nowrap;
  box-shadow: 0 5px 30px #0008;
}
#barrierAction span {
  display: block;
  font-size: 10px;
  color: #e5c561;
  margin-bottom: 6px;
  letter-spacing: 2px;
}
#openBarrier {
  padding: 10px;
  color: #f9db8f;
}
#cancelBarrier {
  margin-left: 10px;
}
#breedingTelemetry {
  max-width: 410px;
  line-height: 1.7;
  color: #f1cce6;
  margin-top: 6px;
  font-size: 10px;
}
#debug {
  max-height: 65vh;
  overflow: auto;
}
@media (max-width: 650px) {
  #breedingNotice {
    top: 95px;
    font-size: 9px;
    padding: 9px;
    max-width: 95%;
    white-space: normal;
  }
  #barrierAction {
    bottom: 50px;
    font-size: 10px;
  }
}
#field:has(#comboPayoff:not([hidden])) #contained {
  top: auto;
  bottom: 65px;
  transform: translateX(-50%);
  padding: 12px 16px;
  width: min(90%, 360px);
}
#field:has(#comboPayoff:not([hidden])) #contained h2 {
  font-size: 16px;
  margin: 4px 0 10px;
}
#field:has(#comboPayoff:not([hidden])) #contained p,
#field:has(#comboPayoff:not([hidden])) #contained small {
  display: none;
}

.setting input[type="number"] {
  width: 82px;
  background: #122b32;
  color: #e4f7ee;
  border: 1px solid #55706b;
  border-radius: 5px;
  padding: 8px;
}
.aquatic #hud {
  background: linear-gradient(160deg, #112e36, #0b1925);
}
.aquatic .field-header,
.aquatic .map-footer {
  background: #092632e8;
}
.aquatic #objective {
  color: #90eddf;
}
.aquatic .panel {
  background: linear-gradient(145deg, #17373d, #111e2a);
}

.map-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #8dd9d7;
  margin: 12px 0;
}
.map-preview img {
  width: 54px;
  height: 54px;
}
.map-preview span {
  font-size: 12px;
}

.modal:has(#mapSetting) {
  z-index: 30;
}

.urban #hud {
  background: linear-gradient(160deg, #34434a, #192c35);
}
.urban .field-header,
.urban .map-footer {
  background: #263b43ee;
}
.urban #objective {
  color: #efd3a0;
}
.urban .panel {
  background: linear-gradient(145deg, #35444a, #1c2d37);
}

/* Keep the playfield clear: only floating controls occupy its edges. */
.field-header,
.aquatic .field-header,
.urban .field-header {
  top: 14px;
  right: 14px;
  left: auto;
  padding: 0;
  background: none;
  border: 0;
}
.map-footer,
.aquatic .map-footer,
.urban .map-footer {
  left: auto;
  right: 14px;
  bottom: 14px;
  width: auto;
  height: auto;
  padding: 6px;
  gap: 8px;
  border: 1px solid #768b7766;
  border-radius: 8px;
  background: #142522e8;
}
.map-footer b {
  margin: 0;
  min-width: 36px;
  text-align: center;
}
.map-footer button {
  width: 32px;
  height: 32px;
}
#scoreCard {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid #cfde8f77;
  border-radius: 10px;
  background: linear-gradient(130deg, #35452d, #142622);
}
.score-top,
.score-best {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 0.5px;
}
.score-top {
  color: #e5edbd;
}
#scoreRank {
  color: #e9c784;
}
#scoreCard > strong {
  display: block;
  font-size: 42px;
  font-variant-numeric: tabular-nums;
  color: #e7ffa5;
  line-height: 1.2;
  margin: 6px 0;
}
.score-best {
  color: #bbcbb5;
}
#scoreProgress {
  display: block;
  width: 100%;
  height: 7px;
  margin: 12px 0 8px;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  accent-color: #dcf18c;
  background: #091b19;
}
#scoreProgress::-webkit-progress-bar {
  background: #091b19;
}
#scoreProgress::-webkit-progress-value {
  background: linear-gradient(90deg, #7dcab0, #e6ed9a);
}
#scoreTarget {
  font-size: 11px;
  color: #e2d49f;
  font-weight: 700;
}
#scoreCard > small {
  display: block;
  font-size: 10px;
  color: #a9bfa6;
  margin-top: 6px;
}
#scoreCard[data-rank="gold"],
#scoreCard[data-rank="platinum"],
#scoreCard[data-rank="diamond"] {
  border-color: #f5d681;
}
#hud #tutorial,
#hud #toast,
#hud #comboPayoff,
#hud #contained {
  position: static;
  transform: none;
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 8px 0;
  padding: 12px;
  grid-column: 1/-1;
  box-shadow: none;
  font-size: 12px;
}
#hud #toast:not(.visible),
#hud #breedingNotice {
  display: none;
}
#hud #comboPayoff {
  animation: none;
  border-width: 1px;
}
#hud #comboPayoff strong,
#hud #comboPayoff[data-tier="huge"] strong {
  font-size: 26px;
}
#hud #comboPayoff b {
  font-size: 18px;
}
#hud #comboPayoff small,
#hud #comboPayoff span {
  font-size: 10px;
}
#hud #contained h2 {
  font-size: 19px;
}
#hud #contained button {
  width: 100%;
  padding: 12px;
}
#mobileScore {
  display: none;
}
.result-medal {
  color: #e4cf8f;
  font-weight: bold;
}
@media (max-width: 650px) {
  #field {
    height: calc(100dvh - 355px);
    min-height: 150px;
  }
  #hud {
    height: 355px;
    overflow-y: auto;
    align-content: start;
  }
  #scoreCard {
    display: block;
    grid-column: 1/-1;
    margin: 0 0 8px;
    padding: 9px 12px;
    position: relative;
  }
  #scoreCard > strong {
    font-size: 29px;
    margin: 3px 0;
  }
  .score-best {
    position: absolute;
    right: 12px;
    top: 34px;
    gap: 8px;
  }
  #scoreProgress {
    margin: 6px 0;
    height: 5px;
  }
  #scoreCard > small {
    display: none;
  }
  #scoreTarget {
    font-size: 10px;
  }
  #hud #tutorial {
    max-height: 110px;
    overflow-y: auto;
  }
  #hud #comboPayoff {
    padding: 7px;
  }
  #hud #comboPayoff strong,
  #hud #comboPayoff[data-tier="huge"] strong {
    font-size: 20px;
  }
}

@media (max-width: 650px) {
  #hud {
    grid-template-rows: none;
    grid-auto-rows: auto;
  }
  #wallet,
  #equipment {
    grid-row: auto;
  }
}

@media (max-width: 650px) {
  .tool {
    height: 68px;
  }
}
