/* GRAVYARD SHIFT — an after-hours kitchen, printed in ink and acid. */
:root {
  color-scheme: dark;
  --ink: #181c1b;
  --ink-deep: #101413;
  --ink-soft: #252b28;
  --paper: #f0ecd9;
  --paper-dim: #b9b9a6;
  --paper-dark: #ddd9c7;
  --lime: #d4fb62;
  --lime-dark: #a7d345;
  --coral: #ff795f;
  --blue: #86d2dc;
  --line: rgba(240, 236, 217, .2);
  --font: "Arial", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --display: Impact, "Arial Narrow", "Franklin Gothic Condensed", var(--font);
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overscroll-behavior: none; }
body {
  overflow: hidden;
  background: var(--ink-deep);
  color: var(--paper);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 5px;
}
button:disabled { cursor: not-allowed; opacity: .4; }
button:disabled:hover { transform: none; }
button svg { display: block; }
::selection { color: var(--ink); background: var(--lime); }
#game { position: fixed; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; }
#app { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.hidden { display: none !important; }
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 34px;
  pointer-events: none;
  background: rgba(13, 18, 16, .75);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.screen > * { flex-shrink: 0; }

/* Opening shift. */
#menu {
  background: linear-gradient(100deg, rgba(16, 21, 18, .93) 3%, rgba(16, 21, 18, .7) 55%, rgba(16, 21, 18, .82));
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 48px 6vw;
}
#menu::before {
  content: "";
  position: fixed;
  inset: 15px;
  border: 1px solid rgba(240, 236, 217, .14);
  pointer-events: none;
}
.menu-layout {
  width: min(1200px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.17fr) minmax(350px, .83fr);
  gap: clamp(32px, 6vw, 94px);
  align-items: center;
  position: relative;
  margin: auto;
}
.menu-brand { position: relative; padding: 10px 0; }
.eyebrow, .brand-kicker, .card-label, .panel-kicker, .upgrade-type {
  font: 700 11px/1.3 var(--mono);
  text-transform: uppercase;
  letter-spacing: 2px;
}
.brand-kicker, .eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--lime);
  margin: 0 0 24px;
}
.brand-kicker::before, .menu-brand > .eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--lime);
  box-shadow: 0 0 15px rgba(212, 251, 98, .3);
}
.game-title {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--paper);
  font-family: var(--display);
  font-size: clamp(68px, 8.3vw, 120px);
  font-weight: 900;
  line-height: .85;
  letter-spacing: -2px;
  text-transform: uppercase;
  text-shadow: 4px 4px 0 var(--ink-deep);
}
.game-title > span { display: inline; }
.game-title .title-outline, .title-outline {
  color: var(--lime);
  -webkit-text-stroke: 0;
  margin-top: 8px;
}
.game-title .title-period { display: inline; color: var(--coral); }
.tagline {
  max-width: 470px;
  margin: 25px 0 12px;
  color: var(--paper);
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 800;
  line-height: 1.55;
  letter-spacing: -.8px;
  word-break: keep-all;
}
.menu-description {
  max-width: 420px;
  margin: 0;
  color: var(--paper-dim);
  font-size: 13px;
  line-height: 1.85;
  word-break: keep-all;
}
.sticker {
  display: inline-block;
  padding: 7px 11px;
  border: 2px solid var(--ink);
  background: var(--lime);
  color: var(--ink);
  font: 900 11px/1.25 var(--mono);
  letter-spacing: .7px;
  box-shadow: 3px 3px 0 var(--ink-deep);
  transform: rotate(-5deg);
}
.menu-brand > .sticker { margin: 22px 0 0; }
.record-strip {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  align-items: baseline;
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  max-width: 430px;
}
.record-strip > div { display: flex; flex-direction: column; gap: 4px; }
.record-strip label, .record-strip small, .record-strip span {
  display: block;
  color: #969e92;
  font: 700 10px/1.4 var(--mono);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.record-strip strong {
  display: block;
  font: 700 22px/1.1 var(--mono);
  letter-spacing: -1px;
  color: var(--paper);
}
.menu-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 20px;
  color: #969e92;
  font: 10px/1.5 var(--mono);
  letter-spacing: .3px;
}
.menu-layout > .menu-footer { grid-column: 1 / -1; margin-top: -20px; }
.menu-brand .menu-footer { margin-top: 24px; }
.corner-note { position: fixed; bottom: 24px; left: 6vw; font: 700 8px/1.5 var(--mono); color: #7e8977; letter-spacing: 2px; }
.menu-footer a { color: inherit; text-underline-offset: 4px; pointer-events: auto; }
.menu-card {
  position: relative;
  pointer-events: auto;
  background: var(--paper);
  color: var(--ink);
  padding: 30px;
  border: 3px solid var(--ink-deep);
  box-shadow: 9px 9px 0 var(--lime), 11px 11px 0 var(--ink-deep);
}
.menu-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -3px;
  height: 5px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 12px, var(--paper) 12px 15px);
}
.card-label { color: #68705e; margin: 0 0 10px; }
.card-label > span:last-child:not(:first-child) { float: right; font-size: 8px; letter-spacing: .4px; line-height: 14px; }
.card-title { font-size: 27px; font-weight: 900; letter-spacing: -1.2px; line-height: 1.25; margin: 0 0 24px; }
.menu-card .panel-copy { color: #68705c; margin-top: -13px; margin-bottom: 20px; font-size: 11px; }
.menu-card .menu-footer { display: block; margin: 17px 0 0; color: #7a816d; font-size: 9px; line-height: 1.7; letter-spacing: -.2px; text-align: center; }
.difficulty-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 20px; font-size: 10px; font-weight: 700; color: #68705c; }
.difficulty-row .button-row { flex-wrap: nowrap; margin: 0; gap: 5px; }
.difficulty-row .button { flex: 0 0 auto; min-height: 30px; padding: 6px 8px; background: transparent; color: #5d6550; border: 1px solid #b6baa5; font-size: 10px; }
.difficulty-row .button.active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.mobile-howto { display: none; margin: 19px 0 0; font-size: 10px; line-height: 1.7; color: #68705c; text-align: center; }
.starter-options { display: grid; gap: 9px; margin: 0 0 22px; }
.starter-card {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 43px minmax(0, 1fr);
  align-items: center;
  gap: 1px 13px;
  padding: 12px 34px 12px 12px;
  color: var(--ink);
  background: transparent;
  border: 2px solid #c6c7b4;
  text-align: left;
  transition: background 120ms ease, transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}
.starter-card::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 13px;
  width: 12px;
  height: 12px;
  border: 2px solid #969d87;
  border-radius: 50%;
  transform: translateY(-50%);
}
.starter-card:hover { background: #e7e7d2; border-color: var(--ink); }
.starter-card.active { background: var(--lime); border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); transform: translate(-1px, -1px); }
.starter-card.active::after { border-color: var(--ink); background: var(--ink); box-shadow: inset 0 0 0 2px var(--lime); }
.weapon-icon {
  grid-row: 1 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 43px;
  height: 43px;
  font-size: 25px;
  line-height: 1;
}
.weapon-icon svg { width: 34px; height: 34px; }
.starter-name { display: block; font-weight: 900; font-size: 15px; line-height: 1.4; letter-spacing: -.4px; }
.starter-desc { display: block; color: #58604e; font-size: 11px; line-height: 1.5; word-break: keep-all; }
.starter-card > div:not(.weapon-icon) { grid-column: 2; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 45px;
  padding: 11px 18px;
  border: 2px solid var(--paper);
  border-radius: 0;
  color: var(--paper);
  background: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -.15px;
  pointer-events: auto;
  transition: transform 120ms ease, background 120ms ease, box-shadow 120ms ease;
}
.button:hover { background: #333a31; transform: translateY(-2px); }
.button:active { transform: translateY(1px); box-shadow: none; }
.button.primary { background: var(--lime); border-color: var(--ink); color: var(--ink); box-shadow: 4px 4px 0 var(--ink-deep); }
.button.primary:hover { background: #e1ff8c; }
.menu-card > .button.primary { width: 100%; min-height: 54px; background: var(--ink); border-color: var(--ink); color: var(--paper); box-shadow: 4px 4px 0 #a7b991; font-size: 15px; }
.menu-card > .button.primary:hover { background: #30392a; }
.button.secondary { background: transparent; border-color: #51594c; color: var(--paper); }
.button.secondary:hover { border-color: var(--paper); background: rgba(240, 236, 217, .06); }
.menu-card .button.secondary { color: var(--ink); border-color: #b6baa5; }
.menu-card .button.secondary:hover { background: #e2e5cd; border-color: var(--ink); }
.button.small { min-height: 34px; padding: 7px 11px; font-size: 11px; }
.button.danger { color: var(--coral); border-color: var(--coral); }
.button.danger:hover { background: #40271f; }
.button-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin-top: 16px; }
.button-row > .button { flex: 1; }
.howto {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 23px;
  padding-top: 18px;
  border-top: 1px dashed #b3b7a3;
  color: #6d725f;
  font-size: 10px;
  line-height: 1.8;
  text-align: center;
}
.kbd, kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 21px;
  min-height: 21px;
  margin: 0 2px;
  padding: 0 5px;
  border: 1px solid currentColor;
  border-bottom-width: 3px;
  border-radius: 2px;
  font: 700 10px/1.5 var(--mono);
  vertical-align: middle;
}

/* A little dumpling with a very long night ahead of it. */
.hero-illustration { position: absolute; right: -4px; bottom: 45px; width: 150px; height: 150px; pointer-events: none; transform: rotate(9deg); }
.hero-dumpling {
  position: relative;
  width: 130px;
  height: 105px;
  margin: 34px auto 0;
  border: 5px solid var(--ink-deep);
  border-radius: 48% 48% 42% 42%;
  background: var(--paper);
  box-shadow: 6px 7px 0 rgba(0, 0, 0, .2), inset -9px -8px 0 #d3ccae;
}
.menu-brand > .hero-dumpling { position: absolute; right: 35px; bottom: 100px; margin: 0; transform: rotate(9deg); }
.hero-dumpling::before { content: ""; position: absolute; width: 44px; height: 28px; top: -21px; left: 37px; border: 5px solid var(--ink-deep); border-bottom: 0; background: var(--paper); border-radius: 50% 50% 0 0; }
.hero-dumpling::after { content: ""; position: absolute; width: 19px; height: 9px; bottom: 20px; left: 48px; border-bottom: 4px solid var(--ink); border-radius: 50%; }
.dumpling-eye { position: absolute; width: 8px; height: 13px; background: var(--ink); left: 32px; top: 44px; border-radius: 3px; transform: rotate(-8deg); }
.dumpling-eye:nth-of-type(2) { left: auto; right: 31px; transform: rotate(8deg); }
.dumpling-fold { position: absolute; left: 57px; top: 8px; width: 3px; height: 25px; background: #b7af92; transform-origin: top center; transform: rotate(-33deg); }
.dumpling-fold:nth-of-type(4) { transform: rotate(0); }
.dumpling-fold:nth-of-type(5) { transform: rotate(33deg); }

/* The run reads in one glance. */
#hud { position: fixed; inset: 20px 24px auto; padding-top: env(safe-area-inset-top, 0px); pointer-events: none; }
.hud-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.hud-left { display: grid; gap: 0; min-width: 0; width: clamp(190px, 21vw, 280px); }
.health-block {
  width: clamp(190px, 21vw, 280px);
  padding: 11px 13px 13px;
  border: 2px solid rgba(240, 236, 217, .25);
  background: rgba(20, 26, 22, .92);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .2);
}
.health-label { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 7px; color: var(--paper); font: 700 11px/1.2 var(--mono); letter-spacing: .4px; }
.health-label > :first-child { color: var(--coral); }
.hud-left .health-block { width: 100%; }
.xp-label { display: flex; justify-content: space-between; padding: 6px 2px 4px; color: var(--paper-dim); font: 700 9px/1.1 var(--mono); text-shadow: 1px 1px 0 var(--ink-deep); }
.xp-label > :first-child { color: var(--lime); }
.hud-left > .xp-track { margin-top: 0; width: 100%; }
.health-track, .xp-track, .boss-track { overflow: hidden; height: 9px; background: #414637; }
.health-fill { width: 100%; height: 100%; background: var(--coral); transition: width 150ms ease-out; }
.xp-track { height: 4px; margin-top: 5px; background: #333b2d; }
.xp-fill { height: 100%; width: 0; background: var(--lime); transition: width 150ms ease-out; }
.run-clock {
  position: absolute;
  top: env(safe-area-inset-top, 0px);
  left: 50%;
  min-width: 112px;
  transform: translateX(-50%);
  padding: 9px 15px 8px;
  border: 2px solid rgba(240, 236, 217, .25);
  background: rgba(20, 26, 22, .94);
  text-align: center;
}
.clock-value { display: block; font: 800 29px/1 var(--mono); letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.clock-caption { display: block; margin-top: 4px; color: #aaaF98; font: 700 8px/1.2 var(--mono); letter-spacing: 1.5px; text-transform: uppercase; }
.hud-actions { display: flex; align-items: center; gap: 8px; pointer-events: auto; }
.hud-actions .button, #pausebutton, #settingsbutton { min-width: 39px; min-height: 39px; border-color: rgba(240, 236, 217, .28); background: rgba(20, 26, 22, .94); color: var(--paper); }
.hud-actions .button:hover { background: #3a4331; border-color: var(--paper); }
.hud-bottom { position: fixed; left: 24px; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; align-items: flex-start; gap: 13px; }
.build-slots { display: flex; gap: 7px; flex-wrap: wrap; max-width: 440px; }
.build-slot { position: relative; display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; border: 2px solid #657052; background: rgba(20, 26, 22, .94); font-size: 23px; line-height: 1; box-shadow: 3px 3px 0 rgba(0, 0, 0, .25); }
.build-slot:empty { border-color: #3c4435; background: rgba(20, 26, 22, .5); }
.build-slot small, .build-slot > span:last-child:not(:first-child) { position: absolute; right: -3px; bottom: -4px; padding: 2px 4px; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); font: 800 9px/1 var(--mono); }
.build-slot.evolved { border-color: var(--lime); box-shadow: 0 0 14px rgba(212, 251, 98, .18); }
.dash-indicator { display: flex; align-items: center; gap: 7px; color: #a2ac92; font: 700 10px/1.2 var(--mono); letter-spacing: .7px; text-transform: uppercase; }
.dash-pip { display: inline-block; width: 28px; height: 6px; background: #414b36; border: 1px solid #596549; transform: skew(-15deg); }
.dash-pip.ready { background: var(--lime); border-color: var(--lime); }
#bossbar { position: fixed; top: calc(106px + env(safe-area-inset-top, 0px)); left: 50%; width: min(430px, calc(100% - 40px)); transform: translateX(-50%); padding: 10px 14px 12px; border: 2px solid var(--coral); background: rgba(28, 24, 19, .94); box-shadow: 4px 4px 0 rgba(0, 0, 0, .25); }
.boss-name { display: flex; justify-content: space-between; margin-bottom: 7px; color: var(--coral); font: 800 11px/1.2 var(--mono); letter-spacing: 1.3px; text-transform: uppercase; }
.boss-track { height: 8px; background: #58372d; }
.boss-fill { height: 100%; background: var(--coral); transition: width 150ms ease-out; }
#hurt-flash { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse at center, transparent 42%, rgba(255, 84, 60, .35)); opacity: 0; transition: opacity 120ms ease-out; }

/* Intermissions, upgrades, and the end-of-shift receipt. */
.panel {
  width: min(470px, 100%);
  position: relative;
  margin: auto;
  padding: 32px;
  background: var(--ink);
  border: 2px solid var(--paper);
  color: var(--paper);
  box-shadow: 8px 8px 0 #080c08, 9px 9px 0 #6a715e;
  pointer-events: auto;
  animation: panel-arrive 160ms ease-out both;
}
.panel::before { content: ""; position: absolute; top: -2px; left: 28px; width: 38px; height: 4px; background: var(--lime); }
.panel-wide { width: min(890px, 100%); }
.panel > .button { width: 100%; }
.panel > .button + .button { margin-top: 12px; }
.panel-kicker { margin: 0 0 12px; color: var(--lime); }
.panel-title { margin: 0 0 12px; font-size: clamp(26px, 3.2vw, 39px); font-weight: 900; line-height: 1.17; letter-spacing: -1.5px; word-break: keep-all; }
.panel-copy { color: var(--paper-dim); margin: 0 0 23px; font-size: 12px; line-height: 1.85; word-break: keep-all; }
.upgrade-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-top: 28px; }
.upgrade-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  min-height: 272px;
  padding: 18px;
  border: 2px solid #686f5c;
  border-radius: 0;
  color: var(--paper);
  background: #252d23;
  text-align: left;
  transition: transform 140ms ease, background 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}
.upgrade-card:hover, .upgrade-card:focus-visible { background: #333e29; border-color: var(--lime); transform: translate(-2px, -5px); box-shadow: 5px 6px 0 #080c08; }
.upgrade-card:active { transform: translate(0, 0); box-shadow: none; }
.upgrade-type { display: block; margin: 0 0 18px; color: #b4bea2; font-size: 9px; letter-spacing: 1.5px; }
.upgrade-icon { display: flex; justify-content: center; align-items: center; width: 54px; height: 54px; margin: 0 0 17px; background: #161d13; border: 1px solid #566344; font-size: 31px; line-height: 1; }
.upgrade-icon svg { width: 35px; height: 35px; }
.upgrade-name { display: block; margin-bottom: 8px; font-size: 17px; line-height: 1.3; font-weight: 900; letter-spacing: -.6px; word-break: keep-all; }
.upgrade-desc { display: block; margin: 0 0 20px; color: var(--paper-dim); font-size: 11px; line-height: 1.75; word-break: keep-all; }
.upgrade-level { display: block; margin-top: auto; color: var(--lime); font: 700 10px/1.4 var(--mono); letter-spacing: .8px; }
.upgrade-synergy { display: block; width: 100%; margin-top: 12px; padding-top: 10px; border-top: 1px dashed #4d5a40; color: #a8bd8f; font-size: 10px; line-height: 1.6; word-break: keep-all; }
.upgrade-card.evolution { border-color: var(--lime); background: #344321; box-shadow: inset 0 0 0 3px var(--ink); }
.upgrade-card.evolution .upgrade-type, .upgrade-card.evolution .upgrade-name { color: var(--lime); }
.upgrade-card.evolution .upgrade-icon { border-color: var(--lime); background: #29361a; }
.reroll-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 23px; color: #a1aa95; font-size: 10px; }
.reroll-row .button { flex-shrink: 0; }
.pause-stats { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin: 22px 0 26px; padding: 16px 0; border-top: 1px dashed #59604d; border-bottom: 1px dashed #59604d; color: var(--paper-dim); font: 12px/1.8 var(--mono); }
.pause-stats strong { color: var(--paper); }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--line); color: var(--paper); font-size: 12px; cursor: pointer; }
.settings-row input[type="checkbox"] { width: 19px; height: 19px; margin: 0; flex-shrink: 0; accent-color: var(--lime); cursor: pointer; }
.settings-row input[type="range"] { width: 140px; min-width: 70px; accent-color: var(--lime); cursor: pointer; }
.settings-row select { max-width: 150px; padding: 6px 9px; border: 1px solid #6a7458; background: var(--ink-soft); color: var(--paper); }
.settings-note { margin: 15px 0 22px; color: #a0aa92; font-size: 10px; line-height: 1.8; word-break: keep-all; }
.result-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid #526045; border-left: 1px solid #526045; margin: 24px 0 22px; }
.stat-item { display: flex; flex-direction: column; gap: 5px; padding: 17px 15px; border-right: 1px solid #526045; border-bottom: 1px solid #526045; }
.stat-item label, .stat-item > span, .stat-item small { color: #a4ae95; font-size: 10px; }
.stat-item strong { font: 800 24px/1.2 var(--mono); letter-spacing: -.5px; }
.stat-item:first-child strong { color: var(--lime); }
.recipe-list { margin: 14px 0 21px; padding: 12px 14px; border-left: 3px solid var(--lime); background: #252e20; color: #c7cfb6; font-size: 11px; line-height: 1.85; word-break: keep-all; }
.recipe-list:empty { display: none; }
.result-cause { margin: 8px 0 15px; color: var(--coral); font-size: 12px; line-height: 1.6; }
.codex-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 24px 0; }
.codex-card { position: relative; min-width: 0; padding: 17px; border: 1px solid #58624c; background: #232b21; }
.codex-card h3, .codex-card strong { margin: 0 0 8px; color: var(--lime); font-size: 15px; letter-spacing: -.5px; }
.codex-card p { margin: 7px 0 0; font-size: 11px; line-height: 1.75; color: var(--paper-dim); word-break: keep-all; }
.recipe-arrow { display: inline-block; padding: 0 5px; color: var(--lime); font-weight: 900; }
.warning-note { padding: 11px 13px; margin: 17px 0 0; border: 1px solid #80624a; background: #342b20; color: #f2c29d; font-size: 11px; line-height: 1.7; word-break: keep-all; }
.menu-card .warning-note { background: #e8dcc0; border-color: #b69a71; color: #755438; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

/* Touch sits outside the player's line of sight. */
#touch-controls { display: none; position: fixed; inset: 0; pointer-events: none; z-index: 4; }
#joystick-base { position: absolute; width: 116px; height: 116px; border: 2px solid rgba(212, 251, 98, .5); border-radius: 50%; background: rgba(212, 251, 98, .055); transform: translate(-50%, -50%); opacity: 0; pointer-events: none; transition: opacity 100ms ease; }
#joystick-base.active { opacity: 1; }
#joystick-base::before { content: ""; position: absolute; inset: 15px; border: 1px dashed rgba(212, 251, 98, .25); border-radius: 50%; }
#joystick-knob { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--lime); background: rgba(212, 251, 98, .2); transform: translate(-50%, -50%); }
#dash-button { position: fixed; right: calc(24px + env(safe-area-inset-right, 0px)); bottom: calc(27px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; width: 83px; height: 83px; border: 2px solid var(--lime); border-radius: 50%; background: rgba(30, 40, 22, .9); color: var(--lime); font: 900 12px/1.2 var(--mono); letter-spacing: .5px; box-shadow: 0 0 0 5px rgba(212, 251, 98, .06); touch-action: none; pointer-events: auto; user-select: none; -webkit-user-select: none; }
#dash-button:active { background: var(--lime); color: var(--ink); transform: scale(.94); }
#dash-button:disabled { opacity: .35; }
.touch-hint { position: absolute; left: 28px; bottom: calc(37px + env(safe-area-inset-bottom, 0px)); color: rgba(240, 236, 217, .5); font-size: 10px; letter-spacing: .2px; text-align: center; }

@keyframes panel-arrive { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-arrive { from { opacity: 0; } to { opacity: 1; } }

@media (min-width: 1500px) {
  .menu-layout { max-width: 1320px; gap: 100px; }
  .game-title { font-size: 139px; }
  .menu-card { padding: 36px; }
  .starter-card { padding-top: 16px; padding-bottom: 16px; }
}
@media (max-width: 1050px) {
  #menu { padding: 38px 5vw; }
  .menu-layout { grid-template-columns: minmax(0, 1fr) minmax(320px, .9fr); gap: 35px; }
  .game-title { font-size: clamp(60px, 8vw, 88px); }
  .menu-card { padding: 24px; }
  .hero-illustration { opacity: .65; right: -5px; bottom: 36px; transform: scale(.8) rotate(9deg); transform-origin: bottom right; }
  .menu-brand > .hero-dumpling { right: 0; bottom: 105px; transform: scale(.78) rotate(9deg); transform-origin: bottom right; }
  .tagline, .menu-description { max-width: 350px; }
  .record-strip { gap: 20px; }
}
@media (max-width: 780px) {
  .screen { padding: 24px; }
  #menu { padding: 40px 6vw; }
  .menu-layout { max-width: 540px; grid-template-columns: 1fr; gap: 28px; }
  .menu-brand { padding: 0; }
  .brand-kicker, .eyebrow { margin-bottom: 16px; font-size: 10px; }
  .game-title { font-size: clamp(66px, 14vw, 104px); line-height: .88; }
  .game-title > span { display: inline; }
  .game-title .title-outline { display: inline; margin-top: 3px; }
  .tagline { margin-top: 18px; margin-bottom: 8px; max-width: 100%; font-size: 19px; }
  .menu-description { max-width: 100%; font-size: 12px; }
  .menu-brand > .sticker { position: absolute; top: 73px; right: 0; margin: 0; transform: rotate(6deg); font-size: 9px; }
  .hero-illustration { right: 8px; bottom: 78px; opacity: 1; transform: scale(.68) rotate(9deg); }
  .menu-brand > .hero-dumpling { right: 8px; bottom: 76px; transform: scale(.85) rotate(9deg); }
  .record-strip { max-width: 100%; margin-top: 21px; padding-top: 13px; gap: 30px; }
  .record-strip strong { font-size: 18px; }
  .record-strip label, .record-strip span, .record-strip small { font-size: 9px; }
  .menu-card { padding: 25px; box-shadow: 6px 6px 0 var(--lime), 8px 8px 0 var(--ink-deep); }
  .card-title { margin-bottom: 18px; }
  .starter-options { gap: 7px; margin-bottom: 18px; }
  .starter-card { padding-top: 10px; padding-bottom: 10px; }
  .menu-layout > .menu-footer { margin-top: 0; }
  .corner-note { display: none; }
  .menu-brand .menu-footer { margin-top: 16px; }
  .panel { padding: 25px; }
  .upgrade-grid { gap: 10px; }
  .upgrade-card { padding: 14px; }
  .upgrade-name { font-size: 15px; }
  .upgrade-desc { font-size: 10px; }
  #hud { inset: 15px 16px auto; }
  .health-block { width: 185px; padding: 9px 10px 10px; }
  .hud-left { width: 185px; }
  .clock-value { font-size: 25px; }
  .run-clock { min-width: 94px; padding: 8px 10px; }
  .hud-bottom { left: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 640px) {
  .screen { padding: 20px 16px; }
  #menu { padding: calc(30px + env(safe-area-inset-top, 0px)) 7vw calc(30px + env(safe-area-inset-bottom, 0px)); }
  #menu::before { inset: 9px; }
  .menu-layout { gap: 25px; }
  .game-title { font-size: clamp(57px, 15.2vw, 90px); letter-spacing: -1px; }
  .tagline { font-size: 17px; }
  .menu-description { font-size: 11px; line-height: 1.8; }
  .menu-brand > .sticker { top: 70px; right: 0; padding: 6px 7px; font-size: 8px; }
  .hero-illustration { right: -7px; bottom: 77px; transform: scale(.56) rotate(9deg); }
  .menu-brand > .hero-dumpling { right: -4px; bottom: 80px; transform: scale(.65) rotate(9deg); }
  .menu-card { padding: 22px; }
  .card-label { font-size: 9px; }
  .card-title { font-size: 24px; }
  .menu-card .panel-copy { margin-top: -9px; font-size: 10px; }
  .difficulty-row { gap: 6px; font-size: 9px; }
  .difficulty-row .button { padding-inline: 7px; font-size: 9px; }
  .howto { margin-top: 19px; padding-top: 15px; }
  .panel { padding: 23px 20px; box-shadow: 5px 5px 0 #080c08, 6px 6px 0 #6a715e; }
  .panel-kicker { font-size: 9px; margin-bottom: 9px; }
  .panel-title { font-size: 27px; letter-spacing: -1px; }
  .panel-copy { font-size: 11px; margin-bottom: 17px; }
  .upgrade-grid { grid-template-columns: 1fr; gap: 9px; margin-top: 20px; }
  .upgrade-card { min-height: 0; display: grid; grid-template-columns: 45px minmax(0, 1fr); gap: 0 13px; padding: 13px; }
  .upgrade-type { grid-column: 2; margin-bottom: 3px; font-size: 8px; line-height: 1.2; }
  .upgrade-icon { grid-column: 1; grid-row: 1 / 5; align-self: center; width: 45px; height: 45px; margin: 0; font-size: 27px; }
  .upgrade-name { grid-column: 2; margin-bottom: 4px; font-size: 15px; }
  .upgrade-desc { grid-column: 2; margin-bottom: 7px; font-size: 10px; line-height: 1.5; }
  .upgrade-level { grid-column: 2; margin: 0; font-size: 8px; }
  .upgrade-synergy { grid-column: 1 / -1; margin-top: 8px; padding-top: 6px; font-size: 9px; }
  .upgrade-card:hover, .upgrade-card:focus-visible { transform: translate(-1px, -2px); box-shadow: 3px 3px 0 #080c08; }
  .reroll-row { margin-top: 16px; gap: 8px; font-size: 9px; }
  .reroll-row .button { font-size: 10px; }
  .codex-grid { grid-template-columns: 1fr; gap: 9px; margin: 18px 0; }
  .codex-card { padding: 13px; }
  .codex-card h3, .codex-card strong { font-size: 13px; }
  .codex-card p { font-size: 10px; }
  #hud { inset: 12px 12px auto; }
  .hud-top { gap: 8px; }
  .health-block { width: clamp(110px, 33vw, 148px); padding: 8px; }
  .hud-left { width: clamp(110px, 33vw, 148px); }
  .xp-label { font-size: 7px; padding-top: 5px; }
  .health-label { margin-bottom: 6px; font-size: 9px; gap: 5px; }
  .health-track { height: 7px; }
  .xp-track { height: 3px; margin-top: 4px; }
  .run-clock { min-width: 77px; padding: 8px 7px 6px; }
  .clock-value { font-size: 22px; }
  .clock-caption { font-size: 6px; letter-spacing: 1px; }
  .hud-actions { gap: 5px; }
  .hud-actions .button, #pausebutton, #settingsbutton { min-height: 35px; min-width: 35px; padding: 7px; font-size: 10px; }
  .hud-bottom { left: 12px; gap: 9px; }
  .build-slots { gap: 5px; max-width: 290px; }
  .build-slot { width: 34px; height: 34px; font-size: 18px; border-width: 1px; }
  .build-slot small, .build-slot > span:last-child:not(:first-child) { font-size: 7px; }
  .dash-indicator { font-size: 8px; gap: 5px; }
  .dash-pip { width: 21px; height: 5px; }
  #bossbar { top: calc(82px + env(safe-area-inset-top, 0px)); padding: 8px 10px; }
  .boss-name { font-size: 9px; margin-bottom: 6px; }
  .boss-track { height: 6px; }
  .result-stats { margin: 19px 0; }
  .stat-item { padding: 13px; }
  .stat-item strong { font-size: 21px; }
}
@media (max-width: 380px) {
  #menu { padding-inline: 6vw; }
  .menu-card { padding: 18px; }
  .menu-brand > .sticker { max-width: 105px; top: 58px; }
  .game-title { font-size: 15vw; }
  .hero-illustration { display: none; }
  .menu-brand > .hero-dumpling { display: none; }
  .record-strip { gap: 23px; }
  .health-block { width: 114px; }
  .hud-left { width: 114px; }
  .run-clock { left: 53%; min-width: 69px; }
  .clock-value { font-size: 20px; }
  .hud-actions { gap: 4px; }
  .hud-actions .button, #pausebutton, #settingsbutton { min-width: 30px; min-height: 32px; padding: 5px; }
  .panel { padding: 21px 16px; }
}
@media (pointer: coarse) {
  #touch-controls { display: block; }
  .hud-bottom { bottom: calc(137px + env(safe-area-inset-bottom, 0px)); }
  .button { min-height: 44px; }
  .button.small { min-height: 38px; }
  .starter-card { min-height: 66px; }
  .howto .desktop-only { display: none; }
  .menu-card .howto { display: none; }
  .mobile-howto { display: block; }
}
@media (hover: none) {
  .button:hover { transform: none; }
  .upgrade-card:hover { transform: none; box-shadow: none; }
}
@media (max-height: 650px) and (min-width: 781px) {
  #menu { padding: 30px 5vw; }
  .menu-layout { gap: 40px; }
  .game-title { font-size: min(8.7vw, 91px); }
  .brand-kicker, .eyebrow { margin-bottom: 17px; }
  .tagline { font-size: 20px; margin-top: 20px; }
  .record-strip { margin-top: 24px; padding-top: 15px; }
  .menu-card { padding: 23px; }
  .menu-card .menu-footer { font-size: 8px; margin-top: 13px; }
  .card-title { margin-bottom: 16px; font-size: 25px; }
  .starter-card { padding-top: 9px; padding-bottom: 9px; }
  .starter-options { margin-bottom: 16px; }
  .howto { margin-top: 18px; padding-top: 14px; }
  .panel { padding: 24px; }
  .upgrade-card { min-height: 250px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .screen { padding: 18px; align-items: flex-start; }
  #menu { padding: 24px 30px; }
  .menu-layout { max-width: 1050px; grid-template-columns: minmax(0, 1fr) minmax(280px, .9fr); gap: 30px; align-items: center; }
  .menu-brand { padding: 0; }
  .game-title { font-size: clamp(48px, 8vw, 77px); }
  .game-title > span { display: inline; }
  .brand-kicker, .eyebrow { margin-bottom: 13px; font-size: 8px; letter-spacing: 1.5px; }
  .tagline { margin-top: 15px; font-size: 15px; }
  .menu-description { font-size: 10px; }
  .record-strip { margin-top: 16px; padding-top: 12px; gap: 22px; }
  .record-strip strong { font-size: 17px; }
  .record-strip label, .record-strip small, .record-strip span { font-size: 8px; }
  .hero-illustration { display: none; }
  .menu-brand > .hero-dumpling { display: none; }
  .menu-brand > .sticker { position: static; margin-top: 15px; font-size: 8px; padding: 5px 8px; }
  .menu-card { padding: 18px; }
  .card-label { margin-bottom: 6px; font-size: 8px; }
  .card-title { margin-bottom: 12px; font-size: 21px; }
  .menu-card .panel-copy { font-size: 9px; margin-top: -4px; margin-bottom: 10px; }
  .difficulty-row { margin-bottom: 12px; font-size: 8px; }
  .difficulty-row .button { min-height: 25px; padding: 4px 6px; font-size: 8px; }
  .starter-card { min-height: 49px; grid-template-columns: 31px minmax(0, 1fr); padding: 7px 27px 7px 8px; gap: 0 8px; }
  .weapon-icon { width: 31px; height: 31px; font-size: 22px; }
  .starter-name { font-size: 12px; }
  .starter-desc { font-size: 9px; }
  .starter-options { gap: 5px; margin-bottom: 12px; }
  .menu-card > .button.primary { min-height: 40px; padding: 9px; font-size: 12px; }
  .menu-card .button-row { margin-top: 12px; gap: 8px; }
  .menu-card .difficulty-row .button-row { margin-top: 0; gap: 4px; }
  .menu-card .button.small { min-height: 31px; font-size: 9px; }
  .howto { margin-top: 12px; padding-top: 9px; font-size: 8px; gap: 5px 8px; }
  .mobile-howto { margin-top: 12px; font-size: 8px; }
  .menu-card .menu-footer { margin-top: 11px; font-size: 8px; }
  .menu-layout > .menu-footer { margin-top: -10px; font-size: 8px; }
  .menu-brand .menu-footer { margin-top: 12px; font-size: 8px; }
  .panel { padding: 22px; }
  .panel-wide { width: min(860px, 100%); }
  .panel-title { font-size: 25px; margin-bottom: 8px; }
  .panel-kicker { margin-bottom: 8px; font-size: 9px; }
  .panel-copy { margin-bottom: 14px; font-size: 10px; }
  .upgrade-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 17px; gap: 10px; }
  .upgrade-card { display: flex; min-height: 175px; padding: 12px; }
  .upgrade-type { font-size: 8px; margin-bottom: 9px; }
  .upgrade-icon { width: 36px; height: 36px; margin-bottom: 10px; font-size: 25px; align-self: flex-start; }
  .upgrade-name { margin-bottom: 6px; font-size: 13px; }
  .upgrade-desc { font-size: 9px; line-height: 1.5; margin-bottom: 10px; }
  .upgrade-level { font-size: 8px; margin-top: auto; }
  .upgrade-synergy { font-size: 8px; margin-top: 8px; padding-top: 6px; }
  .reroll-row { margin-top: 14px; }
  .codex-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #hud { inset: 9px 14px auto; }
  .health-block { padding: 7px 9px; width: 165px; }
  .hud-left { width: 165px; }
  .health-label { font-size: 8px; margin-bottom: 5px; }
  .health-track { height: 6px; }
  .run-clock { min-width: 80px; padding: 6px 9px; }
  .clock-value { font-size: 21px; }
  .clock-caption { font-size: 6px; margin-top: 3px; }
  #bossbar { top: calc(66px + env(safe-area-inset-top, 0px)); width: 310px; padding: 6px 9px; }
  .boss-name { font-size: 8px; }
  .hud-bottom { bottom: calc(18px + env(safe-area-inset-bottom, 0px)); left: 145px; }
  .build-slot { width: 30px; height: 30px; font-size: 17px; }
  #dash-button { width: 66px; height: 66px; right: calc(22px + env(safe-area-inset-right, 0px)); bottom: calc(19px + env(safe-area-inset-bottom, 0px)); font-size: 10px; }
  .touch-hint { left: 22px; bottom: 28px; font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .button:hover, .upgrade-card:hover, .upgrade-card:focus-visible { transform: none; }
}

/* Shared markup details and scrollable touch overlays. */
.screen { pointer-events: auto; }
.starter-check { display: none; }
.build-slot svg { width: 100%; height: 100%; }
.build-slot > b { position: absolute; right: -3px; bottom: -4px; padding: 2px 4px; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); font: 800 9px/1 var(--mono); }
.build-slot.evolved > b { background: var(--lime); }
.health-fill.critical { background: var(--coral); }
#dash-button.empty { opacity: .45; border-color: var(--paper-dim); }

/* A short viewport can still be a narrow phone: width wins over landscape. */
@media (max-width: 640px) and (max-height: 520px) {
  #menu { padding: 24px 7vw; }
  .menu-layout { grid-template-columns: minmax(0, 1fr); max-width: 510px; gap: 24px; }
  .menu-brand { min-width: 0; }
  .game-title { font-size: clamp(48px, 14.8vw, 78px); }
  .brand-kicker { flex-wrap: wrap; font-size: 9px; }
  .menu-card { min-width: 0; }
  .menu-description { max-width: 100%; }
}

/* Permanent progression uses earned local currency only. */
.meta-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; margin: 0 0 12px; border-top: 1px solid #b7bba1; border-bottom: 1px solid #b7bba1; }
.meta-bar > div > span, .shop-wallet > span { display: block; font: 700 9px/1.4 var(--mono); letter-spacing: 1px; color: #657052; }
.meta-bar strong, .shop-wallet strong { display: flex; align-items: center; gap: 7px; font: 900 23px/1.2 var(--mono); }
.meta-bar strong { color: var(--ink); }
.coin-icon { display: inline-block; width: 17px; height: 17px; border: 2px solid #826525; border-radius: 50%; background: #efcb6b; box-shadow: inset 0 0 0 2px #ffe39b; flex: 0 0 auto; }
.meta-bar .shop-open { min-height: 40px; padding: 9px 14px; background: var(--ink); border: 2px solid var(--ink); color: var(--paper); font-size: 12px; }
.meta-summary { margin: 12px 0 0; font-size: 9px; line-height: 1.6; color: #637052; }
.shop-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.shop-wallet { min-width: 100px; padding: 10px 14px; border: 1px solid #847343; background: #292b20; text-align: right; }
.shop-wallet > span { color: #c7bc95; }
.shop-wallet strong { justify-content: flex-end; color: #f1d587; }
.shop-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.shop-card { position: relative; min-width: 0; padding: 18px; border: 1px solid #667052; background: #242c24; }
.shop-card.maxed { border-color: #a8b765; background: #2a3425; }
.shop-card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.shop-card h3 { margin: 0; font-size: 17px; letter-spacing: -.4px; }
.shop-rank { font: 800 11px var(--mono); color: var(--lime); white-space: nowrap; }
.shop-card p { margin: 8px 0; color: #c0c6af; font-size: 11px; line-height: 1.5; }
.shop-stats { font: 700 12px/1.6 var(--mono); color: #e9dfb5!important; }
.shop-rank-track { display: flex; gap: 4px; margin: 12px 0; }
.shop-rank-track i { height: 4px; flex: 1; background: #454c3b; }
.shop-rank-track i.filled { background: var(--lime); }
.shop-card .button { width: 100%; min-height: 36px; padding: 8px 10px; font-size: 11px; background: #e6cc81; color: #272b20; border: 1px solid #e6cc81; }
.shop-card .button:disabled { background: #343a2d; color: #9aa38e; border-color: #5c6550; opacity: 1; }
.shop-confirm { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 15px; padding: 14px 17px; border: 2px solid #e6cc81; background: #333525; }
.shop-confirm strong { color: #f4da99; font-size: 14px; }
.shop-confirm p { margin: 5px 0 0; font-size: 11px; color: #d0c6a6; }
.shop-confirm .button-row { margin: 0; min-width: 170px; }
.shop-status { min-height: 20px; margin: 12px 0 0; font-size: 12px; color: var(--lime); }
.shop-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 7px; }
.shop-footer .settings-note { margin: 0; text-align: left; font-size: 10px; }
.shop-footer .button { min-width: 125px; }
.result-reward { padding: 13px 15px; margin: 15px 0; border: 1px solid #8e8050; background: #2c3023; }
.reward-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: #ead28d; }
.reward-heading strong { font: 900 23px/1.2 var(--mono); }
.reward-breakdown { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 10px; color: #c8c7af; }
.reward-balance { margin: 8px 0 0; font-size: 10px; color: #aeb79d; }
@media(max-width:640px){
  .meta-bar { margin-bottom: 10px; padding: 9px 0; }
  .meta-bar strong { font-size: 20px; }
  .meta-bar .shop-open { padding: 8px 11px; font-size: 11px; }
  .shop-grid { grid-template-columns: 1fr; gap: 9px; }
  .shop-card { padding: 13px; }
  .shop-card h3 { font-size: 15px; }
  .shop-card p { margin: 6px 0; font-size: 10px; }
  .shop-rank-track { margin: 8px 0; }
  .shop-confirm { flex-direction: column; align-items: stretch; gap: 12px; }
  .shop-confirm .button-row { min-width: 0; }
  .shop-wallet { min-width: 82px; padding: 9px; }
  .shop-wallet strong { font-size: 20px; }
  .shop-footer { align-items: flex-start; }
  .shop-footer .button { min-width: 90px; font-size: 11px; }
}
@media(max-height:520px) and (min-width:641px){.shop-grid{grid-template-columns:repeat(2,minmax(0,1fr));}.shop-card{padding:12px;}.shop-card p{font-size:10px;}.meta-bar{padding:7px 0;margin-bottom:8px;}.meta-bar .shop-open{min-height:30px;padding:6px 10px;}}

/* v1.3: a single reserved top rail, above combat HUD and below device cutouts.
   The rail never grows, queues banners, receives pointer input, or uses world position. */
#hud { display: flex; flex-direction: column; gap: 6px; }
#combat-notifications { flex: 0 0 26px; height: 26px; width: min(560px, 100%); margin-inline: auto; pointer-events: none; overflow: hidden; }
.toast { display: flex; align-items: center; justify-content: center; gap: 10px; height: 26px; max-width: 100%; padding: 3px 12px; border: 1px solid #5d6947; border-left: 3px solid var(--lime); background: rgba(20, 26, 22, .94); color: var(--paper); pointer-events: none; animation: toast-arrive 140ms ease-out both; }
.toast-title { flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; line-height: 18px; font-weight: 800; color: var(--lime); }
.toast-sub { min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; line-height: 16px; color: #d0d5be; }
.toast-sub:empty { display: none; }
.hud-top { position: relative; }
.run-clock { top: 0; }
#bossbar { position: relative; inset: auto; transform: none; width: min(430px, 100%); margin-inline: auto; padding: 5px 10px; box-shadow: none; }
.boss-name { font-size: 9px; margin-bottom: 4px; }
.boss-track { height: 5px; }
.shop-card h3 { display: flex; align-items: center; gap: 9px; }
.shop-icon { display: inline-flex; width: 42px; height: 42px; flex: 0 0 42px; border: 1px solid #667052; background: #171e19; }
.shop-icon svg { width: 100%; height: 100%; }
.recipe-items { display: grid; gap: 6px; margin-block: 12px; }
.recipe-items > span { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--paper-dim); }
.recipe-items svg { width: 28px; height: 28px; flex: 0 0 28px; }
.result-item { display: inline-flex; align-items: center; gap: 5px; }
.result-item svg { width: 25px; height: 25px; flex: 0 0 25px; }
.build-slot.passive { border-color: #8b8971; }
@media (max-width: 640px) {
  .toast { gap: 7px; padding-inline: 7px; }
  .toast-title { font-size: 11px; }
  .toast-sub { font-size: 9px; }
  .shop-icon { width: 36px; height: 36px; flex-basis: 36px; }
  .shop-card h3 { gap: 7px; }
}
@media (max-height: 520px) {
  #hud { gap: 4px; }
  #combat-notifications, .toast { height: 24px; }
  #combat-notifications { flex-basis: 24px; }
  .toast-title { font-size: 11px; }
  .toast-sub { font-size: 9px; }
  #bossbar { padding: 4px 8px; }
  .boss-name { font-size: 8px; margin-bottom: 3px; }
  .boss-track { height: 4px; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .build-slots { max-width: max(130px, calc(100vw - 260px)); gap: 4px; }
}

/* Keep Korean difficulty labels intact instead of shrinking the last syllables. */
.difficulty-row > .button-row { flex: 0 0 auto; }
.difficulty-row .button-row > .button { flex: 0 0 auto; min-width: 54px; white-space: nowrap; }

/* Regular play can be registered only with explicit nickname consent. */
.ranked-menu-note { margin: 9px 0 0; color: #59634e; font-size: 10px; line-height: 1.7; word-break: keep-all; }
.menu-links .button { white-space: nowrap; }
.online-status { min-height: 22px; margin: 16px 0; color: var(--lime); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.online-status.error { color: #ffa58e; }
.ranked-result { padding: 16px; margin: 18px 0; border: 1px solid #829c51; background: #222d20; }
.ranked-result-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.ranked-result-heading .panel-kicker { margin-bottom: 8px; }
#ranked-result-mode { font-size: 11px; color: var(--paper-dim); }
.ranked-result .panel-copy { font-size: 11px; margin-bottom: 12px; }
.nickname-label { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 800; }
#ranked-nickname { display: block; width: 100%; min-height: 45px; padding: 10px 12px; color: var(--paper); border: 1px solid #7f8a6e; background: var(--ink-deep); border-radius: 0; font-size: 16px; }
#ranked-nickname:disabled { color: var(--paper-dim); opacity: .8; }
#ranked-name-help { text-align: left; margin: 7px 0 11px; font-size: 10px; }
.ranked-disclosure { font-size: 11px; color: #c7d0b5; line-height: 1.75; }
#ranked-submit-button { width: 100%; }
.ranked-result .online-status { margin-bottom: 0; }
.leaderboard-panel { width: min(670px, 100%); }
.leaderboard-tabs { margin: 4px 0 13px; gap: 8px; }
.leaderboard-tabs .button.active { border-color: var(--lime); color: var(--lime); background: #303c23; }
.leaderboard-order { font-size: 10px; color: var(--paper-dim); line-height: 1.7; }
.leaderboard-list { padding: 0; margin: 0; list-style: none; }
.leaderboard-entry { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid #46513b; }
.leaderboard-rank { font: 800 18px var(--mono); color: var(--paper-dim); }
.leaderboard-entry:nth-child(-n+3) .leaderboard-rank { color: var(--lime); }
.leaderboard-name { display: block; font-weight: 800; font-size: 14px; overflow-wrap: anywhere; }
.leaderboard-state { display: block; font-size: 10px; color: #b8c4a5; margin-top: 3px; }
.leaderboard-record { text-align: right; white-space: nowrap; }
.leaderboard-time { display: block; font: 700 16px var(--mono); color: var(--paper); }
.leaderboard-kills { display: block; margin-top: 4px; color: var(--paper-dim); font-size: 10px; }
@media (max-width: 640px) {
  .ranked-result { padding: 13px; }
  .leaderboard-entry { gap: 8px; grid-template-columns: 26px minmax(0, 1fr) auto; }
  .leaderboard-name { font-size: 13px; }
  .leaderboard-time { font-size: 14px; }
  .menu-links { gap: 6px; }
  .menu-links .button { padding-inline: 8px; }
}
/* Seven starters stay scan-friendly without making narrow menus too tall. */
.starter-options { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 296px; overflow-y: auto; padding: 3px 6px 6px 3px; overscroll-behavior: contain; scrollbar-color: #7b8669 #d7dbc4; }
.starter-card { grid-template-columns: 28px minmax(0, 1fr); gap: 8px; padding: 10px 20px 10px 8px; }
.starter-card::after { width: 8px; height: 8px; right: 7px; }
.starter-card .weapon-icon { width: 28px; height: 34px; }
.starter-card .weapon-icon svg { width: 28px; height: 28px; }
.starter-card .starter-name { font-size: 12px; }
.starter-card .starter-desc { font-size: 9px; }
@media (max-width: 420px) {
  .starter-options { grid-template-columns: minmax(0, 1fr); max-height: 252px; }
  .starter-card { grid-template-columns: 34px minmax(0, 1fr); padding: 9px 25px 9px 10px; }
  .starter-card .starter-name { font-size: 13px; }
  .starter-card .starter-desc { font-size: 10px; }
}
.ranked-live-status { display: block; margin-top: 5px; color: var(--lime); font-size: 9px; line-height: 1.3; }
#ranked-verify-retry { width: 100%; margin: 0 0 15px; }
#ranked-verification-status { padding-bottom: 12px; border-bottom: 1px solid #516340; }
