/* Starcade (the arcade): the game picker. A slideshow of real gameplay, one game at a time, sliding by on its own; the
   old-CRT look of the arcade around it (scanlines, a drifting starfield, pixel fonts). As little text as possible. */
:root {
  --bg: #04050c;
  --text: #e3e8ff;
  --muted: #8a92b8;
  --phosphor: #6cf0ff;
  --blood: #ff2e4d;
  --font-display: 'Sixtyfour', 'Silkscreen', ui-monospace, monospace;
  --font-title: 'Silkscreen', 'VT323', ui-monospace, monospace;
  --font-body: 'VT323', ui-monospace, 'Cascadia Mono', monospace;
  --accent-now: #ff7a3d;
  --cut: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; overflow: hidden;
  background: radial-gradient(ellipse at 50% 0%, #0d1230 0%, var(--bg) 60%) fixed;
  color: var(--text); font-family: var(--font-body); font-size: 20px; line-height: 1.2; -webkit-font-smoothing: none;
}
[hidden] { display: none !important; }
#stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
/* the page takes on the colour of the game on show */
body::before { content: ''; position: fixed; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse 75% 60% at 50% 55%, color-mix(in srgb, var(--accent-now) 24%, transparent), transparent 72%); transition: background 0.8s; }
/* the CRT */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 3px), radial-gradient(ellipse at center, transparent 62%, rgba(0, 0, 0, 0.4) 100%);
  mix-blend-mode: multiply;
}

.hub { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; }

/* ---- top bar: the logo, and join with a code ---- */
.hub-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px clamp(16px, 4vw, 48px) 0; }
.logo { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(1.1rem, 2.6vw, 1.8rem); line-height: 1; color: #eaf6ff; text-shadow: 0 0 18px rgba(108, 240, 255, 0.55); white-space: nowrap; }
.logo span { color: var(--blood); text-shadow: 0 0 18px rgba(255, 46, 77, 0.7); }
.join { position: relative; display: flex; gap: 8px; }
.join input { width: 120px; padding: 8px 10px; font: 1.3rem var(--font-body); letter-spacing: 0.3em; text-align: center; text-transform: uppercase; color: var(--text); background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(108, 240, 255, 0.3); outline: none; }
.join input:focus { border-color: var(--phosphor); }
.join button, .resume a, .go { font-family: var(--font-title); letter-spacing: 0.1em; color: #02141d; border: 0; clip-path: var(--cut); cursor: pointer; }
.join button { padding: 0 16px; font-size: 0.75rem; background: linear-gradient(180deg, #b4f9ff, #5ad8f2 55%, #1f9fd0); }
.msg { position: absolute; right: 0; top: calc(100% + 6px); white-space: nowrap; font-size: 1rem; color: #ff9aae; }
.msg.ok { color: #7dffa8; }

.resume { display: flex; justify-content: center; gap: 10px; padding-top: 10px; }
.resume a { padding: 8px 14px; font-size: 0.7rem; text-transform: uppercase; text-decoration: none; background: linear-gradient(180deg, #b4f9ff, #5ad8f2 55%, #1f9fd0); animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(-2px); } }

/* ---- the slideshow ---- */
.stage { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; --w: min(1180px, 84vw, calc((100vh - 150px) * 16 / 9)); }
.games { position: relative; height: calc(var(--w) * 9 / 16); touch-action: pan-y; }
.game {
  position: absolute; left: 50%; top: 0; width: var(--w); height: 100%; margin-left: calc(var(--w) / -2);
  display: block; overflow: hidden; color: inherit; text-decoration: none; clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px);
  transform: translateX(calc(var(--off, 0) * (var(--w) + 40px))) scale(0.86); opacity: 0.35; filter: saturate(0.4) brightness(0.7);
  transition: transform 0.75s cubic-bezier(0.65, 0, 0.25, 1), opacity 0.75s, filter 0.75s;
  user-select: none; -webkit-user-drag: none;
}
.game.active { transform: translateX(0) scale(1); opacity: 1; filter: none; z-index: 2; }
.game.far { opacity: 0; pointer-events: none; }
.games.dragging .game { transition: none; }
.shots, .shots video { position: absolute; inset: 0; width: 100%; height: 100%; }
.shots { background: #000; }
.shots video { object-fit: cover; }
.game::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent, #6cf0ff) 70%, transparent); }

/* the title, laid over the bottom of the picture */
.cap { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: flex-end; gap: 16px; padding: 80px clamp(16px, 3vw, 34px) clamp(14px, 2.4vw, 28px); background: linear-gradient(180deg, transparent, rgba(2, 3, 10, 0.88) 70%); }
.title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.kind { font-family: var(--font-title); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.cap h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(1.6rem, 4vw, 3rem); line-height: 1; color: #fff; text-shadow: 0 0 22px color-mix(in srgb, var(--accent) 70%, transparent), 0 3px 0 rgba(0, 0, 0, 0.6); }
.foot { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.go { padding: 14px 26px; font-size: 1rem; background: var(--accent); transition: transform 0.15s, filter 0.15s; }
.game.active:hover .go { transform: scale(1.06); filter: brightness(1.12); }
.live { font-size: 1rem; color: #c9cfee; text-shadow: 0 1px 2px #000; }
.live.on::before { content: '●'; color: #7dffa8; margin-right: 6px; text-shadow: 0 0 8px #7dffa8; animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: 0.35; } }

.game.nms { --accent: #ff7a3d; }
.game.pts { --accent: #ff6bd6; }
.game.rotg { --accent: #00f0ff; }
.game.sbz { --accent: #ffd36b; }
.game.sch { --accent: #f08a3c; }

/* arrows and dots (the active dot fills up until the next slide) */
.nav { position: absolute; top: 50%; z-index: 5; width: 54px; height: 54px; margin-top: -40px; display: grid; place-items: center; border: 0; cursor: pointer; background: var(--accent-now); clip-path: var(--cut); opacity: 0.9; transition: transform 0.15s, filter 0.2s, background 0.8s; }
.nav:hover { transform: scale(1.1); filter: brightness(1.15); }
.nav::before { content: ''; width: 15px; height: 15px; border: solid #02141d; border-width: 0 0 5px 5px; transform: translateX(4px) rotate(45deg); }
.nav.next::before { transform: translateX(-4px) rotate(-135deg); }
.nav.prev { left: max(8px, calc(50% - var(--w) / 2 - 74px)); }
.nav.next { right: max(8px, calc(50% - var(--w) / 2 - 74px)); }
.dots { display: flex; justify-content: center; gap: 10px; padding: 18px 0 14px; }
.dots button { position: relative; width: 34px; height: 6px; padding: 0; border: 0; background: rgba(255, 255, 255, 0.22); cursor: pointer; overflow: hidden; }
.dots button i { position: absolute; inset: 0; background: var(--accent-now); transform-origin: left; transform: scaleX(0); }
.dots button.on i { transform: scaleX(1); }
.dots.playing button.on i { animation: fill var(--hold, 6s) linear forwards; }
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.nav:focus-visible, .dots button:focus-visible, .game:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

@media (max-width: 700px) {
  body { font-size: 18px; }
  .hub-head { flex-direction: column; gap: 10px; padding-top: 14px; }
  .stage { --w: 92vw; justify-content: flex-start; padding-top: 12vh; }
  .games { height: auto; aspect-ratio: auto; height: min(118vw, 62vh); }
  .game { clip-path: none; border-radius: 14px; }
  .cap { flex-direction: column; align-items: stretch; gap: 10px; }
  .foot { flex-direction: row; align-items: center; justify-content: space-between; }
  .go { padding: 14px 30px; }
  .nav { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
