/* Comsicare-Networks design language — tokens and components taken from the homepage rework
   (theme.json palette, comsicare-motion.css background/pulse/halo, status-display cards). */

@font-face { font-family: 'DM Mono'; src: url('/fonts/DMMono-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'DM Mono'; src: url('/fonts/DMMono-Medium.ttf') format('truetype'); font-weight: 500 600; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/fonts/jetbrains-mono-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/fonts/jetbrains-mono-500.woff2') format('woff2'); font-weight: 500 600; font-display: swap; }
@font-face { font-family: 'uni 05_53'; src: url('/fonts/uni05_53.ttf') format('truetype'); font-display: swap; }

:root {
  --bg: #120a1f;
  --fg: #f1e9ff;
  --primary: #c084fc;
  --magenta: #ff2fb0;
  --cyan: #2fe6ff;
  --tertiary: #3a2158;
  --tertiary-border: #2d1f45;
  --card: #1c1130;
  --success: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --muted: #64748b;
  --shadow: 0 4px 16px rgba(0, 0, 0, .35);
  --font-ui: 'DM Mono', ui-monospace, Menlo, Consolas, monospace;
  --font-body: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --font-pixel: 'uni 05_53', 'DM Mono', monospace;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font: 400 15px/1.7 var(--font-body);
  display: flex;
  flex-direction: column;
}
a { color: inherit; }
.muted { color: rgba(241, 233, 255, .55); font-size: 12px; }

/* ---------- background (blobs + grain) ---------- */
@keyframes cw-blob-a { 0% { transform: translate(0, 0) scale(1); } 20% { transform: translate(180px, 60px) scale(1.2); } 45% { transform: translate(220px, 200px) scale(1.4); } 70% { transform: translate(60px, 240px) scale(1.15); } 100% { transform: translate(0, 0) scale(1); } }
@keyframes cw-blob-b { 0% { transform: translate(0, 0) scale(1); } 25% { transform: translate(-160px, -80px) scale(1.3); } 55% { transform: translate(-240px, -180px) scale(1.1); } 80% { transform: translate(-80px, -220px) scale(1.35); } 100% { transform: translate(0, 0) scale(1); } }
@keyframes cw-blob-c { 0% { transform: translate(0, 0) scale(1); } 30% { transform: translate(-140px, 100px) scale(1.25); } 60% { transform: translate(-60px, 220px) scale(1.05); } 85% { transform: translate(120px, 140px) scale(1.3); } 100% { transform: translate(0, 0) scale(1); } }
@keyframes cw-blob-d { 0% { transform: translate(0, 0) scale(1); } 35% { transform: translate(130px, -90px) scale(1.15); } 65% { transform: translate(200px, -30px) scale(1.35); } 90% { transform: translate(40px, -160px) scale(1.1); } 100% { transform: translate(0, 0) scale(1); } }
.cw-page-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.cw-blob1, .cw-blob2, .cw-blob3, .cw-blob4 { position: absolute; border-radius: 50%; filter: blur(40px); }
.cw-blob1 { width: 420px; height: 420px; left: 6%; top: -140px; background: radial-gradient(circle, rgba(192, 132, 252, .28) 0%, rgba(192, 132, 252, .12) 40%, transparent 70%); animation: cw-blob-a 16s ease-in-out infinite; }
.cw-blob2 { width: 380px; height: 380px; right: 22%; bottom: -160px; background: radial-gradient(circle, rgba(255, 47, 176, .25) 0%, rgba(255, 47, 176, .1) 40%, transparent 70%); animation: cw-blob-b 19s ease-in-out infinite; }
.cw-blob3 { width: 320px; height: 320px; left: 58%; top: -110px; background: radial-gradient(circle, rgba(47, 230, 255, .2) 0%, rgba(47, 230, 255, .08) 40%, transparent 70%); animation: cw-blob-c 22s ease-in-out infinite; }
.cw-blob4 { width: 360px; height: 360px; left: 32%; bottom: -180px; background: radial-gradient(circle, rgba(192, 132, 252, .22) 0%, rgba(192, 132, 252, .09) 40%, transparent 70%); animation: cw-blob-d 17s ease-in-out infinite; }
.cw-grain { position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px); background-size: 3px 3px; }

