/* ============================================================
   Avatars Domain - Dark Gaming Tema
   ============================================================ */

:root {
  --bg: #0d0f14;
  --bg-soft: #141720;
  --bg-card: #1a1e2a;
  --bg-input: #232838;
  --border: #2b3145;
  --text: #e6e9f0;
  --text-muted: #8b93a7;
  --primary: #7c5cff;
  --primary-hover: #9376ff;
  --accent: #00e0c6;
  --accent-hover: #33e6d2;
  --danger: #ff4d6d;
  --success: #2fdc8f;
  --warn: #ffb020;
  --radius: 10px;
  --shadow: 0 4px 16px rgba(0,0,0,.35);
  --font: 'Segoe UI', system-ui, -apple-system, Helvetica, Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; }

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

.main { flex: 1; padding: 1.5rem 1rem 3rem; }

/* ---------- Navbar ---------- */
.navbar {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; min-height: 64px; }

.brand {
  font-weight: 800;
  font-size: 1.25rem;
  text-decoration: none;
  color: var(--text);
  letter-spacing: .5px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: .25rem;
  list-style: none;
  flex-wrap: wrap;
}

.nav-links a {
  display: block;
  padding: .55rem .8rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 8px;
  font-size: .95rem;
  transition: color .15s, background .15s;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--text); background: var(--bg-input); }
.nav-links a.active { color: var(--text); background: var(--bg-input); }

.nav-links a.nav-cta {
  padding: .55rem .8rem;
  color: #fff;
  background: var(--primary);
  border-radius: 8px;
}
.nav-links a.nav-cta:hover { color: #fff; background: var(--primary-hover); }

.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.5rem; cursor: pointer; }

.badge {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  margin-left: 4px;
  font-size: .7rem;
  line-height: 18px;
  text-align: center;
  background: var(--danger);
  color: #fff;
  border-radius: 999px;
  vertical-align: middle;
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    padding-bottom: .5rem;
  }
  .nav-links.open { display: flex; }
}

/* ---------- Buttons ---------- */
button, input[type="submit"], input[type="button"], input[type="reset"] {
  font-family: inherit;
  font-size: 100%;
  line-height: inherit;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .55rem 1.1rem;
  min-height: 40px;
  border: none;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  transition: filter .15s, background .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-accent { background: var(--accent); color: #062b28; }
.btn-accent:hover { background: var(--accent-hover); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); background: var(--bg-input); }
.btn-sm { padding: .55rem .8rem; font-size: .95rem; }

/* Kompakte mini-knapper (MM-stil) til admin-lister */
.btn-mini {
  display: inline-flex; align-items: center;
  font-size: .75rem; font-weight: 600;
  padding: .22rem .6rem;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.45;
  text-decoration: none;
  transition: filter .15s, background .15s;
}
.btn-mini-danger { background: rgba(255,77,109,.14); color: #ff8a98; }
.btn-mini-danger:hover { background: rgba(255,77,109,.26); }
.btn-mini-accent { background: rgba(47,220,143,.12); color: #53e0a3; }
.btn-mini-accent:hover { background: rgba(47,220,143,.24); }
.btn-mini-ghost { background: var(--bg-input); color: var(--text-muted); border-color: var(--border); }
.btn-mini-ghost:hover { color: var(--text); background: var(--bg-soft); }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: .35rem; font-weight: 600; font-size: .9rem; color: var(--text-muted); }
.form-control,
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=url],
select, textarea {
  width: 100%;
  padding: .6rem .8rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .95rem;
  font-family: inherit;
  transition: border-color .15s;
}
.form-control:focus, input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
}

.card-header { margin-bottom: 1rem; }
.card-header h2 { font-size: 1.25rem; margin-bottom: .25rem; }
.card-header p { color: var(--text-muted); font-size: .9rem; }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.file-picker { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.file-picker .file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip-path: inset(50%); }
.btn[hidden] { display: none !important; }
.url-input-group { display: flex; align-items: stretch; }
.url-input-group input { flex: 1; min-width: 0; border-radius: 0 var(--radius) var(--radius) 0; }
.url-input-group .url-prefix {
  display: flex; align-items: center;
  padding: 0 .75rem; white-space: nowrap;
  background: var(--bg-input);
  border: 1px solid var(--border); border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  color: var(--text-muted); font-size: .92rem; font-family: inherit;
  user-select: none;
}

