/* Cool Matt Games: shared styles.
   Look: Frutiger Aero sky and glass, with Y2K window chrome. No web fonts, no third-party requests. */

:root {
  --sky-1: #0f6fd0;
  --sky-2: #4fb4f4;
  --sky-3: #bfeaff;
  --meadow-1: #dff7c6;
  --meadow-2: #8fd64a;

  --ink: #0a2f52;
  --ink-2: #33597a;

  --aqua-1: #7ad7ff;
  --aqua-2: #1d93e6;
  --aqua-3: #0c72c8;

  --lime-1: #c4f77e;
  --lime-2: #5cc81f;
  --lime-3: #2f8f0a;

  --sun: #ffd23f;
  --chrome-1: #fbfdff;
  --chrome-2: #c9d7e2;
  --chrome-3: #94a8b8;

  --font: "Frutiger", "Myriad Pro", "Segoe UI", "Lucida Grande", "Trebuchet MS", Tahoma, Verdana, sans-serif;
  --font-display: "Trebuchet MS", "Lucida Grande", "Segoe UI", Tahoma, sans-serif;
  --font-lcd: "Courier New", Courier, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { color-scheme: light; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font: 17px/1.5 var(--font);
  color: var(--ink);
  background: var(--sky-2);
  overflow-x: hidden;
}

/* The sky sits on a fixed layer so it holds still on phones too. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(42vmax 30vmax at 88% -6%, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0) 62%),
    radial-gradient(30vmax 9vmax at 18% 22%, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 70%),
    radial-gradient(26vmax 7vmax at 70% 40%, rgba(255, 255, 255, .4), rgba(255, 255, 255, 0) 70%),
    linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 34%, var(--sky-3) 66%, var(--meadow-1) 85%, var(--meadow-2) 100%);
}

img, canvas, svg { max-width: 100%; }
a { color: var(--aqua-3); }
h1, h2, h3, p { margin: 0; }

:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute; left: 12px; top: -60px;
  background: #fff; color: var(--ink); padding: 8px 12px; border-radius: 8px; z-index: 10;
}
.skip:focus { top: 12px; }

/* ---------- ambient bubbles (decorative) ---------- */
.sky-bubbles { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.sky-bubbles span {
  position: absolute;
  bottom: -140px;
  left: var(--x);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .95) 0 7%, rgba(255, 255, 255, 0) 22%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0) 55%, rgba(255, 255, 255, .55) 96%, rgba(255, 255, 255, .15) 100%);
  box-shadow: inset 0 0 12px rgba(255, 255, 255, .5);
  animation: drift var(--d) linear var(--delay) infinite;
  opacity: .8;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(var(--sway), -125vh, 0); }
}

/* ---------- page frame ---------- */
.page { max-width: 1040px; margin: 0 auto; padding: 14px 16px 36px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 8px 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .95);
  background: linear-gradient(180deg, rgba(255, 255, 255, .95) 0%, rgba(255, 255, 255, .62) 49%, rgba(226, 243, 255, .55) 51%, rgba(255, 255, 255, .78) 100%);
  box-shadow: 0 8px 22px rgba(8, 60, 110, .25), inset 0 1px 0 #fff;
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
  backdrop-filter: blur(10px) saturate(1.3);
}

.brand {
  display: inline-flex; align-items: center; gap: 9px;
  text-decoration: none; color: var(--aqua-3);
  font: italic 800 1.12rem/1 var(--font-display);
  letter-spacing: -.01em;
  text-shadow: 0 1px 0 #fff;
  white-space: nowrap;
}
.brand-orb {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #f4ffe0 0, var(--lime-1) 18%, var(--lime-2) 56%, var(--lime-3) 100%);
  border: 1.5px solid #fff;
  box-shadow: 0 2px 5px rgba(0, 60, 0, .4), inset 0 -3px 5px rgba(20, 90, 0, .45);
  position: relative;
}
.brand-orb::after {
  content: ""; position: absolute; left: 11px; top: 8px;
  border-left: 10px solid #fff; border-top: 6px solid transparent; border-bottom: 6px solid transparent;
  filter: drop-shadow(0 1px 0 rgba(0, 70, 0, .5));
}

