@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700;800&display=swap');

:root {
  color-scheme: dark;
  --bg: #111414;
  --panel: #1a1f1d;
  --panel-strong: #232a26;
  --text: #f4f0e8;
  --muted: #aeb7ad;
  --accent: #58c097;
  --accent-strong: #89e0bb;
  --danger: #e4675f;
  --gold: #e7b657;
  --coffee: #8b6f4e;
  --line: #344039;
  --accent: #7a4cb0;
}


* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow-x: hidden;
}

body {
  overflow: hidden;
  background:
    radial-gradient(circle at 16% 0%, rgba(88, 192, 151, 0.15), transparent 30%),
    linear-gradient(135deg, #111414 0%, #181b19 48%, #101211 100%);
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-weight: 300;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.start-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  background:
    linear-gradient(rgba(17, 20, 20, 0.06), rgba(17, 20, 20, 0.34)),
    radial-gradient(circle at 22% 18%, rgba(231, 182, 87, 0.18), transparent 28%),
    linear-gradient(135deg, #17201c 0%, #25312b 46%, #111414 100%);
}

.start-screen[hidden] {
  display: none;
}

.start-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.start-panel {
  position: relative;
  display: grid;
  gap: 16px;
  width: min(360px, 100%);
  padding: 26px;
  background: rgba(26, 31, 29, 0.88);
  border: 1px solid rgba(244, 240, 232, 0.18);
  border-radius: 8px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
}

.title-logo {
  display: grid;
  gap: 2px;
  justify-items: center;
  margin: 0;
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 64px;
  font-weight: 900;
  line-height: 0.88;
  text-align: center;
  text-shadow:
    4px 0 #07110d,
    0 4px #07110d,
    4px 4px #07110d,
    8px 8px #8b6f4e;
  text-transform: uppercase;
}

.title-logo span:last-child {
  color: var(--gold);
}

.start-version {
  min-height: 0;
  margin: -6px 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  letter-spacing: 1px;
}

.start-panel p {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
}

.start-actions {
  display: grid;
  gap: 10px;
}

.new-game-form {
  display: grid;
  gap: 10px;
}

.new-game-form[hidden] {
  display: none;
}

.new-game-form label {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.new-game-form input {
  width: 220px;
  min-height: 42px;
  padding: 8px 10px;
  background: #151917;
  border: 3px solid #07110d;
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 16px;
  font-weight: 900;
  outline: 2px solid #f4f0e8;
}

.new-game-form input:focus {
  outline-color: var(--gold);
}

.about-text {
  justify-items: center;
  text-align: center;
  gap: 20px;
  padding-top: 8px;
}

.about-text p {
  margin: 0 0 16px 0;
  font-size: 18px;
  color: var(--text);
}

.app-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  width: 100vw;
  height: 100vh;
  padding: 18px;
}

.top-bar,
.bottom-bar,
.control-panel,
.scene-panel {
  background: rgba(26, 31, 29, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

.top-bar,
.bottom-bar {
  display: grid;
  align-items: center;
  gap: 14px;
  min-height: 66px;
  padding: 12px 16px;
}

.top-bar {
  grid-template-columns: 0.1fr repeat(4, minmax(110px, 0.4fr)) auto;
}

.bottom-bar {
  grid-template-columns: repeat(3, minmax(100px, 0.36fr)) minmax(220px, 1fr) auto;
}

.top-menu-wrap {
  position: relative;
  justify-self: end;
}

.game-menu {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(7, 17, 13, 0.72);
}

.game-menu[hidden] {
  display: none;
}

.menu-close {
  position: absolute;
  top: 10px;
  right: 10px;
  padding-bottom: 2px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(#e7b657, #e7b657) center / calc(100% - 8px) calc(100% - 8px) no-repeat,
    #9d7632;
  color: #07110d;
  cursor: pointer;
  font-family: "JetBrains Mono", monospace;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  box-shadow:
    0 0 0 2px #000000,
    3px 3px 0 #000000;
}

.menu-close:hover,
.menu-close:focus-visible {
  background:
    linear-gradient(#ffd879, #ffd879) center / calc(100% - 8px) calc(100% - 8px) no-repeat,
    #b88939;
  outline: 0;
}

.menu-close:active {
  transform: translate(1px, 1px);
  box-shadow:
    0 0 0 2px #7b5c25,
    2px 2px 0 #7b5c25;
}

.game-menu-panel::before {
  content: "Menu";
  display: block;
  margin-bottom: 22px;
  color: var(--gold);
  font-family: "JetBrains Mono", monospace;
  font-size: 28px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 3px 3px 0 #07110d;
}

.menu-action {
  width: 100%;
  text-align: center;
}


.top-bar > div,
.bottom-bar > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.wide-stat strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#profit.positive {
  color: var(--accent-strong);
}

#profit.negative {
  color: var(--danger);
}

.label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

strong {
  font-size: 23px;
  line-height: 1.05;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(330px, 390px);
  gap: 14px;
  min-height: 0;
}

.scene-panel {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  padding: 12px;
}

.scene-control-button {
  display: grid;
  place-items: center;
  width: 70px;
  height: 50px;
  padding: 0;
  background: rgba(244, 240, 232, 0.9);
  border: 3px solid #07110d;
  border-radius: 0;
  box-shadow: 3px 3px 0 #07110d;
  cursor: pointer;
}

.scene-control-button:hover,
.scene-control-button:focus-visible,
.scene-control-button.active {
  background: #ffd879;
  outline: 0;
}

.scene-control-button:disabled {
  cursor: default;
  opacity: 0.55;
}

.fast-forward-icon,
.skip-icon {
  position: relative;
  display: block;
  width: 38px;
  height: 28px;
}

.fast-forward-icon {
  margin-left: 6px;
}

.fast-forward-icon::before,
.fast-forward-icon::after,
.skip-icon::before,
.skip-icon::after {
  content: "";
  position: absolute;
  top: 0;
  width: 0;
  height: 0;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  border-left: 18px solid #07110d;
}

.fast-forward-icon::before,
.skip-icon::before {
  left: 1px;
}

.fast-forward-icon::after,
.skip-icon::after {
  left: 19px;
}

.skip-icon {
  width: 44px;
}

.scene-control-button .skip-icon {
  border-right: 5px solid #07110d;
}

canvas {
  align-self: stretch;
  justify-self: stretch;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #141817;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.canvas-wrap {
  position: relative;
  width: min(100%, 1600px);
  height: min(calc(100vw * 900 / 1600), calc(100vh - 215px), 900px);
  display: flex;
  justify-content: center;  /* horizontal centering */
  align-items: center;      /* vertical centering */
  margin: 0 auto;
  overflow: hidden;
  --scene-scale: 1;
}

#scene {
  display: block;
  width: 100%;
  height: 100%;
}

.day-controls {
  position: absolute;
  top: calc(105px * var(--scene-scale));
  left: calc(364px * var(--scene-scale));
  z-index: 2;
  display: flex;
  gap: calc(8px * var(--scene-scale));
  transform-origin: top left;
  transform: scale(var(--scene-scale));
}

.day-controls[hidden] {
  display: none;
}



.control-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) minmax(56px, auto);
  gap: 8px;
  min-height: 0;
  padding: 14px;
  overflow: hidden;
}

.tab-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  min-height: 42px;
  padding: 4px;
  background: #151917;
  border: 1px solid rgba(174, 183, 173, 0.12);
  border-radius: 8px;
}