/* ---------- Alerts ---------- */
.alert {
  padding: .9rem 1.1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-weight: 500;
}
.alert-success { background: rgba(47,220,143,.12); border: 1px solid var(--success); color: var(--success); }
.alert-error { background: rgba(255,77,109,.12); border: 1px solid var(--danger); color: var(--danger); }

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 3.5rem 1rem;
  background:
    radial-gradient(circle at 20% 30%, rgba(124,92,255,.22), transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(0,224,198,.15), transparent 45%);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 2rem;
}
.hero h1 { font-size: 2.5rem; margin-bottom: .75rem; }
.hero p { color: var(--text-muted); font-size: 1.1rem; max-width: 640px; margin: 0 auto 1.5rem; }
.hero .ctas { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

/* ---------- Grids ---------- */
.grid { display: grid; gap: 1.25rem; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.grid-profile { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.grid-profile > * { align-self: start; }
.admin-games-grid { grid-template-columns: 1fr 2fr; }
@media (max-width: 900px) {
    .admin-games-grid { grid-template-columns: 1fr; }
}

/* ---------- User cards ---------- */
.user-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  position: relative;
  transition: border-color .15s, transform .15s;
}
.user-card:hover { border-color: var(--primary); transform: translateY(-2px); }
/* Hele kassen som link, mens indre knapper forbliver klikbare */
.user-card .stretched-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: var(--radius);
}
.user-card .btn { position: relative; z-index: 2; }

.user-card-top { display: flex; gap: .85rem; align-items: center; margin-bottom: .75rem; }
.user-card-top h3 { font-size: 1.05rem; }
.user-card-top .role-tag { font-size: .7rem; padding: .15rem .45rem; border-radius: 999px; background: var(--bg-input); color: var(--text-muted); text-transform: uppercase; }

.user-card .meta { color: var(--text-muted); font-size: .85rem; }
.user-card .tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .75rem; }
.tag { font-size: .75rem; background: var(--bg-input); border: 1px solid var(--border); padding: .2rem .55rem; border-radius: 999px; color: var(--text-muted); }

/* ---------- Shop ---------- */
.shop-thumb {
  width: 96px; height: 96px; border-radius: calc(var(--radius) / 2);
  background-color: var(--bg-soft);
  background-size: cover; background-position: center; background-repeat: no-repeat;
  border: 1px solid var(--border); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: .7rem;
}
.shop-thumb--ready { color: transparent; }

/* ---------- Avatar ---------- */
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--bg-input); cursor: zoom-in; }
.avatar:hover { outline: 2px solid var(--accent); outline-offset: 1px; }
.avatar-64 { width: 64px; height: 64px; }
.avatar-96 { width: 96px; height: 96px; }

/* ---------- Profile ---------- */
.profile-head { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.profile-head h1 { font-size: 2rem; }
.profile-head .meta { color: var(--text-muted); }

/* ---------- Game badges ---------- */
.game-badge { display: flex; align-items: center; gap: .5rem; }

/* ---------- Game cards ---------- */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; }
.game-tile {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .9rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.game-tile-head { display: flex; gap: .65rem; align-items: center; }
.game-tile-head strong { font-size: .95rem; line-height: 1.3; }
.game-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--bg-input); border: 1px solid var(--border); flex-shrink: 0; }
.field-list { display: flex; flex-direction: column; gap: .3rem; }
.field-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .6rem;
  font-size: .85rem;
  padding: .3rem .5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.field-label { color: var(--text-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .4px; }
.field-value { font-weight: 600; text-align: right; word-break: break-word; }

/* ---------- Tables ---------- */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
}
.table th, .table td { padding: .8rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
.table th { background: var(--bg-soft); font-size: .8rem; color: var(--text-muted); }
.verified-head {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px;
  border: 1px solid var(--border); border-radius: 50%;
  font-size: .72rem; font-weight: 700; line-height: 1;
  color: var(--text-muted); cursor: pointer;
  transition: color .15s, border-color .15s;
}
.verified-head:hover { color: var(--text); border-color: var(--primary); }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(124,92,255,.04); }
/* Horisontal scroll på smalle skærme (mobilvenlig tabel) */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
.table-wrap .table { border-radius: 0; }