.nav { display: flex; gap: 4px; }
.nav a {
  display: inline-block; padding: 7px 14px; border-radius: 999px;
  font-weight: 700; font-size: .92rem; text-decoration: none; color: var(--ink);
  white-space: nowrap;
}
.nav a:hover { background: rgba(255, 255, 255, .8); }
.nav a[aria-current="page"] {
  color: #fff;
  text-shadow: 0 1px 1px rgba(5, 50, 100, .6);
  background: linear-gradient(180deg, var(--aqua-1) 0%, var(--aqua-2) 48%, var(--aqua-3) 52%, #2f9fea 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 1px 3px rgba(8, 60, 110, .4);
}

/* ---------- masthead ---------- */
.masthead { padding: 34px 4px 22px; }
.wordmark {
  position: relative; display: inline-block;
  font: italic 800 clamp(2.5rem, 10.5vw, 4.9rem)/.92 var(--font-display);
  letter-spacing: -.03em;
  color: #fff;
  text-shadow:
    0 1px 0 #cfeeff,
    0 3px 0 var(--aqua-2),
    0 5px 0 var(--aqua-3),
    0 7px 0 #095ba6,
    0 14px 22px rgba(6, 50, 100, .45);
}
/* One lens-flare sparkle on the wordmark: the single piece of Y2K jewelry on the page. */
.wordmark::after {
  content: ""; position: absolute; right: -.28em; top: -.16em; width: .5em; height: .5em;
  background:
    radial-gradient(circle, #fff 0 12%, rgba(255, 255, 255, 0) 60%),
    conic-gradient(from 0deg, transparent 0 43deg, #fff 45deg, transparent 47deg 133deg, #fff 135deg, transparent 137deg 223deg, #fff 225deg, transparent 227deg 313deg, #fff 315deg, transparent 317deg);
  border-radius: 50%;
  transform: rotate(45deg);
  filter: drop-shadow(0 0 6px #fff);
}
.tagline {
  margin-top: 20px; max-width: 34em;
  font-size: 1.14rem; font-weight: 600; color: #062a4b;
}

/* ---------- moving pictures: pixel-art GIFs, each with a still version for reduced motion ---------- */
.gif { display: block; image-rendering: pixelated; }
.masthead.with-pal { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.masthead.with-pal > div { min-width: 0; }
.pal { flex: none; }
.pal img { width: 128px; height: 160px; }
.pal.small img { width: 96px; height: 128px; }
@media (min-width: 1000px) { .pal:not(.small) img { width: 192px; height: 240px; } }
@media (max-width: 480px) { .pal:not(.small) img { width: 64px; height: 80px; } }
.gif-row { display: flex; justify-content: center; }
.gif-row img { max-width: 100%; height: auto; }
.status picture { flex: none; }
.status .gif { border-radius: 4px; box-shadow: inset 0 1px 3px #000, 0 1px 0 rgba(255, 255, 255, .8); }
.who picture { flex: none; }

/* ---------- windows ---------- */
.desk { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
.desk > .wide { grid-column: 1 / -1; }
.stack { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }

.win {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .95);
  background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .7));
  box-shadow: 0 14px 34px rgba(8, 60, 110, .3), inset 0 1px 0 #fff;
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
  backdrop-filter: blur(10px) saturate(1.3);
}
.win-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 12px;
  border-radius: 13px 13px 0 0;
  border-bottom: 1px solid rgba(8, 70, 130, .5);
  background: linear-gradient(180deg, var(--aqua-1) 0%, var(--aqua-2) 48%, var(--aqua-3) 52%, #2f9fea 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75);
  color: #fff;
}
.win-bar h1, .win-bar h2 {
  font: 700 .98rem/1.2 var(--font);
  text-shadow: 0 1px 1px rgba(5, 50, 100, .65);
}
.win-dots { display: flex; gap: 5px; }
.win-dots i {
  width: 11px; height: 11px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0 20%, #d7ecfb 45%, #8fbfe6 100%);
  box-shadow: 0 0 0 1px rgba(8, 70, 130, .45);
}
.win-body { padding: 16px; }
.win-body > * + * { margin-top: 12px; }
.win-body h3 { font: 800 1.3rem/1.15 var(--font-display); letter-spacing: -.01em; }
.win-body p { max-width: 62ch; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 22px;
  border-radius: 999px;
  font: 700 1rem/1 var(--font);
  text-decoration: none; cursor: pointer;
  color: #fff;
  text-shadow: 0 1px 1px rgba(15, 70, 0, .7);
  border: 1px solid #2a7d0e;
  background: linear-gradient(180deg, var(--lime-1) 0%, var(--lime-2) 48%, #3aa90f 52%, #6fd22e 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 3px 8px rgba(20, 80, 0, .35);
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); box-shadow: inset 0 2px 5px rgba(0, 50, 0, .45); }

.btn-quiet {
  color: var(--ink);
  text-shadow: 0 1px 0 #fff;
  border-color: var(--chrome-3);
  background: linear-gradient(180deg, var(--chrome-1) 0%, #e6eef4 48%, var(--chrome-2) 52%, #e3ecf2 100%);
  box-shadow: inset 0 1px 0 #fff, 0 2px 6px rgba(8, 60, 110, .22);
}
.btn:disabled { opacity: .5; cursor: default; filter: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- featured game preview ---------- */
.preview {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  background: linear-gradient(180deg, #071a3d 0%, #16408a 62%, #4f6fc4 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35), inset 0 3px 14px rgba(0, 0, 0, .55);
}
.preview .star { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff; left: var(--x); top: var(--y); opacity: .8; }
.preview .b {
  position: absolute; left: var(--x); bottom: -24%;
  width: var(--s); aspect-ratio: 1; border-radius: 50%;
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .95) 0 9%, rgba(255, 255, 255, 0) 30%),
    radial-gradient(circle at 40% 35%, var(--c1), var(--c2) 70%, var(--c3) 100%);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .55);
  animation: rise var(--d) linear var(--delay) infinite;
}
@keyframes rise {
  from { transform: translateY(0); }
  to { transform: translateY(-640%); }
}
.b.ticket { --c1: #9be3ff; --c2: #39b8f2; --c3: #0f78cf; }
.b.vip { --c1: #fff0a6; --c2: #ffc928; --c3: #d98a00; }
.b.esc { --c1: #ffb3b5; --c2: #ff5a5f; --c3: #c2181f; }
.b.macro { --c1: #d5ff9f; --c2: #5fd235; --c3: #2f8f0a; }

.orb-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: clamp(76px, 20%, 104px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 35% 26%, #f6ffe6 0, var(--lime-1) 16%, var(--lime-2) 55%, var(--lime-3) 100%);
  border: 3px solid #fff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .5), inset 0 -8px 14px rgba(20, 90, 0, .5);
}
.orb-play::after {
  content: ""; position: absolute; left: 39%; top: 28%;
  width: 0; height: 0;
  border-left: clamp(22px, 5vw, 30px) solid #fff;
  border-top: clamp(14px, 3.2vw, 19px) solid transparent;
  border-bottom: clamp(14px, 3.2vw, 19px) solid transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 70, 0, .5));
}
.preview:hover .orb-play { filter: brightness(1.08); }

/* ---------- game shelf ---------- */
.shelf { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.cart {
  display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #fff;
  background: linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(232, 245, 255, .85));
  box-shadow: 0 2px 8px rgba(8, 60, 110, .18);
  text-decoration: none; color: inherit;
}
a.cart:hover { box-shadow: 0 0 0 2px var(--aqua-1), 0 4px 12px rgba(8, 60, 110, .28); }
.cart-art {
  width: 64px; height: 64px; border-radius: 50%;
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .95) 0 9%, rgba(255, 255, 255, 0) 30%),
    radial-gradient(circle at 40% 35%, #9be3ff, #39b8f2 70%, #0f78cf 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .6), 0 3px 8px rgba(8, 60, 110, .35);
}
.cart-art.soon {
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .95) 0 9%, rgba(255, 255, 255, 0) 30%),
    radial-gradient(circle at 40% 35%, #f3f7fa, #c9d7e2 70%, #94a8b8 100%);
}
.cart-art.shapes {
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .95) 0 9%, rgba(255, 255, 255, 0) 30%),
    radial-gradient(circle at 40% 35%, #ffb3b5, #ff5a5f 70%, #c2181f 100%);
}
.cart-art.corner {
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .95) 0 9%, rgba(255, 255, 255, 0) 30%),
    radial-gradient(circle at 40% 35%, #fff0a6, #ffc928 70%, #d98a00 100%);
}
.cart-art.bomb {
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .95) 0 9%, rgba(255, 255, 255, 0) 30%),
    radial-gradient(circle at 40% 35%, #8fe3d6, #2f8f86 70%, #0f4a45 100%);
}
.cart { position: relative; }
.cart-new { position: absolute; top: -10px; right: -8px; }
.cart.is-new > span:last-of-type { padding-right: 44px; }
.cart strong { display: block; font: 800 1.08rem/1.2 var(--font-display); }
.cart span { display: block; font-size: .92rem; color: var(--ink-2); }

/* ---------- about page ---------- */
.avatar {
  flex: none; width: 76px; height: 76px; border-radius: 50%;
  display: grid; place-items: center;
  font: italic 800 1.7rem/1 var(--font-display); color: #fff;
  text-shadow: 0 2px 2px rgba(5, 50, 100, .6);
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, .95) 0 8%, rgba(255, 255, 255, 0) 30%),
    radial-gradient(circle at 40% 35%, var(--aqua-1), var(--aqua-2) 65%, var(--aqua-3) 100%);
  border: 2px solid #fff;
  box-shadow: 0 4px 10px rgba(8, 60, 110, .4), inset 0 -6px 10px rgba(5, 60, 120, .45);
}
.who { display: flex; gap: 14px; align-items: center; }
.who p { font-size: .98rem; }

