/* ═══════════════════════════════════════════════════════════════════════════
   AstroTown · Sidebar Layout System
   Left-rail navigation + right content area (Astrocade-style)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── CSS Variables (complement tokens.css) ───────────────────────────────── */
:root {
  --sidebar-w:       220px;
  --sidebar-w-coll:   64px;   /* collapsed icon-only mode */
  --topbar-h:         56px;
  --content-pad:      20px;
  --row-gap:          32px;
  --card-w-sm:       120px;
  --card-w-md:       150px;
  --card-h-sm:       160px;
  --card-h-md:       200px;
  --card-aspect:     calc(3/4);
}

/* ── App Shell ────────────────────────────────────────────────────────────── */
.at-shell {
  display: flex;
  min-height: 100vh;
  background: var(--bg-deep);
}

/* ── Top bar (mobile + shared logo area) ─────────────────────────────────── */
.at-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  padding-inline: var(--s4);
  gap: var(--s3);
  background: rgba(7,8,16,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

@media (min-width: 960px) {
  .at-topbar { display: none; }  /* desktop uses sidebar logo */
}

.at-topbar-logo {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-black);
  color: var(--text-primary);
  letter-spacing: -0.02em;
  flex: 1;
  text-decoration: none;
}

.at-topbar-logo .logo-star {
  background: linear-gradient(135deg, var(--accent-primary), var(--nebula-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 5px rgba(99,102,241,0.6));
}

.at-topbar-search-btn,
.at-topbar-menu-btn {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--t-fast) ease;
  flex-shrink: 0;
}
.at-topbar-search-btn:hover,
.at-topbar-menu-btn:hover { background: var(--bg-raised); color: var(--text-primary); }

/* ── Left Sidebar ─────────────────────────────────────────────────────────── */
.at-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  z-index: calc(var(--z-nav) - 1);
  background: rgba(7,8,16,0.96);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform var(--t-enter), width var(--t-base) var(--ease-out);
}

/* Mobile: hide sidebar, show topbar */
@media (max-width: 959px) {
  .at-sidebar {
    transform: translateX(-100%);
    top: var(--topbar-h);
  }
  .at-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 40px rgba(0,0,0,0.6);
  }
}

/* ── Sidebar Logo ─────────────────────────────────────────────────────────── */
.at-sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s5) var(--s4);
  text-decoration: none;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--s2);
}

.at-sidebar-logo .logo-star {
  font-size: 22px;
  background: linear-gradient(135deg, var(--accent-primary), var(--nebula-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 6px rgba(99,102,241,0.7));
  flex-shrink: 0;
}

.at-sidebar-logo .logo-wordmark {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-black);
  color: var(--text-primary);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.at-sidebar-logo .logo-wordmark span { color: var(--accent-glow); }

/* ── Sidebar Play Button ──────────────────────────────────────────────────── */
.at-sidebar-play-btn {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin: 0 var(--s3) var(--s4);
  padding: var(--s3) var(--s4);
  border-radius: var(--r-md);
  background: var(--accent-primary);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--t-fast) ease, transform var(--t-fast) ease;
  border: none;
  flex-shrink: 0;
}
.at-sidebar-play-btn:hover { background: var(--accent-secondary); transform: scale(1.02); }
.at-sidebar-play-btn .btn-icon { font-size: 14px; }

/* ── Sidebar Nav ──────────────────────────────────────────────────────────── */
.at-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-raised) transparent;
}

.at-sidebar-nav::-webkit-scrollbar { width: 4px; }
.at-sidebar-nav::-webkit-scrollbar-thumb { background: var(--bg-raised); border-radius: 2px; }

.at-sidebar-section {
  padding: 0 var(--s2) var(--s4);
}

.at-sidebar-section-label {
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: var(--s3) var(--s3) var(--s2);
}

.at-nav-item {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s2) var(--s3);
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--t-fast) ease, color var(--t-fast) ease;
  white-space: nowrap;
  position: relative;
}

.at-nav-item:hover {
  background: var(--bg-raised);
  color: var(--text-primary);
}

.at-nav-item.active {
  background: rgba(99,102,241,0.15);
  color: var(--accent-glow);
}

.at-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  bottom: 25%;
  width: 3px;
  background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 6px rgba(99,102,241,0.6);
}

.at-nav-badge {
  margin-left: auto;
  font-size: var(--text-3xs);
  padding: 1px 6px;
  border-radius: var(--r-full);
  background: var(--accent-primary);
  color: #fff;
  font-weight: var(--weight-bold);
}