@keyframes cw-pulse { 0%, 100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.4); opacity: 1; } }
.cw-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: cw-pulse 1.8s ease-in-out infinite; }

.cw-cursor-halo { position: fixed; top: 0; left: 0; width: 180px; height: 180px; margin: -90px 0 0 -90px; border-radius: 50%; background: radial-gradient(circle, rgba(192, 132, 252, .22) 0%, rgba(255, 47, 176, .1) 45%, transparent 70%); filter: blur(20px); mix-blend-mode: screen; pointer-events: none; z-index: 9999; transform: translate3d(var(--cw-halo-x, -400px), var(--cw-halo-y, -400px), 0); opacity: 0; transition: opacity .4s ease; }
.cw-cursor-halo.is-active { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .cw-blob1, .cw-blob2, .cw-blob3, .cw-blob4, .cw-dot { animation: none; }
  .cw-cursor-halo { display: none; }
  .card { transition: none; }
}

/* ---------- live widget (floats top right, no header bar) / footer ---------- */
/* Right-hand column next to hero + servers; sticks while scrolling past them. */
.top-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.top-main { min-width: 0; }
.live-widget {
  position: sticky; top: 20px; margin-top: 24px;
  display: flex; flex-direction: column; align-items: stretch; gap: 10px;
}
.live-count {
  align-self: flex-end;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  background: rgba(28, 17, 48, .85);
  border: 1px solid var(--tertiary);
  box-shadow: var(--shadow);
  font: 500 12px/1 var(--font-ui); color: var(--fg);
}
.player-panel {
  width: 100%;
  background: rgba(28, 17, 48, .9);
  border: 1px solid var(--tertiary);
  box-shadow: var(--shadow);
}
.player-list { list-style: none; margin: 0; padding: 6px 0; max-height: 48vh; overflow-y: auto; }
.player-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 6px 14px; font: 400 13px/1.4 var(--font-body); }
.player-list li + li { border-top: 1px solid var(--tertiary-border); }
.player-list .pname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.player-list .pmap { flex-shrink: 0; font: 500 10px/1.4 var(--font-ui); text-transform: uppercase; letter-spacing: .04em; color: var(--cyan); }
.player-list .pempty { color: rgba(241, 233, 255, .55); font-size: 12px; }
.player-list .pmore .pname { color: rgba(241, 233, 255, .6); font-style: italic; }

.site-footer {
  margin-top: auto;
  display: flex; justify-content: space-between; gap: 16px;
  padding: 24px 40px;
  border-top: 1px solid var(--tertiary-border);
  font: 400 12px/1.4 var(--font-ui);
  color: rgba(241, 233, 255, .7);
}

/* ---------- page ---------- */
.page { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 40px 72px; }
.hero { padding: 80px 0 8px; }
.eyebrow { margin: 0 0 14px; font: 400 11px/1 var(--font-ui); color: var(--cyan); }
.hero h1 { margin: 0; font: 600 44px/1.35 var(--font-ui); text-transform: uppercase; letter-spacing: .02em; }
.bracket { color: var(--primary); }