.scores { width: 100%; border-collapse: collapse; }
.scores caption { text-align: left; font-size: .9rem; color: var(--ink-2); padding-bottom: 8px; }
.scores th, .scores td { padding: 9px 0; border-top: 1px solid rgba(10, 47, 82, .14); text-align: left; vertical-align: middle; }
.scores th { font-weight: 600; padding-right: 12px; }
.scores th small { display: block; font-weight: 400; font-size: .86rem; color: var(--ink-2); }
.scores td { text-align: right; white-space: nowrap; }

.lcd {
  display: inline-block;
  font: 700 1.02rem/1 var(--font-lcd); letter-spacing: .12em;
  color: #b8ff6a; background: #0c2a12;
  padding: 6px 8px 5px; border-radius: 5px;
  box-shadow: inset 0 1px 4px #000, 0 1px 0 rgba(255, 255, 255, .8);
}

.plain-list { margin: 0; padding-left: 1.15em; }
.plain-list li + li { margin-top: 6px; }

/* ---------- credits table ---------- */
.table-wrap { overflow-x: auto; }
.credits { width: 100%; border-collapse: collapse; font-size: .94rem; }
.credits th, .credits td { padding: 8px 10px 8px 0; text-align: left; vertical-align: top; border-top: 1px solid rgba(10, 47, 82, .14); }
.credits thead th { border-top: 0; font-size: .86rem; color: var(--ink-2); font-weight: 700; }
.credits tbody th { font-weight: 700; }
.credits td:nth-child(2) { overflow-wrap: anywhere; }
.credits thead th, .credits td:nth-child(3), .credits td:nth-child(4) { white-space: nowrap; }

