:root {
  --bg: #070b14;
  --bg-elev: rgba(15, 22, 38, 0.82);
  --bg-card: rgba(17, 24, 42, 0.86);
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(255, 255, 255, 0.22);
  --text: #f8fafc;
  --text-dim: #94a3b8;
  --text-muted: #64748b;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.22);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.ambient-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 540px at 16% 12%, var(--accent-soft), transparent 65%),
    radial-gradient(760px 520px at 88% 8%, rgba(139, 92, 246, 0.14), transparent 62%),
    radial-gradient(700px 460px at 50% 95%, rgba(14, 165, 233, 0.08), transparent 70%);
  transition: background 0.45s ease;
}

.grid-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.25;
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent 85%);
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1380px;
  margin: 0 auto;
  padding: 24px 28px 72px;
}

.mono {
  font-family: var(--font-mono);
}

.hidden {
  display: none !important;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-emblem {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 24px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.24), rgba(168, 85, 247, 0.24));
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.brand-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.2vw, 1.9rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand-subtitle {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.stats-ribbon {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stat-pill {
  font-size: 0.78rem;
  color: var(--text-dim);
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.stat-pill strong {
  color: var(--text);
  font-weight: 700;
}

.launcher-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
}

.launcher-status.is-connected {
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.35);
}

.launcher-status.is-connected .status-dot {
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.8);
}

.launcher-status.is-hosted {
  color: #a5f3fc;
  border-color: rgba(6, 182, 212, 0.35);
}

.launcher-status.is-hosted .status-dot {
  background: #06b6d4;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.8);
}

/* Spotlight Hero */
.spotlight {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(320px, 1fr);
  gap: 26px;
  padding: 20px;
  border-radius: var(--radius-xl);
  background: linear-gradient(145deg, rgba(16, 23, 42, 0.92), rgba(10, 14, 27, 0.92));
  border: 1px solid var(--border);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  backdrop-filter: blur(14px);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.spotlight::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(620px 260px at 85% 20%, var(--accent-soft), transparent 70%);
  opacity: 0.85;
  transition: background 0.35s ease;
}

.spotlight-media {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #0b1020;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.spotlight-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.55s ease, opacity 0.25s ease;
}

.spotlight-media:hover img {
  transform: scale(1.025);
}

.spotlight-media-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to top, rgba(7, 11, 20, 0.72) 0%, transparent 45%);
}

.spotlight-nav {
  position: absolute;
  inset: auto 14px 14px auto;
  display: flex;
  gap: 8px;
  z-index: 2;
}

.icon-circle-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(8, 12, 23, 0.78);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(8px);
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.icon-circle-btn:hover {
  transform: translateY(-1px);
  background: rgba(30, 41, 59, 0.92);
  border-color: var(--accent);
}

.spotlight-dots {
  position: absolute;
  left: 16px;
  bottom: 18px;
  display: flex;
  gap: 7px;
  z-index: 2;
}

.spot-dot {
  width: 24px;
  height: 6px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

.spot-dot.is-active {
  width: 42px;
  background: var(--accent);
}

.spotlight-info {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 4px 6px;
}

.spotlight-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.game-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.game-badge.is-online {
  color: #67e8f9;
  background: rgba(6, 182, 212, 0.16);
  border-color: rgba(6, 182, 212, 0.42);
}

.game-badge.is-local {
  color: #86efac;
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
}

.game-badge.is-native {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.42);
}

.date-chip {
  font-size: 0.76rem;
  color: var(--text-dim);
}

.spotlight-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 2.8vw, 2.35rem);
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.spotlight-sub {
  margin: -4px 0 0;
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--accent);
}

.spotlight-tagline {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.55;
  color: #cbd5e1;
}

.spotlight-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 2px;
}

.mini-stat {
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border);
}

.mini-stat-label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.mini-stat-value {
  display: block;
  margin-top: 2px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spotlight-tech, .tech-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tech-chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 4px 9px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}

.spotlight-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 17px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: #06101e;
  box-shadow: 0 8px 24px var(--accent-soft);
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent);
}

.btn-sm {
  padding: 8px 13px;
  font-size: 0.8rem;
  border-radius: 9px;
}

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.search-wrap {
  position: relative;
  flex: 1 1 240px;
  max-width: 310px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(7, 11, 20, 0.72);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.86rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.search-wrap input:focus {
  border-color: var(--accent);
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.filter-pill:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.filter-pill.is-active {
  background: var(--accent);
  color: #06101e;
  border-color: var(--accent);
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sort-select {
  padding: 8px 11px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(7, 11, 20, 0.85);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.82rem;
  outline: none;
  cursor: pointer;
}

.view-toggle {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: rgba(7, 11, 20, 0.82);
  border: 1px solid var(--border);
}

.view-btn {
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.view-btn.is-active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

/* Shelf View */
.library-container.view-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 20px;
}

.game-card {
  --card-accent: var(--accent);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  cursor: pointer;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--card-accent);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--card-accent);
}

.card-art {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0a0f1c;
}

.card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}

.game-card:hover .card-art img {
  transform: scale(1.045);
}

