@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-logo: 'Space Grotesk', monospace;

  --background: #fafafa;
  --foreground: #0a0a0b;
  --card: #ffffff;
  --muted: #f1f1f3;
  --muted-foreground: #71717a;
  --border: #e5e5ea;
  --primary: #ff6a00;
  --primary-foreground: #ffffff;
  --status-online: #16a34a;
  --status-offline: #71767f;
  --destructive: #ef4444;
  --premium-gold: #d4af37;
  --discord: #5865f2;
  --radius: 0.75rem;
  --shadow: 0 4px 20px rgba(0,0,0,0.06);
}

[data-theme="dark"] {
  --background: #0a0a0b;
  --foreground: #fafafa;
  --card: #131316;
  --muted: #26262b;
  --muted-foreground: #a1a1aa;
  --border: #26262b;
  --shadow: 0 4px 20px rgba(0,0,0,0.4);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  background: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  transition: background .3s, color .3s;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
h1,h2,h3,h4 { font-weight: 700; line-height: 1.2; }
img { max-width: 100%; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--card) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.logo { font-family: var(--font-logo); font-weight: 700; font-size: 22px; letter-spacing: .05em; display: flex; align-items: center; gap: 8px; }
.logo .dot { color: var(--primary); }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a { padding: 9px 14px; border-radius: 10px; font-weight: 600; font-size: 15px; color: var(--muted-foreground); transition: .2s; }
.nav a:hover, .nav a.active { color: var(--foreground); background: var(--muted); }
.header-actions { display: flex; align-items: center; gap: 10px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 15px; padding: 0 20px; height: 44px; border-radius: 12px; border: none; cursor: pointer; transition: .2s; font-family: var(--font-main); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: var(--primary-foreground); box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 30%, transparent); }
.btn-primary:hover { background: color-mix(in srgb, var(--primary) 90%, black); }
.btn-outline { background: var(--card); color: var(--foreground); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--muted); }
.btn-ghost { background: transparent; color: var(--foreground); }
.btn-discord { background: var(--discord); color: #fff; }
.btn-danger { background: color-mix(in srgb, var(--destructive) 12%, transparent); color: var(--destructive); }
.btn-danger:hover { background: var(--destructive); color: #fff; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.theme-toggle { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; }

/* Hero */
.hero { padding: 80px 0 64px; text-align: center; border-bottom: 1px solid var(--border); background: linear-gradient(to bottom, var(--muted), var(--background)); }
.badge-pill { display: inline-flex; gap: 8px; align-items: center; background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent); padding: 6px 16px; border-radius: 999px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 22px; }
.hero h1 { font-size: clamp(42px, 7vw, 76px); font-weight: 900; letter-spacing: -.03em; margin-bottom: 18px; }
.hero h1 span { color: var(--primary); }
.hero p { max-width: 640px; margin: 0 auto 34px; color: var(--muted-foreground); font-size: 18px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* Sections */
main { flex: 1; }
.section { padding: 56px 0; }
.section-title { display: flex; align-items: center; gap: 12px; font-size: 30px; font-weight: 900; margin-bottom: 28px; letter-spacing: -.02em; }
.count-badge { background: var(--muted); color: var(--muted-foreground); font-size: 14px; font-weight: 700; padding: 3px 12px; border-radius: 999px; border: 1px solid var(--border); }

/* Premium spotlight */
.premium-card { background: var(--card); border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border)); border-radius: 24px; padding: 40px; position: relative; overflow: hidden; box-shadow: var(--shadow); margin-bottom: 56px; }
.premium-card .crown { display: inline-flex; gap: 8px; align-items: center; background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent); padding: 5px 14px; border-radius: 999px; font-size: 12px; font-weight: 700; text-transform: uppercase; margin-bottom: 14px; }
.premium-card h2 { font-size: clamp(24px, 4vw, 36px); margin-bottom: 12px; }
.premium-card .desc { color: var(--muted-foreground); font-size: 17px; margin-bottom: 22px; max-width: 640px; }
.stat-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
.stat-chip { display: flex; align-items: center; gap: 10px; background: var(--muted); border: 1px solid var(--border); padding: 10px 16px; border-radius: 12px; }
.stat-chip .label { font-size: 11px; text-transform: uppercase; color: var(--muted-foreground); font-weight: 700; }
.stat-chip .value { font-weight: 800; font-family: var(--font-logo); }

