:root {
  color-scheme: light;
  --ink: #173f3b;
  --coral: #ff6b63;
  --yellow: #ffd85a;
  --cream: #fff8df;
  --shell: #b9e2dc;
  --shell-dark: #76aaa5;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, #fff 0 4px, transparent 5px),
    radial-gradient(circle at 85% 72%, #ffcb65 0 6px, transparent 7px),
    linear-gradient(135deg, #fff8df 0 48%, #f9efc9 48% 52%, #fff8df 52%);
  background-size: 90px 90px, 120px 120px, auto;
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
}

.page-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  padding: 28px 28px 30px;
}

.intro { width: min(540px, 90vw); margin-top: 34px; text-align: center; }
.eyebrow {
  margin: 0 0 8px;
  color: #d94752;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(72px, 10vw, 132px);
  line-height: .82;
  letter-spacing: -.055em;
  text-shadow: 5px 5px 0 var(--yellow);
  transform: rotate(-2deg);
}

h1 span { color: var(--coral); }
.visual-title {
  width: 100%;
  line-height: 0;
  text-shadow: none;
  transform: none;
}
.visual-title img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: center;
}
.lede { max-width: 420px; margin: 30px auto 24px; font-size: 19px; line-height: 1.45; font-weight: 700; }
.instructions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 18px; font-size: 12px; font-weight: 900; text-transform: uppercase; }
.instructions span { display: flex; align-items: center; gap: 7px; }
.instructions b {
  display: grid;
  width: 23px;
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: #fff;
  box-shadow: 2px 2px 0 var(--yellow);
}

.console {
  position: relative;
  width: min(410px, 94vw);
  padding: 23px 25px 40px;
  border: 4px solid var(--ink);
  border-radius: 26px 26px 70px 26px;
  background: var(--shell);
  box-shadow: inset 0 -10px 0 var(--shell-dark), 12px 14px 0 rgba(23, 63, 59, .16);
}

.console::before, .console::after {
  content: "";
  position: absolute;
  top: 12px;
  width: 7px;
  height: 7px;
  border: 2px solid var(--shell-dark);
  border-radius: 50%;
}
.console::before { left: 14px; }
.console::after { right: 14px; }

.console-top { display: flex; align-items: center; gap: 8px; margin: 0 20px 7px; font-size: 7px; font-weight: 900; letter-spacing: .08em; }
.console-top::before, .console-top::after, .console-top i { content: ""; height: 2px; flex: 1; background: var(--ink); opacity: .55; }
.console-top i { max-width: 28px; }

.screen-bezel {
  position: relative;
  padding: 20px 22px 20px 40px;
  border: 3px solid var(--ink);
  border-radius: 14px 14px 34px 14px;
  background: #396863;
  box-shadow: inset 0 0 0 4px #2c5753;
}