/* ── Sidebar Footer ────────────────────────────────────────────────────────── */
.at-sidebar-footer {
  flex-shrink: 0;
  padding: var(--s4);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.at-sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s2);
  border-radius: var(--r-sm);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: background var(--t-fast) ease;
}
.at-sidebar-user:hover { background: var(--bg-raised); }

/* Language toggle — appears in sidebar footer on /games and /gaming */
.lang-switch-sidebar {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  text-decoration: none;
  padding: var(--s1) var(--s2);
  border-radius: var(--r-sm);
  transition: color var(--t-fast) ease, background var(--t-fast) ease;
  white-space: nowrap;
  overflow: hidden;
  margin-top: var(--s2);
}
.lang-switch-sidebar:hover {
  color: var(--text-secondary);
  background: var(--bg-raised);
}

.at-sidebar-avatar {
  width: 32px; height: 32px;
  border-radius: var(--r-full);
  background: var(--bg-overlay);
  border: 2px solid var(--border-accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.at-sidebar-username {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Main Content Area ─────────────────────────────────────────────────────── */
.at-main {
  flex: 1;
  margin-left: 0;
  min-height: 100vh;
  padding-top: var(--topbar-h);
}

@media (min-width: 960px) {
  .at-main {
    margin-left: var(--sidebar-w);
    padding-top: 0;
  }
}

/* ── Sidebar nav icon — SVG-ready ─────────────────────────────────────────── */
.at-nav-icon {
  width: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  line-height: 1;
  transition: color var(--t-fast) ease;
}

/* text label in nav items (separate span so collapse can hide it) */
.at-nav-label {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  max-width: 160px;
  opacity: 1;
  transition: max-width 0.24s ease, opacity 0.14s ease;
}

/* ── Sidebar collapse toggle button ──────────────────────────────────────── */
.at-sidebar-collapse-btn {
  display: none;   /* shown only on desktop */
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  position: absolute;
  right: -14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transition: background var(--t-fast), color var(--t-fast),
              border-color var(--t-fast), transform 0.24s ease;
  flex-shrink: 0;
}
.at-sidebar-collapse-btn:hover {
  background: var(--bg-raised);
  color: var(--text-primary);
  border-color: var(--border-accent);
}

@media (min-width: 960px) {
  .at-sidebar-collapse-btn { display: flex; }
}

/* ── Collapsed sidebar state ──────────────────────────────────────────────── */
body.sidebar-collapsed .at-sidebar {
  width: var(--sidebar-w-coll);
}

/* Hide text in collapsed state */
body.sidebar-collapsed .logo-wordmark,
body.sidebar-collapsed .at-sidebar-section-label,
body.sidebar-collapsed .at-sidebar-play-btn .btn-label,
body.sidebar-collapsed .at-sidebar-copyright,
body.sidebar-collapsed .lang-switch-sidebar {
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  pointer-events: none;
  transition: max-width 0.24s ease, opacity 0.12s ease;
}

body.sidebar-collapsed .at-nav-label,
body.sidebar-collapsed .at-nav-badge {
  max-width: 0;
  opacity: 0;
  pointer-events: none;
}

/* Re-center nav items when collapsed */
body.sidebar-collapsed .at-nav-item {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

body.sidebar-collapsed .at-sidebar-play-btn {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
  margin-inline: var(--s2);
}

body.sidebar-collapsed .at-sidebar-logo {
  justify-content: center;
}

body.sidebar-collapsed .at-sidebar-footer {
  align-items: center;
}

body.sidebar-collapsed .at-sidebar-user {
  justify-content: center;
}

/* Collapse button rotates when sidebar is collapsed */
body.sidebar-collapsed .at-sidebar-collapse-btn {
  transform: translateY(-50%) rotate(180deg);
}

/* Content area shifts smoothly */
.at-main {
  transition: margin-left 0.26s ease;
}

@media (min-width: 960px) {
  body.sidebar-collapsed .at-main {
    margin-left: var(--sidebar-w-coll);
  }
}

/* ── Sidebar overlay (mobile) ────────────────────────────────────────────── */
.at-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-nav) - 2);
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
}
.at-sidebar-overlay.open { display: block; }

/* ── Games Page: Category Row Layout ─────────────────────────────────────── */
.games-content {
  padding: var(--s6) var(--content-pad);
  max-width: 1600px;
}

.games-search-bar {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-bottom: var(--s6);
}

.games-search-input {
  flex: 1;
  max-width: 480px;
  padding: var(--s3) var(--s4) var(--s3) 44px;
  border-radius: var(--r-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-normal);
  color: var(--text-primary);
  font-size: var(--text-sm);
  position: relative;
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
.games-search-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.games-search-input::placeholder { color: var(--text-muted); }

.games-search-wrap {
  position: relative;
  flex: 1;
  max-width: 480px;
}

.games-search-wrap .search-icon-inline {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 16px;
}

/* ── Category Row ─────────────────────────────────────────────────────────── */
.cat-row {
  margin-bottom: var(--row-gap);
}

.cat-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s4);
}