.tab-button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.tab-button.active {
  background: var(--panel-strong);
  color: var(--text);
}

.tab-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tab-panels {
  min-height: 0;
}

.tab-panel {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
}

.tab-panel[hidden] {
  display: none;
}

.panel-section {
  display: grid;
  gap: 5px;
  padding: 11px;
  background: rgba(35, 42, 38, 0.72);
  border: 1px solid rgba(174, 183, 173, 0.14);
  border-radius: 8px;
}

.section-heading,
.control-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

h2 {
  margin: 0;
  font-size: 15px;
}

.section-heading span,
output,
#version {
  color: var(--muted);
  font-size: 13px;
}

input[type="range"] {
  width: 100%;
  height: 26px;
  appearance: none;
  background: transparent;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 12px;
  background:
    linear-gradient(#58c097, #58c097) left center / var(--track-fill, 50%) 100% no-repeat,
    #151917;
  border: 3px solid #07110d;
  box-shadow: 0 0 0 2px #f4f0e8;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 24px;
  margin-top: -9px;
  background: #e7b657;
  border: 3px solid #07110d;
  box-shadow: 3px 3px 0 #07110d;
}

input[type="range"]::-moz-range-track {
  height: 12px;
  background: #151917;
  border: 3px solid #07110d;
}

input[type="range"]::-moz-range-progress {
  height: 12px;
  background: #58c097;
  border: 3px solid #07110d;
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 24px;
  background: #e7b657;
  border: 3px solid #07110d;
  border-radius: 0;
}

input[type="range"]:disabled::-webkit-slider-runnable-track {
  background:
    linear-gradient(#56615a, #56615a) left center / var(--track-fill, 50%) 100% no-repeat,
    #151917;
  border: 3px solid #07110d;
  box-shadow: 0 0 0 2px #f4f0e8;
}

input[type="range"]:disabled::-webkit-slider-thumb {
  background: #8a928c;
  cursor: default;
}

input[type="range"]:disabled::-moz-range-progress {
  background: #56615a;
}

input[type="range"]:disabled::-moz-range-thumb {
  background: #8a928c;
}

input[type="range"]:disabled {
  opacity: 0.8;
  cursor: default;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.inventory-grid div {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 9px;
  background: #151917;
  border: 1px solid rgba(174, 183, 173, 0.12);
  border-radius: 8px;
}

.inventory-grid span {
  color: var(--muted);
  font-size: 12px;
}

.upgrade-list {
  display: grid;
  gap: 8px;
}

.equipment-upgrade-list {
  height: auto;
  padding: 0;
  overflow: visible;
  scrollbar-color: #e7b657 #07110d;
  scrollbar-width: thin;
}

.equipment-upgrade-list::-webkit-scrollbar {
  width: 14px;
}

.equipment-upgrade-list::-webkit-scrollbar-track {
  background: #07110d;
  border: 3px solid #f4f0e8;
}

.equipment-upgrade-list::-webkit-scrollbar-thumb {
  background: #e7b657;
  border: 3px solid #07110d;
}

.shop-upgrade-list {
  margin-bottom: 4px;
}

.hire-list {
  display: grid;
  gap: 10px;
}

.hire-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  background: #151917;
  border: 3px solid #07110d;
  box-shadow: 4px 4px 0 #07110d;
}

.hire-copy {
  min-width: 0;
}

.hire-card h3,
.hire-card p {
  margin: 0;
}

.hire-card h3 {
  font-size: 15px;
  text-transform: uppercase;
}

.hire-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.hire-card button {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 9px 11px;
  background: #2c3f35;
  border: 3px solid #07110d;
  border-radius: 0;
  box-shadow: 3px 3px 0 #07110d;
  color: var(--text);
  cursor: pointer;
  font-weight: 500;
}

.hire-icon {
  position: relative;
  width: 50px;
  height: 58px;
  background: var(--panel-strong);
  border: 3px solid #07110d;
  box-shadow: 3px 3px 0 #07110d;
}

.hire-icon::before,
.hire-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.hire-icon::before {
  top: 8px;
  width: 24px;
  height: 8px;
  background: var(--employee-hat);

  box-shadow:
    /* head */
    0 8px 0 #d8a06c,
    0 16px 0 #d8a06c,

    /* shirt connected directly under head */
    -7px 24px 0 var(--employee-shirt),
    0 24px 0 var(--employee-shirt),
    7px 24px 0 var(--employee-shirt),

    -7px 32px 0 var(--employee-shirt),
    0 32px 0 var(--employee-shirt),
    7px 32px 0 var(--employee-shirt);
}

.hire-icon::after {
  content: "";
  position: absolute;
  top: 20px;
  left: 18px;
  width: 4px;
  height: 4px;
  background: #07110d;
  box-shadow: 10px 0 0 #07110d;
}

.cashier-hire-icon {
  --employee-hat: #f4f0e8;
  --employee-shirt: #58c097;
}

.baker-hire-icon {
  --employee-hat: #e7b657;
  --employee-shirt: #f4f0e8;
}

.hire-card button strong {
  color: var(--gold);
  font-weight: 100;
  font-size: 16px;
}

.hire-card button:hover,
.hire-card button:focus-visible {
  background: #365645;
  outline: 0;
}

.hire-card button:disabled {
  background: #56615a;
  color: #aeb7ad;
  cursor: default;
  opacity: 0.75;
}

.upgrade-list button,
.primary-action,
.secondary-action {
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.upgrade-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  padding: 10px 12px;
  background: #151917;
}

.upgrade-list button:hover,
.upgrade-list button:focus-visible {
  background: var(--line);
}

.upgrade-list button:disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.72;
}

.upgrade-list button strong {
  color: var(--gold);
  font-size: 16px;
}

.upgrade-list .shop-style-upgrade {
  min-height: 64px;
  border: 3px solid #07110d;
  box-shadow: 4px 4px 0 #07110d;
}

.location-upgrade-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: #151917;
  border: 3px solid #07110d;
  box-shadow: 4px 4px 0 #07110d;
}

