/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0d1117;
  --surface:     #161b22;
  --surface2:    #21262d;
  --border:      #30363d;
  --text:        #e6edf3;
  --text-muted:  #8b949e;
  --accent:      #58a6ff;
  --accent-dark: #1f6feb;
  --google:      #ffffff;
  --google-dark: #e6ecf2;
  --patreon:     #ff424d;
  --patreon-dark:#e0363f;
  --success:     #3fb950;
  --warn-bg:     #1c1a14;
  --warn-border: #bb8009;
  --error-bg:    #1c1215;
  --error-border:#f85149;
  --radius:      10px;
  --shadow:      0 4px 24px rgba(0,0,0,0.5);
}

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ───────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
  box-sizing: border-box;
}

/* Narrow container for portal/flasher pages */
.container-narrow {
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}

/* ── Header ───────────────────────────────────────────────── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.logo-icon { font-size: 1.5rem; }
.logo strong { color: var(--accent); }

nav { display: flex; align-items: center; gap: 0.75rem; }
.nav-user { color: var(--text-muted); font-size: 0.9rem; }

/* ── Hero ─────────────────────────────────────────────────── */
.hero { text-align: center; margin-bottom: 2.5rem; }
.hero h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; }
.hero .subtitle {
  margin-top: 0.75rem;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.card-center { text-align: center; }

.card h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.card p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  font-size: 0.97rem;
}

.card-warn {
  border-color: var(--warn-border);
  background: var(--warn-bg);
}

.status-icon { font-size: 2.5rem; margin-bottom: 1rem; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, background 0.15s;
  text-decoration: none;
}
.btn:hover { opacity: 0.88; }
.btn:active { opacity: 0.75; }

.btn-primary {
  background: var(--accent-dark);
  color: #fff;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.8rem;
  font-size: 1rem;
}

.btn-patreon {
  background: var(--patreon);
  color: #fff;
  margin: 0.5rem auto;
}
.btn-patreon:hover { background: var(--patreon-dark); opacity: 1; }

.btn-google {
  background: var(--google);
  color: #1f1f1f;
  border: 1px solid #c7d1db;
  margin: 0.5rem auto;
}
.btn-google:hover { background: var(--google-dark); opacity: 1; }

.btn-success {
  background: var(--success);
  color: #08150b;
}
.btn-success:hover { background: #2ea043; opacity: 1; }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--surface2); opacity: 1; }

.btn-copy {
  margin-top: 1rem;
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Patreon SVG icon */
.patreon-icon { width: 18px; height: 18px; flex-shrink: 0; }

/* ── Form ─────────────────────────────────────────────────── */
.form-group { margin: 1.5rem 0 1rem; }

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 1rem;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  transition: border-color 0.15s;
  outline: none;
}

.form-group input:focus { border-color: var(--accent); }
.form-group input::placeholder { color: var(--text-muted); font-family: inherit; }

.portal-or {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  margin: 0.75rem 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.field-hint {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* ── Access badge ─────────────────────────────────────────── */
.access-badge {
  display: inline-block;
  background: rgba(63, 185, 80, 0.12);
  color: var(--success);
  border: 1px solid rgba(63, 185, 80, 0.3);
  border-radius: 20px;
  padding: 0.25rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.access-reason {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: -0.75rem;
  margin-bottom: 1.25rem;
}

/* ── Server table ─────────────────────────────────────────── */
.server-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; margin-top: 0.75rem; }
.server-table td { padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--border); }
.server-table tr:last-child td { border-bottom: none; }
.server-table td:first-child { color: var(--text-muted); width: 45%; }

/* ── Result box ───────────────────────────────────────────── */
.result-box {
  margin-top: 1.5rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  animation: fadeIn 0.3s ease;
}

.result-box h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.token-display {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  word-break: break-all;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  text-align: center;
}

.token-meta {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.token-meta code {
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, monospace;
}

/* ── Alerts ───────────────────────────────────────────────── */
.alert {
  border-radius: 6px;
  padding: 0.85rem 1rem;
  font-size: 0.92rem;
  margin-top: 1rem;
}

.alert-error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: #f85149;
}

/* ── Hint text ────────────────────────────────────────────── */
.hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 1rem;
  margin-bottom: 0;
}

/* ── Footer ───────────────────────────────────────────────── */
footer {
  text-align: center;
  margin-top: 4rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

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

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .container { padding: 0 1rem 3rem; }

  /* Header — stack logo and nav */
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
  }
  nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
  }
  nav .btn { font-size: 0.8rem; padding: 0.45rem 0.85rem; }
  .nav-user { width: 100%; font-size: 0.85rem; }

  /* Hero */
  .hero h1 { font-size: 1.5rem; }
  .hero .subtitle { font-size: 0.95rem; }

  /* Cards */
  .card { padding: 1.25rem; }

  /* Token display */
  .token-display { font-size: 0.9rem; letter-spacing: 0.04em; }

  /* Buttons — stack on mobile */
  .btn-primary { font-size: 0.95rem; }
  .btn-download { margin-left: 0 !important; margin-top: 0.5rem; }
  .btn-copy, .btn-download { width: 100%; display: block; }

  /* Stats tables — make scrollable */
  table { display: block; overflow-x: auto; white-space: nowrap; }

  /* Server charts — stack on mobile */
  .server-charts { grid-template-columns: 1fr !important; }

  /* Charts grid — single column */
  .charts-grid { grid-template-columns: 1fr !important; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
}
