/* shared.css — Site-wide component styles & responsive breakpoints
   Eservs — Mobile / Desktop / Ultrawide
   ─────────────────────────────────────────────────────────────────
   Breakpoints:
     Mobile:       ≤ 768px    — single-column, touch-friendly
     Tablet:       769–1100px  — 2-column grids
     Desktop:      1101–1440px — standard full layouts
     Wide Desktop: 1441–2000px — larger containers (1440p, 4K HiDPI)
     Ultrawide:    ≥ 2001px   — expanded multi-column layouts
   ───────────────────────────────────────────────────────────────── */

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

/* ── Body defaults ─────────────────────────────────────────────── */
body {
  background: #0a0e13;
  color: #c9d1d9;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}
html.animations-disabled .bg-grid,
html.animations-disabled .orb,
html.animations-disabled #constellation,
html.animations-disabled #lightning-canvas,
html.animations-disabled #lightning-overlay,
html.animations-disabled #alien-canvas { display: none !important; }
html.animations-disabled body {
  background:
    radial-gradient(circle at 50% 42%, rgba(88,166,255,0.22) 0%, rgba(88,166,255,0.11) 16%, rgba(88,166,255,0.03) 34%, rgba(10,14,19,0) 58%),
    radial-gradient(circle at 50% 50%, rgba(201,209,217,0.03) 0%, rgba(201,209,217,0.02) 24%, rgba(10,14,19,0) 62%),
    repeating-radial-gradient(circle at 50% 50%, rgba(88,166,255,0.045) 0 2px, transparent 2px 112px),
    linear-gradient(rgba(88,166,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88,166,255,0.035) 1px, transparent 1px),
    linear-gradient(180deg, #1a2433 0%, #111a26 38%, #0a0e13 100%);
  background-size: auto, auto, auto, 32px 32px, 32px 32px, auto;
}
html.animations-disabled body.landing-page {
  background:
    linear-gradient(180deg, rgba(2, 8, 18, 0.72) 0%, rgba(2, 8, 18, 0.82) 100%),
    url('/EServsBG1.png') center center / cover no-repeat,
    #06101b;
}
a { color: #58a6ff; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Animated background (bg.js) ───────────────────────────────── */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(88,166,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88,166,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: gridDrift 20s linear infinite;
}
@keyframes gridDrift {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(60px, 60px); }
}
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(160px);
  opacity: 0.04;
  z-index: 0;
  animation: orbFloat 15s ease-in-out infinite;
}
.orb-1 { width: 500px; height: 500px; background: #58a6ff; top: -220px; right: -180px; }
.orb-2 { width: 400px; height: 400px; background: #8957e5; bottom: -180px; left: -150px; animation-delay: -7s; }
.orb-3 { width: 300px; height: 300px; background: #3fb950; top: 40%; left: 50%; animation-delay: -3s; opacity: 0.025; }
.orb-4 { width: 200px; height: 200px; background: #f778ba; top: 20%; left: 10%; animation-delay: -10s; opacity: 0.02; }
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(30px, -20px) scale(1.05); }
  66%       { transform: translate(-20px, 15px) scale(0.95); }
}
#constellation {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* ── Container / Layout ────────────────────────────────────────── */
.container       { max-width: 1100px; margin: 0 auto; padding: 24px 20px 40px; }
.container-sm    { max-width: 900px;  margin: 0 auto; padding: 24px 20px 40px; }
.container-wide  { max-width: 1300px; margin: 0 auto; padding: 24px 20px 40px; }

@media (max-width: 768px) {
  .container, .container-sm, .container-wide {
    padding: 16px 12px 24px;
  }
}
@media (min-width: 1441px) {
  .container      { max-width: 1400px; padding: 24px 32px 40px; }
  .container-sm   { max-width: 1100px; padding: 24px 32px 40px; }
  .container-wide { max-width: 1800px; padding: 24px 32px 40px; }
}
@media (min-width: 2001px) {
  .container      { max-width: 1600px; padding: 24px 40px 40px; }
  .container-sm   { max-width: 1200px; padding: 24px 40px 40px; }
  .container-wide { max-width: 3400px; padding: 24px 40px 40px; }
}

/* ── Cards ─────────────────────────────────────────────────────── */

/* Electric glow pulse on hover — flickery like a plasma discharge */
/* 0%/100% matches the .card rest state exactly so hover-enter and loop-restart have no jump.
   linear timing removes the ease-in-out velocity seam at the loop boundary. */
@keyframes card-electric-hover {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(88,166,255,0.06),
      0 0 8px  rgba(88,166,255,0.04),
      0 0 0px  rgba(137,87,229,0.00),
      0 4px 20px rgba(0,0,0,0.55);
  }
  38% {
    box-shadow:
      0 0 0 1px rgba(88,166,255,0.36),
      0 0 24px rgba(88,166,255,0.32),
      0 0 52px rgba(137,87,229,0.20),
      0 4px 20px rgba(0,0,0,0.55);
  }
  42% {
    box-shadow:
      0 0 0 1px rgba(88,166,255,0.16),
      0 0 10px rgba(88,166,255,0.12),
      0 0 22px rgba(137,87,229,0.06),
      0 4px 20px rgba(0,0,0,0.55);
  }
  44% {
    box-shadow:
      0 0 0 1px rgba(88,166,255,0.28),
      0 0 20px rgba(88,166,255,0.26),
      0 0 44px rgba(137,87,229,0.16),
      0 4px 20px rgba(0,0,0,0.55);
  }
}

.card {
  background: rgba(13, 17, 23, 0.52);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(48, 54, 61, 0.65);
  border-radius: 8px;
  padding: 20px;
  /* 4 layers kept in sync with @keyframes so interpolation is smooth */
  box-shadow:
    0 0 0 1px rgba(88,166,255,0.06),
    0 0 8px  rgba(88,166,255,0.04),
    0 0 0px  rgba(137,87,229,0.00),
    0 4px 20px rgba(0,0,0,0.55);
  transition: box-shadow 0.35s ease, border-color 0.35s ease;
}
.card:hover {
  border-color: rgba(88,166,255,0.30);
  /* linear timing: no ease-in-out seam at the loop boundary */
  animation: card-electric-hover 2.2s linear infinite;
}
/* Selected / active state — strongest static glow */
.card.selected, .card:focus-within {
  border-color: rgba(88,166,255,0.44);
  box-shadow:
    0 0 0 1px rgba(88,166,255,0.30),
    0 0 22px rgba(88,166,255,0.30),
    0 0 52px rgba(137,87,229,0.20),
    0 4px 20px rgba(0,0,0,0.55);
  animation: none;
}
.card h2, .card h3 {
  font-size: 1rem;
  color: #f0f6fc;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #21262d;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Status sub-text */
.status-sub { font-size: 0.78rem; color: #8b949e; }
.card-desc {
  font-size: 0.82rem;
  color: #8b949e;
  margin-bottom: 14px;
}

@media (max-width: 768px) {
  .card { padding: 16px; }
  .card h2 { font-size: 0.92rem; }
}

/* ── Grid utilities ────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.full-width { grid-column: 1 / -1; }
.span-2 { grid-column: span 2; }
.span-full { grid-column: 1 / -1; }

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
}
@media (min-width: 769px) and (max-width: 1100px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}

/* ── Stat boxes ────────────────────────────────────────────────── */
.stat-row { display: flex; gap: 16px; flex-wrap: wrap; }
.stat-box { flex: 1; min-width: 140px; }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-label { font-size: 0.75rem; color: #8b949e; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.stat-value { font-size: 1.35rem; font-weight: 700; color: #f0f6fc; }
.stat-sub { font-size: 0.78rem; color: #8b949e; margin-top: 2px; }

@media (max-width: 768px) {
  .stat-row { flex-direction: column; }
  .stat-box { min-width: unset; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 1.15rem; }
}
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
}

/* ── Progress bars ─────────────────────────────────────────────── */
.progress-track {
  width: 100%;
  height: 6px;
  background: #21262d;
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}
.fill-green  { background: #3fb950; }
.fill-yellow { background: #d29922; }
.fill-red    { background: #f85149; }
.fill-blue   { background: #58a6ff; }

/* ── Status dots ───────────────────────────────────────────────── */
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.4s ease, box-shadow 0.4s ease;
}
.dot-online  { background: #3fb950; box-shadow: 0 0 6px #3fb95066; }
.dot-offline { background: #f85149; box-shadow: 0 0 6px #f8514966; }
.dot-standby { background: #484f58; box-shadow: none; animation: dotPulse 1.5s ease-in-out infinite; }
.dot-loading { background: #8b949e; animation: dotPulse 1.5s ease-in-out infinite; }
@keyframes dotPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ── Service list ──────────────────────────────────────────────── */
.service-list { list-style: none; }
.service-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #21262d;
  font-size: 0.9rem;
}
.service-list li:last-child { border-bottom: none; }
.service-name { font-weight: 600; color: #f0f6fc; min-width: 120px; }
.service-detail { color: #8b949e; font-size: 0.82rem; }

@media (max-width: 768px) {
  .service-list li {
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.85rem;
  }
  .service-name { min-width: unset; }
}

/* ── Badges ────────────────────────────────────────────────────── */
.service-badge, .badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  flex-shrink: 0;
}
.service-badge { margin-left: auto; }
.badge-vm      { background: #a371f733; color: #a371f7; }
.badge-lxc     { background: #1f6feb33; color: #58a6ff; }
.badge-docker  { background: #23863633; color: #3fb950; }
.badge-host    { background: #d2992233; color: #d29922; }
.badge-tunnel  { background: #f778ba33; color: #f778ba; }
.badge-dedicated { background: #d2992233; color: #d29922; }

/* ── Quick links ───────────────────────────────────────────────── */
details.link-group { margin-bottom: 16px; }
details.link-group:last-child { margin-bottom: 0; }
details.link-group > .link-grid { padding-top: 8px; }

summary.link-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid #21262d;
  cursor: pointer;
  list-style: none;
  user-select: none;
  border-radius: 6px;
  transition: background .15s;
}
summary.link-group-header::-webkit-details-marker { display: none; }
summary.link-group-header::marker { display: none; content: ''; }
summary.link-group-header:hover { background: #161b22; }

.link-group-chevron {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform .2s ease;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238b949e' viewBox='0 0 16 16'%3E%3Cpath d='M6.22 3.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L9.94 8 6.22 4.28a.75.75 0 0 1 0-1.06z'/%3E%3C/svg%3E") center / contain no-repeat;
}
details.link-group[open] > summary .link-group-chevron {
  transform: rotate(90deg);
}

.link-group-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.link-group-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
  white-space: nowrap;
}
.link-group-count {
  margin-left: auto;
  font-size: 0.75rem;
  color: #8b949e;
  white-space: nowrap;
}
.badge-global     { background: #23883533; color: #3fb950; }
.badge-lan        { background: #58a6ff22; color: #58a6ff; }
.badge-tunnel-net { background: #f778ba22; color: #f778ba; }

.link-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.link-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #c9d1d9;
  transition: border-color .15s, background .15s;
}
.link-item:hover { border-color: #58a6ff; background: #161b22; text-decoration: none; color: #f0f6fc; }
.link-icon { font-size: 1.1rem; }

@media (prefers-reduced-motion: reduce) {
  summary.link-group-header,
  .link-group-chevron,
  .link-item {
    transition: none;
  }

  details.link-group[open] > summary .link-group-chevron {
    transform: none;
  }
}

@media (max-width: 768px) {
  summary.link-group-header {
    flex-wrap: wrap;
    row-gap: 6px;
  }
  .link-group-count {
    width: calc(100% - 26px);
    margin-left: 26px;
  }
  .link-grid { grid-template-columns: 1fr; }
  .link-item { padding: 12px 14px; font-size: 0.9rem; }
  .link-group { margin-bottom: 14px; }
}
@media (min-width: 769px) and (max-width: 1440px) {
  .link-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1441px) and (max-width: 2000px) {
  .link-grid { grid-template-columns: 1fr 1fr 1fr; }
}
@media (min-width: 2001px) {
  .link-grid { grid-template-columns: 1fr 1fr 1fr; }
}

/* ── Game banner ───────────────────────────────────────────────── */
.game-banner {
  background: linear-gradient(135deg, rgba(13,17,23,0.52) 0%, rgba(18,26,40,0.52) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(48,54,61,0.65);
  border-radius: 8px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
  box-shadow:
    0 0 0 1px rgba(88,166,255,0.06),
    0 0 8px rgba(88,166,255,0.04),
    0 4px 20px rgba(0,0,0,0.55);
  transition: box-shadow 0.35s ease, border-color 0.35s ease;
}
.game-banner:hover {
  border-color: rgba(88,166,255,0.30);
  animation: card-electric-hover 2.2s ease-in-out infinite;
}
.game-banner-left { display: flex; align-items: center; gap: 16px; }
.game-banner h2 { margin: 0; padding: 0; border: none; font-size: 1.1rem; }
.game-banner p { color: #8b949e; font-size: 0.85rem; margin-top: 2px; }
.game-list { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.game-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #21262d;
  border-radius: 16px;
  font-size: 0.82rem;
  color: #c9d1d9;
  text-decoration: none;
  transition: background .15s, border-color .15s;
  border: 1px solid transparent;
}
.game-chip:hover { background: #30363d; border-color: #484f58; text-decoration: none; }
.game-chip .status-dot { width: 8px; height: 8px; }

@media (max-width: 768px) {
  .game-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
    gap: 12px;
  }
  .game-banner-left { flex-direction: column; align-items: flex-start; gap: 8px; }
  .game-list { gap: 8px; }
  .game-chip { padding: 8px 14px; font-size: 0.85rem; }
}

/* ── Buttons (shared across game server & server-actions pages) ── */
.btn {
  padding: 7px 18px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 0.82rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-actions {
  padding: 7px 18px;
  border-radius: 6px;
  border: 1px solid #58a6ff33;
  background: #58a6ff15;
  color: #58a6ff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.btn-actions:hover { background: #58a6ff25; border-color: #58a6ff55; text-decoration: none; }
.btn-start   { background: #23863622; color: #3fb950; border-color: #23863644; }
.btn-start:hover { background: #23863644; }
.btn-stop    { background: #f8514922; color: #f85149; border-color: #f8514944; }
.btn-stop:hover { background: #f8514944; }
.btn-restart { background: #d2992222; color: #d29922; border-color: #d2992244; }
.btn-restart:hover { background: #d2992244; }
.btn-backup  { background: #58a6ff22; color: #58a6ff; border-color: #58a6ff44; }
.btn-backup:hover { background: #58a6ff44; }
.btn-warn    { background: #d2992222; color: #d29922; border-color: #d2992244; }
.btn-warn:hover { background: #d2992244; }
.btn-danger  { background: #f8514922; color: #f85149; border-color: #f8514944; }
.btn-danger:hover { background: #f8514944; }
.btn-force   { background: #da368822; color: #da3688; border-color: #da368844; }
.btn-force:hover { background: #da368844; }

@media (max-width: 768px) {
  .btn { padding: 10px 18px; font-size: 0.88rem; }
  .btn-actions { padding: 10px 18px; font-size: 0.88rem; }
  .actions { flex-wrap: wrap; }
}

/* ── Status row (game server pages) ────────────────────────────── */
.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.status-text { font-weight: 600; font-size: 0.9rem; }

/* ── Actions row ───────────────────────────────────────────────── */
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Log area ──────────────────────────────────────────────────── */
.log-area {
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: 6px;
  padding: 12px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.75rem;
  color: #8b949e;
  max-height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
.log-time { color: #484f58; }
.log-ok   { color: #3fb950; }
.log-err  { color: #f85149; }
.log-info { color: #58a6ff; }

@media (max-width: 768px) {
  .log-area {
    font-size: 0.72rem;
    max-height: 180px;
    padding: 10px;
  }
}

/* ── Game detail items ─────────────────────────────────────────── */
.game-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin-bottom: 14px;
}
.detail-item { display: flex; flex-direction: column; gap: 2px; }
.detail-label { font-size: 0.72rem; color: #484f58; text-transform: uppercase; letter-spacing: 0.5px; }
.detail-value { font-size: 0.88rem; color: #c9d1d9; font-family: 'SFMono-Regular', Consolas, monospace; }

@media (max-width: 768px) {
  .game-details { grid-template-columns: 1fr; }
}

/* ── Stat bars (game pages) ────────────────────────────────────── */
.stat-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.stat-bar {
  flex: 1;
  height: 6px;
  background: #21262d;
  border-radius: 3px;
  overflow: hidden;
}
.stat-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ── Toast notifications ───────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 9999;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.toast-ok   { background: #23863655; color: #3fb950; border: 1px solid #23863644; }
.toast-err  { background: #f8514955; color: #f85149; border: 1px solid #f8514944; }
.toast-info { background: #58a6ff33; color: #58a6ff; border: 1px solid #58a6ff44; }

@media (max-width: 768px) {
  .toast {
    left: 12px;
    right: 12px;
    bottom: 12px;
    text-align: center;
  }
}

/* ── Content z-index: ensure content sits above fixed background animations ── */
.container,
.member-dash,
.sa-page,
.about-shell,
.studio-page,
.fe-page,
.sh-page-header,
.radio-page,
.modern-player,
.scores-page,
.chat-main,
.room-wrapper,
main {
  position: relative;
  z-index: 1;
}

/* ── Footer ────────────────────────────────────────────────────── */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 24px 20px 16px;
  color: #484f58;
  font-size: 0.78rem;
  border-top: 1px solid #21262d;
  margin-top: 30px;
}
.footer-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.footer-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #8b949e;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.70rem;
}
.footer-item svg { opacity: 0.6; stroke: #8b949e; }
.footer-label { color: #8b949e; font-family: inherit; }
.footer-val   { color: #58a6ff; }
.footer-copy  { color: #484f58; margin-top: 6px; font-size: 0.68rem; }

@media (max-width: 768px) {
  .footer {
    padding: 16px 12px 12px;
    margin-top: 20px;
  }
  .footer-grid {
    flex-direction: column;
    gap: 8px;
  }
  .footer-item { font-size: 0.65rem; }
  .footer-copy { font-size: 0.62rem; }
}
@media (min-width: 2001px) {
  .footer { padding: 24px 40px 16px; margin-top: 10px; }
}

/* ── Filmstrip columns (desktop + ultrawide only) ──────────────── */
.filmstrip {
  position: fixed;
  top: 0;
  left: 0;
  width: 120px;
  height: 100%;
  z-index: 50;
  overflow: hidden;
  pointer-events: auto;
  background: rgba(13, 17, 23, 0.92);
  border-right: 1px solid #21262d;
}
.filmstrip-right {
  left: auto;
  right: 0;
  border-right: none;
  border-left: 1px solid #21262d;
}
.filmstrip::before,
.filmstrip::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 60px;
  z-index: 2;
  pointer-events: none;
}
.filmstrip::before { top: 0; background: linear-gradient(to bottom, #0d1117, transparent); }
.filmstrip::after  { bottom: 0; background: linear-gradient(to top, #0d1117, transparent); }

.filmstrip-track {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
}
.filmstrip-scroll-up   { animation: filmUp 80s linear infinite; }
.filmstrip-scroll-down { animation: filmDown 80s linear infinite; }
@keyframes filmUp   { from { transform: translateY(0); }   to { transform: translateY(-50%); } }
@keyframes filmDown { from { transform: translateY(-50%); } to { transform: translateY(0); } }

.filmstrip:hover .filmstrip-track {
  animation-play-state: paused;
}

.filmstrip-frame {
  width: 104px;
  height: 78px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #161b22;
  border: 2px solid #2a2e34;
  position: relative;
  cursor: pointer;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.filmstrip-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
  filter: saturate(0.6);
  transition: opacity 0.3s, filter 0.3s;
  border-radius: 3px;
}
.filmstrip:hover .filmstrip-frame img {
  opacity: 0.85;
  filter: saturate(1);
}
.filmstrip-frame:hover {
  border-color: #58a6ff;
  box-shadow: 0 0 8px #58a6ff44;
}
.filmstrip-frame:hover img {
  opacity: 1;
  filter: saturate(1);
}

/* Floating preview */
.filmstrip-preview {
  display: none;
  position: fixed;
  z-index: 999;
  width: 280px;
  height: 210px;
  border-radius: 8px;
  border: 2px solid #58a6ff;
  box-shadow: 0 8px 32px rgba(0,0,0,0.7), 0 0 0 1px #58a6ff33;
  overflow: hidden;
  background: #161b22;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  opacity: 0;
  transform: scale(0.92);
}
.filmstrip-preview.visible {
  display: block;
  opacity: 1;
  transform: scale(1);
}
.filmstrip-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Lightbox overlay */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.lightbox-overlay.active { display: flex; }
.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  border: 1px solid #30363d;
  box-shadow: 0 8px 48px rgba(0,0,0,0.7);
  object-fit: contain;
  cursor: default;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 28px;
  width: 36px;
  height: 36px;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  color: #c9d1d9;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s;
}
.lightbox-close:hover { border-color: #58a6ff; color: #f0f6fc; }

/* Hide filmstrips on mobile/tablet */
@media (max-width: 1000px) {
  .filmstrip { display: none; }
  .filmstrip-preview { display: none !important; }
}

/* Ultrawide filmstrip: bigger frames, faster scroll */
@media (min-width: 2001px) {
  .filmstrip {
    width: 140px;
    pointer-events: none;
  }
  .filmstrip-scroll-up   { animation-duration: 70s; }
  .filmstrip-scroll-down { animation-duration: 70s; }

  .filmstrip-frame {
    width: 124px;
    height: 93px;
    cursor: default;
  }
  .filmstrip-frame img {
    opacity: 0.5;
    filter: saturate(0.5);
    border-radius: 0;
  }
  /* Simplified hover for ultrawide — no individual frame effects */
  .filmstrip-frame:hover {
    border-color: #2a2e34;
    box-shadow: none;
  }
  .filmstrip-frame:hover img {
    opacity: 0.5;
    filter: saturate(0.5);
  }
  .filmstrip:hover .filmstrip-frame img {
    opacity: 0.85;
    filter: saturate(1);
  }
}

/* ── Collapse panels (game server pages) ───────────────────────── */
.collapse-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  padding: 8px 0;
}
.collapse-header .arrow {
  transition: transform 0.25s;
  color: #484f58;
}
.collapse-header.open .arrow {
  transform: rotate(90deg);
}
.collapse-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.collapse-body.open {
  max-height: 2000px;
}

/* ── Settings grid (game server config pages) ──────────────────── */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.setting-group { display: flex; flex-direction: column; gap: 4px; }
.setting-label { font-size: 0.75rem; color: #8b949e; }
.setting-input, .setting-select {
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: 6px;
  padding: 8px 10px;
  color: #c9d1d9;
  font-size: 0.85rem;
  font-family: 'SFMono-Regular', Consolas, monospace;
}
.setting-input:focus, .setting-select:focus {
  border-color: #58a6ff;
  outline: none;
  box-shadow: 0 0 0 2px #58a6ff22;
}
.setting-hint { font-size: 0.68rem; color: #484f58; }
.settings-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}
.btn-save {
  background: #238636;
  color: #fff;
  border: 1px solid #2ea04366;
  padding: 7px 18px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-save:hover { background: #2ea043; }
.settings-status { font-size: 0.78rem; color: #8b949e; }
.settings-warning {
  background: #d2992215;
  border: 1px solid #d2992233;
  border-radius: 6px;
  padding: 10px 14px;
  color: #d29922;
  font-size: 0.8rem;
  margin-bottom: 12px;
}

@media (max-width: 700px) {
  .settings-grid { grid-template-columns: 1fr; }
}

/* ── Connection box ────────────────────────────────────────────── */
.conn-box {
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 0.85rem;
  color: #c9d1d9;
}
.clickable-copy {
  cursor: pointer;
  transition: color 0.15s;
}
.clickable-copy:hover { color: #58a6ff; }

/* ── IO grid (enshrouded/valheim details) ──────────────────────── */
.io-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.io-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

@media (max-width: 768px) {
  .io-grid { grid-template-columns: 1fr; }
}

/* ── Password toggle ───────────────────────────────────────────── */
.pass-toggle {
  background: none;
  border: none;
  color: #58a6ff;
  cursor: pointer;
  font-size: 0.78rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s;
}
.pass-toggle:hover { background: #58a6ff15; }

/* ── Password eye-toggle wrapper ───────────────────────────────── */
.pw-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.pw-wrapper input {
  flex: 1;
  padding-right: 38px !important;
}
.pw-eye {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: #484f58;
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 4px;
  line-height: 1;
  transition: color 0.15s;
  display: flex;
  align-items: center;
}
.pw-eye:hover { color: #8b949e; }
.pw-eye.active { color: #58a6ff; }

/* ── Snapshot/backup lists ─────────────────────────────────────── */
.snapshot-list, .snap-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.snapshot-item, .snap-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: 6px;
  font-size: 0.82rem;
}
.snapshot-name, .snap-name { font-weight: 600; color: #f0f6fc; flex: 1; }
.snapshot-meta, .snap-date { color: #8b949e; font-size: 0.75rem; }
.snapshot-del, .snap-del {
  background: none;
  border: none;
  color: #f85149;
  cursor: pointer;
  font-size: 0.78rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s;
}
.snapshot-del:hover, .snap-del:hover { background: #f8514915; }
.snap-badge {
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 8px;
  background: #23863633;
  color: #3fb950;
}

/* ── Toggle switch (satisfactory) ──────────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.toggle-switch { position: relative; display: inline-block; width: 38px; height: 20px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute;
  inset: 0;
  background: #21262d;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-track::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: #c9d1d9;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-track { background: #238636; }
.toggle-switch input:checked + .toggle-track::before { transform: translateX(18px); }

/* ── Chart containers ──────────────────────────────────────────── */
.chart-container {
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: 6px;
  padding: 12px;
  margin-top: 10px;
}

/* ── Modal (server-actions confirmation dialogs) ───────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 24px;
  max-width: 420px;
  width: 90%;
  text-align: center;
}
.modal h3 { color: #f0f6fc; margin-bottom: 10px; }
.modal p { color: #8b949e; font-size: 0.88rem; margin-bottom: 16px; }
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.btn-cancel {
  padding: 7px 18px;
  border-radius: 6px;
  background: #21262d;
  border: 1px solid #30363d;
  color: #c9d1d9;
  font-size: 0.82rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s;
}
.btn-cancel:hover { background: #30363d; }

/* ── Infrastructure cards (server-actions) ─────────────────────── */
.infra-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.infra-card {
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: 6px;
  padding: 14px;
}

@media (max-width: 768px) {
  .infra-grid { grid-template-columns: 1fr; }
  .modal { padding: 18px; }
}
@media (min-width: 2001px) {
  .infra-grid { grid-template-columns: 1fr 1fr 1fr; }
}

/* ── Dashboard-specific: ultrawide 3-column grid ───────────────── */
@media (min-width: 2001px) {
  .dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
  }
}

/* ── Utility: margin helpers ───────────────────────────────────── */
.mb-16 { margin-bottom: 16px; }
.mb-10 { margin-bottom: 10px; }

/* ── Accessibility: skip-to-content link ───────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 10000;
  background: #238636;
  color: #fff;
  padding: 8px 16px;
  border-radius: 0 0 6px 6px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
}
