/**
 * WOOWMAP STRATEGY – Unified Site Shell Stylesheet
 * Shared across the entire public homepage (Startseite, /play/, future subpages).
 * Provides the global design system, top live bar, main navbar, server status popover,
 * and synchronized clock.
 */

:root {
  --bg-deep: #05080c;
  --bg-topbar: #030508;
  --bg-navbar: rgba(8, 12, 18, 0.94);
  --bg-overlay: rgba(10, 15, 24, 0.96);
  --bg-card: rgba(16, 24, 38, 0.85);
  --bg-card-hover: rgba(26, 38, 60, 0.95);
  
  --border-subtle: rgba(56, 189, 248, 0.14);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(56, 189, 248, 0.4);

  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-cyan: #38bdf8;
  --accent-blue: #0ea5e9;
  --accent-green: #10b981;
  --accent-yellow: #f59e0b;
  --accent-red: #ef4444;
  --accent-purple: #a855f7;

  --topbar-height: 32px;
  --navbar-height: 64px;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --shadow-overlay: 0 20px 60px rgba(0, 0, 0, 0.85), 0 0 30px rgba(2, 132, 199, 0.15);
  --shadow-glow: 0 0 20px rgba(56, 189, 248, 0.3);
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;
}

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

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Base Fullscreen App Container */
.site-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  z-index: 10;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ==============================================================================
   1. Slim Top Live Bar (Unified)
   ============================================================================== */

.top-live-bar {
  height: var(--topbar-height);
  background: var(--bg-topbar);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  z-index: 20;
}

.top-bar-left,
.top-bar-center,
.top-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.live-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.alpha-tag {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.live-dot-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fbbf24;
  box-shadow: 0 0 8px #fbbf24;
  animation: pulse-glow 2s infinite ease-in-out;
}

.version-tag {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--accent-cyan);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10.5px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.status-dot.healthy, .status-dot.online { background: var(--accent-green); box-shadow: 0 0 6px var(--accent-green); }
.status-dot.degraded, .status-dot.connecting { background: var(--accent-yellow); box-shadow: 0 0 6px var(--accent-yellow); }
.status-dot.offline, .status-dot.error { background: var(--accent-red); box-shadow: 0 0 6px var(--accent-red); }
.status-dot.pulse-yellow { animation: status-blink 1.2s infinite ease-in-out; }

.metric-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
}

.metric-chip strong {
  color: var(--text-main);
  font-weight: 700;
}

.metric-chip small {
  color: var(--text-dim);
}

/* ==============================================================================
   2. Clickable Serverstatus Pill & Fixed Popover (Unified)
   ============================================================================== */

.server-status-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.server-status-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.server-status-pill-btn:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.3);
}