/* ---------- status bar ---------- */
.status {
  margin-top: 20px;
  display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; justify-content: space-between;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--chrome-3);
  background: linear-gradient(180deg, var(--chrome-1) 0%, #e6eef4 48%, var(--chrome-2) 52%, #e3ecf2 100%);
  box-shadow: inset 0 1px 0 #fff, 0 6px 16px rgba(8, 60, 110, .2);
  font-size: .86rem;
}
.status p { display: flex; align-items: center; gap: 8px; }

/* ---------- game page ---------- */
.game-desk { display: grid; gap: 18px; grid-template-columns: minmax(0, 500px) minmax(0, 1fr); align-items: start; margin-top: 18px; }
.game-win .win-body { padding: 10px; }

.stage {
  position: relative; margin: 0 auto;
  width: min(100%, 460px, calc((100vh - 150px) * 2 / 3));
  width: min(100%, 460px, calc((100dvh - 150px) * 2 / 3));
  min-width: 250px;
  aspect-ratio: 2 / 3;
  border-radius: 10px; overflow: hidden;
  background: #071a3d;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35), 0 2px 10px rgba(0, 0, 0, .35);
}
.stage canvas { display: block; width: 100%; height: 100%; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }

.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 18px; text-align: center;
  color: #fff;
  background: rgba(5, 20, 50, .72);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.screen[hidden] { display: none; }
