/* =========================================
   skate3rpcs3serverstats - public/style.css
   ========================================= */

:root {
  --bg1: #070b14;
  --bg2: #0b1630;

  --panel: rgba(18, 26, 42, 0.92);
  --panel2: rgba(14, 26, 42, 0.92);

  --text: #e6edf3;
  --muted: #9fb2c3;

  --accent: #4ea1ff;
  --accent2: #7c5cff;

  --ok: #22c55e;   /* green */
  --err: #ef4444;  /* red */
  --warn: #eab308; /* yellow */

  --border: rgba(36, 50, 68, 0.95);
  --borderSoft: rgba(36, 50, 68, 0.65);
  --shadow: 0 18px 50px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 20% 0%, rgba(78,161,255,0.14), transparent 60%),
    radial-gradient(900px 600px at 100% 20%, rgba(124,92,255,0.12), transparent 55%),
    linear-gradient(135deg, var(--bg1), var(--bg2));
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, "Helvetica Neue", Arial, "Noto Sans",
               "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
}

/* ---------- Header / Footer ---------- */

header, footer {
  text-align: center;
  padding: 26px 16px;
}

header h1 {
  margin: 0 0 6px;
  font-weight: 900;
  letter-spacing: 0.2px;
}

.subtitle { color: var(--muted); margin: 0; }
small { color: var(--muted); }

/* ---------- Layout ---------- */

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px 44px;
  display: grid;
  gap: 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-header h2 { margin: 0; }

.controls { display: flex; align-items: center; gap: 10px; }

/* ---------- Links & text ---------- */

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--muted); }
.smallprint { font-size: 12px; line-height: 1.5; }

/* ---------- IP badge ---------- */

.badge {
  display: inline-block;
  padding: 2px 10px;
  margin-left: 6px;
  border-radius: 10px;
  border: 1px solid var(--borderSoft);
  background: rgba(12, 26, 43, 0.75);
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.92em;
}

/* ---------- Buttons ---------- */

.btn, button {
  background: linear-gradient(135deg, var(--accent), rgba(78,161,255,0.85));
  color: #07111f;
  border: none;
  border-radius: 12px;
  padding: 9px 12px;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: 0.1px;
  box-shadow: 0 10px 24px rgba(78,161,255,0.18);
}

.btn:hover, button:hover { filter: brightness(1.06); }

.btn:disabled, button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: rgba(15, 34, 54, 0.8);
  color: var(--text);
  border: 1px solid var(--borderSoft);
  box-shadow: none;
}

.btn-ghost {
  background: rgba(15, 34, 54, 0.55);
  color: var(--text);
  border: 1px solid rgba(36, 50, 68, 0.55);
  box-shadow: none;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.14);
  color: #ffb4b4;
  border: 1px solid rgba(239, 68, 68, 0.25);
  box-shadow: none;
}

/* ---------- Status line ---------- */

.statusline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sep { opacity: 0.6; }

.dot {
  width: 10px; height: 10px;
  border-radius: 999px;
  background: var(--ok);
  display: inline-block;
  box-shadow: 0 0 12px rgba(34,197,94,0.55);
}
.dot.off { background: var(--err); box-shadow: none; }

/* ---------- Counters ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.stat-card {
  background: rgba(11, 20, 34, 0.75);
  border: 1px solid rgba(36, 50, 68, 0.75);
  border-radius: 14px;
  padding: 14px;
}

.stat-title { color: var(--muted); font-size: 13px; font-weight: 800; }
.stat-value { font-size: 30px; font-weight: 950; margin-top: 6px; }

/* ---------- Error banner ---------- */

.error {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.14);
  color: #ffb4b4;
}

/* ---------- Filters summary (always visible) ---------- */

.filters-summary {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(36, 50, 68, 0.65);
  border-radius: 16px;
  background: rgba(11, 20, 34, 0.55);
}

.filters-summary-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.filters-summary-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- Active filter chips (always visible) ---------- */

.chips-wrap {
  width: 100%;
  display: grid;
  gap: 8px;
}

.chips-title {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14px;
  text-transform: uppercase;
  opacity: 0.9;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(36, 50, 68, 0.7);
  background: rgba(11, 20, 34, 0.72);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  user-select: none;
}

.chip--muted {
  color: var(--muted);
  font-weight: 900;
}

.chip--accent {
  border-color: rgba(78, 161, 255, 0.35);
  background: rgba(78, 161, 255, 0.10);
}

.chip--warn {
  border-color: rgba(234, 179, 8, 0.35);
  background: rgba(234, 179, 8, 0.10);
  color: #ffe08a;
}

.chip--danger {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.10);
  color: #ffb4b4;
}