/* ---------- Chat ---------- */
.chat-layout { display: grid; grid-template-columns: 300px 1fr; gap: 1rem; height: calc(100vh - 200px); min-height: 400px; }

.chat-list { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.chat-list::-webkit-scrollbar { width: 10px; }
.chat-list::-webkit-scrollbar-track { background: transparent; margin: 12px 0; }
.chat-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
.chat-list::-webkit-scrollbar-thumb:hover { background: var(--primary); background-clip: padding-box; }
.chat-tabs { display:flex; gap:.25rem; padding:.5rem .6rem; border-bottom:1px solid var(--border); position:sticky; top:0; background:var(--bg-card); z-index:2; }
.chat-tabs a { flex:1; text-align:center; padding:.35rem .5rem; border-radius:8px; font-size:.85rem; color:var(--text-muted); text-decoration:none; }
.chat-tabs a:hover { background:var(--bg-input); color:var(--text); }
.chat-tabs a.active { background:var(--bg-input); color:var(--text); font-weight:600; }
.tab-count { background:var(--bg-soft); border:1px solid var(--border); border-radius:999px; padding:.02rem .45rem; font-size:.72rem; }
.chat-item-link { display:flex; gap:.75rem; align-items:center; flex:1; min-width:0; text-decoration:none; color:var(--text); }
.chat-members-bar { display:flex; gap:.5rem .9rem; flex-wrap:wrap; padding:.5rem .75rem; border-bottom:1px solid var(--border); background:var(--bg-soft); max-height:140px; overflow-y:auto; }
.chat-members-bar a { display:inline-flex; align-items:center; gap:.35rem; text-decoration:none; color:var(--text); font-size:.82rem; }

/* Shop-kort: pris + knap fast i bunden uanset indholdets længde */
.shop-item-card { display: flex; flex-direction: column; }
.shop-item-card .shop-item-foot { margin-top: auto; padding-top: .6rem; }
.chat-item { display: flex; gap: .75rem; padding: .85rem; align-items: center; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--border); }
.chat-item:hover { background: var(--bg-input); }
.chat-item.active { background: var(--bg-input); border-left: 3px solid var(--primary); }
.chat-item .info { flex: 1; min-width: 0; }
.chat-item .info strong { display: block; font-size: .95rem; }
.chat-item .info small { color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

.chat-window { display: flex; flex-direction: column; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.chat-header { padding: .85rem 1rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .75rem; }
.chat-body { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.chat-input { display: flex; gap: .5rem; padding: .8rem; border-top: 1px solid var(--border); }
.chat-input input { flex: 1; }

.msg { position: relative; max-width: 70%; padding: .6rem .9rem; border-radius: 14px; font-size: .95rem; white-space: pre-wrap; word-wrap: break-word; }
.msg.mine { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.msg.theirs { align-self: flex-start; background: var(--bg-input); color: var(--text); border-bottom-left-radius: 4px; }
.msg .m-time { display: block; font-size: .7rem; opacity: .6; margin-top: .2rem; }
.msg-report { position: absolute; top: .3rem; right: .4rem; background: none; border: none; cursor: pointer; font-size: .8rem; opacity: .45; padding: 0; line-height: 1; }
.msg-report:hover { opacity: 1; }

/* Mobil: samtale-listen bliver en flyout fra venstre */
.chat-burger { display: none; }
@media (max-width: 768px) {
    .chat-layout { grid-template-columns: 1fr; height: calc(100vh - 160px); }
    .chat-list {
        position: fixed; top: 0; left: 0; bottom: 0;
        width: min(300px, 85vw); margin: 0; border-radius: 0;
        z-index: 110; transform: translateX(-100%); transition: transform .25s ease;
        box-shadow: var(--shadow);
    }
    .chat-list.open { transform: translateX(0); }
    .chat-flyoverlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 105; display: none; }
    .chat-flyoverlay.show { display: block; }
    .chat-burger { display: inline-flex; }
}

/* ---------- Modal (anmeldelser mv.) ---------- */
.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(5,7,12,.65); }
.modal-box { position: relative; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; padding: 1.25rem; }
.modal-box h3 { margin-bottom: .35rem; }
.modal-intro { color: var(--text-muted); font-size: .9rem; margin-bottom: 1rem; }
.modal-box .form-group { margin-bottom: .85rem; }
.modal-box label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: .35rem; }
.modal-box select, .modal-box textarea { width: 100%; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }

/* Avatar-lysboks */
.modal-box.avatar-lightbox { width: auto; max-width: min(92vw, 620px); padding: 0; background: transparent; border: 0; box-shadow: none; overflow: visible; text-align: center; }
.avatar-lightbox .avatar-lb-img { display: inline-block; max-width: min(92vw, 600px); max-height: 84vh; width: auto; height: auto; border-radius: 12px; border: 2px solid var(--border); box-shadow: var(--shadow); background: var(--bg-input); }
.avatar-lb-close { position: absolute; top: -14px; right: -14px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-card); color: var(--text); font-size: 1rem; line-height: 1; cursor: pointer; box-shadow: var(--shadow); z-index: 1; }
.avatar-lb-close:hover { background: var(--bg-input); }