.cat-row-title {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.cat-row-icon { font-size: 20px; line-height: 1; }

.cat-row-see-all {
  font-size: var(--text-sm);
  color: var(--accent-glow);
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: color var(--t-fast) ease, gap var(--t-fast) ease;
  white-space: nowrap;
}
.cat-row-see-all:hover { color: var(--accent-pulse); gap: 8px; }

/* Horizontal scroll row */
.cat-row-list {
  display: flex;
  gap: var(--s3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--s2);
  scrollbar-width: none;
}
.cat-row-list::-webkit-scrollbar { display: none; }
.cat-row-list > * { scroll-snap-align: start; flex-shrink: 0; }

/* ── Game Card (Astrocade style — portrait, smaller than Cube) ────────────── */
.gc {
  position: relative;
  display: flex;
  flex-direction: column;
  width: var(--card-w-md);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  border-radius: var(--r-cube);
  overflow: hidden;
  transition:
    transform var(--t-base) var(--ease-out),
    box-shadow var(--t-base) ease;
  background: var(--bg-surface);
}

.gc:hover {
  transform: scale(1.06) translateY(-4px);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(99,102,241,0.3);
  z-index: 2;
}

.gc:active { transform: scale(0.97); }

@media (prefers-reduced-motion: reduce) {
  .gc:hover { transform: none; box-shadow: var(--shadow-sm); }
  .gc:active { transform: none; }
}

.gc-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  position: relative;
  overflow: hidden;
  background: var(--mesh-1);
}

.gc[data-mesh="1"] .gc-cover { background: var(--mesh-1); }
.gc[data-mesh="2"] .gc-cover { background: var(--mesh-2); }
.gc[data-mesh="3"] .gc-cover { background: var(--mesh-3); }
.gc[data-mesh="4"] .gc-cover { background: var(--mesh-4); }
.gc[data-mesh="5"] .gc-cover { background: var(--mesh-5); }
.gc[data-mesh="6"] .gc-cover { background: var(--mesh-6); }

.gc-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--t-slow) var(--ease-out);
}
.gc:hover .gc-cover img { transform: scale(1.08); }

/* Play overlay on hover */
.gc-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--t-fast) ease;
}
.gc:hover .gc-play-overlay { opacity: 1; }

.gc-play-circle {
  width: 44px; height: 44px;
  border-radius: var(--r-full);
  background: rgba(99,102,241,0.9);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 20px rgba(99,102,241,0.5);
}

