/* ==========================================================================
   Gaming303 Stats – Stylesheet
   ========================================================================== */

:root {
  --bg:        #0b0d12;
  --bg-2:      #0f1218;
  --surface:   #141821;
  --surface-2: #1a1f2b;
  --line:      #232a38;
  --line-hi:   #313a4d;
  --text:      #e8ecf3;
  --text-2:    #a3adbf;
  --text-3:    #6b7589;

  --acid:      #b8ff3c;   /* Gaming303-Akzent */
  --acid-ink:  #0b0d12;
  --acid-lo:   rgba(184, 255, 60, .12);
  --discord:   #5865f2;
  --discord-hi:#6d78f5;
  --boost:     #ff73fa;
  --boost-lo:  rgba(255, 115, 250, .12);
  --ok:        #3ddc84;
  --ok-lo:     rgba(61, 220, 132, .1);
  --err:       #ff5a5f;
  --err-lo:    rgba(255, 90, 95, .1);
  --warn:      #ffb648;

  --role:      var(--acid); /* wird pro Nutzer mit Rollenfarbe überschrieben */

  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;

  --f-display: 'Chakra Petch', 'DM Sans', system-ui, sans-serif;
  --f-body:    'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono:    'JetBrains Mono', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
code { font-family: var(--f-mono); font-size: .85em; }

/* --- Hintergrund ----------------------------------------------------------- */
.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}
.bg-glow {
  position: fixed; z-index: -1; pointer-events: none;
  top: -280px; left: 50%; width: 900px; height: 560px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(88,101,242,.22), transparent),
              radial-gradient(closest-side at 70% 60%, rgba(184,255,60,.10), transparent);
  filter: blur(20px);
}

/* --- Layout ---------------------------------------------------------------- */
.container { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 20px; }
main { flex: 1; }
.center-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 16px 48px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-top: 22px; padding-bottom: 22px;
}
.page-join .topbar, .page-landing .topbar { justify-content: space-between; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--acid); color: var(--acid-ink);
  font-family: var(--f-display); font-weight: 700; font-size: .95rem; letter-spacing: -.02em;
  box-shadow: 0 0 0 1px rgba(184,255,60,.4), 0 6px 24px -6px rgba(184,255,60,.55);
}
.brand-text { font-family: var(--f-display); font-weight: 600; font-size: 1.05rem; letter-spacing: .01em; }
.brand-text b { color: var(--acid); font-weight: 700; }
.brand-text span { color: var(--text-3); font-weight: 500; margin-left: 2px; }

.topnav { display: flex; align-items: center; gap: 8px; }
.topnav form.inline { display: contents; }
.topnav a, .topnav button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--r-sm);
  font-size: .84rem; font-weight: 500; color: var(--text-2); text-decoration: none;
  background: transparent; border: 1px solid var(--line); cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.topnav a:hover, .topnav button:hover { color: var(--text); border-color: var(--line-hi); background: var(--surface); }

/* --- Typo ------------------------------------------------------------------ */
.display {
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(2.2rem, 6vw, 3.8rem); line-height: 1.04; letter-spacing: -.02em;
}
.accent-text { color: var(--acid); }
.lead { color: var(--text-2); font-size: 1.08rem; max-width: 56ch; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-mono); font-size: .78rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--text-2); margin-bottom: 18px;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(20,24,33,.6);
}
.fine { color: var(--text-3); font-size: .86rem; margin-top: 14px; }
.muted { color: var(--text-2); }
.small { font-size: .84rem; }

.live-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 0 0 rgba(61,220,132,.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(61,220,132,.55); }
  70%  { box-shadow: 0 0 0 8px rgba(61,220,132,0); }
  100% { box-shadow: 0 0 0 0 rgba(61,220,132,0); }
}

