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

:root {
  --nav-h: 68px;
  --top-h: 30px;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: 'Monaco', sans-serif;
  color: #fff;
  transition: background 0.3s ease;
}

body.has-bg {
  background: url('assets/background.png') center / cover no-repeat fixed;
}

#matrix-canvas {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 0;
}

/* ── Top bar ─────────────────────────────────────────────── */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--top-h);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 max(2rem, 5vw);
}

.top-item {
  font-size: clamp(9px, 0.95vw, 13px);
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  letter-spacing: 0.06em;
  transition: color 0.15s;
  user-select: none;
}

.top-item:hover,
.top-item.active {
  color: rgba(255, 255, 255, 0.9);
}

/* ── Content panel ───────────────────────────────────────── */
.content-panel {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, calc(-50% + (var(--top-h) - var(--nav-h)) / 2));
  width: min(940px, 65vw);
  height: min(480px, calc(100vh - var(--nav-h) - var(--top-h) - 32px));
  background: rgba(0, 0, 0, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.82);
  z-index: 10;
  overflow: clip;
}

.panel-inner {
  position: relative;
  height: 100%;
}


/* ── Bottom nav ──────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: safe center;
  gap: clamp(4px, 0.8vw, 10px);
  padding: 0 max(1rem, 2vw);
  overflow-x: auto;
  scrollbar-width: none;
  background: #fff;
}

.bottom-nav::-webkit-scrollbar {
  display: none;
}

.nav-item {
  font-size: clamp(11px, 1.25vw, 18px);
  font-weight: 400;
  color: rgba(0, 0, 0, 0.38);
  cursor: pointer;
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.15s;
  user-select: none;
}

.nav-item:hover {
  color: rgba(0, 0, 0, 0.65);
}

.nav-item.active {
  color: #000;
  font-weight: 700;
}

.nav-sep {
  color: rgba(0, 0, 0, 0.25);
  font-weight: 700;
  font-size: calc(clamp(11px, 1.25vw, 18px) * 1.2);
  flex-shrink: 0;
  pointer-events: none;
  user-select: none;
}

.nav-back {
  font-weight: 700;
  font-size: calc(clamp(11px, 1.25vw, 18px) * 1.2);
}

/* ── Landing — absolutely centered within the rect ───────── */
.landing {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  text-align: center;
}

.landing p {
  font-size: clamp(12px, 1.35vw, 17px);
  letter-spacing: 0.06em;
}

/* ── Text body — absolutely fills the rect, scrolls ─────── */
.text-body {
  position: absolute;
  inset: 0;
  padding: clamp(1.4rem, 2.8vh, 2.4rem) clamp(1.6rem, 3.5vw, 3rem);
  overflow-y: auto;
  scrollbar-width: none;
  font-size: clamp(11px, 1.05vw, 14px);
  line-height: 1.72;
  text-align: center;
}

.text-body::-webkit-scrollbar {
  display: none;
}

/* People text — vertically centered, scrollable on small screens */
.text-body.centered {
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  align-items: center;
}

.text-body p + p {
  margin-top: 1.1em;
}

.text-body em {
  font-style: italic;
}

/* ── Games grid ──────────────────────────────────────────── */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(100px, 14vw, 170px), 1fr));
  grid-auto-rows: 1fr;
  gap: clamp(6px, 1.1vw, 14px);
  height: 100%;
}

.game-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  cursor: pointer;
  transition: opacity 0.15s;
  min-height: 0;
}

.game-card:hover {
  opacity: 0.7;
}

.game-card img {
  flex: 1;
  width: 100%;
  min-height: 0;
  object-fit: cover;
  display: block;
}

.game-card-label {
  font-size: clamp(7px, 0.78vw, 11px);
  color: rgba(255, 255, 255, 0.82);
  text-align: center;
  letter-spacing: 0.03em;
}

/* ── Game detail ─────────────────────────────────────────── */
.game-detail {
  display: flex;
  align-items: center;
  gap: clamp(1.2rem, 3vw, 2.5rem);
  height: 100%;
}

.game-detail-text {
  flex: 1;
  font-size: clamp(10px, 1.05vw, 14px);
  line-height: 1.72;
  padding-left: clamp(1.2rem, 3vw, 2.5rem);
}

.game-detail-text p + p {
  margin-top: 1em;
}

.game-detail-img {
  flex: 0 0 42%;
  max-width: 42%;
}

.game-detail-img a {
  display: block;
  cursor: pointer;
}

.game-detail-img img {
  width: 100%;
  display: block;
}
