:root {
  color-scheme: dark;
  --sky: #6cc6e8;
  --ink: #102033;
  --panel: #f9e4a9;
  --panel-edge: #d18a3a;
  --green: #2e9f66;
  --red: #d64a37;
  --blue: #256aa8;
  --white: #fff7dd;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #18263a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  overflow: hidden;
}

.arcade-shell {
  width: min(100vw, 1200px);
  padding: clamp(12px, 2vw, 28px);
}

.game-stage {
  position: relative;
  width: min(100%, 960px);
  aspect-ratio: 16 / 9;
  margin: 0 auto;
  background: var(--sky);
  border: 8px solid #0d1626;
  box-shadow:
    0 0 0 4px #f1c45e,
    0 18px 0 #0a1020,
    0 28px 48px rgb(0 0 0 / 45%);
  image-rendering: pixelated;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.hud {
  position: absolute;
  inset: 14px 14px auto;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

.hud-group {
  display: flex;
  gap: 8px;
}

.hud-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  height: 34px;
  padding: 0 10px;
  border: 3px solid #0d1626;
  background: var(--white);
  color: var(--ink);
  font-size: clamp(12px, 1.7vw, 18px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 rgb(0 0 0 / 25%);
}

#cash,
#writeoffs,
#rums,
#status {
  font-family: "Courier New", Courier, ui-monospace, monospace;
  font-weight: 900;
  text-shadow:
    1px 0 0 currentColor,
    0 1px 0 currentColor;
  -webkit-font-smoothing: none;
  font-smooth: never;
  font-variant-numeric: tabular-nums;
}

.hud-pill.danger {
  min-width: 150px;
  background: #f6cf4d;
  white-space: nowrap;
}

.coin-icon,
.writeoff-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: 8px;
  color: #17320f;
  background: #5fb44b;
  border: 2px solid #17320f;
  font-size: 12px;
}

.writeoff-icon {
  color: #1f315c;
  background: #b9d6ff;
  border-color: #1f315c;
}

.rum-icon {
  width: 16px;
  height: 20px;
  margin-right: 8px;
  background:
    linear-gradient(#fff7dd 0 25%, transparent 25%),
    linear-gradient(90deg, transparent 0 24%, #7a3a20 24% 76%, transparent 76%),
    linear-gradient(#d97b2f 0 100%);
  border: 2px solid #3b1f17;
}

.overlay,
.card-screen {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(11 21 36 / 38%);
}

.overlay[hidden],
.card-screen[hidden] {
  display: none;
}

.panel,
.father-card {
  width: min(470px, 86vw);
  border: 6px solid #0d1626;
  background: var(--panel);
  color: var(--ink);
  box-shadow:
    8px 8px 0 #0d1626,
    inset 0 0 0 4px var(--panel-edge);
  text-align: center;
}

.panel {
  padding: 30px 24px 26px;
}

.panel h1,
.father-card h2 {
  margin: 0 0 22px;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 0.95;
  letter-spacing: 0;
  color: #1c3e74;
  text-shadow: 3px 3px 0 #f6cf4d;
}

.play-button {
  min-width: 152px;
  min-height: 46px;
  border: 4px solid #0d1626;
  background: #2e9f66;
  color: #fff7dd;
  box-shadow: 5px 5px 0 #0d1626;
  cursor: pointer;
  font: inherit;
  font-size: 20px;
  text-transform: uppercase;
}

.play-button:hover,
.play-button:focus-visible {
  background: #23794e;
  outline: 0;
  transform: translate(1px, 1px);
  box-shadow: 4px 4px 0 #0d1626;
}

.father-card {
  padding: 18px;
  background: #f8d76e;
}

.card-front {
  min-height: 270px;
  display: grid;
  align-content: center;
  gap: 14px;
  border: 5px solid #0d1626;
  background:
    linear-gradient(90deg, rgb(255 255 255 / 0%) 0 48%, rgb(255 255 255 / 28%) 48% 52%, rgb(255 255 255 / 0%) 52%),
    #fff7dd;
  padding: 28px 24px;
}

.card-kicker {
  margin: 0;
  color: #d64a37;
  font-size: 16px;
  text-transform: uppercase;
}

.father-card h2 {
  margin-bottom: 0;
  font-size: clamp(30px, 4.5vw, 48px);
}

.card-copy {
  margin: 0;
  color: #27384e;
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.5;
}

.father-card .play-button {
  margin-top: 18px;
  background: #256aa8;
}

@media (max-width: 700px) {
  body {
    align-items: start;
    overflow: auto;
  }

  .arcade-shell {
    padding: 10px;
  }

  .game-stage {
    border-width: 5px;
  }

  .hud {
    inset: 8px 8px auto;
  }

  .hud-pill {
    min-width: 54px;
    height: 28px;
    padding: 0 6px;
  }

  .hud-pill.danger {
    min-width: 104px;
  }

  .coin-icon,
  .writeoff-icon,
  .rum-icon {
    margin-right: 4px;
  }
}
