:root {
  --bg: #09090b;
  --panel: #131316;
  --panel2: #1c1c21;
  --line: #2a2a31;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --accent: #8b5cf6;
  --danger: #ef4444;
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a { color: var(--accent); }
h1, h2 { line-height: 1.2; margin: 0 0 .6em; }
h2 { font-size: 1.15rem; }
small { font-size: .8rem; }
.muted { color: var(--muted); }
.center { text-align: center; justify-content: center; }
.right { margin-left: auto; }
.inline { display: inline; margin: 0; }
.grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* ---------- App-Layout ---------- */
.topnav {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(9, 9, 11, .85); backdrop-filter: blur(10px); z-index: 10;
}
.brand { font-weight: 800; font-size: 1.2rem; color: var(--text); text-decoration: none; letter-spacing: -.02em; }
.navlinks { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.navlinks a, .linkbtn { color: var(--muted); text-decoration: none; font-size: .95rem; }
.navlinks a:hover, .linkbtn:hover { color: var(--text); }
.linkbtn { background: none; border: 0; cursor: pointer; padding: 0; font: inherit; }
main.narrow { max-width: 440px; margin: 48px auto; padding: 0 16px; }
main.wide { max-width: 1100px; margin: 32px auto; padding: 0 16px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.row > label { flex: 1; min-width: 120px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; margin-top: 20px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }
.head-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

label { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; color: var(--muted); }
input, textarea, select {
  font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; width: 100%;
}
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
input[type=color] { padding: 2px; height: 42px; cursor: pointer; }
input[type=range] { padding: 0; accent-color: var(--accent); background: none; border: 0; }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
label.check input { width: auto; }
label.file input { padding: 8px; }
fieldset.media { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; margin: 0; }
fieldset.media legend { padding: 0 6px; font-size: .9rem; }
fieldset.media small { color: var(--muted); }
.current { font-size: .85rem; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: 10px 18px;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 6px 12px; font-size: .9rem; color: #fff; }
button.icon { background: var(--panel2); border: 1px solid var(--line); color: var(--text); border-radius: 8px; width: 32px; height: 32px; cursor: pointer; }
button.icon:disabled { opacity: .3; cursor: default; }
button.icon.danger:hover { background: var(--danger); }

.flash { background: #14532d; border: 1px solid #166534; padding: 10px 14px; border-radius: 10px; margin: 12px 0; }
.flash.err { background: #450a0a; border-color: #7f1d1d; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.stats div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; }
.stats b { font-size: 1.6rem; }
.stats span { color: var(--muted); font-size: .85rem; }

.links { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 8px; }
.linkrow { display: flex; align-items: center; gap: 10px; background: var(--panel2); border-radius: 10px; padding: 8px 10px; }
.tag { background: var(--accent); color: #fff; font-size: .7rem; padding: 2px 8px; border-radius: 99px; }
.tag.red { background: var(--danger); }

.list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
details { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
details[open] { padding-bottom: 14px; }
summary { cursor: pointer; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; list-style: none; }
summary::-webkit-details-marker { display: none; }
details > form, details > .row { margin-top: 12px; }
.av { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.badge-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.picker { display: flex; flex-wrap: wrap; gap: 6px; }
.pick { flex-direction: row; cursor: pointer; }
.pick input { display: none; }
.pick span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--line); color: var(--text); }
.pick span svg { width: 22px; height: 22px; }
.pick input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 25%, transparent); }

/* Landing */
.hero { text-align: center; padding: 60px 0 40px; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 4rem); letter-spacing: -.04em; }
.hero p { color: var(--muted); max-width: 520px; margin: 0 auto 28px; font-size: 1.1rem; }
.grad { background: linear-gradient(90deg, #8b5cf6, #ec4899, #f97316); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ugrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.ucard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text); text-decoration: none; transition: transform .2s; }
.ucard:hover { transform: translateY(-3px); border-color: var(--accent); }
.ucard img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.mini-badges { display: flex; gap: 2px; }

/* ---------- Abzeichen ---------- */
.badge { position: relative; display: inline-grid; place-items: center; width: 22px; height: 22px; color: var(--bc); cursor: default; }
.badge svg, .badge img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 4px color-mix(in srgb, var(--bc) 60%, transparent)); }
.badge .emoji { font-size: 17px; line-height: 1; }
.badge .tip {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) scale(.9);
  background: #0b0b0e; color: #fff; border: 1px solid var(--bc); border-radius: 8px;
  padding: 6px 10px; font-size: .75rem; white-space: nowrap; pointer-events: none; opacity: 0;
  transition: .15s; z-index: 5; text-align: center; line-height: 1.35;
}
.badge:hover .tip, .badge:focus .tip { opacity: 1; transform: translateX(-50%) scale(1); }
.badge-row { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: center; align-items: center; }
.badge-row.big .badge { width: 30px; height: 30px; }

/* Link-Icons */
.licon { width: 22px; height: 22px; flex: none; display: inline-block; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.licon.plain { background: none; -webkit-mask: none; mask: none; }
.licon.plain svg { width: 100%; height: 100%; }

/* ---------- Profilseite (guns.lol-Stil) ---------- */
body.profile { min-height: 100vh; overflow-x: hidden; }
.bg { position: fixed; inset: 0; z-index: -1; }
.bg img, .bg video { width: 100%; height: 100%; object-fit: cover; }
.bg-default { position: absolute; inset: 0; background: radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 50%), radial-gradient(circle at 80% 80%, #ec489955, transparent 50%), #050507; }
.bg-shade { position: absolute; inset: 0; background: rgba(0, 0, 0, .35); }


.pwrap { min-height: 100vh; display: grid; place-items: center; padding: 40px 16px; }
.pcard {
  width: 100%; max-width: 480px; text-align: center; padding: 32px 24px 18px;
  background: rgba(10, 10, 14, var(--card-a)); border: 1px solid rgba(255, 255, 255, .1); border-radius: 22px;
  backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: 0 0 40px color-mix(in srgb, var(--accent) 30%, transparent);
  opacity: 0; translate: 0 20px; transition: opacity .8s ease .15s, translate .8s ease .15s, transform .15s ease-out;
}
body.entered .pcard { opacity: 1; translate: 0 0; }
.avatar { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent); box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 70%, transparent); }
.pname { font-size: 2rem; margin: 14px 0 6px; color: #fff; letter-spacing: -.02em; }
.pname.glow { text-shadow: 0 0 10px var(--accent), 0 0 24px color-mix(in srgb, var(--accent) 60%, transparent); }
.pcard .badge-row { margin-bottom: 10px; }
.pcard .badge { width: 24px; height: 24px; }
.bio { color: #e4e4e7; min-height: 1.5em; margin: 6px 0; white-space: pre-wrap; }
.bio.typing::after { content: '|'; margin-left: 2px; animation: blink 1s steps(1) infinite; color: var(--accent); }
@keyframes blink { 50% { opacity: 0; } }
.loc { color: #a1a1aa; font-size: .9rem; margin: 4px 0; }
.plinks { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.plink {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 12px; color: #fff; text-decoration: none;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); transition: .2s;
}
.plink span:nth-child(2) { flex: 1; text-align: left; font-weight: 600; }
.plink .arrow { opacity: .5; }
.plink:hover { background: color-mix(in srgb, var(--accent) 30%, transparent); border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 45%, transparent); }
.pfoot { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; color: #a1a1aa; font-size: .85rem; }
.mute { background: none; border: 0; font-size: 1.1rem; cursor: pointer; }
.row > input { flex: 1; width: auto; min-width: 0; }
.card > .badge-row.big { display: flex; justify-content: flex-start; margin-bottom: 8px; }
.waitlist { max-width: 520px; margin: 0 auto 40px; scroll-margin-top: 80px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.wl-row { display: flex; gap: 10px; align-items: center; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.flash.created pre { background: #0b0b0e; padding: 10px 12px; border-radius: 8px; overflow-x: auto; user-select: all; }
