:root {
  color-scheme: dark;
  --bg: #0b1417;
  --panel: #112023;
  --ink: #eef9f4;
  --muted: #adc4c1;
  --signal: #a8ffeb;
  --amber: #ffc983;
  --line: #84cebd45;
  font-family: "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
  scroll-behavior: smooth;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 4px; }
[hidden] { display: none !important; }

.topbar, footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding: 18px max(5vw, 22px);
  border-bottom: 1px solid var(--line);
  font-size: .84rem;
  color: var(--muted);
}

.brand { font-size: 1.3rem; font-weight: 800; color: var(--ink); }
.brand small { margin-inline-start: 9px; color: var(--signal); font: .7rem monospace; }
.entry {
  min-height: clamp(470px, 65vw, 670px);
  display: grid;
  align-items: center;
  padding: 70px max(6vw, 24px);
  background:
    linear-gradient(90deg, #090f13f7, #090f1380 44%, transparent 78%),
    linear-gradient(0deg, var(--bg), transparent 30%),
    url("covers/dream-room.jpg") center 55% / cover;
}

.entry h1 {
  margin: 0;
  font-size: clamp(36px, 6vw, 84px);
  line-height: 1.18;
  letter-spacing: .02em;
  font-weight: 900;
  text-shadow: 0 0 34px #71ffdf49;
}

.eyebrow { color: var(--signal); font-size: .78rem; letter-spacing: .14em; }
.connect {
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  min-height: 46px;
  margin-top: 12px;
  padding: 10px 20px;
  background: var(--signal);
  color: #0a201c;
  font-weight: 750;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%);
}
.entry .connect { margin-top: 26px; }
.connect:hover { background: var(--amber); }
.connect:focus-visible { outline-offset: -4px; outline-color: #10231f; }

#collection { max-width: 1490px; margin: auto; padding: 26px max(5vw, 22px) 76px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-head h2 { font-size: clamp(1.35rem, 3vw, 2.5rem); }
#random-game { display: none; background: var(--panel); color: var(--signal); border: 1px solid var(--line); padding: 9px 12px; }
.has-projection #random-game { display: block; }
.projection {
  position: relative;
  isolation: isolate;
  min-height: clamp(360px, 40vw, 520px);
  display: grid;
  align-items: end;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
}
.projection-art { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.projection::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, #081014eb, #081014cc 35%, transparent 85%),
    linear-gradient(0deg, #081014cc, transparent 45%);
}
.projection-copy { padding: clamp(20px, 5vw, 64px); max-width: 575px; }
.projection h3 { margin: 6px 0; font-size: clamp(2.35rem, 5vw, 4.55rem); line-height: 1.16; }
#projection-description { max-width: 32ch; line-height: 1.85; }
.record { color: var(--amber); font-size: .8rem; }
.record:empty { display: none; }

.games { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 265px), 1fr)); gap: 14px; margin-top: 16px; }
.cover { display: grid; grid-template-areas: "frame"; overflow: hidden; aspect-ratio: 1.65; border: 1px solid var(--line); background: var(--panel); }
.cover > * { grid-area: frame; }
.cover img { width: 100%; height: 100%; min-height: 0; object-fit: cover; transition: transform .3s ease; }
.cover:hover img { transform: scale(1.045); }
.cover[aria-current] { border-color: var(--signal); box-shadow: inset 0 0 0 1px var(--signal); }
.card-label { display: grid; align-content: end; padding: 12px; z-index: 1; background: linear-gradient(transparent 28%, #071014ef); }
.card-label h3 { margin: 3px 0 0; font-size: clamp(1rem, 2vw, 1.5rem); }
.genre { color: var(--muted); font-size: .72rem; }
.description { color: var(--muted); line-height: 1.7; }
.has-projection .game > :is(.description, .record) { display: none; }
footer { border-top: 1px solid var(--line); border-bottom: 0; }
footer p { margin: 0; }

@media (max-width: 660px) {
  .entry { background-position: center, center, 61% center; }
  .games { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .projection::after { background: linear-gradient(0deg, #081014 4%, #081014de 38%, transparent 100%); }
  .projection-art { object-position: center top; }
  .projection-copy { padding-top: 135px; }
  .card-label { padding: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  .cover img { transition: none; }
}

.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand img { flex: none; }
.brand small { white-space: nowrap; }

.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand img { display: block; flex: none; }
.brand-label { display: flex; align-items: center; gap: 9px; line-height: 1; }
.brand .brand-label small { margin: 0; white-space: nowrap; }

.game-updated {
  margin-top: 5px;
  color: var(--muted);
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
}

.collection-controls { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
#game-sort { font: inherit; background: var(--panel); color: var(--signal); border: 1px solid var(--line); padding: 8px; }
