:root {
  color-scheme: dark;
  --ink: #09090b;
  --paper: #f4efdf;
  --yellow: #ffd928;
  --pink: #ff477e;
  --cyan: #48d9d2;
  --purple: #4b3278;
  --white: #fffdf4;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--yellow);
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: "Arial Narrow", "Roboto Condensed", Arial, sans-serif;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 4px solid var(--pink);
  outline-offset: 3px;
}

.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 10px clamp(16px, 4vw, 64px);
  background: var(--yellow);
  border-bottom: 5px solid var(--ink);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  letter-spacing: .05em;
}

.family-mark {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--ink);
  font-size: clamp(1.25rem, 3vw, 2rem);
  text-decoration: none;
}

.heart {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--yellow);
  background: var(--ink);
  font-family: Arial, sans-serif;
  font-size: 22px;
  line-height: 1;
}

.release-stamp {
  font: 700 .75rem/1.2 "Courier New", monospace;
  text-align: right;
}

main {
  overflow: hidden;
}

.arcade {
  background: var(--ink);
  color: var(--white);
  border-bottom: 10px solid var(--yellow);
}

.billboard {
  display: grid;
  grid-template-columns: 1fr minmax(290px, 2fr) 1fr;
  gap: 24px;
  align-items: center;
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 64px) 24px;
  text-align: center;
}

.billboard h1 {
  margin: 0;
  color: var(--yellow);
  font-family: Impact, Haettenschweiler, "Arial Black", sans-serif;
  font-size: clamp(4.6rem, 11vw, 10.5rem);
  font-weight: 500;
  letter-spacing: -.035em;
  line-height: .73;
  text-shadow: 7px 7px 0 var(--pink);
  transform: skew(-4deg);
}

.billboard p {
  max-width: 230px;
  margin: 0 auto;
  padding-block: 10px;
  border-block: 3px solid var(--white);
  font: 700 clamp(.68rem, 1.4vw, .95rem)/1.35 "Courier New", monospace;
  letter-spacing: .06em;
}

.game-frame {
  position: relative;
  width: min(1440px, calc(100% - clamp(0px, 4vw, 64px)));
  margin: 0 auto;
  border: 5px solid var(--yellow);
  background: #10101b;
  box-shadow: 10px 10px 0 var(--purple);
  touch-action: none;
}

canvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #10101b;
  image-rendering: pixelated;
}

.game-tools {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  z-index: 2;
}

.game-tools button {
  min-height: 32px;
  padding: 5px 9px;
  border: 2px solid var(--yellow);
  border-radius: 0;
  color: var(--yellow);
  background: rgba(9, 9, 11, .82);
  font: 700 11px/1 "Courier New", monospace;
  cursor: pointer;
}

.touch-controls {
  display: none;
}

.machine-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 5vw, 80px);
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 32px clamp(16px, 5vw, 72px) 38px;
  color: var(--paper);
  font: 600 clamp(.9rem, 1.7vw, 1.1rem)/1.45 "Courier New", monospace;
}

.machine-strip p {
  margin: 0;
}

.machine-strip strong {
  color: var(--yellow);
}

.field-notes {
  display: grid;
  grid-template-columns: minmax(220px, .7fr) 1.5fr;
  gap: clamp(28px, 7vw, 100px);
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 64px 0 72px;
}

.section-number {
  margin: 0 0 12px;
  font: 700 .75rem/1.2 "Courier New", monospace;
}

.field-notes h2 {
  margin: 0;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 500;
  line-height: .88;
}

.control-list {
  margin: 0;
  border-top: 4px solid var(--ink);
}

.control-list div {
  display: grid;
  grid-template-columns: minmax(110px, .7fr) 2fr;
  gap: 20px;
  padding: 15px 0;
  border-bottom: 2px solid var(--ink);
}

.control-list dt {
  font: 800 .85rem/1.4 "Courier New", monospace;
}

.control-list dd {
  margin: 0;
  font-size: 1.05rem;
}

.mobile-note {
  display: none;
}

footer {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 24px;
  align-items: center;
  padding: 22px clamp(16px, 4vw, 64px);
  background: var(--yellow);
  border-top: 5px solid var(--ink);
  font: 800 .75rem/1.3 "Courier New", monospace;
}

footer a {
  color: var(--ink);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

@media (max-width: 760px) {
  .release-stamp {
    max-width: 100px;
  }

  .billboard {
    grid-template-columns: 1fr;
    padding-top: 25px;
  }

  .billboard p:first-child {
    display: none;
  }

  .billboard h1 {
    font-size: clamp(4rem, 22vw, 7rem);
    text-shadow: 4px 4px 0 var(--pink);
  }

  .billboard p {
    max-width: none;
  }

  .game-frame {
    width: 100%;
    border-width: 4px 0;
    box-shadow: none;
  }

  .game-tools {
    top: 6px;
    right: 6px;
  }

  .game-tools button {
    min-height: 26px;
    font-size: 9px;
  }

  .touch-controls {
    display: flex;
    justify-content: space-between;
    align-items: end;
    min-height: 164px;
    padding: 12px 16px 16px;
    background: #171727;
    border-top: 4px solid var(--yellow);
  }

  .touch-dpad {
    display: grid;
    grid-template-columns: repeat(3, 54px);
    grid-template-rows: repeat(2, 54px);
  }

  .touch-dpad button,
  .touch-actions button {
    border: 3px solid var(--paper);
    border-radius: 0;
    color: var(--paper);
    background: #26263d;
    box-shadow: 4px 4px 0 #050507;
    font: 900 18px/1 "Courier New", monospace;
    touch-action: none;
  }

  .touch-dpad button:active,
  .touch-actions button:active,
  .touch-controls .is-pressed {
    transform: translate(3px, 3px);
    box-shadow: 1px 1px 0 #050507;
    color: var(--ink);
    background: var(--yellow);
  }

  .touch-dpad [data-control="up"] { grid-column: 2; grid-row: 1; }
  .touch-dpad [data-control="left"] { grid-column: 1; grid-row: 2; }
  .touch-dpad [data-control="down"] { grid-column: 2; grid-row: 2; }
  .touch-dpad [data-control="right"] { grid-column: 3; grid-row: 2; }

  .touch-actions {
    display: flex;
    gap: 8px;
    align-items: end;
  }

  .touch-actions button {
    width: 58px;
    height: 58px;
    border-radius: 50%;
  }

  .touch-actions button:last-child {
    width: 68px;
    height: 68px;
    background: var(--pink);
  }

  .touch-actions .touch-special {
    width: 48px;
    height: 48px;
    background: var(--purple);
  }

  .machine-strip {
    grid-template-columns: 1fr;
    padding-top: 25px;
  }

  .field-notes {
    grid-template-columns: 1fr;
    padding: 46px 0;
  }

  .mobile-note {
    display: block;
    margin: -10px 0 0;
    font: 700 .8rem/1.5 "Courier New", monospace;
  }

  footer {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

@media (pointer: coarse) and (orientation: landscape) and (max-height: 600px) {
  .site-head,
  .billboard,
  .machine-strip,
  .field-notes,
  footer {
    display: none;
  }

  .game-frame {
    display: grid;
    grid-template-columns: 1fr 260px;
    width: 100vw;
    min-height: 100vh;
    border: 0;
  }

  canvas {
    align-self: center;
  }

  .touch-controls {
    align-self: stretch;
    min-height: 100vh;
    padding: 20px 10px;
    border-top: 0;
    border-left: 4px solid var(--yellow);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