.power-lamp { position: absolute; top: 42%; left: 8px; text-align: center; color: #d9f0d4; font-size: 6px; font-weight: 900; }
.power-lamp i { display: block; width: 8px; height: 8px; margin: 0 auto 4px; border-radius: 50%; background: #ff5d68; box-shadow: 0 0 8px #ff9c6e; }
.screen-wrap { position: relative; overflow: hidden; border: 3px solid #102d2b; background: #173f3b; box-shadow: inset 0 0 10px #000; }
#game-screen { display: block; width: 100%; image-rendering: pixelated; cursor: pointer; touch-action: manipulation; }
.screen-shine { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, rgba(255,255,255,.16), transparent 24% 68%, rgba(255,255,255,.06)); mix-blend-mode: screen; }

.brand-row { display: flex; align-items: baseline; gap: 5px; margin: 8px 12px 15px; font-style: italic; }
.brand-row strong { font-family: Impact, sans-serif; font-size: 20px; letter-spacing: .04em; }
.brand-row span { font-size: 10px; font-weight: 900; }
.brand-row em { margin-left: auto; color: #d84655; font-size: 10px; font-weight: 900; letter-spacing: .12em; }

.controls { position: relative; height: 104px; }
button { font: inherit; }
.dpad { position: absolute; left: 18px; top: 7px; width: 86px; height: 86px; filter: drop-shadow(3px 4px 0 rgba(23,63,59,.28)); }
.dpad button, .dpad i { position: absolute; border: 0; background: var(--ink); }
.dpad button { width: 30px; height: 30px; cursor: pointer; }
.dpad button::after { content: ""; position: absolute; inset: 9px; border-top: 6px solid #50726d; border-left: 6px solid transparent; border-right: 6px solid transparent; }
.dpad .up { left: 28px; top: 0; border-radius: 5px 5px 0 0; }
.dpad .right { right: 0; top: 28px; border-radius: 0 5px 5px 0; transform: rotate(90deg); }
.dpad .down { left: 28px; bottom: 0; border-radius: 0 0 5px 5px; transform: rotate(180deg); }
.dpad .left { left: 0; top: 28px; border-radius: 5px 0 0 5px; transform: rotate(-90deg); }
.dpad i { left: 28px; top: 28px; width: 30px; height: 30px; }
.dpad i::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #214b47; }

.action-buttons { position: absolute; right: 11px; top: 19px; display: flex; gap: 13px; transform: rotate(-12deg); }
.action-buttons button {
  width: 47px;
  height: 47px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  color: #fff7cf;
  background: var(--coral);
  box-shadow: inset 0 -6px 0 #d84452, 3px 5px 0 rgba(23,63,59,.24);
  font-size: 19px;
  font-weight: 900;
  cursor: pointer;
}
.action-buttons button:active, .dpad button:active, .menu-button:active { scale: .92; }
.menu-button { position: absolute; left: 44%; bottom: 2px; border: 2px solid var(--ink); border-radius: 8px; color: var(--ink); background: #f7e59a; box-shadow: 2px 3px 0 rgba(23,63,59,.3); font-size: 8px; font-weight: 900; cursor: pointer; transform: rotate(-4deg); }
.speaker { position: absolute; right: 24px; bottom: 17px; display: flex; gap: 7px; transform: rotate(-24deg); }
.speaker i { width: 5px; height: 35px; border-radius: 5px; background: var(--shell-dark); box-shadow: inset 1px 0 rgba(23,63,59,.35); }
.keyboard-note { margin: -6px 0 0; text-align: center; font-size: 10px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; opacity: .65; }

.package-preview {
  position: relative;
  overflow: hidden;
  width: min(1080px, calc(100% - 40px));
  margin: 48px auto 0;
  border: 3px solid var(--ink);
  border-radius: 28px;
  background: #f4eee8;
  box-shadow: 9px 10px 0 #91ded4;
}
.package-preview img { display: block; width: 100%; height: auto; }
.package-preview figcaption {
  position: absolute;
  right: 24px;
  bottom: 24px;
  display: grid;
  max-width: 310px;
  padding: 16px 19px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255, 253, 242, .94);
  box-shadow: 4px 5px 0 var(--yellow);
}
.package-preview figcaption span { color: #c63448; font-size: 9px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.package-preview figcaption strong { margin-top: 3px; font-size: 18px; line-height: 1.15; }
.package-preview figcaption small { margin-top: 6px; color: #56736d; font-size: 9px; font-weight: 700; text-transform: uppercase; }

.history {
  width: min(1080px, calc(100% - 40px));
  margin: 70px auto 40px;
  padding: clamp(28px, 5vw, 58px);
  border: 3px solid var(--ink);
  border-radius: 28px;
  background: #fffdf2;
  box-shadow: 9px 10px 0 var(--yellow);
}

.history-heading { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 50px; align-items: end; margin-bottom: 38px; }
.history-heading .eyebrow { grid-column: 1 / -1; }
.history-heading h2 {
  margin: 0;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(38px, 6vw, 68px);
  line-height: .95;
  letter-spacing: -.02em;
  text-transform: uppercase;
}
.history-heading > p:last-child { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.5; }
.history-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink); }
.history-grid article { position: relative; padding: 30px 26px 25px; }
.history-grid article + article { border-left: 2px solid var(--ink); }
.history-year {
  display: inline-block;
  margin-bottom: 20px;
  padding: 4px 9px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  color: var(--ink);
  background: var(--yellow);
  box-shadow: 2px 2px 0 var(--ink);
  font-family: monospace;
  font-size: 12px;
  font-weight: 900;
}
.history-grid article:nth-child(2) .history-year { background: #91ded4; }
.history-grid article:nth-child(3) .history-year { background: #ff9a91; }
.history h3 { margin: 0 0 13px; font-size: 20px; line-height: 1.1; }
.history figure { margin: 0 0 20px; }
.history figure img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 2px solid var(--ink);
  border-radius: 5px;
  background: #173f3b;
  box-shadow: 4px 4px 0 #b8d9b3;
  image-rendering: pixelated;
  object-fit: contain;
}
.history figcaption { margin-top: 9px; color: #647c76; font-family: monospace; font-size: 9px; font-weight: 900; line-height: 1.3; text-transform: uppercase; }
.history article p { margin: 0 0 12px; color: #315853; font-size: 13px; line-height: 1.55; }
.history-sources { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding-top: 24px; font-size: 11px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.history-sources strong { margin-right: auto; }
.history-sources a { color: #c63448; text-underline-offset: 4px; }
.history-sources a:hover { color: var(--ink); }

@keyframes lamp-pulse { 50% { opacity: .72; box-shadow: 0 0 3px #ff9c6e; } }
.power-lamp i { animation: lamp-pulse 1.8s steps(2) infinite; }

@media (max-width: 800px) {
  .page-shell { gap: 18px; padding-top: 22px; }
  .intro { text-align: center; }
  .lede { margin-left: auto; margin-right: auto; }
  .instructions { justify-content: center; }
  h1 { font-size: clamp(74px, 25vw, 112px); }
  .history { margin-top: 48px; }
  .history-heading { grid-template-columns: 1fr; }
  .history-heading .eyebrow { grid-column: auto; }
  .history-grid { grid-template-columns: 1fr; }
  .history-grid article + article { border-left: 0; border-top: 2px solid var(--ink); }
  .package-preview figcaption { position: static; max-width: none; border: 0; border-top: 2px solid var(--ink); border-radius: 0; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
