:root {
  --bg: #0f1117;
  --surface: #1a1d26;
  --border: #2d3148;
  --accent: #5d6aff;
  --accent-light: #818cf8;
  --text: #e2e8f0;
  --text-muted: #8892aa;
  --green: #34d399;
  --red: #f87171;
  --yellow: #fbbf24;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --radius: 8px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Header ---- */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--accent-light);
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.online  { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot.offline { background: var(--text-muted); }

/* ---- Main ---- */
main {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px;
  width: 100%;
}

/* ---- Hero ---- */
.hero {
  text-align: center;
  padding: 60px 20px;
}

.hero h1 {
  font-size: 28px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.hero p {
  color: var(--text-muted);
  margin-bottom: 12px;
}

.hero pre {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 24px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text);
  margin: 8px 0 20px;
}

.hl { color: var(--accent-light); }
.hint { font-size: 13px; }

/* ---- Tunnels Table ---- */
#tunnels-section h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

thead th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(93,106,255,0.05); }
tbody tr.new-row { animation: fadeIn 0.4s ease; }

td {
  padding: 14px 16px;
  font-size: 14px;
  vertical-align: middle;
}

td a {
  color: var(--accent-light);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 13px;
}
td a:hover { text-decoration: underline; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(52,211,153,0.15);
  color: var(--green);
  border: 1px solid rgba(52,211,153,0.3);
}

.text-muted { color: var(--text-muted); font-size: 13px; }

/* ---- Usage Section ---- */
.usage {
  margin-top: 56px;
}

.usage h2 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.usage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.usage-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.usage-card h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.usage-card pre {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
}

/* ---- Footer ---- */
footer {
  padding: 16px 32px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
footer a { color: var(--accent-light); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ---- Animations ---- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  header { padding: 12px 16px; }
  main   { padding: 24px 16px; }
  table  { font-size: 13px; }
  td, thead th { padding: 10px 12px; }
  .usage-grid { grid-template-columns: 1fr; }
}