/* Server list rows */
.server-list { display: flex; flex-direction: column; gap: 16px; }
.server-row { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; transition: .2s; }
.server-row:hover { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); box-shadow: var(--shadow); }
.server-id-name { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1; }
.server-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--muted); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--primary); font-size: 20px; flex-shrink: 0; }
.server-name { font-weight: 700; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-addr { font-family: var(--font-logo); color: var(--muted-foreground); font-size: 13px; }
.server-meta { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.meta-block { display: flex; flex-direction: column; min-width: 64px; }
.meta-block .k { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-foreground); font-weight: 700; }
.meta-block .v { font-family: var(--font-logo); font-weight: 700; font-size: 14px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 8px; width: fit-content; }
.status.online { color: var(--status-online); background: color-mix(in srgb, var(--status-online) 12%, transparent); }
.status.offline { color: var(--status-offline); background: color-mix(in srgb, var(--status-offline) 12%, transparent); }

/* Cards grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; transition: .2s; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }
.card-head { padding: 18px 20px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--muted) 40%, transparent); }
.card-body { padding: 20px; flex: 1; }
.card-foot { padding: 16px 20px; border-top: 1px solid var(--border); }
.badges { display: flex; gap: 8px; margin-bottom: 12px; }
.tag { font-size: 10px; text-transform: uppercase; font-weight: 700; padding: 4px 8px; border-radius: 6px; letter-spacing: .05em; }
.tag.premium { background: var(--primary); color: #fff; }

/* Auth forms */
.auth-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px 20px; }
.auth-card { width: 100%; max-width: 480px; background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 40px; box-shadow: var(--shadow); }
.auth-card h1 { text-align: center; font-size: 28px; margin-bottom: 8px; }
.auth-card .sub { text-align: center; color: var(--muted-foreground); margin-bottom: 28px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.field input, .field textarea, .field select { width: 100%; height: 48px; border: 1px solid var(--border); background: var(--background); color: var(--foreground); border-radius: 12px; padding: 0 16px; font-size: 15px; font-family: var(--font-main); }
.field textarea { height: auto; padding: 12px 16px; min-height: 90px; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--primary); border-color: var(--primary); }
.form-foot { text-align: center; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted-foreground); font-size: 14px; }
.form-foot a { color: var(--primary); font-weight: 700; }
.checkbox-row { display: flex; align-items: center; gap: 8px; margin: 8px 0 18px; font-size: 14px; color: var(--muted-foreground); }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; margin-bottom: 16px; }
.alert-error { background: color-mix(in srgb, var(--destructive) 10%, transparent); color: var(--destructive); border: 1px solid color-mix(in srgb, var(--destructive) 25%, transparent); }
.alert-success { background: color-mix(in srgb, var(--status-online) 10%, transparent); color: var(--status-online); border: 1px solid color-mix(in srgb, var(--status-online) 25%, transparent); }

/* Tables */
.panel { background: var(--card); border: 1px solid var(--border); border-radius: 18px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { text-align: left; padding: 14px 18px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-foreground); background: color-mix(in srgb, var(--muted) 50%, transparent); font-weight: 700; }
td { padding: 14px 18px; border-top: 1px solid var(--border); font-size: 14px; }
tbody tr:hover { background: color-mix(in srgb, var(--muted) 40%, transparent); }

/* Tabs */
.tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab { padding: 12px 6px; font-weight: 700; color: var(--muted-foreground); border-bottom: 2px solid transparent; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Empty */
.empty { text-align: center; padding: 64px 20px; border: 1px dashed var(--border); border-radius: 24px; color: var(--muted-foreground); }

/* Pagination */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 40px; }
.pagination a, .pagination span { min-width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; border: 1px solid var(--border); background: var(--card); font-weight: 700; }
.pagination .cur { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--card); padding: 40px 0; margin-top: 40px; color: var(--muted-foreground); }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; align-items: center; }

.avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.mono { font-family: var(--font-logo); }
.mt-4 { margin-top: 32px; } .mb-4 { margin-bottom: 32px; }

@media (max-width: 768px) {
  .nav { display: none; }
  .nav.open { display: flex; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; background: var(--card); border-bottom: 1px solid var(--border); padding: 12px; }
  .menu-toggle { display: flex !important; }
  .server-meta { width: 100%; justify-content: space-between; }
}
.menu-toggle { display: none; }

/* Mobile layout correction */
html,body{max-width:100%;overflow-x:clip}
main,.site-header,.site-footer{min-width:0;max-width:100%}
.container,.section,.hero,.premium-card,.server-row,.header-inner{min-width:0;max-width:100%}
.premium-card *,.server-row *{min-width:0}
.premium-card h2,.server-name,.stat-chip,.hero p{overflow-wrap:anywhere;white-space:normal}
@media(max-width:768px){
 .container{padding-left:14px;padding-right:14px}
 .header-inner{gap:7px}
 .header-inner .logo{font-size:clamp(15px,4vw,20px);letter-spacing:0;white-space:nowrap}
 .header-actions{gap:5px;min-width:0}
 .header-actions .btn{padding:0 8px;font-size:12px;height:34px}
 .header-actions .theme-toggle{width:35px;height:35px;flex-shrink:0}
 .nav.open{max-width:100%;flex-wrap:wrap}
 .hero{padding:45px 0}
 .hero h1{font-size:clamp(29px,9vw,48px);overflow-wrap:anywhere}
 .hero-actions{flex-wrap:wrap;gap:8px}
 .hero-actions .btn{max-width:100%;min-width:0;padding:0 12px}
 .section{padding-top:26px;padding-bottom:26px}
 .premium-card{padding:18px;margin-bottom:25px}
 .premium-card h2{font-size:clamp(20px,6vw,30px)}
 .stat-row{flex-wrap:wrap;max-width:100%}
 .stat-chip{flex:1 1 165px;padding:8px;max-width:100%}
 .server-row{gap:12px;padding:12px}
 .server-name{font-size:15px}
 .grid{grid-template-columns:minmax(0,1fr)}
 .auth-card{padding:20px}
 .footer-inner{gap:12px}
}
@media(max-width:390px){.header-actions .btn{font-size:11px;padding:0 6px}.header-inner .logo{font-size:15px}}

/* Layout stability patch */
@media (min-width: 769px) {
  .container {width:calc(100% - 64px);max-width:1200px;padding-left:20px;padding-right:20px;margin-inline:auto;}
}
@media (min-width: 1280px) {
  .container {width:calc(100% - 96px);}
}
@media (max-width:768px) {
  .header-inner{height:60px;gap:8px;position:relative;}
  .header-inner .logo{font-size:clamp(14px,4.2vw,19px);min-width:0;flex-shrink:1;}
  .header-actions{gap:4px;flex-shrink:0;}
  .header-actions .btn{padding:0 7px;font-size:12px;height:32px;}
  .header-actions .theme-toggle{width:32px;height:32px;}
  .nav.open{position:absolute;top:60px;left:0;right:0;width:100%;max-width:100%;padding:12px;flex-direction:column;align-items:stretch;z-index:100;box-shadow:var(--shadow);}
  .nav.open a{display:block;width:100%;}
}
@media (max-width:380px) {
  .header-inner .logo{font-size:14px;letter-spacing:-.04em;}
  .header-actions .btn{font-size:11px;padding:0 5px;}
  .header-actions .theme-toggle{width:30px;height:30px;}
}
.footer-premium{min-width:170px;max-width:300px;flex:1 1 210px;}
.footer-premium strong{display:block;margin-bottom:8px;color:var(--foreground);font-size:14px;}
.footer-premium ul{list-style:none;padding:0;margin:0;}
.footer-premium li{padding:4px 0;display:flex;flex-direction:column;min-width:0;}
.footer-premium li a{font-size:13px;overflow-wrap:anywhere;}
.footer-premium li small{font-size:11px;opacity:.7;}
.footer-premium li a:hover{color:var(--primary);}
@media(max-width:768px){.footer-inner{align-items:flex-start;}.footer-premium{min-width:0;max-width:100%;}}