.is-pixelated {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.card-art-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(7, 11, 20, 0.55) 0%, transparent 34%),
    linear-gradient(to top, rgba(8, 12, 23, 0.85) 0%, transparent 48%);
  pointer-events: none;
}

.card-top-badges .game-badge,
.poster-overlay .game-badge {
  background: rgba(7, 11, 20, 0.86);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.card-top-badges .game-badge.is-online,
.poster-overlay .game-badge.is-online {
  background: rgba(7, 18, 28, 0.88);
}

.card-top-badges .game-badge.is-local,
.poster-overlay .game-badge.is-local {
  background: rgba(7, 22, 16, 0.88);
}

.card-top-badges .game-badge.is-native,
.poster-overlay .game-badge.is-native {
  background: rgba(24, 16, 6, 0.9);
}

.card-top-badges {
  position: absolute;
  top: 11px;
  left: 11px;
  right: 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.photo-count-pill {
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(7, 11, 20, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e2e8f0;
  backdrop-filter: blur(6px);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  flex: 1;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.card-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.18rem;
  letter-spacing: -0.015em;
}

.card-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.card-tagline {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.48;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.card-stat-chip {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

.card-footer {
  margin-top: auto;
  padding-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-actions {
  display: flex;
  gap: 8px;
}

/* Poster Wall View */
.library-container.view-poster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}

.poster-tile {
  --card-accent: var(--accent);
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  background: #0a0f1c;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.poster-tile:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: var(--card-accent);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.52);
}

.poster-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}

.poster-tile:hover img {
  transform: scale(1.06);
}

.poster-overlay {
  position: absolute;
  inset: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(to top, rgba(5, 8, 16, 0.94) 5%, rgba(5, 8, 16, 0.25) 55%, rgba(5, 8, 16, 0.35) 100%);
}

.poster-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.poster-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.poster-sub {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: #cbd5e1;
}

/* Timeline View */
.library-container.view-timeline {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  padding-left: 28px;
}

.library-container.view-timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), rgba(148, 163, 184, 0.2));
}

.timeline-item {
  --card-accent: var(--accent);
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 20px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.timeline-item:hover {
  border-color: var(--card-accent);
  transform: translateX(3px);
}

.timeline-node {
  position: absolute;
  left: -25px;
  top: 28px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--card-accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 12px var(--card-accent);
}

.timeline-thumb {
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.timeline-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.timeline-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 9px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 64px 20px;
  border-radius: var(--radius-xl);
  background: var(--bg-card);
  border: 1px dashed var(--border);
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(3, 6, 14, 0.78);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  padding: 22px;
  overflow-y: auto;
}

.modal-card {
  position: relative;
  width: min(1120px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 22px;
  background: #0c1222;
  border: 1px solid var(--border-strong);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.65);
  padding: 24px;
}

.modal-close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 4;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

.modal-close:hover {
  border-color: var(--accent);
}

.modal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.modal-stage {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  background: #060912;
  border: 1px solid var(--border);
}

.modal-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.lightbox-trigger {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 6px 11px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(8, 12, 23, 0.8);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}

.modal-caption {
  margin: 9px 0 10px;
  font-size: 0.83rem;
  color: var(--text-dim);
}

.modal-thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.thumb-btn {
  width: 84px;
  height: 52px;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #060912;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.thumb-btn.is-active,
.thumb-btn:hover {
  opacity: 1;
  border-color: var(--accent);
}

.thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-title {
  margin: 8px 0 2px;
  font-family: var(--font-display);
  font-size: 1.75rem;
}

.modal-subtitle {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
}

.modal-desc {
  margin: 0 0 14px;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #cbd5e1;
}

.modal-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.modal-section {
  margin-bottom: 14px;
}

.modal-section h3 {
  margin: 0 0 7px;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.feature-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.86rem;
  line-height: 1.5;
  color: #cbd5e1;
}

.feature-list li + li {
  margin-top: 4px;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 7px;
}

.control-item {
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  font-size: 0.78rem;
}

.control-key {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 2px;
}

.control-action {
  display: block;
  color: var(--text-dim);
}

.path-box {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(6, 9, 18, 0.85);
  border: 1px solid var(--border);
}

.path-box code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #cbd5e1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-btn {
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 16px;
}

/* Lightbox */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(2, 4, 10, 0.94);
  display: grid;
  place-items: center;
  padding: 36px;
}

.lightbox-content {
  max-width: min(1240px, 92vw);
  max-height: 88vh;
  text-align: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.7);
}

.lightbox-content p {
  margin: 10px 0 0;
  color: #cbd5e1;
  font-size: 0.92rem;
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 22px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.lightbox-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  font-size: 26px;
  cursor: pointer;
}

.lightbox-arrow.left { left: 20px; }
.lightbox-arrow.right { right: 20px; }

/* Toast */
.toast-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 95;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 11px 16px;
  border-radius: 11px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--accent);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
  animation: toastIn 0.2s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 960px) {
  .spotlight {
    grid-template-columns: 1fr;
  }
  .modal-layout {
    grid-template-columns: 1fr;
  }
  .timeline-item {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .shell {
    padding: 16px 14px 56px;
  }
  .spotlight-stats, .modal-stats {
    grid-template-columns: 1fr;
  }
}