/* Format badge */
.gc-fmt-badge {
  position: absolute;
  bottom: var(--s2); left: var(--s2);
  font-size: 9px;
  font-weight: var(--weight-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: var(--r-full);
  line-height: 1.5;
  backdrop-filter: blur(4px);
  background: rgba(0,0,0,0.55);
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.12);
}
.gc-fmt-badge[data-fmt="xmp-cc"]      { color: #67e8f9; border-color: rgba(103,232,249,0.25); }
.gc-fmt-badge[data-fmt="xmp-advanced"] { color: #a78bfa; border-color: rgba(167,139,250,0.25); }
.gc-fmt-badge[data-fmt="h5-pure"]      { color: #34d399; border-color: rgba(52,211,153,0.25); }
.gc-fmt-badge[data-fmt="xmp-native"]   { color: #fbbf24; border-color: rgba(251,191,36,0.25); }

/* NEW badge */
.gc-new-dot {
  position: absolute;
  top: var(--s2); right: var(--s2);
  width: 8px; height: 8px;
  border-radius: var(--r-full);
  background: var(--accent-primary);
  box-shadow: 0 0 6px var(--accent-primary);
}

/* Info strip */
.gc-info {
  padding: var(--s2) var(--s3) var(--s3);
}

.gc-title {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: var(--leading-snug);
}

.gc-author {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Skeleton */
.gc-skeleton .gc-cover { animation: shimmer 1.8s linear infinite; }
.gc-skeleton .gc-title { height: 10px; background: var(--bg-raised); border-radius: 3px; width: 85%; margin-bottom: 4px; animation: shimmer 1.8s linear infinite; }
.gc-skeleton .gc-author { height: 8px; background: var(--bg-raised); border-radius: 3px; width: 60%; animation: shimmer 1.8s linear infinite; }

/* ── Filter bar (horizontal tabs for genres/formats) ─────────────────────── */
.games-filter-tabs {
  display: flex;
  gap: var(--s2);
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: var(--s2);
  margin-bottom: var(--s5);
}
.games-filter-tabs::-webkit-scrollbar { display: none; }

.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s2) var(--s4);
  border-radius: var(--r-full);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--t-fast) ease;
  flex-shrink: 0;
  text-decoration: none;
}

.filter-tab:hover {
  background: var(--bg-raised);
  color: var(--text-primary);
  border-color: var(--border-normal);
}

.filter-tab.active {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(99,102,241,0.35);
}
.filter-tab:active { transform: scale(0.97); }

/* ══════════════════════════════════════════════════════════════════════════
   PLAY PAGE LAYOUT
   ══════════════════════════════════════════════════════════════════════════ */

.play-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-void);
}

/* Left sidebar shares .at-sidebar styles */

/* Center: game area */
.play-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--s4);
  min-width: 0;
  position: relative;
  background: var(--bg-void);
}

/* Player window */
.play-player-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s3);
  max-height: calc(100vh - 80px);
}

/* Player size selector */
.play-size-select {
  display: flex;
  align-items: center;
  gap: var(--s2);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--s2) var(--s3);
}

.play-size-btn {
  padding: var(--s1) var(--s3);
  border-radius: var(--r-sm);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--t-fast) ease, color var(--t-fast) ease;
  white-space: nowrap;
}
.play-size-btn:hover { color: var(--text-secondary); background: var(--bg-raised); }
.play-size-btn.active { background: var(--bg-overlay); color: var(--text-primary); }

.play-size-btn .size-ratio { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); }

/* The iframe player shell */
.play-player-shell {
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-glow), 0 20px 60px rgba(0,0,0,0.7);
  border: 1px solid var(--border-subtle);
  position: relative;
  background: #000;
  transition: width var(--t-base) var(--ease-out), height var(--t-base) var(--ease-out);
  flex-shrink: 0;
}

/* Top info bar above player */
.play-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 480px;
  padding: var(--s2) var(--s1);
}

.play-game-meta {
  display: flex;
  align-items: center;
  gap: var(--s3);
}

.play-game-title-sm {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.play-game-fmt {
  font-size: var(--text-2xs);
  padding: 1px 7px;
  border-radius: var(--r-full);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.play-topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--s2);
}

/* Right action rail (like Astrocade's right column) */
.play-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: var(--s5) var(--s3);
  gap: var(--s4);
  border-left: 1px solid var(--border-subtle);
  background: rgba(7,8,16,0.7);
  min-width: 60px;
  max-width: 72px;
}

.play-rail-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s3);
}

.play-rail-btn {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  transition: background var(--t-fast) ease, color var(--t-fast) ease, border-color var(--t-fast) ease;
}

.play-rail-btn:hover {
  background: var(--bg-raised);
  color: var(--text-primary);
  border-color: var(--border-accent);
}

.play-rail-btn.active { color: var(--accent-glow); border-color: var(--border-accent); }
.play-rail-btn.danger { color: var(--color-error); }

.play-rail-count {
  font-size: 9px;
  color: var(--text-muted);
  font-weight: var(--weight-semibold);
  line-height: 1;
}

