* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    16px/1.45 "Trebuchet MS",
    sans-serif;
}
body[data-kind="shop"] {
  --bg: #e8f2f4;
  --ink: #183342;
  --paper: #fff8df;
  --accent: #23516d;
  --border: #a9c7d0;
  --button: #23516d;
  --buttonInk: #fff8df;
}
body[data-kind="pub"] {
  --bg: #102e28;
  --ink: #f6e7c4;
  --paper: #1b4438;
  --accent: #e6c974;
  --border: #627660;
  --button: #e6c974;
  --buttonInk: #183b30;
}
button,
input,
select {
  font: inherit;
}
button,
a,
select,
input {
  touch-action: manipulation;
}
button {
  border: 1px solid var(--border);
  background: var(--button);
  color: var(--buttonInk);
  border-radius: 5px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: bold;
  min-height: 44px;
}
button:hover:enabled {
  filter: brightness(1.12);
}
button:disabled {
  cursor: default;
  opacity: 0.48;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid #ef6c43;
  outline-offset: 3px;
}
header {
  max-width: 1100px;
  margin: auto;
  padding: 16px 20px 8px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
h1 {
  font:
    bold clamp(23px, 4vw, 31px) / 1.1 Georgia,
    serif;
  margin: 0;
}
header p {
  font-size: 13px;
  margin: 4px 0 0;
  opacity: 0.85;
}
header button {
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}
main {
  max-width: 1100px;
  margin: auto;
  padding: 6px 20px 24px;
}
.till {
  display: flex;
  gap: 24px;
  align-items: center;
  padding: 10px 0 14px;
  border-bottom: 2px solid var(--border);
  flex-wrap: wrap;
}
.till p {
  margin: 0;
}
.till strong {
  font-size: 23px;
  display: block;
  line-height: 1.15;
}
.till span {
  font-size: 12px;
}
.till .actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.till .actions button {
  font-size: 14px;
}
canvas {
  width: 100%;
  aspect-ratio: 800/430;
  display: block;
  border-bottom: 3px solid var(--border);
}
.scene {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}
.welcome {
  background: var(--paper);
  border: 2px solid var(--border);
  padding: 18px 22px;
  margin: 12px 0;
}
.welcome h2 {
  font: bold 24px Georgia;
  margin: 0 0 8px;
}
.welcome p {
  margin: 8px 0;
  max-width: 70ch;
}
.welcome button {
  margin-top: 4px;
}
.status {
  border-bottom: 1px solid var(--border);
  min-height: 55px;
  display: flex;
  align-items: center;
  font-size: 14px;
  gap: 12px;
  padding: 9px 0;
}
.status p {
  margin: 0;
  flex: 1;
}
.status span {
  font-size: 12px;
  max-width: 130px;
  text-align: right;
}
.desk {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
  padding: 18px 0;
}
.controls label {
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}
.controls input {
  width: 100%;
  accent-color: var(--accent);
  margin: 12px 0 8px;
  min-height: 28px;
}
.controls select {
  background: var(--paper);
  color: var(--ink);
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 3px;
}
.controls p {
  font-size: 13px;
  margin: 4px 0 14px;
  opacity: 0.9;
}
.investments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
}
.graphs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.graph {
  margin: 0;
  border-bottom: 1px solid var(--border);
}
.graph:last-child {
  grid-column: 1/-1;
}
.graph figcaption {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  font-size: 13px;
}
.graph strong {
  font-size: 17px;
}
.graph svg {
  width: 100%;
  height: 68px;
  display: block;
  color: var(--ink);
}
details {
  border-top: 1px solid var(--border);
  padding: 12px 0;
  font-size: 14px;
}
summary {
  cursor: pointer;
  font-weight: bold;
  min-height: 32px;
}
details p {
  max-width: 78ch;
}
footer {
  font-size: 12px;
  opacity: 0.8;
}
#result {
  width: min(460px, calc(100% - 30px));
  max-height: calc(100% - 30px);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: auto;
}
#result::backdrop {
  background: #081c16b8;
}
#result:not([open]),
[hidden] {
  display: none !important;
}
.result-actions {
  display: grid;
  gap: 10px;
}
.receipt {
  background: var(--paper);
  color: var(--ink);
  padding: 24px;
  max-width: 460px;
  width: 100%;
  border: 3px solid var(--border);
}
.receipt h2 {
  font: bold 30px Georgia;
  margin: 0;
}
.receipt p {
  font-size: 15px;
}
.receipt dl {
  margin: 15px 0;
  border-block: 1px dashed var(--border);
  padding: 8px 0;
}
.receipt dl div {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
}
.receipt dd {
  margin: 0;
}
.receipt dl div:last-child {
  font-weight: bold;
  border-top: 1px solid var(--border);
  margin-top: 6px;
  padding-top: 8px;
}
.receipt button {
  width: 100%;
}
@media (min-width: 900px) {
  .desk {
    grid-template-columns: 1fr 1fr;
  }
  .scene {
    max-width: 800px;
  }
}
@media (max-width: 600px) {
  header {
    padding: 14px 12px 8px;
    align-items: flex-start;
  }
  header button {
    font-size: 12px;
    padding: 7px;
    white-space: nowrap;
  }
  header p {
    max-width: 220px;
  }
  main {
    padding: 4px 12px 20px;
  }
  .till {
    gap: 16px;
    justify-content: space-between;
  }
  .till strong {
    font-size: 20px;
  }
  .till .actions {
    width: 100%;
    margin: 0;
  }
  .till .actions button {
    flex: 1;
  }
  .desk {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .graphs {
    gap: 12px;
  }
  .welcome {
    padding: 14px;
  }
  .welcome h2 {
    font-size: 22px;
  }
  .status {
    align-items: flex-start;
  }
  .status span {
    max-width: 95px;
  }
  canvas {
    min-height: 195px;
  }
  .controls p {
    margin-bottom: 12px;
  }
  .investments button {
    flex: 1;
  }
  .receipt {
    padding: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
