:root {
  --bg-hi: #ffffff;
  --bg-lo: #d3d8dc;
  --ink: #2a2d30;
  --dim: #9aa1a7;
  --ribbon-a: rgba(120, 190, 60, .22);
  --ribbon-b: rgba(150, 160, 170, .28);
  --ring: #ffffff;
  --lift: 0 14px 30px -8px rgba(20, 30, 40, .45);
  --green-hi: #8fd14f;
  --green-lo: #4d9a1f;
  --slate-hi: #6b7581;
  --slate-lo: #3f4750;
  --silver-hi: #d9dde1;
  --silver-lo: #aeb4ba;
  --silver-ink: #3b4045;
  --a: #5fbf28;
  --font: 'Segoe UI', 'Open Sans', system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-hi: #2a2f34;
    --bg-lo: #0f1214;
    --ink: #f1f3f4;
    --dim: #6f777e;
    --ribbon-a: rgba(110, 190, 50, .2);
    --ribbon-b: rgba(160, 170, 180, .08);
    --lift: 0 16px 34px -8px rgba(0, 0, 0, .8);
    --silver-hi: #8d949b;
    --silver-lo: #646b72;
    --silver-ink: #f1f3f4;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg-hi: #2a2f34;
  --bg-lo: #0f1214;
  --ink: #f1f3f4;
  --dim: #6f777e;
  --ribbon-a: rgba(110, 190, 50, .2);
  --ribbon-b: rgba(160, 170, 180, .08);
  --lift: 0 16px 34px -8px rgba(0, 0, 0, .8);
  --silver-hi: #8d949b;
  --silver-lo: #646b72;
  --silver-ink: #f1f3f4;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(120% 90% at 30% 20%, var(--bg-hi), var(--bg-lo)) fixed;
  background-color: var(--bg-lo);
  color: var(--ink);
  font: 400 1rem/1.4 var(--font);
  overflow-x: hidden;
}
button { font: inherit; color: inherit; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--a); outline-offset: 3px; }

/* soft light ribbons behind everything */
.ribbons { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.ribbons svg { width: 100%; height: 100%; }
.ribbons path { fill: none; stroke-linecap: round; }
.ribbons .r1 { stroke: var(--ribbon-a); stroke-width: 70; }
.ribbons .r2 { stroke: var(--ribbon-b); stroke-width: 26; }
.ribbons .r3 { stroke: var(--ribbon-b); stroke-width: 120; opacity: .6; }

/* ---------- header and pivots ---------- */
.top, .pivots, main, .hints { padding-left: max(16px, 7vw); padding-right: 16px; }
.top { padding-top: clamp(18px, 4vh, 40px); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-size: 1.15rem; font-weight: 600; }
.brand img { width: 56px; height: 56px; }

.pivots {
  display: flex;
  gap: clamp(18px, 3vw, 40px);
  margin-top: clamp(10px, 3vh, 28px);
  overflow-x: auto;
  scrollbar-width: none;
  mask-image: linear-gradient(90deg, #000 85%, transparent);
}
.pivots::-webkit-scrollbar { display: none; }
.pivots [role="tab"] {
  flex: none;
  padding: 0 0 6px;
  border: 0;
  background: none;
  cursor: pointer;
  font-size: clamp(1.7rem, 4.2vw, 2.7rem);
  font-weight: 300;
  letter-spacing: -.01em;
  color: var(--dim);
  transition: color .15s;
}
.pivots [aria-selected="true"] { color: var(--ink); }
.pivots [role="tab"]:focus-visible { outline: none; color: var(--ink); box-shadow: inset 0 -3px var(--a); }
@media (hover: hover) { .pivots [role="tab"]:hover { color: var(--ink); } }

/* ---------- tiles ---------- */
main { flex: 1; padding-top: clamp(16px, 3.5vh, 32px); }
.panel { max-width: 1060px; }
.panel.enter { animation: slide-in .28s cubic-bezier(.2, .8, .2, 1); }
@keyframes slide-in { from { opacity: 0; translate: 40px 0; } }

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.grid li:first-child { grid-column: span 2; grid-row: span 2; }
.grid li { display: flex; }

.tile {
  position: relative;
  display: flex;
  align-items: flex-end;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  overflow: hidden;
  border: 0;
  color: #fff;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  background: linear-gradient(160deg, var(--green-hi), var(--green-lo));
  transition: transform .16s cubic-bezier(.2, .8, .2, 1), box-shadow .16s;
}
.grid li:first-child .tile { aspect-ratio: auto; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile .label {
  position: relative;
  width: 100%;
  padding: 26px 12px 9px;
  font-size: .95rem;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.game .label { padding: 48px 16px 12px; font-size: 1.35rem; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); }
.tile:focus, .tile:focus-visible {
  z-index: 1;
  outline: none;
  transform: scale(1.035);
  box-shadow: 0 0 0 2px var(--ring), 0 0 0 6px var(--a), var(--lift);
}

/* coming soon tiles, in the dashboard's greens, slates and silvers */
.soon { cursor: default; }
.soon svg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34%;
  translate: -50% -62%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  opacity: .45;
}
.grid li:nth-child(3) .tile, .grid li:nth-child(6) .tile { background: linear-gradient(160deg, var(--slate-hi), var(--slate-lo)); }
.grid li:nth-child(4) .tile { background: linear-gradient(160deg, var(--silver-hi), var(--silver-lo)); color: var(--silver-ink); }
.grid li:nth-child(4) .label { text-shadow: none; }
.grid li:nth-child(5) .tile { background: linear-gradient(160deg, var(--slate-lo), #2b3137); }
.soon.nope { animation: nope .32s; }
@keyframes nope { 25% { translate: -6px 0; } 50% { translate: 5px 0; } 75% { translate: -3px 0; } }

.tile.wide { aspect-ratio: auto; min-height: 220px; max-width: 520px; cursor: default; }
.tile.wide .label { padding: 16px 18px; font-size: 1.35rem; font-weight: 300; }

/* the tile growing to fill the screen as a game launches */
.launch { position: fixed; z-index: 10; pointer-events: none; background: #000; }
.launch img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- controller hints ---------- */
.hints { display: flex; gap: 28px; padding-top: 28px; padding-bottom: clamp(18px, 4vh, 36px); font-size: .9rem; color: var(--ink); }
.hints span { display: inline-flex; align-items: center; gap: 8px; }
.btn {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 12px;
  font-size: .72rem;
  font-weight: 600;
  color: #fff;
}
.btn.a { background: radial-gradient(circle at 35% 30%, #8be05a, var(--a) 60%, #3d8a12); }
.btn.bumper { min-width: 32px; padding: 0 6px; border-radius: 6px 6px 10px 10px; background: linear-gradient(#7d858c, #4a5157); }
.btn.bumper + .btn.bumper { margin-left: -4px; }
@media (pointer: coarse) { .hints { display: none; } }

/* ---------- phones ---------- */
@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .grid li:first-child { grid-row: auto; }
  .grid li:first-child .tile { aspect-ratio: 4 / 3; }
}

/* ---------- error and notice pages ---------- */
.notice { max-width: 34rem; margin: 18vh auto 0; padding: 0 16px; }
.notice h1 { font-size: 2.4rem; font-weight: 300; margin: 0 0 8px; }
.notice p { color: var(--dim); }
.notice a { color: var(--ink); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .tile, .pivots [role="tab"] { transition: none; }
  .panel.enter, .soon.nope { animation: none; }
}