.location-upgrade-head,
.location-actions {
  display: grid;
  gap: 8px;
}

.location-upgrade-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.location-upgrade-head span {
  color: var(--text);
  font-weight: 900;
}

.location-upgrade-head strong {
  color: var(--muted);
  font-size: 13px;
}

.location-actions {
  grid-template-columns: 36px minmax(0, 1fr) 36px;
}

.location-actions button {
  min-height: 44px;
  background: #2c3f35;
  border: 3px solid #07110d;
  border-radius: 0;
  font-size: 16px;
}

.location-actions button:disabled {
  background: #56615a;
  color: #aeb7ad;
  cursor: default;
  opacity: 0.75;
}

.location-actions strong {
  color: var(--gold);
  font-size: 16px;
}

.location-actions button:hover,
.location-actions button:focus-visible {
  background: #365645;
  outline: 0;
}

.location-actions button:disabled:hover,
.location-actions button:disabled:focus-visible {
  background: #56615a;
}

.primary-action {
  align-self: end;
  min-height: 56px;
  background: var(--accent);
  color: #07110d;
  font-weight: 800;
  letter-spacing: 0;
}

.secondary-action {
  min-height: 42px;
  padding: 0 14px;
  background: #151917;
  color: var(--text);
  font-weight: 800;
}

.primary-action:hover,
.primary-action:focus-visible {
  background: var(--accent-strong);
}

.secondary-action:hover,
.secondary-action:focus-visible {
  border-color: var(--accent);
}

.primary-action:disabled,
.secondary-action:disabled {
  background: var(--panel-strong);
  color: var(--muted);
  cursor: default;
  opacity: 0.72;
}

#version {
  justify-self: end;
  white-space: nowrap;
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
  }

  .game-layout,
  .top-bar,
  .bottom-bar {
    grid-template-columns: 1fr 1fr;
  }

  .wide-stat,
  .top-menu-wrap,
  #version {
    grid-column: 1 / -1;
  }

  #version {
    justify-self: start;
  }
}

