:root {
  --ink: #182720;
  --paper: #f4f0df;
  --orange: #e95b32;
  --lime: #d3ef7c;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
button {
  cursor: pointer;
}
a,
button {
  touch-action: manipulation;
}
dialog button {
  font: 700 13px monospace;
  border: 1px solid var(--ink);
  background: var(--paper);
  padding: 11px 16px;
  color: var(--ink);
}
dialog button:hover,
dialog button:focus-visible {
  background: var(--lime);
}
dialog {
  font-family: Arial, Helvetica, sans-serif;
}
dialog {
  padding: 24px;
  border: 2px solid var(--ink);
  background: var(--paper);
  width: min(980px, 96vw);
  max-height: 95vh;
  overflow: auto;
  color: var(--ink);
}
dialog::backdrop {
  background: #0d211bd9;
  backdrop-filter: blur(5px);
}
.game-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.game-head small {
  font: 10px monospace;
  letter-spacing: 2px;
}
.game-head h2 {
  margin: 7px 0;
  font-size: 28px;
}
#instructions {
  font-size: 14px;
  line-height: 1.5;
}
.hud {
  display: flex;
  gap: 15px;
  align-items: center;
  font: 12px monospace;
  margin: 14px 0;
}
.hud #best {
  margin-right: auto;
}
.hud button {
  padding: 7px 12px;
}
#stage {
  position: relative;
  background: #e2edce;
  min-height: 260px;
}
canvas {
  display: block;
  width: 100%;
  height: auto;
  outline: none;
}
#overlay {
  position: absolute;
  inset: 0;
  background: #182720e8;
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 20px;
}
#overlay h3 {
  font-size: 36px;
  margin: 0 0 12px;
}
#overlay p {
  max-width: 480px;
  line-height: 1.5;
}
#overlay button {
  background: var(--lime);
  margin-top: 15px;
}
#controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 14px;
  flex-wrap: wrap;
}
#controls button {
  min-width: 95px;
}
.hint {
  text-align: center;
  font: 10px monospace;
  color: #607063;
}
#board {
  display: none;
  padding: 20px;
  min-height: 460px;
}
.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-width: 650px;
  margin: auto;
}
.memory-grid button {
  min-height: 90px;
  font-size: 28px;
  background: #182720;
  color: var(--paper);
}
.memory-grid button.revealed {
  background: var(--lime);
  color: var(--ink);
}
.tycoon {
  text-align: center;
}
.bank {
  font: bold 52px monospace;
  margin: 25px;
}
.tycoon button {
  margin: 8px;
}
.shop {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}
.shop button {
  max-width: 220px;
  line-height: 1.6;
}
.tycoon p {
  font: 14px monospace;
}
@media (max-width: 760px) {
  dialog {
    padding: 14px;
  }
  .hud {
    gap: 8px;
    flex-wrap: wrap;
  }
  .hud button {
    padding: 7px;
  }
}
/* Flappy Files uses the original arcade's blue-and-gold pixel-art direction. */
dialog.flappy {
  background: #0d142b;
  color: #f8edaa;
  border-color: #344d70;
}
.flappy button {
  background: #152340;
  color: #fff2a2;
  border-color: #577397;
}
.flappy #stage {
  background: #174c88;
}
.flappy canvas {
  image-rendering: pixelated;
}
.flappy #overlay {
  background: #0c1329e8;
  border: 5px double #486187;
  margin: 12% 8%;
  padding: 15px;
  font-family: monospace;
}
.flappy #overlay h3 {
  font: 36px monospace;
  color: #ffec8c;
  text-transform: uppercase;
}
.flappy #overlay p {
  font: 16px monospace;
  text-transform: uppercase;
}
.flappy .hint {
  color: #b8c8df;
}
.flappy #overlay button {
  color: #ffec8c;
  border: 0;
  font-size: 17px;
}
.flappy #controls button {
  background: #172b4d;
}
.flappy .hud {
  color: #e5ecf5;
}