/* Statusmærker for anmeldelser */
.status-tag { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .7rem; font-weight: 700; letter-spacing: .03em; }
.status-open { background: rgba(255,77,109,.15); color: var(--danger); }
.status-resolved { background: rgba(47,220,143,.15); color: var(--success); }
.status-ignored { background: var(--bg-input); color: var(--text-muted); }

/* ---------- Notifications ---------- */
.notif-item { display: flex; gap: .9rem; padding: 1rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: .6rem; }
.notif-item.unread { border-left: 3px solid var(--primary); }
.notif-item .n-body { color: var(--text-muted); font-size: .9rem; }

/* ---------- Footer ---------- */
.footer { background: var(--bg-soft); border-top: 1px solid var(--border); padding: 1.2rem 0; margin-top: auto; text-align: center; color: var(--text-muted); font-size: .85rem; }

/* ---------- Utilities ---------- */
.muted { color: var(--text-muted); }
.text-link { color: var(--primary); font-weight: 600; text-decoration: none; border-bottom: 1px solid transparent; transition: color .15s, border-color .15s; }
.text-link:hover { color: var(--primary-hover); border-color: currentColor; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; gap: .5rem; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.text-center { text-align: center; }
.full-height { min-height: calc(100vh - 200px); display: flex; align-items: center; justify-content: center; }

.auth-box { max-width: 430px; margin: 0 auto; }
.wide { max-width: 860px; }
.inline-form { display: inline; }
.error-list li { margin-left: 1.2rem; }
.field-error { display: block; margin-top: .35rem; font-size: .82rem; color: var(--warn); }
input.input-error, .input-error { border-color: var(--warn); }
.input-error:focus { border-color: var(--warn); box-shadow: 0 0 0 3px rgba(255, 176, 32, .15); }

/* Faner (vennepage m.fl.) */
.tabs { display: flex; gap: .35rem; flex-wrap: wrap; border-bottom: 1px solid var(--border); padding-bottom: .6rem; }
.tab-link {
  padding: .45rem .9rem; border-radius: 999px; font-size: .88rem;
  background: var(--bg-input); color: var(--text-muted); text-decoration: none;
  border: 1px solid var(--border);
}
.tab-link:hover { color: var(--text); border-color: var(--primary); }
.tab-link.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.tab-count {
  display: inline-block; margin-left: .3rem; padding: 0 .4rem;
  border-radius: 999px; background: var(--bg-input); color: var(--text-muted);
  font-size: .75rem; line-height: 1.45; font-weight: 700;
}
.tab-count-alert {
  background: rgba(124,92,255,.16); color: var(--primary);
  box-shadow: 0 0 10px rgba(124,92,255,.55);
  animation: tabPulse 2s ease-in-out infinite;
}
@keyframes tabPulse { 0%,100% { box-shadow: 0 0 6px rgba(124,92,255,.35); } 50% { box-shadow: 0 0 14px rgba(124,92,255,.7); } }
.tooltip { display: inline-block; vertical-align: middle; }
.tooltip img { border-radius: 50%; border: 2px solid var(--border); transition: border-color .15s ease; }
.tooltip:hover img { border-color: var(--primary); }

/* Venne-avatarer med navn (profil) */
.friend-item { display: flex; flex-direction: column; align-items: center; gap: .3rem; text-decoration: none; color: var(--text); width: 72px; cursor: pointer; }
.friend-name { font-size: .72rem; max-width: 72px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }

/* Søgeresultater (Vennepage) */
.search-list { display: flex; flex-direction: column; }
.user-card-search { display: flex; align-items: center; gap: .75rem; padding: .65rem 0; border-bottom: 1px solid var(--border); }
.user-card-search:last-child { border-bottom: none; }
.user-card-search .prowl { display: flex; align-items: center; gap: .75rem; flex: 1; min-width: 0; text-decoration: none; color: var(--text); cursor: pointer; }
.user-card-search .pinfo { min-width: 0; }
.user-card-search .pinfo strong { display: block; }
.user-card-search .pinfo small { color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; font-size: .82rem; }
.user-card-search .pactions { display: flex; gap: .4rem; align-items: center; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }

/* Opt-in checkbox */
.checkbox-label { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; }
.checkbox-label input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }

/* ============================================================
   Hold / Teams
   ============================================================ */

.flex-col { flex-direction: column; align-items: flex-start; gap: .35rem; }

.role-tag { font-size: .72rem; padding: .2rem .55rem; border-radius: 999px; background: var(--bg-input); border: 1px solid var(--border); color: var(--text-muted); white-space: nowrap; }
.rank-select { font: inherit; font-size: .72rem; padding: .2rem .55rem; border-radius: 999px; background: var(--bg-input); border: 1px solid var(--border); color: var(--text-muted); white-space: nowrap; cursor: pointer; max-width: 150px; }
.rank-select:hover { border-color: var(--primary); color: var(--text); }
.role-tag.owner { background: rgba(255,176,32,.12); border-color: var(--warn); color: var(--warn); }
.role-tag.officer { background: rgba(124,92,255,.12); border-color: var(--primary); color: #b7a6ff; }

.member-list { display: flex; flex-direction: column; }
.member-row { display: flex; align-items: center; gap: .75rem; padding: .65rem 0; border-bottom: 1px solid var(--border); }
.member-row:last-child { border-bottom: none; }
.member-row .pinfo { flex: 1; min-width: 0; }
.member-row .pinfo strong { display: block; font-size: .95rem; }
.member-row .pinfo small { color: var(--text-muted); font-size: .82rem; }
.member-row .pactions { display: flex; gap: .4rem; align-items: center; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }

.team-header { position: relative; overflow: hidden; padding: 2.25rem 1.25rem; margin-bottom: .6rem; }
.team-banner { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .45; z-index: 0; }
.team-header-inner { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(13,15,20,.25), rgba(13,15,20,.92)); z-index: 1; }
.team-header .card-header, .team-header .profile-head, .team-header .team-head-inner { position: relative; z-index: 2; }
.team-head-inner { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.team-thumb { width: 88px; height: 88px; border-radius: 14px; object-fit: cover; background: var(--bg-input); border: 2px solid var(--border); flex-shrink: 0; }
.team-head-inner h1 { font-size: 1.9rem; line-height: 1.15; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.team-type { font-size: .8rem; color: var(--text-muted); }
.team-slug { max-width: 380px; }

.perms-details { padding: .6rem .75rem; background: var(--bg-soft); border: 1px dashed var(--border); border-radius: var(--radius); margin-top: .4rem; }

.alert-info { background: rgba(124,92,255,.1); border: 1px solid var(--primary); color: #b7a6ff; }

.wanted-tag { font-size: .75rem; background: var(--bg-input); border: 1px dashed var(--primary); color: #b7a6ff; padding: .15rem .5rem; border-radius: 999px; }

.divider { border-top: 1px solid var(--border); margin: 1rem 0; }
.section-title { font-size: .95rem; font-weight: 700; margin-bottom: .6rem; }

.avatar-preview { display: flex; flex-direction: column; align-items: center; gap: .5rem; text-align: center; }
.avatar-preview svg { box-shadow: var(--shadow); }

.avatar-group { margin-bottom: .7rem; }
.avatar-group-label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: .35rem; }
.avatar-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.avatar-chips input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .65rem; font-size: .8rem; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; background: var(--bg-card); transition: border-color .15s, background .15s; user-select: none; }
.chip:hover { border-color: var(--primary); }
.chip:has(input:checked) { border-color: var(--accent); background: rgba(0,224,198,.12); color: var(--accent); }
.swatch { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.35); flex-shrink: 0; }

.av3d-layout { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; }
.av3d-box { width: 320px; flex-shrink: 0; position: sticky; top: 1rem; }
#av3d { aspect-ratio: 8 / 10; width: 100%; border-radius: var(--radius); border: 1px solid var(--border); background: radial-gradient(circle at 50% 45%, #20263a 0%, #141720 70%, #0d0f14 100%); overflow: hidden; }
.av3d-controls { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: .5rem; }
.av3d-controls .checkbox-label { font-size: .85rem; }
.av3d-hint { font-size: .78rem; margin-top: .55rem; }

.av3d-form { flex: 1; min-width: 280px; }

.av-dd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .7rem; margin: .8rem 0 1rem; }
.av-dd { position: relative; }
.av-dd-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: .3rem; }
.av-dd-btn { display: flex; align-items: center; gap: .5rem; width: 100%; padding: .4rem .6rem; border: 1px solid var(--border); border-radius: calc(var(--radius) / 2); background: var(--bg-card); cursor: pointer; font: inherit; font-size: .85rem; color: var(--text); transition: border-color .15s; }
.av-dd-btn:hover { border-color: var(--primary); }
.av-dd-btn::after { content: ''; margin-left: auto; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--text-muted); flex-shrink: 0; }
.av-dd[open] .av-dd-btn { border-color: var(--primary); }
.av-dd[open] .av-dd-btn::after { transform: rotate(180deg); }
.av-dd-cur { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av-dd-thumb { width: 28px; height: 28px; border-radius: 6px; background-size: 28px 28px; background-position: center; background-repeat: no-repeat; background-color: rgba(255,255,255,.03); border: 1px solid rgba(0,0,0,.3); flex-shrink: 0; }
.av-dd-thumb--none { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Cline x1='5' y1='23' x2='23' y2='5' stroke='%23a49bb0' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E"); }
.av-dd-list { display: none; position: absolute; z-index: 60; left: 0; right: 0; top: 100%; margin-top: .3rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: calc(var(--radius) / 2); box-shadow: 0 8px 24px rgba(0,0,0,.4); max-height: 280px; overflow-y: auto; }
.av-dd[open] .av-dd-list { display: block; }
.av-dd.av-dd-up .av-dd-list { top: auto; bottom: 100%; margin-top: 0; margin-bottom: .3rem; }
.av-dd-opt { display: flex; align-items: center; gap: .55rem; padding: .4rem .6rem; cursor: pointer; font-size: .82rem; color: var(--text); transition: background .12s; }
.av-dd-opt:hover { background: rgba(0,224,198,.08); }
.av-dd-opt input { position: absolute; opacity: 0; pointer-events: none; }
.av-dd-opt:has(input:checked) { background: rgba(0,224,198,.14); color: var(--accent); }
.av-dd-opt-label { display: inline-flex; align-items: center; gap: .35rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av-dd-disabled { opacity: .5; pointer-events: none; }
.av-note { font-size: .82rem; color: var(--accent); margin: -.2rem 0 .6rem; }

@media (max-width: 700px) {
    .av3d-box { width: 100%; position: static; }
    .av3d-layout { flex-direction: column; }
    .av-dd-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .av-dd-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Sidebar-layout (lodret menu)
   ============================================================ */
.app-topbar {
    display: none; position: sticky; top: 0; z-index: 60;
    align-items: center; gap: .75rem; padding: .6rem 1rem;
    background: var(--bg-card); border-bottom: 1px solid var(--border);
}
.app-burger {
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text); font-size: 1.15rem;
    line-height: 1; padding: .35rem .6rem; cursor: pointer;
}
.app-brand {
    font-weight: 800; font-size: 1.25rem; letter-spacing: .5px; white-space: nowrap;
    text-decoration: none; color: var(--text);
    background: linear-gradient(90deg, var(--primary), var(--accent));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.app-brand-lg { font-size: 1.45rem; text-align: center; }
.app-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 65; }
.app-overlay.show { display: block; }

.app-sidebar {
    position: fixed; top: 0; left: 0; width: 250px; height: 100vh;
    background: var(--bg-card); border-right: 1px solid var(--border);
    z-index: 70; display: flex; flex-direction: column;
    padding: 1rem; box-sizing: border-box; overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.app-sidebar::-webkit-scrollbar { width: 8px; }
.app-sidebar::-webkit-scrollbar-track { background: transparent; }
.app-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
.app-sidebar::-webkit-scrollbar-thumb:hover { background: var(--primary); }
.app-close {
    display: none; position: absolute; top: .6rem; right: .6rem;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: 50%; color: var(--text); width: 30px; height: 30px;
    font-size: .95rem; line-height: 1; cursor: pointer;
}
.app-user {
    display: flex; flex-direction: column; align-items: center; gap: .5rem;
    padding-bottom: 1rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem;
}
.app-user-name { font-weight: 700; font-size: .95rem; }
.app-logo-row {
    display: flex; justify-content: center;
    padding-bottom: 1rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem;
}
.app-logo-row a { line-height: 1.2; }
.app-nav { display: flex; flex-direction: column; gap: .15rem; }
.app-nav a {
    display: flex; align-items: center; gap: .6rem;
    padding: .5rem .6rem; border-radius: var(--radius);
    color: var(--text); text-decoration: none; font-size: .9rem; white-space: nowrap;
}
.app-nav a:hover { background: var(--bg-input); }
.app-nav a.active { background: var(--bg-input); color: var(--accent); }
.app-ico { display: inline-flex; align-items: center; justify-content: center; width: 22px; flex-shrink: 0; color: var(--primary); }
.app-nav a.active .app-ico { color: var(--accent); }
.app-svg { width: 20px; height: 20px; }
.app-nav .badge { margin-left: auto; }

.app-main { margin-left: 250px; padding: 1.5rem; min-height: calc(100vh - 60px); }
.app-footer {
    margin-left: 250px; border-top: 1px solid var(--border);
    padding: 1.2rem 1.5rem; color: var(--text-muted); font-size: .85rem;
}

@media (max-width: 900px) {
    .app-topbar { display: flex; }
    .app-sidebar { transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow); }
    .app-sidebar.open { transform: translateX(0); }
    .app-close { display: inline-flex; align-items: center; justify-content: center; }
    .app-main { margin-left: 0; }
    .app-footer { margin-left: 0; }
}

/* Gruppe-chat ikon */
.chat-group-ico {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
    background: var(--bg-input); border: 1px solid var(--border); font-size: 1.1rem;
}

/* XP & level */
.level-badge {
    display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .03em;
    padding: .15rem .5rem; border-radius: 999px; vertical-align: middle;
    background: linear-gradient(90deg, var(--primary), var(--accent)); color: #141720;
}
.title-tag { color: var(--accent); font-weight: 700; }
.handle { color: var(--text-muted); font-weight: 600; }
.xp-bar {
    height: 8px; border-radius: 999px; background: var(--bg-input);
    border: 1px solid var(--border); overflow: hidden; margin-top: .4rem; max-width: 420px;
}
.xp-bar-sm { height: 6px; width: 100%; max-width: none; margin-top: .35rem; }
.xp-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 999px; transition: width .4s ease; }
.app-user-lv { font-size: .75rem; color: var(--accent); font-weight: 700; margin-top: -.15rem; }