:root {
  --bg: #0b0f13;
  --bg-soft: #111820;
  --panel: rgba(255, 255, 255, 0.03);
  --glass: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);
  --white: #f7fafc;
  --muted: #9aa3b1;
  --accent: #6be3b4;
  --accent-2: #4cc0ff;
  --danger: #fca5a5;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--white);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(600px 300px at 20% -5%, rgba(107, 227, 180, 0.12), transparent 60%),
    radial-gradient(600px 300px at 85% 0%, rgba(76, 192, 255, 0.12), transparent 60%);
}

.wrap {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 15, 19, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--glass-border);
}

.topbar-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--white);
  font-weight: 700;
  font-size: 15px;
}

.topbar-brand img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  object-fit: cover;
  background: #1a232e;
  border: 1px solid var(--glass-border);
}

.topbar-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.topbar-link:hover { color: var(--accent); }

/* Hero */
.hero {
  text-align: center;
  padding: 28px 8px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid rgba(107, 227, 180, 0.3);
  background: rgba(107, 227, 180, 0.06);
  padding: 6px 14px;
  border-radius: 999px;
}

.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.hero h1 {
  font-size: 44px;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.h1-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  max-width: 520px;
}

.hero-checks {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  font-size: 13px;
  color: var(--muted);
}

.hero-checks li::before {
  content: '✓ ';
  color: var(--accent);
  font-weight: 700;
}

/* Card */
.card {
  background: var(--bg-soft);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.field-label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
}

.field-label.ok { color: var(--accent); }

.field-label.big { font-size: 15px; color: var(--white); margin-bottom: 4px; }

.card-sub {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 14px;
}

/* Input row: icon + single-line input + go button */
.input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 12px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.input-row:focus-within {
  border-color: var(--accent);
  background: var(--panel);
}

.link-icon { color: var(--muted); flex-shrink: 0; }

.link-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--white);
  font-size: 14px;
  font-family: inherit;
  padding: 10px 0;
}

.link-input::placeholder { color: var(--muted); opacity: 0.6; }
.link-input:focus { outline: none; }

.go-btn {
  flex-shrink: 0;
  padding: 10px 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06251a;
  border: none;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.go-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(107, 227, 180, 0.3);
}

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

/* Popular + all services */
.popular-row {
  margin-top: 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.popular-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.popular-pill {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--glass-border);
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.popular-pill:hover { color: var(--accent); border-color: var(--accent); }

.all-services {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.all-services:hover { text-decoration: underline; }

/* Stats */
.stats {
  display: flex;
  justify-content: center;
  gap: 0;
  padding: 6px 0;
}

.stat {
  flex: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px;
}

.stat + .stat { border-left: 1px solid var(--glass-border); }

.stat strong { font-size: 22px; font-weight: 800; }
.stat span { font-size: 12px; color: var(--muted); }

.support-badge {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
}

.support-badge.yes {
  color: var(--accent);
  background: rgba(107, 227, 180, 0.08);
  border-color: rgba(107, 227, 180, 0.3);
}

.support-badge.no {
  color: var(--muted);
  background: var(--glass);
}

.support-badge.warn {
  color: #fcd34d;
  background: rgba(252, 211, 77, 0.08);
  border-color: rgba(252, 211, 77, 0.35);
}

/* Turnstile */
.turnstile-row {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  border: 1px dashed var(--glass-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.015);
}

.turnstile-status {
  font-size: 12px;
  color: var(--muted);
}

.turnstile-status.ready { color: var(--accent); }
.turnstile-status.err { color: var(--danger); }

.gate-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* Buttons */
.primary-btn {
  width: 100%;
  padding: 13px 20px;
  margin-top: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06251a;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.primary-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(107, 227, 180, 0.3);
}

.primary-btn:active:not(:disabled) { transform: translateY(0); }

.primary-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

/* Result */
.result-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--glass-border);
  animation: slideIn 0.25s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-box {
  padding: 12px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  word-break: break-all;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 12px;
  max-height: 120px;
  overflow-y: auto;
}

.action-buttons { display: flex; gap: 10px; }

.secondary-btn {
  flex: 1;
  padding: 10px 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--white);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.secondary-btn:hover {
  background: var(--panel);
  border-color: var(--accent);
  color: var(--accent);
}

.secondary-btn.copied {
  background: var(--accent);
  color: #06251a;
  border-color: var(--accent);
}

/* Loading */
.loading { padding: 24px 0 4px; text-align: center; }

.spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto 10px;
  border: 3px solid var(--glass);
  border-top: 3px solid var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
.loading p { font-size: 13px; color: var(--muted); }

/* Error */
.error {
  margin-top: 14px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
  padding: 12px;
  border-radius: 10px;
  font-size: 13px;
  text-align: center;
}

/* History */
.history h2, .supported h2 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.history-header h2 { margin: 0; }

.clear-btn {
  padding: 5px 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.clear-btn:hover { background: rgba(239, 68, 68, 0.2); }

.history-list { display: flex; flex-direction: column; gap: 8px; }

.history-item {
  padding: 10px 12px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.history-item:hover { border-color: var(--accent); transform: translateX(2px); }

.history-item-original {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item-destination {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item-time { font-size: 10px; color: var(--muted); opacity: 0.7; }

/* Supported */
.supported .muted { color: var(--muted); font-size: 13px; line-height: 1.6; }

.supported details { margin-top: 12px; }

.supported summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.domain-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.domain-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 6px;
}

.domain-group-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.domain-list span {
  font-size: 11px;
  color: var(--muted);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  padding: 4px 8px;
  border-radius: 20px;
}

.domain-list span.g-server {
  color: var(--accent);
  border-color: rgba(107, 227, 180, 0.3);
}

.domain-list span.g-browser {
  color: #fcd34d;
  border-color: rgba(252, 211, 77, 0.3);
}

/* Footer */
.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  padding: 8px 0 0;
}

.footer .dot { opacity: 0.5; }

.hidden { display: none !important; }

@media (max-width: 520px) {
  .wrap { padding: 24px 14px 40px; }
  .hero h1 { font-size: 32px; }
  .action-buttons { flex-direction: column; }
  .input-row { flex-wrap: wrap; }
  .link-input { flex: 1 1 100%; order: 2; padding: 4px 0 10px; }
  .go-btn { width: 100%; order: 3; justify-content: center; }
}
