@font-face {
  font-family: "TGH64";
  src: url("assets/c64.woff2") format("woff2");
  font-display: swap;
}

:root {
  --c-black: #000;
  --c-white: #fff;
  --c-red: #883932;
  --c-cyan: #67b6bd;
  --c-purple: #8b3f96;
  --c-green: #55a049;
  --c-blue: #40318d;
  --c-yellow: #bfce72;
  --c-orange: #8b5429;
  --c-lred: #b86962;
  --c-lgreen: #94e089;
  --c-lblue: #7869c4;
  --c-lgrey: #9f9f9f;
  --osd: #5ef08a;
  --gold: #f5d76e;
  --bg: #07040c;
  --text: #e8e4f0;
  --dim: #9a93ad;
  --font: "TGH64", ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { background: var(--bg); scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: none;
  font-smooth: never;
  text-transform: uppercase;
  overflow-x: hidden;
}

img { image-rendering: pixelated; max-width: 100%; height: auto; }
a { color: var(--osd); }
a:focus-visible, video:focus-visible { outline: 2px dashed var(--gold); outline-offset: 4px; }

h1, h2, h3, p, blockquote, ul { margin: 0; }

.en { display: block; color: var(--dim); }
h2 .en, .sub .en { font-size: 16px; letter-spacing: 0; }

/* TV set */
.tv {
  position: relative;
  padding: clamp(10px, 2.5vw, 28px);
  border-radius: 28px;
  background: linear-gradient(160deg, #2a2730, #121016 60%, #1d1a22);
  box-shadow: 0 0 0 2px #000, 0 20px 50px #000c, inset 0 1px 0 #ffffff1a;
}
.tv--small { padding: 10px; border-radius: 16px; }

.screen {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 6% / 9%;
  background: #000;
  box-shadow: inset 0 0 0 2px #000;
}
.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, #0000 0 2px, #0006 2px 3px),
    radial-gradient(ellipse at center, #0000 55%, #000a 100%);
  border-radius: inherit;
  box-shadow: inset 0 0 40px #000;
}
.screen > img, .screen video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Hero */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 48px 16px;
  overflow: hidden;
}
.tinsel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .55;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, #0000 30%, var(--bg) 85%);
}
.tv--hero { z-index: 1; width: min(100%, 960px); }
.tv--hero .screen { aspect-ratio: auto; min-height: min(56vw, 540px); }

.snow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  opacity: 0;
  pointer-events: none;
}