/* --- Buttons --------------------------------------------------------------- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.actions-stack { flex-direction: column; align-items: stretch; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 11px 20px; border-radius: var(--r);
  font-weight: 600; font-size: .94rem; text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
  transition: transform .12s, filter .15s, background .15s, border-color .15s, box-shadow .15s;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-lg { padding: 14px 24px; font-size: 1rem; }
.btn-discord { background: var(--discord); color: #fff; box-shadow: 0 10px 30px -10px rgba(88,101,242,.8); }
.btn-discord:hover { background: var(--discord-hi); }
.btn-accent { background: var(--acid); color: var(--acid-ink); box-shadow: 0 10px 30px -12px rgba(184,255,60,.7); }
.btn-accent:hover { filter: brightness(1.06); }
.btn-ghost { background: rgba(20,24,33,.6); color: var(--text); border-color: var(--line-hi); }
.btn-ghost:hover { border-color: var(--text-3); background: var(--surface); }
.btn:focus-visible, .topnav a:focus-visible, .topnav button:focus-visible, .link-btn:focus-visible {
  outline: 2px solid var(--acid); outline-offset: 3px;
}
.link-btn { background: none; border: 0; color: var(--text-3); font-size: .84rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 4px; }
.link-btn:hover { color: var(--text-2); }

/* --- Alerts ---------------------------------------------------------------- */
.alert {
  margin-top: 18px; padding: 12px 16px; border-radius: var(--r);
  font-size: .92rem; font-weight: 500; border: 1px solid;
}
.alert-ok  { background: var(--ok-lo);  border-color: rgba(61,220,132,.3); color: #8ff0b9; }
.alert-err { background: var(--err-lo); border-color: rgba(255,90,95,.3);  color: #ffadb0; }

/* --- Landing --------------------------------------------------------------- */
.landing { padding-top: clamp(32px, 8vh, 90px); padding-bottom: 64px; }
.landing-hero { max-width: 720px; }
.landing-hero .lead { margin-top: 20px; }
.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px;
  margin-top: clamp(48px, 9vh, 96px);
}
.feature {
  position: relative; padding: 22px; border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line);
  transition: border-color .2s, transform .2s;
}
.feature:hover { border-color: var(--line-hi); transform: translateY(-2px); }
.feature-num { font-family: var(--f-mono); font-size: .76rem; color: var(--acid); }
.feature h3 { font-family: var(--f-display); font-size: 1.15rem; font-weight: 600; margin: 10px 0 6px; }
.feature p { color: var(--text-2); font-size: .9rem; }

/* --- Panels (Join / Fehler) ------------------------------------------------ */
.panel {
  width: 100%; padding: 36px 32px; border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.7);
}
.panel-narrow { max-width: 460px; text-align: center; }
.panel-narrow .lead { margin: 12px auto 0; font-size: 1rem; }
.panel-title { font-family: var(--f-display); font-size: 1.6rem; font-weight: 700; letter-spacing: -.01em; }
.state-icon {
  width: 52px; height: 52px; margin: 0 auto 16px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--f-display); font-weight: 700; font-size: 1.4rem;
}
.state-icon-err { background: var(--err-lo); color: var(--err); border: 1px solid rgba(255,90,95,.3); }
.join-avatar { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 16px; border: 3px solid var(--line-hi); }

.countdown { position: relative; width: 64px; height: 64px; margin: 26px auto 0; }
.countdown svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.countdown circle { fill: none; stroke-width: 3.5; }
.cd-track { stroke: var(--line); }
.cd-bar {
  stroke: var(--discord); stroke-linecap: round;
  stroke-dasharray: 119.4; stroke-dashoffset: 0;
  animation-name: cd; animation-timing-function: linear; animation-fill-mode: forwards;
}
@keyframes cd { to { stroke-dashoffset: 119.4; } }
.countdown span {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--f-display); font-weight: 700; font-size: 1.35rem;
}

/* --- Dashboard ------------------------------------------------------------- */
.dash { padding-bottom: 56px; display: flex; flex-direction: column; gap: 16px; }
.dash > .alert { margin-top: 0; }

.card {
  padding: 22px 24px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-head .card-title { margin-bottom: 0; }
.card-title {
  font-family: var(--f-mono); font-size: .74rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .12em; color: var(--text-3);
  margin-bottom: 16px;
}
.count-pill {
  font-family: var(--f-mono); font-size: .76rem; font-weight: 600;
  padding: 2px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2);
}
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }

/* Profil */
.profile {
  position: relative; overflow: hidden; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
}
.profile-banner {
  height: 132px;
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--role) 55%, transparent), transparent 60%),
    radial-gradient(100% 120% at 100% 0%, rgba(88,101,242,.55), transparent 60%),
    linear-gradient(135deg, #1b2030, #10131a);
  background-size: cover; background-position: center;
}
.profile-banner::after {
  content: ''; display: block; height: 100%;
  background: linear-gradient(180deg, transparent 40%, rgba(20,24,33,.85));
}
.profile-body {
  display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 20px;
  padding: 0 26px 24px; margin-top: -52px; position: relative;
}
.profile-avatar { position: relative; width: 112px; height: 112px; }
.profile-avatar img {
  width: 112px; height: 112px; border-radius: 50%; object-fit: cover;
  border: 5px solid var(--surface); background: var(--surface-2);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--role) 70%, transparent);
}
.avatar-boost {
  position: absolute; right: 4px; bottom: 6px;
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--boost); color: #2a0a2a; font-size: .8rem;
  border: 3px solid var(--surface);
}
.profile-info { min-width: 0; padding-bottom: 4px; }
.profile-name {
  font-family: var(--f-display); font-weight: 700; font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  line-height: 1.1; letter-spacing: -.01em; color: var(--role);
  overflow-wrap: anywhere;
}
.profile-handle { color: var(--text-2); font-size: .92rem; margin-top: 4px; }
.profile-handle .sep { color: var(--text-3); margin: 0 4px; }
.badges { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.badge {
  font-size: .74rem; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line-hi); color: var(--text-2);
}
.badge-boost { background: var(--boost-lo); border-color: rgba(255,115,250,.35); color: #ffb3fc; }
.badge-nitro { background: rgba(88,101,242,.14); border-color: rgba(88,101,242,.4); color: #b5bbff; }

.profile-guild {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--line);
  margin-bottom: 4px;
}
.profile-guild img, .guild-fallback { width: 40px; height: 40px; border-radius: 12px; }
.guild-fallback { display: grid; place-items: center; background: var(--acid); color: var(--acid-ink); font-family: var(--f-display); font-weight: 700; font-size: .85rem; }
.profile-guild .label { display: block; font-size: .7rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .1em; }
.profile-guild strong { font-family: var(--f-display); font-weight: 600; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi {
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px 18px 16px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color .2s, transform .2s;
}
.kpi:hover { border-color: var(--line-hi); transform: translateY(-2px); }
.kpi-label { font-size: .78rem; color: var(--text-3); font-weight: 500; }
.kpi-value {
  font-family: var(--f-display); font-weight: 700; font-size: 2rem; line-height: 1.1;
  font-variant-numeric: tabular-nums; letter-spacing: -.01em;
}
.kpi-value-muted { color: var(--text-3); }
.kpi-sub { font-size: .78rem; color: var(--text-2); }
.kpi-hero {
  background:
    radial-gradient(120% 120% at 100% 0%, var(--acid-lo), transparent 60%),
    var(--surface);
  border-color: rgba(184,255,60,.25);
}
.kpi-hero .kpi-value { color: var(--acid); }
.kpi-boost { border-color: rgba(255,115,250,.3); background: radial-gradient(120% 120% at 100% 0%, var(--boost-lo), transparent 60%), var(--surface); }
.kpi-boost .kpi-value { color: var(--boost); }

/* Meilenstein */
.ms-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.ms-next { display: block; font-family: var(--f-display); font-weight: 700; font-size: 1.4rem; }
.ms-left { color: var(--text-2); font-size: .86rem; }
.ms-pct { font-family: var(--f-mono); font-weight: 600; color: var(--acid); }
.bar { height: 10px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); overflow: hidden; margin-bottom: 10px; }
.bar span {
  display: block; height: 100%; width: var(--w); border-radius: inherit;
  background: linear-gradient(90deg, #7dd61f, var(--acid));
  box-shadow: 0 0 16px rgba(184,255,60,.45);
  animation: grow .9s cubic-bezier(.2,.8,.2,1) both;
}
.bar-boost span { background: linear-gradient(90deg, #c64bd1, var(--boost)); box-shadow: 0 0 16px rgba(255,115,250,.4); }
@keyframes grow { from { width: 0; } }

.share { display: flex; align-items: center; gap: 16px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.share p { color: var(--text-2); font-size: .9rem; }
.share strong { color: var(--text); }
.share-ring {
  --p: 0; flex-shrink: 0; width: 64px; height: 64px; border-radius: 50%;
  background: conic-gradient(var(--discord) calc(var(--p) * 1%), var(--surface-2) 0);
  display: grid; place-items: center;
}
.share-ring span {
  width: 50px; height: 50px; border-radius: 50%; background: var(--surface);
  display: grid; place-items: center; font-family: var(--f-mono); font-weight: 600; font-size: .82rem;
}

/* Detailzeilen */
.rows > div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.rows > div:last-child { border-bottom: 0; }
.rows dt { color: var(--text-2); font-size: .9rem; }
.rows dd { font-weight: 600; font-size: .9rem; text-align: right; overflow-wrap: anywhere; }
.rows dd code { font-weight: 400; color: var(--text-2); background: var(--bg-2); padding: 2px 7px; border-radius: 6px; }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.role-inline { color: var(--c); }
.role-inline::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 7px; vertical-align: 1px; }

/* Rollen */
.roles { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.role {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px 6px 10px; border-radius: 999px;
  font-size: .86rem; font-weight: 500;
  background: color-mix(in srgb, var(--c) 9%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--c) 35%, var(--line));
  transition: transform .15s, border-color .15s;
}
.role:hover { transform: translateY(-1px); border-color: var(--c); }
.role img { width: 16px; height: 16px; }
.role-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px color-mix(in srgb, var(--c) 60%, transparent); }
.role-emoji { font-size: .95rem; line-height: 1; }

/* Server */
.server-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.sstat { padding: 14px 16px; border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--line); }
.sstat-v { display: flex; align-items: center; gap: 8px; font-family: var(--f-display); font-weight: 700; font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.sstat-l { font-size: .8rem; color: var(--text-3); }
.boost-goal { margin-top: 16px; }
.boost-goal .ms-head { margin-bottom: 6px; }

/* Support */
.card-support { display: grid; grid-template-columns: minmax(200px, 1fr) 2fr; gap: 28px; }
.support-intro p { font-size: .92rem; }
.ticket-form { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.field { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.field > span { font-size: .8rem; font-weight: 600; color: var(--text-2); }
.field em { font-style: normal; color: var(--text-3); font-weight: 400; }
.field input, .field textarea {
  width: 100%; padding: 11px 14px; border-radius: var(--r);
  font: inherit; font-size: .94rem; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line);
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-3); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--acid); box-shadow: 0 0 0 3px var(--acid-lo); }

.stamp { text-align: center; color: var(--text-3); font-size: .8rem; font-family: var(--f-mono); }

/* Debug */
.debug { border: 1px dashed var(--line-hi); border-radius: var(--r); background: var(--bg-2); }
.debug summary { padding: 12px 16px; cursor: pointer; color: var(--text-3); font-size: .84rem; }
.debug-pre {
  margin-top: 16px; padding: 14px 16px; max-height: 420px; overflow: auto; text-align: left;
  font-family: var(--f-mono); font-size: .76rem; color: var(--text-2);
  white-space: pre-wrap; word-break: break-all; background: var(--bg-2); border-radius: var(--r-sm);
}
.debug .debug-pre { margin: 0; border-top: 1px dashed var(--line-hi); border-radius: 0; }

/* Footer */
.site-foot {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  padding: 26px 16px 32px; color: var(--text-3); font-size: .8rem;
}
.site-foot a { color: var(--text-2); text-decoration: none; }
.site-foot a:hover { color: var(--acid); }

/* Animation */
.fade-in { animation: fadeUp .5s cubic-bezier(.2,.8,.2,1) both; }
.dash > .fade-in:nth-child(2), .feature-grid > :nth-child(1) { animation-delay: .05s; }
.dash > .fade-in:nth-child(3), .feature-grid > :nth-child(2) { animation-delay: .1s; }
.dash > .fade-in:nth-child(4), .feature-grid > :nth-child(3) { animation-delay: .15s; }
.dash > .fade-in:nth-child(5), .feature-grid > :nth-child(4) { animation-delay: .2s; }
.dash > .fade-in:nth-child(n+6) { animation-delay: .25s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Responsive */
@media (max-width: 760px) {
  .profile-body { grid-template-columns: 1fr; justify-items: center; text-align: center; margin-top: -60px; padding: 0 18px 22px; gap: 14px; }
  .badges { justify-content: center; }
  .profile-guild { margin-bottom: 0; }
  .card-support { grid-template-columns: 1fr; gap: 16px; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .container { padding-left: 16px; padding-right: 16px; }
  .topbar { padding-top: 16px; padding-bottom: 16px; }
  .brand-text span { display: none; }
  .topnav a, .topnav button { padding: 7px 10px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi-hero { grid-column: 1 / -1; }
  .kpi-value { font-size: 1.6rem; }
  .card { padding: 18px; }
  .panel { padding: 28px 20px; }
  .actions .btn { width: 100%; }
}