.chip button {
  appearance: none;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  margin: 0;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-weight: 950;
  line-height: 1;
  opacity: 0.9;
}

.chip button:hover {
  background: rgba(255, 255, 255, 0.10);
  opacity: 1;
}

/* ---------- Collapsible filters panel ---------- */

.filters {
  margin-top: 12px;
  display: grid;
  gap: 14px;
}

.filters.collapsed {
  display: none;
}

.filters-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.filters-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* three columns side-by-side */
.filters-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.filter-group {
  background: var(--panel2);
  border: 1px solid rgba(36, 50, 68, 0.75);
  border-radius: 16px;
  padding: 12px;
}

.filter-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(36, 50, 68, 0.45);
}

.filter-group-header h3 {
  margin: 0;
  font-size: 14px;
  color: var(--text);
  font-weight: 950;
  letter-spacing: 0.15px;
}

.filter-group-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(36, 50, 68, 0.6);
  background: rgba(11, 20, 34, 0.55);
  font-size: 12px;
}

.filter-list {
  display: grid;
  gap: 8px;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(36, 50, 68, 0.65);
  border-radius: 14px;
  background: rgba(11, 20, 34, 0.62);
  cursor: pointer;
  user-select: none;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.checkline:hover {
  transform: translateY(-1px);
  border-color: rgba(78,161,255,0.35);
  background: rgba(11, 20, 34, 0.75);
}

.checkline input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.checkline--wide { padding: 12px; }

.filters-footer {
  display: grid;
  gap: 10px;
}

/* ---------- Lobbies title row ---------- */

.lobbies-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---------- Lobby list ---------- */

.lob-list { display: grid; gap: 12px; }

.lob {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 12px;
  border: 1px solid rgba(36, 50, 68, 0.75);
  border-radius: 16px;
  background: rgba(14, 26, 42, 0.88);
  animation: rise 260ms ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.lob h3 { margin: 0 0 8px; font-weight: 950; }

.tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tags > div {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  background: rgba(11, 20, 34, 0.65);
  border: 1px solid rgba(36, 50, 68, 0.65);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--text);
}

.tags span {
  display: inline-block;
  color: var(--muted);
  font-size: 12px;
  border-right: 1px solid rgba(36, 50, 68, 0.65);
  padding-right: 6px;
  margin-right: 6px;
}

/* Status pill: mapping requested
   Pre-Game => GREEN, In Game => RED, other => YELLOW */
.status-tag {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(36, 50, 68, 0.65);
  font-weight: 950;
  font-size: 12px;
  line-height: 1;
  background: rgba(11, 20, 34, 0.65);
  color: var(--text);
}

.status-tag.pre { background: rgba(34, 197, 94, 0.14); color: var(--ok); }
.status-tag.in  { background: rgba(239, 68, 68, 0.14); color: var(--err); }
.status-tag.other { background: rgba(234, 179, 8, 0.14); color: var(--warn); }

/* Pills & progress */
.pill {
  display: inline-block;
  background: rgba(11, 20, 34, 0.65);
  color: var(--text);
  border: 1px solid rgba(36, 50, 68, 0.75);
  border-radius: 999px;
  padding: 5px 11px;
  text-align: center;
  margin-bottom: 8px;
  font-weight: 900;
}

.pill--soft {
  background: rgba(159, 178, 195, 0.10);
  border-color: rgba(36, 50, 68, 0.65);
  color: var(--muted);
}

.pbar {
  width: 160px;
  height: 8px;
  background: rgba(11, 20, 34, 0.60);
  border: 1px solid rgba(36, 50, 68, 0.75);
  border-radius: 999px;
  overflow: hidden;
}

.pfill {
  height: 100%;
  background: linear-gradient(90deg, rgba(34,197,94,0.95), rgba(78,161,255,0.95));
}

/* Players row under Mode/Difficulty */
.players-line {
  margin-top: 10px;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid rgba(36, 50, 68, 0.65);
  background: rgba(11, 20, 34, 0.55);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

/* "Players" label */
.players-label {
  display: inline-block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12px;
  text-transform: uppercase;
  padding-top: 2px;
  white-space: nowrap;
}

/* Container for player pills */
.players-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Player pill */
.player-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(36, 50, 68, 0.65);
  background: rgba(11, 20, 34, 0.75);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  max-width: 100%;
  word-break: break-word;
}

.empty {
  background: rgba(11, 20, 34, 0.65);
  border: 1px solid rgba(36, 50, 68, 0.75);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  color: var(--muted);
}

/* Credits */
.credits {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}
.credits li { color: var(--text); }

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .filters-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .stats { grid-template-columns: 1fr; }
  .filters-groups { grid-template-columns: 1fr; }
  .pbar { width: 100%; }
  .lob { grid-template-columns: 1fr; }
}