:root {
  --bg: #0d0b14;
  --bg2: #15121f;
  --card: #1b1728;
  --card2: #231e34;
  --line: #2e2844;
  --text: #ece9f5;
  --muted: #9a93b3;
  --accent: #8b5cf6;
  --accent2: #22d3a6;
  --live: #ff3b5c;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, system-ui, sans-serif; font-size: 15px; line-height: 1.5; }
body { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(1200px 600px at 80% -10%, #2a1a5566, transparent), var(--bg); }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: "Space Grotesk", Inter, sans-serif; margin: 0 0 .4em; line-height: 1.15; }
h1 { font-size: clamp(28px, 5vw, 48px); }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

.shell { width: 100%; display: grid; grid-template-columns: 230px minmax(0, 1fr) 280px; min-height: 100vh; }
.side-left { position: sticky; top: 0; height: 100vh; padding: 20px 14px; border-right: 1px solid var(--line); background: #0b0911; display: flex; flex-direction: column; gap: 22px; }
.side-right { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 76px 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.main-col { min-width: 0; display: flex; flex-direction: column; }
.logo { font-family: "Space Grotesk"; font-weight: 700; font-size: 22px; display: flex; align-items: center; gap: 8px; padding: 0 8px; }
.logo-mark { color: var(--accent2); }
.sidenav { display: grid; gap: 4px; }
.navitem { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: var(--muted); font-weight: 600; }
.navitem .ni { width: 22px; text-align: center; }
.navitem:hover { background: var(--card); color: var(--text); }
.navitem.active { background: var(--accent); color: #fff; box-shadow: 0 6px 20px #8b5cf655; }
.navitem .badge { margin-left: auto; }
.side-cta { margin-top: auto; }
.cta-card { background: linear-gradient(160deg, #2a1f4a, #18142a); border: 1px solid var(--line); border-radius: 16px; padding: 18px; text-align: center; display: grid; gap: 8px; }
.cta-card .cta-ic { font-size: 30px; }
.cta-card p { margin: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 12px 24px; background: #0d0b14d9; backdrop-filter: blur(10px); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.bell { position: relative; font-size: 20px; padding: 6px; }
.bell .badge { position: absolute; top: -2px; right: -6px; }
.me-chip { position: relative; display: inline-flex; }
.me-chip .avatar { width: 38px; height: 38px; }
.me-chip .dot-online { position: absolute; right: 0; bottom: 0; border: 2px solid var(--bg); width: 11px; height: 11px; }
.badge { background: var(--live); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 6px; margin-left: 4px; }
.dot-online { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #22c55e; }
.mobile-only { display: none !important; }

main { flex: 1; width: 100%; max-width: 1000px; margin: 0 auto; padding: 8px 24px 60px; }
.footer { text-align: center; padding: 24px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
.footer a { color: var(--accent2); }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }

/* Home */
.hero2 { position: relative; border-radius: 22px; overflow: hidden; min-height: 280px; padding: 38px 36px; display: flex; align-items: center;
  background: radial-gradient(800px 400px at 85% 0%, #7c3aed88, transparent), radial-gradient(600px 300px at 10% 110%, #0ea5e955, transparent), linear-gradient(135deg, #1e1538, #120f22);
  background-size: cover; background-position: center; border: 1px solid #ffffff14; }
.hero2-inner { position: relative; z-index: 1; max-width: 560px; display: grid; gap: 14px; }
.hero2 h1 { font-size: clamp(32px, 5vw, 52px); margin: 0; }
.hero2 p { margin: 0; color: #d8d3ea; font-size: 17px; }
.hero-tag { position: absolute; right: 34px; top: 40px; transform: rotate(-8deg); font-family: "Space Grotesk"; font-weight: 700; font-style: italic; color: #fff; text-align: center; opacity: .9; text-shadow: 0 2px 10px #0008; }
.searchbar { display: flex; align-items: center; gap: 8px; background: #0d0b14cc; border: 1px solid #ffffff22; border-radius: 14px; padding: 6px 6px 6px 14px; backdrop-filter: blur(8px); }
.searchbar input { border: 0; background: transparent; padding: 8px 4px; }
.pop-games { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.pop-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, border-color .15s; }
.pop-card:hover { transform: translateY(-3px); border-color: #ffffff33; }
.pop-img { height: 110px; background-size: cover; background-position: center; position: relative; display: grid; place-items: center; }
.pop-img .emoji { font-size: 44px; filter: drop-shadow(0 4px 10px #0007); }
.pop-body { padding: 12px; display: grid; gap: 5px; }
.group-list { display: grid; gap: 10px; margin-top: 12px; }
.group-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto auto; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.group-row.is-full { opacity: .6; }
.gr-thumb { width: 56px; height: 56px; border-radius: 12px; background-size: cover; background-position: center; display: grid; place-items: center; font-size: 26px; }
.gr-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gr-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gr-meta { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; white-space: nowrap; }
.gr-time { white-space: nowrap; }
.side-card { display: grid; gap: 10px; border-radius: 16px; }
.online-list { display: grid; gap: 10px; }
.online-row { display: flex; gap: 10px; align-items: center; }
.online-row .avatar { width: 36px; height: 36px; }
.ou-name { font-weight: 600; font-size: 14px; }
.qa { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; font: inherit; font-weight: 600; color: var(--text); background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.qa:hover { border-color: var(--accent); }
.help { text-align: center; background: linear-gradient(160deg, #4c1d95, #2a1f4a); }
.help p { margin: 0; }
.pick-games { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.pick-game { border: 1px solid #ffffff1a; border-radius: 12px; height: 70px; background-size: cover; background-position: center; color: #fff; font: inherit; font-weight: 700; cursor: pointer; display: flex; align-items: flex-end; padding: 8px; text-shadow: 0 2px 6px #000; }
.pick-game:hover { border-color: var(--accent); }

@media (max-width: 1250px) { .shell { grid-template-columns: 220px minmax(0, 1fr); } .side-right { display: none; } .pop-games { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side-left { display: none; }
  .mobile-only { display: flex !important; }
  .topbar { justify-content: space-between; padding: 10px 14px; }
  main { padding: 8px 14px 90px; }
  .bottomnav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: #0b0911f2; backdrop-filter: blur(10px); border-top: 1px solid var(--line); justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bottomnav .navitem { flex-direction: column; gap: 2px; padding: 6px 8px; font-size: 11px; position: relative; }
  .bottomnav .navitem .badge { position: absolute; top: 0; right: 4px; margin: 0; }
  .bottomnav .navitem.active { box-shadow: none; }
  .hero2 { padding: 26px 20px; min-height: 230px; }
  .hero-tag { display: none; }
  .pop-games { grid-template-columns: repeat(5, 150px); overflow-x: auto; padding-bottom: 6px; }
  .group-row { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .group-row .gr-meta, .group-row .gr-time { display: none; }
  .gr-thumb { width: 48px; height: 48px; }
  .footer { padding-bottom: 90px; }
}

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; font: inherit; font-weight: 600; padding: 10px 16px; border-radius: 12px; background: var(--accent); color: #fff; transition: transform .08s, filter .15s; }
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: scale(.98); }
.btn.ghost { background: var(--card2); color: var(--text); border: 1px solid var(--line); }
.btn.green { background: var(--accent2); color: #062018; }
.btn.danger { background: transparent; color: #ff7b93; border: 1px solid #5a2433; }
.btn.small { padding: 6px 10px; font-size: 13px; border-radius: 10px; }
.btn.discord { background: #5865f2; }
.btn.twitch { background: #9146ff; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }

.hero { padding: 28px 0 10px; display: grid; gap: 18px; }
.hero p { font-size: 18px; color: var(--muted); max-width: 620px; margin: 0; }
.glow, .hero .glow { background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.section { margin-top: 34px; }

.search { width: 100%; max-width: 420px; }
input, select, textarea { width: 100%; font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { min-height: 90px; resize: vertical; }
label { display: grid; gap: 6px; font-weight: 500; font-size: 14px; }
.form { display: grid; gap: 14px; }
.grid2 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: auto; }

.games { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.games { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.game { position: relative; min-height: 150px; background-color: var(--card); background-size: cover; background-position: center; border: 1px solid #ffffff14; border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; overflow: hidden; transition: transform .15s, box-shadow .15s, border-color .15s; }
.game:hover { transform: translateY(-3px); border-color: #ffffff40; box-shadow: 0 12px 30px #0008; }
.game .emoji { position: absolute; top: 10px; right: 12px; font-size: 44px; opacity: .9; filter: drop-shadow(0 4px 10px #0006); transition: transform .2s; }
.game:hover .emoji { transform: scale(1.12) rotate(-6deg); }
.game .name { font-family: "Space Grotesk"; font-weight: 700; font-size: 18px; text-shadow: 0 2px 8px #000a; }
.game .count { color: var(--accent2); font-size: 13px; font-weight: 600; }
.game-banner { margin: 8px 0 0; padding: 26px 22px; min-height: 170px; border-radius: 18px; background-size: cover; background-position: center; display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; border: 1px solid #ffffff14; }
.game-banner h1 { text-shadow: 0 2px 12px #000a; }
.chip.glass { background: #0006; border-color: #ffffff26; color: #fff; backdrop-filter: blur(6px); }
.chip.act { color: #c4b5fd; border-color: #4c3a8a; }
.chip.full { color: #fff; background: #ff3b5c; border-color: #ff3b5c; }
.chip.joined { color: #062018; background: var(--accent2); border-color: var(--accent2); }
.post.is-full { opacity: .65; }
.chip.time { color: #fff; background: #ff3b5c22; border-color: #ff3b5c66; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.list { display: grid; gap: 12px; }
.post { display: grid; gap: 8px; }
.post .title { font-weight: 600; font-size: 16px; }
.post .body { color: #d7d2e8; white-space: pre-wrap; word-break: break-word; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--card2); border: 1px solid var(--line); color: var(--muted); }
.chip.lvl-nyborjare { color: #7dd3fc; border-color: #1e4a63; }
.chip.lvl-medel { color: #a7f3d0; border-color: #1f5546; }
.chip.lvl-erfaren { color: #fcd34d; border-color: #5c4a14; }
.chip.lvl-pro { color: #f9a8d4; border-color: #6b2450; }
.toggle { cursor: pointer; user-select: none; }
.toggle.on { background: var(--accent); color: #fff; border-color: var(--accent); }

.user { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--card2); display: inline-grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--muted); flex: none; border: 1px solid var(--line); }
.avatar.big { width: 84px; height: 84px; font-size: 30px; }
.flag { font-size: 16px; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: 18px 0; overflow-x: auto; }
.tab { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; cursor: pointer; }
.tab.active { color: var(--text); border-color: var(--accent); }

.filters { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 14px; }

.chat { display: flex; flex-direction: column; height: min(62vh, 560px); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg .meta { font-size: 13px; }
.msg .text { white-space: pre-wrap; word-break: break-word; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: var(--bg2); }
.bubble { max-width: 75%; padding: 8px 12px; border-radius: 14px; background: var(--card2); white-space: pre-wrap; word-break: break-word; }
.bubble.me { align-self: flex-end; background: var(--accent); color: #fff; }

.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 0 #ff3b5c88; animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 #ff3b5c88; } 70% { box-shadow: 0 0 0 8px #ff3b5c00; } 100% { box-shadow: 0 0 0 0 #ff3b5c00; } }
.live-strip { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.live-card { display: flex; align-items: center; gap: 10px; }
.live-tag { color: var(--live); font-weight: 700; font-size: 12px; letter-spacing: .05em; }

.profile-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.notice { background: #22d3a614; border: 1px solid #22d3a655; border-radius: 12px; padding: 12px 14px; }
.notice.warn { background: #f59e0b14; border-color: #f59e0b55; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.link { color: var(--accent2); font-weight: 600; }
.welcome { max-width: 560px; margin: 20px auto; padding: 28px; }
.flag-preview { font-size: 42px; line-height: 1; min-height: 42px; display: flex; align-items: center; gap: 10px; }
.flag-preview span { font-size: 16px; color: var(--muted); }
.modal { position: fixed; inset: 0; z-index: 50; background: #000a; display: grid; place-items: center; padding: 20px; }
.modal-box { width: 100%; max-width: 440px; background: var(--bg2); border: 1px solid var(--line); border-radius: 18px; padding: 22px; display: grid; gap: 14px; max-height: 90vh; overflow-y: auto; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--card2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; z-index: 60; }


.chip.now { color: #062018; background: var(--accent2); border-color: var(--accent2); }
.chip.reg { color: #e9d5ff; background: #6d28d933; border-color: #7c3aed88; }
.chip.newb { color: #bbf7d0; background: #16a34a22; border-color: #16a34a77; }
.gr-chips { margin-top: 3px; }
.gr-chips .chip { font-size: 11px; padding: 1px 7px; }
.kind-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kind-opt { display: block; cursor: pointer; }
.kind-opt input { position: absolute; opacity: 0; pointer-events: none; }
.kind-opt span { display: grid; gap: 2px; text-align: center; padding: 10px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--card2); }
.kind-opt small { color: var(--muted); font-size: 11px; font-weight: 500; }
.kind-opt input:checked + span { border-color: var(--accent); background: #8b5cf622; box-shadow: 0 0 0 1px var(--accent) inset; }
.linkbtn { background: none; border: 0; color: #ff7b93; cursor: pointer; font: inherit; font-size: 12px; padding: 0; }
.id-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 10px; }
.id-pill { display: flex; align-items: center; gap: 10px; text-align: left; font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; min-width: 0; }
.id-pill:hover { border-color: var(--accent); }
.id-pill strong { word-break: break-all; }
.id-ic { font-size: 20px; }
.id-copy { margin-left: auto; color: var(--muted); }
.chip.verified { color: #062018; background: #66c0f4; border-color: #66c0f4; }
.steam-card { background: linear-gradient(135deg, #171a21, #1b2838); border-color: #2a475e; }
.btn.steam { background: #1b2838; border: 1px solid #66c0f4; color: #c7d5e0; }