.block { margin-top: 40px; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-title {
  margin: 0 0 16px;
  font: 600 14px/1.4 var(--font-ui);
  text-transform: uppercase; letter-spacing: .06em;
  border-left: 4px solid var(--magenta);
  padding-left: 10px;
}
.block-head .section-title { margin-bottom: 0; }

.banner {
  margin-bottom: 18px;
  border-left: 4px solid var(--magenta);
  background: rgba(255, 47, 176, .08);
  padding: 14px 18px;
  font-size: 13px;
}

/* ---------- cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--tertiary);
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(192, 132, 252, .25); border-color: var(--primary); }
.titlebar { display: flex; align-items: center; gap: 5px; padding: 10px 14px; border-bottom: 1px solid var(--tertiary); }
.titlebar i { width: 6px; height: 6px; display: block; }
.titlebar i:nth-child(1) { background: #f87171; }
.titlebar i:nth-child(2) { background: #fbbf24; }
.titlebar i:nth-child(3) { background: #34d399; }
.titlebar-label { margin-left: 10px; font: 500 11px/1 var(--font-ui); text-transform: uppercase; letter-spacing: .06em; color: var(--cyan); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.server-card .body { display: flex; flex-direction: column; gap: 14px; padding: 20px 22px 22px; }
.server-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.server-name { margin: 0; font: 600 16px/1.3 var(--font-ui); text-transform: uppercase; letter-spacing: .02em; }
.server-map { margin: 2px 0 0; font: 400 11px/1.4 var(--font-ui); color: var(--cyan); }
.chip {
  font: 600 10px/1 var(--font-ui); letter-spacing: .04em; text-transform: uppercase;
  padding: 5px 7px; color: var(--magenta); background: rgba(255, 47, 176, .12); white-space: nowrap;
}
.status { display: flex; align-items: center; gap: 9px; font: 500 13px/1.3 var(--font-ui); }
.status .cw-dot { width: 8px; height: 8px; flex-shrink: 0; }
.status[data-state="online"] .cw-dot { background: var(--success); }
.status[data-state="starting"] .cw-dot { background: var(--warn); }
.status[data-state="unresponsive"] .cw-dot { background: var(--danger); }
.status[data-state="offline"] .cw-dot, .status[data-state="unknown"] .cw-dot { background: var(--muted); animation: none; }
.status[data-state="online"] .state-text { color: var(--success); }
.status[data-state="starting"] .state-text { color: var(--warn); }
.status[data-state="unresponsive"] .state-text { color: var(--danger); }
.status .uptime { color: rgba(241, 233, 255, .6); font-weight: 400; }

.players { display: flex; align-items: baseline; gap: 10px; }
.players-count { font: 600 30px/1 var(--font-ui); }
.players-label { font: 400 11px/1 var(--font-ui); text-transform: uppercase; letter-spacing: .06em; color: rgba(241, 233, 255, .55); }

.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  appearance: none; cursor: pointer; text-decoration: none; text-align: center;
  font: 600 12px/1 var(--font-ui); text-transform: uppercase; letter-spacing: .04em;
  padding: 11px 16px; border: 1px solid var(--primary);
  background: var(--primary); color: var(--bg);
  transition: box-shadow .2s ease, border-color .2s ease, background .2s ease;
}
.btn:hover { box-shadow: 0 0 14px rgba(192, 132, 252, .5); }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--tertiary); }
.btn.ghost:hover { border-color: var(--primary); box-shadow: none; }
.btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.btn[aria-disabled="true"] { opacity: .35; pointer-events: none; }
.address { font: 400 11px/1.4 var(--font-ui); color: rgba(241, 233, 255, .55); word-break: break-all; }

/* ---------- charts ---------- */
.range-toggle { display: flex; gap: 6px; }
.range-btn {
  appearance: none; cursor: pointer; background: transparent; color: var(--fg);
  border: 1px solid var(--tertiary); padding: 7px 12px; font: 500 11px/1 var(--font-ui); text-transform: uppercase; letter-spacing: .04em;
}
.range-btn:hover { border-color: var(--primary); }
.range-btn.is-active { background: rgba(192, 132, 252, .18); border-color: var(--primary); color: var(--primary); }
.range-btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
#usage-note { margin: 12px 0 18px; }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.chart-card { margin: 0; }
.chart-card:hover { transform: none; }
.chart-wrap { position: relative; height: 320px; padding: 14px 16px 12px; }