.screen h2 {
  font: italic 800 clamp(1.7rem, 8vw, 2.4rem)/1 var(--font-display); letter-spacing: -.02em;
  text-shadow: 0 2px 0 var(--aqua-3), 0 6px 14px rgba(0, 0, 0, .5);
}
.screen p { max-width: 26em; font-size: .98rem; }
.screen a { color: #bfeaff; }
.screen dl { display: grid; grid-template-columns: auto auto; gap: 6px 14px; margin: 0; text-align: left; align-items: center; }
.screen dt { font-size: .92rem; }
.screen dd { margin: 0; text-align: right; }

.controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.controls .btn { min-height: 44px; padding: 8px 16px; font-size: .92rem; }

.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.legend li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: center; font-size: .96rem; }
.legend i {
  width: 34px; height: 34px; border-radius: 50%;
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .95) 0 9%, rgba(255, 255, 255, 0) 30%),
    radial-gradient(circle at 40% 35%, var(--c1), var(--c2) 70%, var(--c3) 100%);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .6), 0 2px 5px rgba(8, 60, 110, .3);
}
.legend .ticket { --c1: #9be3ff; --c2: #39b8f2; --c3: #0f78cf; }
.legend .vip { --c1: #fff0a6; --c2: #ffc928; --c3: #d98a00; }
.legend .esc { --c1: #ffb3b5; --c2: #ff5a5f; --c3: #c2181f; }
.legend .spam { --c1: #eef2f5; --c2: #a9b6c1; --c3: #6f7f8c; }
.legend .coffee { --c1: #f3d9b8; --c2: #c98a4b; --c3: #7f4a1c; }
.legend .macro { --c1: #d5ff9f; --c2: #5fd235; --c3: #2f8f0a; }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .game-desk { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .desk { grid-template-columns: minmax(0, 1fr); }
  .masthead { padding: 26px 2px 18px; }
}
@media (max-width: 420px) {
  .page { padding: 10px 12px 28px; }
  .brand { font-size: 1rem; gap: 7px; }
  .brand-orb { width: 26px; height: 26px; }
  .brand-orb::after { left: 9px; top: 6px; }
  .nav a { padding: 7px 10px; font-size: .88rem; }
  .win-body { padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .sky-bubbles span, .preview .b { animation: none; }
  .sky-bubbles span { bottom: var(--rest, 30%); }
  .preview .b { bottom: var(--rest, 30%); }
}
