:root {
  --bg: #020617;
  --text: #e5e7eb;
  --muted: #9ca3af;

  --java-color: #22c55e;
  --java-glow: rgba(34, 197, 94, 0.55);

  --bedrock-color: #38bdf8;
  --bedrock-glow: rgba(56, 189, 248, 0.55);

  --offline: #f97373;

  --border: #1f2937;
  --card-bg: #020617;

  --radius-card: 16px;
  --radius-inner: 12px;

  --shadow-strong: 0 18px 45px rgba(15, 23, 42, 0.9);
  --shadow-soft: 0 10px 25px rgba(15, 23, 42, 0.7);

  --transition-fast: 0.15s ease-out;
  --transition-slow: 0.3s ease-out;
}

/* Base */

html, body {
  margin: 0;
  padding: 0;

  /* Background image + dark overlay */
  background:
    linear-gradient(rgba(2, 6, 23, 0.75), rgba(2, 6, 23, 0.85)),
    url("background.jpg") center/cover no-repeat fixed;

  color: var(--text);
  font-family: system-ui, sans-serif;
}

.page {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

/* Top bar */

.header-logo {
  height: 100px;
  width: auto;
  border-radius: 8px;
  margin-right: 14px;
  object-fit: contain;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 16px 18px;
  margin-bottom: 24px;

  background: radial-gradient(circle at top left, #0b1120, #020617);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-strong);
}

.subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.top-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.global-info {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Buttons */

.btn {
  border: none;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition-fast),
              box-shadow var(--transition-fast),
              background var(--transition-fast),
              color var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #022c22;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.6);
}

.btn-primary.off {
  background: #111827;
  color: var(--muted);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn-small {
  background: #020617;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 4px 10px;
  font-size: 0.8rem;
}

.btn:hover:not(.off) {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.7);
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Server grid */

.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 20px;
}

/* Server card */

.server-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--transition-slow), transform var(--transition-fast);
}

/* subtle hover glow */
.server-card:hover {
  box-shadow: 0 0 28px rgba(56, 189, 248, 0.18);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 10px;
}

.server-header-left {
  display: flex;
  gap: 10px;
  align-items: center;
}

.server-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: radial-gradient(circle at top, #020617, #020617);
  flex-shrink: 0;
}

.server-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.server-title {
  margin: 0;
  font-size: 1.1rem;
}

.server-title span {
  color: var(--muted);
  font-weight: 400;
}

.server-host {
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.server-host:hover {
  color: #93c5fd;
}

.copy-hint {
  font-size: 0.7rem;
  color: #64748b;
}

.card-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.timestamp {
  font-size: 0.75rem;
  color: var(--muted);
}

/* Edition grid */

.edition-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Edition card */

.edition-card {
  background: #020617;
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow var(--transition-slow), border-color var(--transition-slow), transform var(--transition-fast);
}

/* Glow states */

.edition-card.online-java {
  border-color: var(--java-color);
  box-shadow: 0 0 18px var(--java-glow);
}

.edition-card.online-bedrock {
  border-color: var(--bedrock-color);
  box-shadow: 0 0 18px var(--bedrock-glow);
}

.edition-card.offline {
  border-color: var(--border);
  box-shadow: none;
}

/* Edition header */

.edition-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.edition-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}

.edition-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.java-dot {
  background: var(--java-color);
  box-shadow: 0 0 8px var(--java-glow);
}

.bedrock-dot {
  background: var(--bedrock-color);
  box-shadow: 0 0 8px var(--bedrock-glow);
}

/* Badges */

.badges {
  display: flex;
  gap: 4px;
}

.badge {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #020617;
  color: var(--text);
}

/* Edition main */

.edition-main {
  display: flex;
  gap: 10px;
}

.icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Status, details */

.status-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-text.offline {
  color: var(--offline);
}

/* Slide-down details */

.details-toggle {
  margin-top: 4px;
  padding: 3px 10px;
  font-size: 0.78rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #020617;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.details-toggle:hover {
  color: #e5e7eb;
  border-color: #334155;
}

.details-arrow {
  font-size: 0.7rem;
}

.details-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease-out, opacity 0.25s ease-out;
  opacity: 0;
  margin-top: 4px;
}

.details-panel.open {
  opacity: 1;
  max-height: 200px;
}

.motd {
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 4px;
}

.players {
  font-size: 0.78rem;
  color: var(--muted);
}

/* Players inner */

.players-header {
  display: flex;
  justify-content: space-between;
}

.players-toggle {
  color: #93c5fd;
  cursor: pointer;
  font-size: 0.75rem;
}

.players-list {
  display: none;
  margin-top: 4px;
  flex-wrap: wrap;
  gap: 4px;
}

.players-list span {
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

/* Spinner */

.spinner {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid #1f2937;
  border-top-color: #e5e7eb;
  animation: spin 0.7s linear infinite;
  display: none;
}

.global-spinner {
  width: 14px;
  height: 14px;
}

.tiny-spinner {
  width: 10px;
  height: 10px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Graphs */

canvas {
  width: 100%;
  display: block;
}

/* Ripple */

.ripple {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.35), transparent 60%);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(3.5);
    opacity: 0;
  }
}

/* Responsive */

@media (max-width: 768px) {
  .top-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .server-grid {
    grid-template-columns: 1fr;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .card-header-right {
    align-items: flex-start;
  }
}

/* Footer container */
.footer {
  margin-top: 40px;
  text-align: center;
  padding: 20px 0;
}

/* Neon Discord button */
.discord-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  background: #5865F2;
  border-radius: 999px;
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;

  /* Neon glow */
  box-shadow: 0 0 14px rgba(88, 101, 242, 0.7),
              0 0 28px rgba(88, 101, 242, 0.4);

  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Hover glow boost */
.discord-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(88, 101, 242, 1),
              0 0 40px rgba(88, 101, 242, 0.7);
}

/* Neon Discord icon */
.discord-icon-neon {
  height: 22px;
  width: auto;
  filter: drop-shadow(0 0 6px rgba(88, 101, 242, 0.9));
  opacity: 0.95;
  transition: opacity 0.2s ease;
}

.discord-button:hover .discord-icon-neon {
  opacity: 1;
}

/* Ripple effect for footer button */
.ripple-target {
  position: relative;
  overflow: hidden;
}

.discord-icon-neon {
  height: 22px;
  width: auto;
  opacity: 0.95;

  /* Neon glow */
  filter:
    drop-shadow(0 0 6px rgba(56, 189, 248, 0.9))
    drop-shadow(0 0 12px rgba(56, 189, 248, 0.6));

  transition: opacity 0.2s ease, transform 0.2s ease;
}

.discord-button:hover .discord-icon-neon {
  opacity: 1;
  transform: scale(1.05);
}