.pixel-button {
  position: relative;
  min-height: 48px;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(#e7b657, #e7b657) center / calc(100% - 12px) calc(100% - 12px) no-repeat,
    #9d7632;
  color: #07110d;
  cursor: pointer;
  font-family: "JetBrains Mono", monospace;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  box-shadow:
    0 0 0 3px #07110d,
    8px 8px 0 #07110d;
  margin: 0 0 15px 0;
  padding-left: 12px;
}

.primary-action.pixel-button {
  width: 100%;
  text-align: center;
  margin: 0;
}

.pixel-button:hover,
.pixel-button:focus-visible {
  background:
    linear-gradient(#ffd879, #ffd879) center / calc(100% - 12px) calc(100% - 12px) no-repeat,
    #b88939;
  outline: 0;
}

.pixel-button:disabled {
  background:
    linear-gradient(#56615a, #56615a) center / calc(100% - 12px) calc(100% - 12px) no-repeat,
    #303a35;
  color: #aeb7ad;
  cursor: default;
  opacity: 0.9;
}

.slot-list {
  display: grid;
  gap: 10px;
}

.slot-list[hidden] {
  display: none;
}

.slot-button {
  width: 100%;
  text-align: left;
}

.slot-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}

.slot-row.delete-visible {
  grid-template-columns: minmax(0, 1fr) 42px;
}

.delete-slot-button {
  display: grid;
  place-items: center;
  align-self: start;
  height: 48px;
  min-height: 0;
  padding: 0 0 2px;

  background:
    linear-gradient(#e4675f, #e4675f) center /
    calc(100% - 12px) calc(100% - 12px) no-repeat,
    #a84842;
  border: 0; /* remove border */

  color: #07110d;
  cursor: pointer;
  font-family: "JetBrains Mono", monospace;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;

  box-shadow:
    0 0 0 3px #07110d,
    8px 8px 0 #07110d;
}

.delete-slot-button:hover,
.delete-slot-button:focus-visible {
  background:
    linear-gradient(#ff8a80, #ff8a80) center /
    calc(100% - 12px) calc(100% - 12px) no-repeat,
    #c75b53;
  outline: 0;
}

.delete-slot-button[hidden] {
  display: none;
}

.delete-slot-button:disabled {
  cursor: default;
  opacity: 0.4;
}

.confirm-dialog-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.danger-action {
  color: #07110d;
}

.danger-action.pixel-button {
  background:
    linear-gradient(#e4675f, #e4675f) center / calc(100% - 12px) calc(100% - 12px) no-repeat,
    #8f2f34;
}

.danger-action.pixel-button:hover,
.danger-action.pixel-button:focus-visible {
  background:
    linear-gradient(#ff8a80, #ff8a80) center / calc(100% - 12px) calc(100% - 12px) no-repeat,
    #8f2f34;
}

.scenario-dialog,
.day-summary-dialog,
.equipment-dialog,
.shop-dialog,
.slot-dialog {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(7, 17, 13, 0.72);
}

.scenario-dialog[hidden],
.day-summary-dialog[hidden],
.equipment-dialog[hidden],
.shop-dialog[hidden],
.slot-dialog[hidden] {
  display: none;
}

.scenario-dialog-panel,
.day-summary-panel,
.equipment-dialog-panel,
.shop-dialog-panel,
.menu-dialog-panel,
.location-dialog-panel,
.stats-dialog-panel,
.slot-dialog-panel,
.game-menu-panel {
  position: relative;
  display: grid;
  gap: 16px;
  width: min(780px, 100%);
  max-height: min(88vh, 780px);
  padding: 22px;
  background: var(--panel);
  border: 4px solid var(--line);
  box-shadow: 10px 10px 0 #07110d;
}

.slot-dialog-panel,
.scenario-dialog-panel,
.game-menu-panel {
  width: 360px;
}

.day-summary-panel {
  width: min(680px, 100%);
}

.equipment-dialog-panel,
.shop-dialog-panel {
  width: min(760px, 100%);
  max-height: min(86vh, 760px);
  overflow-y: auto;
}

.day-summary-panel h2,
.equipment-dialog-panel h2,
.shop-dialog-panel h2,
.slot-dialog-panel h2 {
  margin: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 28px;
  text-transform: uppercase;
}

.equipment-modal-grid,
.shop-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.equipment-card,
.shop-modal-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  background: #151917;
  border: 3px solid #07110d;
  box-shadow: 4px 4px 0 #07110d;
}

.equipment-card h3,
.equipment-card p,
.shop-modal-card h3,
.shop-modal-card p {
  margin: 0;
}

.equipment-card h3,
.shop-modal-card h3 {
  font-size: 15px;
  text-transform: uppercase;
}

.equipment-card p,
.shop-modal-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.equipment-card button,
.shop-modal-card > button,
.shop-modal-card .location-actions {
  grid-column: 1 / -1;
}

.equipment-card button,
.shop-modal-card > button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 9px 11px;
  background: #2c3f35;
  border: 3px solid #07110d;
  border-radius: 0;
  box-shadow: 3px 3px 0 #07110d;
  color: var(--text);
  cursor: pointer;
  font-weight: 100;
}

.equipment-card button strong,
.shop-modal-card button strong {
  color: var(--gold);
  font-size: 14px;
}

.equipment-card button:hover,
.equipment-card button:focus-visible,
.shop-modal-card > button:hover,
.shop-modal-card > button:focus-visible {
  background: #365645;
  outline: 0;
}

.equipment-card button:disabled,
.shop-modal-card > button:disabled {
  background: #56615a;
  color: #aeb7ad;
  cursor: default;
  opacity: 0.75;
}

.shop-selector {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  gap: 14px;
  align-items: center;
}

.shop-selector > button {
  min-height: 64px;
  background:
    linear-gradient(#e7b657, #e7b657) center / calc(100% - 10px) calc(100% - 10px) no-repeat,
    #9d7632;
  border: 3px solid #07110d;
  box-shadow: 4px 4px 0 #07110d;
  color: #07110d;
  cursor: pointer;
  font-size: 34px;
  font-weight: 900;
}

.shop-selector > button:disabled {
  background:
    linear-gradient(#56615a, #56615a) center / calc(100% - 10px) calc(100% - 10px) no-repeat,
    #303a35;
  color: #aeb7ad;
  cursor: default;
}

.shop-selector-main {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 18px;
  background: #151917;
  border: 3px solid #07110d;
  box-shadow: 5px 5px 0 #07110d;
  text-align: center;
}

.shop-selector-main h3 {
  margin: 0;
  color: var(--gold);
  font-size: 22px;
  text-transform: uppercase;
}

.shop-selector-main p {
  min-height: 44px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.shop-selector-main .shop-style-upgrade {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #2c3f35;
  border: 3px solid #07110d;
  box-shadow: 4px 4px 0 #07110d;
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
}

.shop-selector-main .shop-style-upgrade strong {
  color: var(--gold);
}

.shop-selector-main .shop-style-upgrade:disabled {
  background: #56615a;
  color: #aeb7ad;
  cursor: default;
  opacity: 0.75;
}

.shop-selector-main .shop-style-upgrade:hover,
.shop-selector-main .shop-style-upgrade:focus-visible {
  background: #365645;
  outline: 0;
}

.shop-selector-main .shop-style-upgrade:disabled:hover {
  background: #56615a;
}

.shop-selector-icon {
  position: relative;
  width: 180px;
  height: 140px;
}

.shop-selector-icon::before,
.shop-selector-icon::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

/* Stand */
.stand-icon::before {
  content: "";
  position: absolute;
  left: 28px;
  top: 32px;
  width: 124px;
  height: 92px;

  background:

    linear-gradient(#5e3f2c, #5e3f2c) 12px 8px / 10px 89px no-repeat, /* left post */
    linear-gradient(#5e3f2c, #5e3f2c) calc(100% - 12px) 8px / 10px 89px no-repeat, /* right post */
    linear-gradient(#c9a075, #c9a075) center 58px / 92px 10px no-repeat, /* counter top */
    linear-gradient(#8b6f4e, #8b6f4e) center 68px / 82px 20px no-repeat, /* counter body */
    linear-gradient(#704d35, #704d35) center 88px / 96px 6px no-repeat; /* base trim */
}

.stand-icon::after {
  content: "";
  position: absolute;
  left: 44px;
  top: 40px;
  width: 92px;
  height: 22px;

  background:
    linear-gradient(
      90deg,
      #e7b657 0 20%,
      #7a4cb0 20% 40%,
      #e7b657 40% 60%,
      #7a4cb0 60% 80%,
      #e7b657 80%
    );

  clip-path: polygon(
    0 0,
    100% 0,
    92% 100%,
    84% 55%,
    76% 100%,
    68% 55%,
    60% 100%,
    52% 55%,
    44% 100%,
    36% 55%,
    28% 100%,
    20% 55%,
    12% 100%,
    0 55%
  );

  opacity: 0.95;
}

/* Cart */
.cart-icon::before {
  content: "";
  position: absolute;
  inset: 0;

  background:
    /* left wheel */
    radial-gradient(circle, #07110d 0 9px, transparent 10px)
      42px 102px / 20px 20px no-repeat,

    /* right wheel */
    radial-gradient(circle, #07110d 0 9px, transparent 10px)
      118px 102px / 20px 20px no-repeat,

    /* cart body */
    linear-gradient(#8b6f4e, #8b6f4e)
      32px 68px / 116px 32px no-repeat,

    /* counter top */
    linear-gradient(#c9a075, #c9a075)
      28px 60px / 124px 10px no-repeat,

    /* left post */
    linear-gradient(#5e3f2c, #5e3f2c)
      42px 24px / 8px 42px no-repeat,

    /* right post */
    linear-gradient(#5e3f2c, #5e3f2c)
      130px 24px / 8px 42px no-repeat;
}

.cart-icon::after {
  content: "";
  position: absolute;
  inset: 0;

  background:
    /* awning stripes */
    repeating-linear-gradient(
      90deg,
      #e7b657 0 16px,
      #7a4cb0 16px 32px
    )
    24px 16px / 132px 28px no-repeat;

  border-top: none;
}

.truck-icon::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 42px;
  width: 156px;
  height: 72px;

  background:
    /* roof sign */
    linear-gradient(#e7b657, #e7b657) 52px 0 / 54px 14px no-repeat,

    /* serving window */
    linear-gradient(#101414, #101414) 64px 20px / 52px 26px no-repeat,

    /* cab window */
    linear-gradient(#f4f0e8, #f4f0e8) 18px 18px / 24px 18px no-repeat,

    /* accent stripe */
    linear-gradient(#994a3e, #994a3e) 0 52px / 100% 10px no-repeat,

    /* truck body */
    #7f3f35;

  border: 4px solid #07110d;
  border-radius: 4px;
}

.truck-icon::after {
  content: "";
  position: absolute;
  left: 28px;
  top: 100px;
  width: 28px;
  height: 28px;

  background: #07110d;
  border-radius: 50%;

  box-shadow:
    92px 0 0 #07110d,
    6px 6px 0 -4px #f4f0e8,
    98px 6px 0 -4px #f4f0e8;
}

/* Small Store */
.small-store-icon::before {
  left: 30px;
  top: 52px;
  width: 120px;
  height: 72px;

  background:
    /* door */
    linear-gradient(#33261d, #33261d) 18px 32px / 24px 40px no-repeat,

    /* window */
    linear-gradient(#89e0bb, #89e0bb) 64px 24px / 38px 24px no-repeat,

    /* window frame */
    linear-gradient(#07110d, #07110d) 62px 22px / 42px 28px no-repeat,

    /* wall */
    #704d35;

  border: 4px solid #07110d;
}

.small-store-icon::after {
  left: 20px;
  top: 22px;
  width: 140px;
  height: 42px;

  background:
    /* roof trim */
    linear-gradient(#e7b657, #e7b657) center bottom / 100% 8px no-repeat,

    /* roof */
    #7a4cb0;

  border: 4px solid #07110d;
  clip-path: polygon(
    50% 0%,
    100% 100%,
    0% 100%
  );
}

/* Large Store */
.large-store-icon::before {
  left: 18px;
  top: 44px;
  width: 144px;
  height: 78px;
  background:
    linear-gradient(#101414, #101414) 20px 34px / 34px 32px no-repeat,
    linear-gradient(#101414, #101414) 90px 34px / 34px 32px no-repeat,
    linear-gradient(#33261d, #33261d) 62px 38px / 24px 40px no-repeat,
    #5e4a3d;
  border: 4px solid #07110d;
}

.large-store-icon::after {
  left: 12px;
  top: 18px;
  width: 156px;
  height: 34px;
  background:
    linear-gradient(90deg, #e7b657 0 20%, #7f3f35 20% 40%, #e7b657 40% 60%, #7f3f35 60% 80%, #e7b657 80%),
    #7f3f35;
  border: 4px solid #07110d;
}

.equipment-icon,
.shop-modal-icon {
  position: relative;
  width: 50px;
  height: 50px;
  background: #e7b657;
  border: 3px solid #07110d;
  box-shadow: 3px 3px 0 #07110d;
}

.equipment-icon::before,
.equipment-icon::after,
.shop-modal-icon::before,
.shop-modal-icon::after {
  content: "";
  position: absolute;
  background: #07110d;
}

.espresso-icon::before { inset: 12px 9px 26px; background: #f4f0e8; }
.espresso-icon::after { left: 15px; right: 15px; bottom: 10px; height: 8px; }
.register-icon::before { left: 9px; top: 9px; width: 28px; height: 10px; background: #f4f0e8; }
.register-icon::after { left: 8px; right: 8px; bottom: 9px; height: 14px; }
.sign-icon::before { left: 8px; right: 8px; top: 9px; height: 24px; background: #2c3f35; }
.sign-icon::after { left: 20px; bottom: 5px; width: 6px; height: 12px; }
.seats-icon::before { left: 8px; right: 8px; top: 18px; height: 8px; }
.seats-icon::after { left: 12px; bottom: 8px; width: 26px; height: 12px; border-left: 5px solid #07110d; border-right: 5px solid #07110d; background: transparent; }
.queue-icon::before { left: 9px; top: 10px; width: 8px; height: 30px; box-shadow: 12px 0 0 #07110d, 24px 0 0 #07110d; }
.queue-icon::after { left: 5px; top: 5px; width: 8px; height: 8px; border-radius: 50%; box-shadow: 12px 0 0 #07110d, 24px 0 0 #07110d; }
.storage-icon::before { left: 8px; right: 8px; bottom: 8px; height: 26px; background: #2c3f35; }
.storage-icon::after { left: 14px; right: 14px; top: 9px; height: 8px; background: #07110d; box-shadow: 0 12px 0 #07110d; }
.location-icon::before { left: 12px; top: 7px; width: 22px; height: 22px; border-radius: 50%; background: #07110d; }
.location-icon::after { left: 20px; top: 25px; width: 8px; height: 16px; transform: rotate(45deg); background: #07110d; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.summary-grid div {
  display: grid;
  gap: 5px;
  min-height: 58px;
  padding: 10px;
  background: #151917;
  border: 3px solid #07110d;
  box-shadow: 3px 3px 0 rgba(7, 17, 13, 0.65);
}

.summary-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.summary-grid strong {
  color: var(--text);
  font-size: 20px;
}

#summarySales,
#summaryProfit.positive,
#summaryPopularity.positive {
  color: var(--accent-strong);
}

#summaryExpense,
#summaryProfit.negative,
#summaryPopularity.negative {
  color: var(--danger);
}

#summaryMessage {
  margin: 0;
  color: var(--gold);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.45;
}

.scenario-dialog-panel p {
  margin: 0;
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.45;
}

@media (max-width: 720px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }
}

#quitGame.pixel-button {
  background:
    linear-gradient(#e4675f, #e4675f) center / calc(100% - 12px) calc(100% - 12px) no-repeat,
    #8f2f34;
}

#quitGame.pixel-button:hover,
#quitGame.pixel-button:focus-visible {
  background:
    linear-gradient(#ff8a80, #ff8a80) center / calc(100% - 12px) calc(100% - 12px) no-repeat,
    #8f2f34;
}

.mobile-icon::before {
  left: 14px;
  top: 7px;
  width: 22px;
  height: 34px;
  background: #f4f0e8;
  border: 3px solid #07110d;
}

.mobile-icon::after {
  left: 20px;
  top: 31px;
  width: 10px;
  height: 4px;
  background: #07110d;
  box-shadow: 0 -14px 0 #58c097;
}
.new-game-form {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(7, 17, 13, 0.72);
}

.new-game-form[hidden] {
  display: none;
}

.new-game-modal-panel {
  display: grid;
  gap: 14px;
  width: min(560px, 100%);
  padding: 24px;
  background: rgba(26, 31, 29, 0.96);
  border: 4px solid #07110d;
  outline: 3px solid var(--gold);
  box-shadow: 10px 10px 0 #07110d;
}

.new-game-modal-panel h2 {
  margin: 0;
  color: var(--gold);
  font-size: 28px;
  line-height: 1;
  text-transform: uppercase;
}

.new-game-form select,
.new-game-form input[type="text"] {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  background: #151917;
  border: 3px solid #07110d;
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 16px;
  font-weight: 900;
  outline: 2px solid #f4f0e8;
}

.new-game-form select:focus,
.new-game-form input:focus {
  outline-color: var(--gold);
}

.character-builder {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 18px;
  align-items: stretch;
}

.character-preview {
  position: relative;
  height: 150px;
  margin-top: 80px;
  background: #151917;
  border: 3px solid #07110d;
  outline: 2px solid var(--line);
  box-shadow: inset 0 -18px 0 #25312b;
  --skin-color: #d8a06c;
  --hat-color: #e7b657;
  --shirt-color: #58c097;
}

.character-preview span {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  image-rendering: pixelated;
}

.preview-hat {
  top: 38px;
  width: 34px;
  height: 12px;
  background: var(--hat-color);
  box-shadow: 0 -10px 0 -2px var(--hat-color);
}

.preview-head {
  top: 50px;
  width: 28px;
  height: 28px;
  background: var(--skin-color);
  box-shadow:
    -7px 8px 0 -3px #07110d,
    7px 8px 0 -3px #07110d;
}

.preview-shirt {
  top: 78px;
  width: 38px;
  height: 48px;
  background: var(--shirt-color);
  box-shadow:
    -18px 12px 0 -12px var(--skin-color),
    18px 12px 0 -12px var(--skin-color)
}

.character-preview[data-gender="female"] .preview-head {
  box-shadow:
    -12px 2px 0 -2px #33261d,
    12px 2px 0 -2px #33261d,
    -7px 8px 0 -3px #07110d,
    7px 8px 0 -3px #07110d;
}

.character-options {
  display: grid;
  gap: 9px;
}

.character-options input[type="color"] {
  width: 100%;
  height: 42px;
  padding: 4px;
  background: #151917;
  border: 3px solid #07110d;
  outline: 2px solid #f4f0e8;
}

.new-game-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}

@media (max-width: 640px) {
  .character-builder {
    grid-template-columns: 1fr;
  }

  .character-preview {
    min-height: 142px;
  }
}

.character-control-label {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 900;
  padding-left: 22px;
  text-transform: uppercase;
}

.pixel-radio-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pixel-radio,
.color-arrow {
  min-height: 38px;
  background: #c9913b;
  border: 3px solid #07110d;
  color: #07110d;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: inset 0 3px 0 #f4d35e, 4px 4px 0 #07110d;
  cursor: pointer;
}

.pixel-radio:hover,
.color-arrow:hover {
  background: #f4d35e;
}

.pixel-radio.active {
  background: var(--gold);
  color: #07110d;
  transform: translate(2px, 2px);
  box-shadow: inset 0 2px 0 #f4f0e8, 2px 2px 0 #07110d;
}

.color-stepper {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.color-arrow {
  min-width: 42px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.color-swatch {
  display: block;
  width: 120px;
  height: 38px;
  background: var(--gold);
  border: 3px solid #07110d;
  outline: 2px solid #f4f0e8;
  box-shadow: inset 0 0 0 4px rgba(7, 17, 13, 0.16);
}

.preview-head::before,
.preview-head::after {
  content: "";
  position: absolute;
  top: 9px;
  width: 4px;
  height: 4px;
  background: #07110d;
}

.preview-head::before {
  left: 7px;
}

.preview-head::after {
  right: 7px;
}

.menu-button,
.stats-button {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  min-height: 46px;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--muted);
  border-radius: 0;
  cursor: pointer;
}

.menu-button {
  align-content: center;
  gap: 5px;
}

.menu-button span,
.stats-button span {
  background: var(--muted);
}

.menu-button span {
  display: block;
  width: 24px;
  height: 3px;
}

.stats-button {
  grid-template-columns: repeat(3, 7px);
  align-items: end;
  justify-content: center;
  gap: 4px;
}

.stats-button span {
  display: block;
  width: 7px;
}

.stats-button span:nth-child(1) { height: 12px; }
.stats-button span:nth-child(2) { height: 21px; }
.stats-button span:nth-child(3) { height: 30px; }

.menu-button:hover,
.menu-button:focus-visible,
.stats-button:hover,
.stats-button:focus-visible {
  border-color: var(--text);
  outline: 0;
}

.menu-button:hover span,
.menu-button:focus-visible span,
.stats-button:hover span,
.stats-button:focus-visible span {
  background: var(--text);
}

.stats-dialog {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(7, 17, 13, 0.72);
}

.stats-dialog[hidden] {
  display: none;
}

.stats-dialog-panel h2 {
  margin: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 28px;
  text-transform: uppercase;
}

.stats-chart {
  width: 100%;
  height: auto;
  border: 3px solid #07110d;
  background: #151917;
  image-rendering: pixelated;
}

.stats-legend {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.stats-legend span::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 6px;
  margin-right: 8px;
  vertical-align: middle;
  background: currentColor;
}

.stats-legend .profit-line { color: #89e0bb; }
.stats-legend .expense-line { color: #e4675f; }

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

.stats-grid div {
  display: grid;
  gap: 5px;
  padding: 12px;
  background: #151917;
  border: 3px solid #07110d;
}

.stats-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.stats-grid strong {
  color: var(--text);
  font-size: 18px;
}

@media (max-width: 720px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.price-up,
.price-down,
.price-even {
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.price-up {
  color: var(--danger);
}

.price-down {
  color: var(--accent-strong);
}

.price-up::after {
  content: "(↑)";
  font-size: 11px;
  font-weight: 900px;
}

.price-down::after {
  content: "(↓)";
  font-size: 11px;
  font-weight: 900px;
}

.price-even::after {
  font-size: 11px;
  font-weight: 900px;
}

/* Location map */
.top-bar {
  grid-template-columns: 46px 46px repeat(4, minmax(110px, 0.4fr)) auto;
}

.location-button {
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--muted);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.location-button::before {
  content: "";
  display: block;
  width: 40;
  height: 40px;
  background: currentColor;

  -webkit-mask: url("./assets/icons/globe.svg") center/contain no-repeat;
  mask: url("./assets/icons/globe.svg") center/contain no-repeat;
}

.location-button {
  display: grid;
  place-items: center;

  width: 46px;
  height: 46px;
  padding-top: 5px;

  border: 1px solid var(--muted);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.location-button::before {
  content: "";
  width: 32px;
  height: 32px;
  top: 8px;
  display: block;
  flex-shrink: 0;
  background: currentColor;
  -webkit-mask: url("./assets/icons/globe.svg") center/contain no-repeat;
  mask: url("./assets/icons/globe.svg") center/contain no-repeat;
}

.location-button:hover,
.location-button:focus-visible {
  border-color: var(--text);
  color: var(--text);
  outline: 0;
}
 

.location-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.location-dialog {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(7, 17, 13, 0.72);
}

.location-dialog[hidden] {
  display: none;
}

.location-dialog-panel h2 {
  margin: 0;
  font-size: 28px;
  text-transform: uppercase;
}

.location-map {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(67px, 86px));
  align-items: end;
  gap: 70px;
  min-height: 230px;
  padding: 34px 20px 24px;
  overflow: hidden;
  background:
    linear-gradient(#7aa7d9 0 44%, #58c097 44% 72%, #8b6f4e 72% 100%);
  border: 4px solid #07110d;
}

.location-map::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 70px;
  height: 8px;
  background: #f4d35e;
  border: 3px solid #07110d;
}

.location-map-node {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 70px;
  padding: 38px 6px 7px;
  background: #56615a;
  border: 3px solid #07110d;
  color: #c3cbc4;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 #07110d;
}

.location-map-node::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 50%;
  width: 20px;
  height: 20px;
  transform: translateX(-50%);
  background: #aeb7ad;
  border: 3px solid #07110d;
  border-radius: 50% 50% 50% 0;
  rotate: -45deg;
}

.location-map-node.unlocked {
  background: #2c3f35;
  color: var(--text);
}

.location-map-node.next-unlock {
  background: var(--line);
  color: var(--text);
}

.location-map-node.current::before {
  background: #89e0bb;
}

.location-map-node.selected {
  outline: 4px solid #f4f0e8;
  outline-offset: 3px;
  transform: translateY(-5px);
}

.location-map-node:hover:not(:disabled),
.location-map-node:focus-visible:not(:disabled) {
  background: #ffd879;
  color: #07110d;
  outline: 3px solid #07110d;
}

.location-map-node:disabled {
  cursor: not-allowed;
}

.location-info-panel {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(320px, 1.5fr);
  gap: 16px;
  align-items: center;
  padding: 16px;
  background: #151917;
  border: 3px solid #07110d;
}

.location-info-panel h3,
.location-info-panel p {
  margin: 0;
}

.location-info-panel h3 {
  margin-top: 5px;
  color: var(--gold);
  font-size: 22px;
  text-transform: uppercase;
}

.location-info-panel p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.location-info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.location-info-grid div {
  display: grid;
  gap: 4px;
  padding: 9px;
  background: #232a26;
  border: 2px solid #07110d;
}

.location-info-grid span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.location-info-grid strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.location-info-panel > .pixel-button {
  grid-column: 1 / -1;
  margin: 0;
}

@media (max-width: 760px) {
  .location-map {
    grid-template-columns: repeat(5, minmax(68px, 1fr));
    overflow-x: auto;
  }

  .location-info-panel {
    grid-template-columns: 1fr;
  }

  .location-info-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.menu-dialog {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(7, 17, 13, 0.72);
}

.menu-dialog[hidden] {
  display: none;
}

.menu-dialog-panel h2 {
  margin: 0;
  font-size: 28px;
  text-transform: uppercase;
}

.menu-recipe-tabs {
  display: flex;
  gap: 0;
  margin-bottom: -4px;
  position: relative;
  z-index: 2;
}

.menu-recipe-tab {
  width: 150px;
  padding: 10px 18px;
  border: 4px solid #07110d;
  border-bottom: 0;
  margin-bottom: -9px;
  background: #25312b;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 4px -2px 0 #07110d;
  position: relative;
  top: 4px;
}

.menu-recipe-tab:not(.active):hover,
.menu-recipe-tab:not(.active):focus-visible {
  background: #365645;
  color: var(--text);
}

.menu-recipe-tab:first-child {
  border-top-left-radius: 6px;
}

.menu-recipe-tab:last-child {
  border-top-right-radius: 6px;
}

.menu-recipe-tab.active {
  background: #1a1f1d;
  color: var(--gold);
  border-bottom: 4px solid #1a1f1d;
  margin-bottom: -18px;
  top: 0;
}

.recipe-panel {
  background: #1a1f1d;
  border: 4px solid #07110d;
  padding: 12px;
  box-shadow: 5px 5px 0 #07110d;
}

.recipe-panel[hidden] {
  display: none;
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.recipe-card {
  display: grid;
  grid-template-rows: 56px auto auto auto;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  background: #1a1f1d;
  border: 4px solid #07110d;
  box-shadow: 5px 5px 0 #07110d;
}

.recipe-card.unlocked {
  border-color: #58c097;
}

.recipe-card h3,
.recipe-card p {
  margin: 0;
}

.recipe-card h3 {
  color: var(--gold);
  font-size: 13px;
  text-transform: uppercase;
}

.recipe-card p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.recipe-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px;
  background: #151917;
  border: 2px solid #07110d;
}

.recipe-price span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

.recipe-price strong {
  color: #89e0bb;
  font-size: 12px;
}

.recipe-card > button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 42px;
  padding: 7px 8px;
  background: #2c3f35;
  border: 3px solid #07110d;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  box-shadow: 3px 3px 0 #07110d;
}

.recipe-card > button strong {
  color: var(--gold);
  font-size: 11px;
  white-space: nowrap;
}

.recipe-card > button:hover:not(:disabled),
.recipe-card > button:focus-visible:not(:disabled) {
  background: #365645;
  outline: 0;
}

.recipe-card > button:disabled {
  cursor: default;
  opacity: 0.75;
}

.recipe-icon {
  position: relative;
  width: 58px;
  height: 50px;
  margin: 0 auto;
  image-rendering: pixelated;
}

.coffee-recipe-icon::before,
.latte-recipe-icon::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 10px;
  width: 34px;
  height: 31px;
  background: #f4f0e8;
  border: 4px solid #07110d;
  box-shadow: inset 0 10px 0 #8b6f4e;
}

.coffee-recipe-icon::after,
.latte-recipe-icon::after {
  content: "";
  position: absolute;
  right: 3px;
  top: 17px;
  width: 13px;
  height: 16px;
  border: 4px solid #07110d;
  background: transparent;
}

.latte-recipe-icon::before {
  background: #f4f0e8;
  box-shadow:
    inset 0 8px 0 #8b6f4e,
    inset 0 25px 0 #d9c2a4;
}

.pastry-recipe-icon::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 13px;
  width: 42px;
  height: 29px;
  background: #e7b657;
  border: 4px solid #07110d;
  clip-path: polygon(50% 0, 100% 65%, 84% 100%, 16% 100%, 0 65%);
}

.pastry-recipe-icon::after {
  content: "";
  position: absolute;
  left: 21px;
  top: 25px;
  width: 6px;
  height: 6px;
  background: #8b6f4e;
  box-shadow: 14px 2px 0 #8b6f4e;
}

.bubble-tea-recipe-icon::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 8px;
  width: 28px;
  height: 38px;
  background:
    radial-gradient(circle at 8px 10px, #07110d 0 3px, transparent 4px),
    radial-gradient(circle at 18px 8px, #07110d 0 3px, transparent 4px),
    radial-gradient(circle at 10px 20px, #07110d 0 3px, transparent 4px),
    radial-gradient(circle at 22px 18px, #07110d 0 3px, transparent 4px),
    radial-gradient(circle at 6px 30px, #07110d 0 3px, transparent 4px),
    radial-gradient(circle at 20px 28px, #07110d 0 3px, transparent 4px),
    #d9c2a4;
  border: 4px solid #07110d;
}

.bubble-tea-recipe-icon::after {
  content: "";
  position: absolute;
  left: 28px;
  top: 0;
  width: 5px;
  height: 18px;
  background: #58c097;
  transform: rotate(18deg);
}

.donut-recipe-icon {
  position: relative;
}

.donut-recipe-icon::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  width: 42px;
  height: 42px;
  background: #d6a15d;
  border: 4px solid #07110d;
  border-radius: 50%;
  box-sizing: border-box;
}

.donut-recipe-icon::after {
  content: "";
  position: absolute;
  left: 11px;
  top: 11px;
  width: 36px;
  height: 36px;
  border-radius: 50%;

  background:
    radial-gradient(
      circle at center,
      #1a1f1d 0 5px,
      transparent 5px
    ),
    linear-gradient(45deg, #7de3ff 0 100%) 8px 7px / 5px 2px no-repeat,
    linear-gradient(-35deg, #ffe36b 0 100%) 20px 10px / 5px 2px no-repeat,
    linear-gradient(20deg, #8cff8c 0 100%) 28px 18px / 5px 2px no-repeat,
    linear-gradient(-45deg, #ffffff 0 100%) 10px 24px / 5px 2px no-repeat,
    linear-gradient(35deg, #ffb86c 0 100%) 24px 28px / 5px 2px no-repeat,
    linear-gradient(-20deg, #c8a0ff 0 100%) 15px 15px / 5px 2px no-repeat,
    radial-gradient(
      circle at center,
      transparent 0 5px,
      #ff8fc2 5px 16px,
      transparent 16px
    );
}

.recipe-card-coming-soon {
  opacity: 0.65;
  height: 215px;
}

.recipe-card-coming-soon h3,
.recipe-card-coming-soon p,
.recipe-card-coming-soon .recipe-price {
  filter: grayscale(1);
}

.recipe-card-coming-soon button {
  cursor: not-allowed;
  opacity: 0.75;
}

.mystery-recipe-icon {
  position: relative;
}

.mystery-recipe-icon::before {
  content: "?";
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  font-size: 28px;
  font-weight: bold;
  color: #d8d8d8;
  background: #3a3a3a;
  border: 4px solid #07110d;
  border-radius: 8px;
}

@media (max-width: 760px) {
  .recipe-grid {
    grid-template-columns: 1fr;
  }
}

.equipment-dialog-panel,
.shop-dialog-panel {
  position: relative;
}
/* Two-step new game setup */
.new-game-progress {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.new-game-progress span {
  display: grid;
  place-items: center;
  min-height: 34px;
  padding: 6px;
  background: #303a35;
  border: 3px solid #07110d;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.new-game-progress span.active {
  background: var(--gold);
  color: #07110d;
  box-shadow: 3px 3px 0 #07110d;
}

.new-game-step {
  display: grid;
  gap: 30px;
}

.new-game-step[hidden] {
  display: none;
}

.shop-accent-preview {
  --shop-accent-color: #7a4cb0;

  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;

  width: 220px;
  height: 190px;

  background: #151917;
  border: 3px solid #07110d;
  outline: 2px solid var(--line);
}

.shop-accent-preview::before,
.shop-accent-preview::after {
  content: "";
  position: absolute;
  bottom: 30px;
  width: 12px;
  height: 95px;
  background: #5e3f2c;
}

.shop-accent-preview::before {
  left: 38px;
}

.shop-accent-preview::after {
  right: 38px;
}

.shop-preview-banner {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 28px;
  background: #e7b657;
  border: 1px solid #07110d;
  color: #07110d;
  font-size: 14px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  text-transform: uppercase;
}

.shop-preview-banner::before,
.shop-preview-banner::after {
  content: "";
  position: absolute;
  left: -3px;
  width: calc(100%);
  height: 6px;
  background: var(--shop-accent-color);
  border-left: 3px solid #07110d;
  border-right: 3px solid #07110d;
  z-index: 1;
}

.shop-preview-banner::before {
  top: -9px;
  border-top: 3px solid #07110d;
}

.shop-preview-banner::after {
  bottom: -9px;
  border-bottom: 3px solid #07110d;
}

.shop-preview-counter {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: 145px;
  height: 44px;
  background: #8b6f4e;
  border: 3px solid #07110d;
  z-index: 2;
}

#shopCustomizationStep {
  justify-items: center;
}

#shopCustomizationStep h2 {
  justify-self: stretch;
}

.shop-customization-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: end;
  width: 100%;
}

.shop-customization-field {
  display: grid;
  gap: 8px;
}

.shop-customization-field .color-stepper {
  min-height: 42px;
}

.shop-accent-preview {
  justify-self: center;
}

@media (max-width: 640px) {
  .shop-customization-grid {
    grid-template-columns: 1fr;
  }
}

.scene-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  padding: 12px;
}

#scene {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
}

/* mobile styling */
@media (max-width: 600px) {

  .top-bar,
  .bottom-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    max-width: 390px;
    grid-template-columns: 1fr;
  }

  .game-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 390px;
  }
  
  .controls {
    width: 100%;
    max-width: 520px;
  }

  .app-shell {
    padding: 10px;
  }

  .inventory-grid {
    grid-template-columns: repeat(4,1fr);
  }

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

  .recipe-card-coming-soon {
    display: none;
  }

  .canvas-wrap {
    height: min(calc(75vw * 900 / 1600), calc(100vh - 215px), 900px);
  }

  .control-panel {
    width: 100%;
  }

  .summary-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .summary-grid div {
    min-height: 0px;
  }

  .summary-grid span {
    font-size: 10px;
  }

  .summary-grid strong {
    font-size: 14px;
  }

  .character-preview {
    display: none;
  }

  .wide-stat {
    display: none !important;
  }

}