.server-status-pill-btn[aria-expanded="true"] {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.server-status-text-wrap {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  text-align: left;
}

.status-label-top {
  font-family: var(--font-mono);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

.status-label-main {
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* Fixed Server Status Popover Dropdown (Positioned below entire header) */
.server-status-popover {
  position: fixed;
  top: calc(var(--topbar-height) + var(--navbar-height) + 10px);
  right: 24px;
  width: 330px;
  max-height: calc(100vh - var(--topbar-height) - var(--navbar-height) - 24px);
  overflow-y: auto;
  background: #080d16;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.92), 0 0 25px rgba(2, 132, 199, 0.25);
  padding: 14px;
  z-index: 60;
  animation: popover-drop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.3) transparent;
}

.server-status-popover.hidden {
  display: none !important;
}

.status-popover-header {
  margin-bottom: 8px;
}

.status-popover-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.status-popover-title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.status-popover-badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 800;
  padding: 1.5px 6px;
  border-radius: 3px;
  letter-spacing: 0.04em;
}

.status-popover-badge.online, .status-popover-badge.healthy {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.status-popover-badge.connecting, .status-popover-badge.degraded, .status-popover-badge.maintenance {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.status-popover-badge.offline, .status-popover-badge.error {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.status-popover-time {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-dim);
  display: block;
  margin-top: 2px;
}

.status-popover-summary-bar {
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  margin-top: 6px;
  margin-bottom: 8px;
  text-align: center;
}

.status-popover-summary-bar.online, .status-popover-summary-bar.healthy {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-popover-summary-bar.connecting, .status-popover-summary-bar.degraded {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.status-popover-summary-bar.offline, .status-popover-summary-bar.error {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.status-popover-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.status-popover-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  background: rgba(14, 22, 34, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
}

.status-popover-row-left {
  display: flex;
  align-items: center;
  gap: 7px;
}

.status-popover-comp-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
}

.status-popover-comp-meta {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
}

.status-popover-row-right {
  text-align: right;
}

.status-popover-comp-state {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.1;
}

.status-popover-comp-state.online, .status-popover-comp-state.healthy { color: var(--accent-green); }
.status-popover-comp-state.connecting, .status-popover-comp-state.degraded { color: var(--accent-yellow); }
.status-popover-comp-state.offline, .status-popover-comp-state.error { color: var(--accent-red); }
.status-popover-comp-state.unknown { color: var(--text-muted); }

.status-popover-comp-desc {
  font-size: 9.5px;
  color: var(--text-muted);
}

/* ==============================================================================
   3. Synchronized Clock
   ============================================================================== */

.header-clock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.header-clock .clock-icon {
  font-size: 11px;
  opacity: 0.85;
}

.header-clock .clock-val {
  font-weight: 600;
  letter-spacing: 0.02em;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

/* ==============================================================================
   4. Main Navigation Header (Unified)
   ============================================================================== */

.main-navbar {
  height: var(--navbar-height);
  background: var(--bg-navbar);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 30;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-badge {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: 1px solid var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.4);
}

.brand-title-wrap {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.1;
}

.brand-bold {
  color: var(--accent-cyan);
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  color: var(--text-muted);
}

/* Navigation Links (New list: START, DAS SPIEL, LIVE-WELT, ENTWICKLUNG, SPIELINSTANZEN) */
.navbar-menu {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-item {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.nav-item:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
}

/* Header Right CTA Action Button */
.navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-action-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: 1px solid rgba(56, 189, 248, 0.6);
  color: #ffffff;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-decoration: none;
  box-shadow: 0 0 18px rgba(2, 132, 199, 0.45);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.nav-action-btn:hover {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  border-color: #38bdf8;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.6);
  transform: translateY(-1px);
}

.nav-action-btn .btn-arrow {
  transition: transform 0.2s ease;
}

.nav-action-btn:hover .btn-arrow {
  transform: translateX(3px);
}

.hamburger-btn {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-direction: column;
  gap: 4px;
}

.hamburger-btn span {
  width: 22px;
  height: 2px;
  background: var(--text-main);
  border-radius: 2px;
  transition: all 0.2s ease;
}

/* ==============================================================================
   5. Shared Keyframe Animations & Responsive Breakpoints
   ============================================================================== */

@keyframes pulse-glow {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.6; }
}

@keyframes status-blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.9); }
}

@keyframes overlay-drop {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes popover-drop {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Tablet (<= 1024px) */
@media (max-width: 1024px) {
  .top-bar-center {
    display: none;
  }
  .navbar-menu {
    gap: 2px;
  }
  .nav-item {
    font-size: 11.5px;
    padding: 6px 10px;
  }
}

/* Mobile (<= 768px) */
@media (max-width: 768px) {
  :root {
    --navbar-height: 56px;
  }
  .top-live-bar {
    padding: 0 12px;
  }
  .main-navbar {
    padding: 0 12px;
  }
  .brand-sub {
    display: none;
  }
  .navbar-menu {
    position: fixed;
    top: calc(var(--topbar-height) + var(--navbar-height));
    left: 0;
    right: 0;
    background: var(--bg-overlay);
    border-bottom: 1px solid var(--border-subtle);
    flex-direction: column;
    padding: 12px;
    gap: 4px;
    display: none;
    z-index: 50;
  }
  .navbar-menu.mobile-open {
    display: flex;
  }
  .nav-item {
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    font-size: 13px;
  }
  .hamburger-btn {
    display: flex;
  }
  .server-status-popover {
    top: calc(var(--topbar-height) + var(--navbar-height) + 8px);
    left: 12px;
    right: 12px;
    width: auto;
    max-width: calc(100vw - 24px);
  }
}
