:root {
  --bg: #0a0a0a;
  --text: #f2f2f2;
  --muted: #9a9a9a;
  --card-bg: #141414;
  --card-border: #262626;
  --btn-border: #333;
  --btn-hover: #1f1f1f;
  --footer-border: #1f1f1f;
  --footer-text: #777;
}
[data-theme="light"] {
  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #666;
  --card-bg: #ffffff;
  --card-border: #e6e6e6;
  --btn-border: #d9d9d9;
  --btn-hover: #f5f5f5;
  --footer-border: #eee;
  --footer-text: #999;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  transition: background 0.3s ease, color 0.3s ease;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  display: block;
  pointer-events: none;
}

#fluid-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  display: none;
  pointer-events: none;
}

#hexagon-canvas,
#matrix-canvas,
#aurora-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  display: none;
  pointer-events: none;
}

.wrap { max-width: 900px; margin: 0 auto; padding: 0 20px; }

header { text-align: center; padding: 64px 0 40px; }
header img { width: 96px; height: 96px; border-radius: 10px; }
header h1 { font-size: 28px; font-weight: 600; margin: 16px 0 6px; }
header p { margin: 0; color: var(--muted); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  padding-bottom: 64px;
}

.card {
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 24px 20px;
  text-align: center;
  background: var(--card-bg);
  transition: background 0.3s ease, border-color 0.3s ease;
}
.card img { width: 64px; height: 64px; border-radius: 10px; }
.card h2 { font-size: 17px; font-weight: 600; margin: 14px 0 6px; }
.card p { font-size: 14px; color: var(--muted); margin: 0 0 16px; }
.card .links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.card a {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid var(--btn-border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  background: var(--card-bg);
  transition: background 0.2s ease;
}
.card a:hover { background: var(--btn-hover); }

/* Service ping status dot */
.ping-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  background: #888; /* checking / unknown */
}
.ping-dot.online { background: #22c55e; box-shadow: 0 0 6px rgba(34, 197, 94, 0.6); }
.ping-dot.offline { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.6); }

footer {
  border-top: 1px solid var(--footer-border);
  padding: 24px 0 40px;
  text-align: center;
  font-size: 13px;
  color: var(--footer-text);
}
footer a { color: var(--text); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* Theme toggle */
#theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
#theme-toggle:hover { background: var(--btn-hover); }
#theme-toggle .icon-moon { display: none; }
[data-theme="light"] #theme-toggle .icon-sun { display: none; }
[data-theme="light"] #theme-toggle .icon-moon { display: block; }

/* FX settings panel (subtle toggle + side card) */
#fx-toggle {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 0.35;
  transition: opacity 0.2s ease, background 0.3s ease, border-color 0.3s ease;
}
#fx-toggle:hover { opacity: 1; background: var(--btn-hover); }

#fx-panel {
  position: fixed;
  right: 16px;
  bottom: 64px;
  width: 240px;
  padding: 14px 16px;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--text);
  z-index: 10;
  transform: translateX(calc(100% + 16px));
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
#fx-panel.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}
.fx-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.fx-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.fx-mode { margin-bottom: 12px; }
.fx-mode > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.fx-mode-btns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.fx-mode-btns button {
  padding: 5px 0;
  border: 1px solid var(--btn-border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.fx-mode-btns button:hover { background: var(--btn-hover); }
.fx-mode-btns button.active {
  background: var(--btn-hover);
  border-color: var(--text);
}
#fx-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
}
#fx-close:hover { color: var(--text); }
.fx-row {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--muted);
}
.fx-row span { display: flex; justify-content: space-between; margin-bottom: 4px; }
.fx-row output { color: var(--text); font-variant-numeric: tabular-nums; }
.fx-row input[type="range"] { width: 100%; accent-color: var(--text); }
.fx-row.fx-check { display: flex; align-items: center; justify-content: space-between; }
.fx-row.fx-check span { margin-bottom: 0; }
.fx-row.fx-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--text);
  cursor: pointer;
}
.fx-row.fx-check input[type="color"] {
  width: 44px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--btn-border);
  border-radius: 6px;
  background: none;
  cursor: pointer;
}
.fx-group { margin-bottom: 4px; }
#fx-reset {
  width: 100%;
  margin-top: 4px;
  padding: 6px 0;
  border: 1px solid var(--btn-border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}
#fx-reset:hover { background: var(--btn-hover); }