@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400..900&display=swap");

:root {
  --bg: #0a0a0d;
  --panel: #131318;
  --panel-raised: #1c1c24;
  --border: #26262f;
  --text: #eef0f4;
  --text-dim: #8b8b98;
  --text-faint: #55555f;

  --accent-blue: #3b82f6;
  --accent-orange: #f2793a;
  --accent-green: #34c77b;

  --accent-1a: #ff5f7e;
  --accent-1b: #ff9b6a;
  --accent-2a: #6a8bff;
  --accent-2b: #7ee8ff;
  --accent-3a: #b46bff;
  --accent-3b: #ff6ee0;
  --accent-4a: #4be3a0;
  --accent-4b: #9bff6e;

  --released-a: #4a4657;
  --released-b: #6b6580;

  --font-display: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* Currently unused, so it is not imported — the fallbacks carry it. */
  --font-mono: "Roboto Mono", ui-monospace, SFMono-Regular, monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-body);
}

/* --- sticky topbar --- */

.site-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

/* --- header --- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 5vw, 3rem);
  padding: 1.5rem 1rem 1rem;
}

.brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.85rem;
}

.brand h1 {
  font-family: var(--font-display);
  /* Fluid so a long site name still fits a phone without overflowing. */
  font-size: clamp(1.1rem, 5vw, 1.9rem);
  font-weight: 800;
  letter-spacing: 0.14em;
  overflow-wrap: anywhere;
  text-transform: uppercase;
  color: var(--text);
}

/* --- section tabs --- */

.section-tabs {
  display: flex;
  justify-content: center;
  padding: 0 1rem 1.25rem;
}

.tab-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.3rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.tab-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-dim);
  text-decoration: none;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
}

.tab-pill svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.tab-pill:hover {
  color: var(--text);
}

.tab-pill.is-active {
  background: var(--panel-raised);
  color: var(--text);
}

/* --- sections --- */

main {
  padding: 1.75rem clamp(1rem, 4vw, 3rem) 3rem;
  max-width: 1320px;
  margin: 0 auto;
}

.view-section {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.view-section.is-active {
  opacity: 1;
}

.pager {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Fixed box, centred: stretching to the grid meant the arrows changed height
   whenever a page held fewer cards. */
.pager-btn {
  flex-shrink: 0;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 64px;
  padding: 0;
  cursor: pointer;
  color: var(--text-dim);
  background: transparent;
  border: 0;
  transition: color 0.15s ease;
}

.pager-btn svg {
  width: 26px;
  height: 26px;
}

.pager-btn:hover:not(:disabled) {
  color: var(--text);
}

/* Kept in the layout when there is only one page, so the grid does not shift
   sideways as you page through sections. */
.pager-btn:disabled {
  opacity: 0.25;
  cursor: default;
}

.pager-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.9rem;
}

.pager-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: var(--panel-raised);
  box-shadow: inset 0 0 0 1px var(--border);
  transition: width 0.18s ease, background 0.18s ease;
}

.pager-dot:hover {
  background: var(--text-faint);
}

/* The current page reads as a pill rather than another dot. */
.pager-dot.is-current {
  width: 18px;
  background: var(--accent-blue);
  box-shadow: none;
  cursor: default;
}

.section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.8rem;
  color: var(--text-dim);
}

.empty-note {
  color: var(--text-faint);
  font-style: italic;
  font-size: 0.85rem;
}

/* A page is exactly PAGE_SIZE cards laid out in two rows — 4 up on a wide
   screen, fewer as it narrows. Only the current page is in the DOM, so no
   off-page card is ever partly visible. */
.card-grid {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

/* 8 per page always; the shape of the page changes rather than the count. */
@media (max-width: 880px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .card-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- game card --- */

/* Holds a grid cell open on a short page without being seen or read out. */
.game-card.is-filler {
  visibility: hidden;
}

.game-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.8rem 0.9rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.game-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  /* Two lines' worth, so every card's art band starts at the same height and
     the grid reads as rows rather than a ragged stack. */
  min-height: 2.05rem;
}

/* The art is the card's subject, so it gets its own band rather than sitting
   inline beside the title. `contain` shows wide Steam key art and square store
   icons whole — neither shape gets cropped. */
/* One fixed shape for every card: 460x215, the Steam header ratio (ANANTA,
   Aion 2 and the rest are native at it). Images fill it with `cover`, so the
   band is identical on every card regardless of the source's own dimensions. */
.game-art {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 92 / 43;
  border-radius: 10px;
  background: var(--panel-raised);
  border: 1px solid var(--border);
}

a.game-art[href] {
  transition: border-color 0.15s ease, filter 0.15s ease;
}

a.game-art[href]:hover {
  border-color: var(--text-dim);
  filter: brightness(1.08);
}

a.game-art[href]:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

.game-poster {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-poster[hidden],
.game-chip[hidden] {
  display: none;
}

.game-chip {
  display: flex;
  width: 100%;
  aspect-ratio: 92 / 43;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: rgba(8, 8, 12, 0.82);
  background: linear-gradient(160deg, var(--accent-1a), var(--accent-1b));
}

.game-card:nth-of-type(4n + 2) .game-chip {
  background: linear-gradient(160deg, var(--accent-2a), var(--accent-2b));
}
.game-card:nth-of-type(4n + 3) .game-chip {
  background: linear-gradient(160deg, var(--accent-3a), var(--accent-3b));
}
.game-card:nth-of-type(4n + 4) .game-chip {
  background: linear-gradient(160deg, var(--accent-4a), var(--accent-4b));
}

.game-card--play .game-chip {
  background: linear-gradient(160deg, var(--released-a), var(--released-b));
}

.game-name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  /* Long titles clamp to two lines; the full name stays in the title tooltip. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.3;
  color: var(--text);
}

.game-genre {
  flex-shrink: 0;
  font-size: 0.56rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
  color: var(--text-dim);
  background: var(--panel-raised);
  border-color: var(--border);
}

.game-genre--gacha {
  color: #ff8aa2;
  background: rgba(255, 95, 126, 0.12);
  border-color: rgba(255, 95, 126, 0.35);
}

.game-genre--mmorpg {
  color: #7ec8ff;
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.4);
}

/* Long platform lists truncate instead of pushing past the card edge; the
   full list stays in the title tooltip. */
.game-platform {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.56rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  background: var(--panel-raised);
  border: 1px solid var(--border);
  color: var(--text-dim);
  white-space: nowrap;
}

.game-status-zone {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: auto;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
}

.game-status-row,
.game-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* A filled pill, so the state reads at a glance instead of as another line. */
.game-status-label {
  flex-shrink: 0;
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.18rem 0.45rem;
  border-radius: 5px;
  color: var(--bg);
  background: var(--accent-blue);
}

/* Window entries are unconfirmed on the day, so they read quieter than a
   dated countdown rather than competing with it. */
.game-card--window .game-status-label {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
}

.game-card--window .game-primary-line {
  color: var(--text-dim);
}

.game-card--live .game-status-label {
  background: var(--accent-orange);
}

.game-card--play .game-status-label {
  background: var(--accent-green);
}

.game-primary-line {
  margin: 0;
  flex-shrink: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.game-card--live .game-primary-line {
  color: var(--accent-orange);
}

.game-secondary-line {
  margin: 0;
  min-width: 0;
  font-size: 0.68rem;
  color: var(--text-faint);
}

.game-card--live {
  animation: pulse-border 2.2s ease-in-out infinite;
}

@keyframes pulse-border {
  0%, 100% { border-color: var(--border); }
  50% { border-color: var(--accent-orange); }
}