/* Nav arrows (top/bottom game navigation) */
.play-rail-nav {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.play-rail-nav-btn {
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  transition: background var(--t-fast) ease, color var(--t-fast) ease;
}
.play-rail-nav-btn:hover { background: var(--bg-raised); color: var(--text-primary); }
.play-rail-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* Bottom info strip (author area) */
.play-bottom-strip {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: var(--s3) var(--s5);
  background: linear-gradient(to top, rgba(7,8,16,0.95), transparent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.play-author-info {
  display: flex;
  align-items: center;
  gap: var(--s3);
  pointer-events: auto;
}

.play-author-avatar {
  width: 32px; height: 32px;
  border-radius: var(--r-full);
  background: var(--bg-overlay);
  border: 2px solid var(--border-accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  overflow: hidden;
}

.play-author-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.play-author-handle {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.play-follow-btn {
  padding: var(--s1) var(--s4);
  border-radius: var(--r-full);
  background: var(--accent-primary);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  pointer-events: auto;
  transition: background var(--t-fast) ease;
}
.play-follow-btn:hover { background: var(--accent-secondary); }
.play-follow-btn.following {
  background: transparent;
  border: 1px solid var(--border-normal);
  color: var(--text-secondary);
}

/* ── Compat mode badge ───────────────────────────────────────────────────── */
.compat-badge {
  position: absolute;
  top: var(--s2); left: 50%; transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s1) var(--s3);
  border-radius: var(--r-full);
  background: rgba(251,191,36,0.15);
  border: 1px solid rgba(251,191,36,0.3);
  font-size: var(--text-2xs);
  color: var(--color-warning);
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
}

/* Mobile play page adjustments */
@media (max-width: 959px) {
  .play-rail {
    min-width: 52px;
    max-width: 52px;
    padding: var(--s3) var(--s2);
  }
  .play-rail-btn { width: 38px; height: 38px; font-size: 16px; }
  .play-center { padding: var(--s2); }
}

/* ── Sidebar Ecosystem Partner Links ─────────────────────────────────────── */
.at-sidebar-ecosystem {
  flex-shrink: 0;
  padding: 10px var(--s3) 8px;
  border-top: 1px solid rgba(255,255,255,0.04);
}

.at-sidebar-ecosystem .at-sidebar-section-label {
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  opacity: 0.5;
  padding: 0 0 6px 2px;
  margin: 0;
}

.at-ecosystem-links {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.at-ecosystem-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 6px;
  border-radius: 3px;
  background: transparent;
  border: none;
  text-decoration: none;
  transition: color var(--t-fast) ease;
  line-height: 1.4;
}

.at-ecosystem-link:hover { background: transparent; }

.at-ecosystem-name {
  font-size: 9px;
  font-weight: 500;
  color: rgba(255,255,255,0.22);
  white-space: nowrap;
  letter-spacing: 0.01em;
  transition: color var(--t-fast) ease;
}

.at-ecosystem-link:hover .at-ecosystem-name { color: rgba(255,255,255,0.5); }

.at-ecosystem-en { display: none; }

/* ── Sidebar Copyright ───────────────────────────────────────────────────── */
.at-sidebar-copyright {
  font-size: 9px;
  color: rgba(255,255,255,0.15);
  text-align: left;
  padding: 6px var(--s1) 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.02em;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* at-site-footer — injected by ATShell.inject({ injectFooter: true })       */
/* Matches buildFooterHTML() in shared-shell.js                              */
/* ══════════════════════════════════════════════════════════════════════════ */
.at-site-footer {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 0 clamp(16px,4vw,48px);
  margin-top: auto;
}
.at-site-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 0 0;
}

/* ── Footer link grid ──────────────────────────────────────────────────── */
.at-footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  margin-bottom: 40px;
}
@media (max-width: 760px) { .at-footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .at-footer-grid { grid-template-columns: 1fr; } }

.at-footer-col-title {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-secondary, #8b5cf6);
  font-weight: 700;
  margin-bottom: 14px;
}

.at-footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.at-footer-links a {
  color: rgba(255,255,255,0.3);
  font-size: 13px;
  text-decoration: none;
  transition: color 0.2s;
  line-height: 1.4;
}
.at-footer-links a:hover { color: rgba(255,255,255,0.75); }

/* ── Footer bottom bar ─────────────────────────────────────────────────── */
.at-footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 20px 0 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: rgba(255,255,255,0.2);
}
.at-footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.at-footer-star {
  background: linear-gradient(135deg, var(--accent-primary,#6366f1), var(--accent-secondary,#8b5cf6));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 14px;
}
.at-footer-dot { opacity: 0.3; }
.at-footer-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}
.at-footer-meta a {
  color: rgba(255,255,255,0.25);
  text-decoration: none;
  font-size: 12px;
  transition: color 0.2s;
}
.at-footer-meta a:hover { color: rgba(255,255,255,0.6); }