.screen__content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2.5vw, 24px);
  min-height: inherit;
  padding: clamp(56px, 9vw, 96px) clamp(16px, 4vw, 48px);
  text-align: center;
  background:
    linear-gradient(to bottom, #0000 0, #0000 40%, #1a0f2e 100%);
}
.osd {
  position: absolute;
  top: clamp(10px, 3vw, 28px);
  right: clamp(16px, 4vw, 40px);
  color: var(--osd);
  font-size: clamp(16px, 3vw, 32px);
  text-shadow: 0 0 8px #5ef08a99;
}
.clock {
  position: absolute;
  bottom: clamp(10px, 2.5vw, 24px);
  left: clamp(16px, 4vw, 40px);
  color: var(--white, #fff);
  font-size: 16px;
  opacity: .8;
}
.screen__content h1 { width: 100%; }
.logo {
  width: min(100%, 828px);
  filter: drop-shadow(0 0 12px #f5d76e66);
}
.sub { font-size: clamp(16px, 2.5vw, 24px); color: var(--gold); }
.platforms { color: var(--osd); }
.watch {
  padding: 8px 16px;
  border: 4px solid var(--gold);
  color: var(--gold);
  font-size: clamp(16px, 2.5vw, 24px);
  text-decoration: none;
  box-shadow: 0 0 16px #f5d76e44;
}
.watch .en { font-size: 16px; }
.watch:hover, .watch:focus-visible { background: var(--gold); color: #000; outline: none; }
.watch:hover .en, .watch:focus-visible .en { color: #000; }

.boxes {
  display: flex;
  gap: clamp(12px, 3vw, 32px);
  align-items: flex-end;
  padding: 0;
  list-style: none;
}
.boxes a { display: block; transition: transform .2s; }
.boxes a:hover, .boxes a:focus-visible { transform: translateY(-6px) rotate(-2deg); }
.boxes img { width: clamp(64px, 14vw, 144px); filter: drop-shadow(0 8px 10px #000); }

/* Power on */
.js .tv--hero .screen__content { animation: power-on 1.1s cubic-bezier(.2, .8, .2, 1) .3s both; }
.js .tv--hero .snow { animation: snow 1.6s linear .2s both; }
@keyframes power-on {
  0% { transform: scale(0, .004); filter: brightness(8); }
  25% { transform: scale(1, .004); filter: brightness(6); }
  60% { transform: scale(1, 1); filter: brightness(2); }
  100% { transform: none; filter: none; }
}
@keyframes snow {
  0%, 20% { opacity: 0; }
  30% { opacity: .9; }
  100% { opacity: 0; }
}

/* Sections */
main { width: min(100% - 32px, 1040px); margin: 0 auto; }
section { padding: clamp(48px, 8vw, 96px) 0; }
h2 {
  margin-bottom: 32px;
  color: var(--gold);
  font-size: clamp(24px, 4vw, 32px);
  letter-spacing: .05em;
  text-align: center;
}

.promo .tv { max-width: 960px; margin: 0 auto; }
.screen--video::after { opacity: .35; }
.play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  transform: translate(-50%, -50%);
  padding: 12px 24px;
  border: 4px solid var(--gold);
  background: #000c;
  color: var(--gold);
  font: 24px/1 var(--font);
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 0 4px #000, 0 0 24px #f5d76e66;
}
.play-btn:hover, .play-btn:focus-visible { background: var(--gold); color: #000; outline: none; }
.screen--video.playing .play-btn { display: none; }
.caption { margin-top: 16px; text-align: center; }

/* Games */
.games { display: grid; gap: clamp(48px, 7vw, 80px); }
.games h2 { margin-bottom: 0; }
.game {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
}
.game:nth-of-type(even) .game__screen { order: 2; }
.game__info { display: grid; gap: 16px; }
.game__head { display: flex; gap: 16px; align-items: center; }
.game__head .box { width: 72px; flex: none; filter: drop-shadow(0 6px 8px #000); }
h3 { color: var(--accent); font-size: clamp(16px, 2.6vw, 24px); line-height: 1.3; }
.tags { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--dim); }
.tags img { height: 19px; width: auto; }
blockquote {
  padding: 12px 16px;
  border-left: 4px solid var(--accent);
  background: #ffffff0a;
}

.game__screen { transition: box-shadow .1s; }
.game__screen.loading { animation: border-flash .24s steps(1) infinite; }
.loadable .shot { position: absolute; inset: 0; opacity: 0; transition: opacity .3s steps(3); }
.loadable.loaded .shot { opacity: 1; }
@keyframes border-flash {
  0% { box-shadow: 0 0 0 6px #40318d; }
  25% { box-shadow: 0 0 0 6px #bfce72; }
  50% { box-shadow: 0 0 0 6px #883932; }
  75% { box-shadow: 0 0 0 6px #67b6bd; }
}

/* Coming soon */
.soon {
  margin: 0 auto clamp(48px, 8vw, 96px);
  padding: 32px 16px;
  max-width: 720px;
  border: 4px dashed var(--gold);
  text-align: center;
}
.soon h2 { margin-bottom: 24px; }
.dialogue { display: grid; grid-template-columns: auto 1fr; gap: 12px 16px; max-width: 480px; margin: 0 auto 24px; text-align: left; }
.dialogue dt { color: var(--c-cyan); }
.dialogue dd { margin: 0; }
.fine { color: var(--dim); }
.fine .en { margin-top: 4px; }

/* Footer */
footer { padding: 32px 0 48px; text-align: center; color: var(--dim); }
.scroller { overflow: hidden; margin-bottom: 24px; padding: 8px 0; background: #000; border-block: 2px solid var(--c-purple); }
.scroller p {
  display: inline-block;
  padding-left: 100%;
  white-space: nowrap;
  color: var(--c-cyan);
  font-size: 24px;
  animation: scroll 40s linear infinite;
}
@keyframes scroll { to { transform: translateX(-100%); } }

@media (max-width: 720px) {
  .game { grid-template-columns: 1fr; }
  .game:nth-of-type(even) .game__screen { order: 0; }
  .tv--hero .screen { min-height: 0; }
  .osd { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .scroller p { padding-left: 0; white-space: normal; }
}
