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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --accent: #06b6d4;
    --bg: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-hover: #252542;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);
    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;
    --gradient-1: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
    --gradient-2: linear-gradient(135deg, #06b6d4 0%, #6366f1 100%);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.35);
    --transition: .25s ease;
    --font: 'Inter', system-ui, -apple-system, sans-serif;
}

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;
    overflow-x: hidden;
    position: relative;
}

/* Ambient glow background (demo look) */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 20%, rgba(6, 182, 212, 0.1) 0%, transparent 40%);
    pointer-events: none;
    z-index: -1;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary); }

.container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 1.5rem;
    box-sizing: border-box;
}
.container-nav { max-width: 1800px; }

.site-shell {
    width: 100%;
    padding: 0 1.25rem;
    box-sizing: border-box;
}

/* ── Navbar ── */
.navbar {
    position: sticky; top: 0; z-index: 200;
    background: rgba(15, 15, 26, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    overflow: visible;
}

.nav-inner {
    display: flex; align-items: center; gap: .75rem;
    height: 64px;
    overflow: visible;
}

.nav-brand {
    display: flex; align-items: center; gap: .5rem;
    font-weight: 800; font-size: 1.25rem;
    white-space: nowrap; flex-shrink: 0;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.3px;
}
.nav-brand:hover { opacity: 0.9; }
.nav-brand img,
.nav-logo {
    height: 32px;
    border-radius: 8px;
    -webkit-text-fill-color: initial;
}

/* ── Nav Links ── */
.nav-links {
    display: flex; align-items: center; gap: .25rem;
    flex: 1 1 auto; min-width: 0; justify-content: center;
    overflow: visible;
}

.nav-link {
    padding: .5rem .85rem; border-radius: var(--radius);
    color: var(--text-muted); font-size: .875rem; font-weight: 500;
    white-space: nowrap; transition: all var(--transition);
}

.nav-link:hover {
    color: var(--text);
    background: var(--bg-card);
}

.nav-link.active {
    background: var(--gradient-1);
    color: #fff;
}

.nav-dropdown { position: relative; z-index: 210; }
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    min-width: 180px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    padding: .5rem 0;
    z-index: 220;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 0;
    right: 0;
    height: 6px;
}
.nav-dropdown-menu a {
    display: block; padding: .5rem 1rem; color: var(--text-muted); font-size: .875rem;
}
.nav-dropdown-menu a:hover { background: var(--bg-hover); color: var(--text); }

.nav-actions { display: flex; align-items: center; gap: .375rem; margin-left: auto; flex-shrink: 0; }

.nav-user-dropdown .nav-dropdown-menu {
    left: auto;
    right: 0;
    min-width: 210px;
}

.nav-user-trigger {
    display: flex;
    align-items: center;
    gap: .375rem;
    padding: .35rem .5rem .35rem .35rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text);
    font-size: .8125rem;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    max-width: min(220px, 28vw);
}

.nav-user-trigger:hover,
.nav-user-dropdown.open .nav-user-trigger,
.nav-user-dropdown:focus-within .nav-user-trigger {
    background: var(--bg-hover);
    border-color: var(--border);
}

.nav-user-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-user-chevron {
    font-size: .65rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.nav-user-notify-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6366f1;
    border: 2px solid var(--bg, #0f172a);
}

.nav-user-menu-head {
    padding: .65rem 1rem .5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: .35rem;
}

.nav-user-menu-head strong {
    display: block;
    font-size: .875rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-user-menu-head span {
    font-size: .75rem;
    color: var(--text-muted);
}

.nav-user-menu a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

.nav-user-menu-badge-link .nav-mail-badge,
.nav-user-menu-badge-link .nav-friends-badge {
    margin-left: auto;
}

.nav-user-menu-divider {
    height: 1px;
    background: var(--border);
    margin: .35rem 0;
}

.nav-user-menu-admin {
    color: var(--accent, #06b6d4) !important;
}

.nav-user-menu-topup {
    color: #fbbf24 !important;
}

.nav-user-logout {
    color: #f87171 !important;
}

.nav-user-dropdown:hover .nav-user-menu,
.nav-user-dropdown:focus-within .nav-user-menu,
.nav-user-dropdown.open .nav-user-menu {
    display: block;
}

.nav-mail-badge,
.nav-friends-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.3rem;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 999px;
    color: #fff;
    flex-shrink: 0;
}

.nav-mail-badge {
    background: #6366f1;
}

.nav-friends-badge {
    background: #ef4444;
}

.nav-mail-badge[hidden],
.nav-friends-badge[hidden] {
    display: none !important;
}

.nav-user {
    display: flex; align-items: center; gap: .375rem;
    color: var(--text); font-size: .8125rem; font-weight: 500;
}

.nav-toggle {
    display: none; 
    flex-direction: column; 
    gap: 4px;
    background: none; 
    border: none; 
    cursor: pointer; 
    padding: .65rem;
    min-height: 44px;
    min-width: 44px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.nav-toggle:hover {
    background: var(--bg-hover);
}

.nav-toggle span {
    display: block; width: 22px; height: 2px;
    background: var(--text); border-radius: 2px; transition: var(--transition);
}

/* Roter striberne når menuen er åben */
.nav-toggle.active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ── Buttons ── */
/* ── Buttons Mobile ── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .625rem 1.25rem; border-radius: var(--radius-sm);
    font-size: .875rem; font-weight: 600; font-family: var(--font);
    border: none; cursor: pointer; transition: all var(--transition);
    text-decoration: none; line-height: 1.4;
    min-height: 44px; /* Minimum touch target for iOS */
}

@media (max-width: 480px) {
    .btn {
        padding: .55rem .95rem;
        font-size: .8125rem;
        min-height: 40px;
    }
    .btn-sm { 
        padding: .35rem .65rem;
        min-height: 36px;
    }
}

.btn-primary { background: var(--gradient-1); color: #fff; box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4); color: #fff; }
.btn-secondary { background: var(--bg-hover); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-card); color: var(--text); border-color: rgba(99, 102, 241, 0.4); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: rgba(99, 102, 241, 0.08); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn-steam { background: linear-gradient(90deg, #1b2838, #2a475e); color: #fff; }
.btn-steam:hover { opacity: .9; color: #fff; }
.btn-sm { padding: .375rem .75rem; font-size: .8125rem; }
.btn-block { width: 100%; }

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
    position: relative;
    overflow: hidden;
}
.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gradient-2);
    opacity: 0.85;
}
.card:hover {
    border-color: rgba(99, 102, 241, 0.35);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

@media (max-width: 768px) {
    .card {
        padding: 1.25rem;
        border-radius: calc(var(--radius) - 4px);
    }
}

@media (max-width: 480px) {
    .card {
        padding: 1rem;
        border-radius: calc(var(--radius) - 6px);
    }
}

/* ── Hero ── */
.hero {
    padding: 4rem 0 3rem;
    text-align: center;
}
.hero-gradient {
    background: transparent;
    border-bottom: none;
}

/* Mobil: reduceret padding for hero (uden banner-billede) */
@media (max-width: 768px) {
    .hero:not(.hero-banner) { padding: 2rem 0 1.5rem; }
    .hero:not(.hero-banner) .hero-content h2 { font-size: clamp(1.5rem, 6vw, 2rem); }
    .hero:not(.hero-banner) .hero-content p { font-size: 0.95rem; padding: 0 0.5rem; }
}

@media (max-width: 480px) {
    .hero:not(.hero-banner) { padding: 1.5rem 0 1rem; }
    .hero:not(.hero-banner) .hero-content h2 { font-size: clamp(1.25rem, 5vw, 1.5rem); }
}
.hero-banner {
    padding: 0;
    border-bottom: 1px solid var(--border);
}
.hero-banner-wrap {
    position: relative;
    width: 100%;
    max-width: 1700px;
    margin: 0 auto;
}
.hero-banner-img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1700 / 244;
    object-fit: cover;
}
.hero-banner-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(rgba(15, 23, 42, 0.25), rgba(15, 23, 42, 0.55));
    text-align: center;
}
.hero-banner .hero-content h1,
.hero-banner .hero-content h2 {
    background: none;
    -webkit-text-fill-color: #fff;
    color: #fff;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.65);
}
.hero-banner .hero-content p {
    color: rgba(241, 245, 249, 0.92);
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55);
}

/* Banner-billede er meget lavt (1700×244) — på mobil stables tekst under billedet */
@media (max-width: 768px) {
    .hero-banner {
        padding: 0;
    }

    .hero-banner-wrap {
        display: flex;
        flex-direction: column;
    }

    .hero-banner-img {
        aspect-ratio: 16 / 5;
        max-height: 110px;
        object-fit: cover;
        object-position: center;
    }

    .hero-banner-overlay {
        position: relative;
        inset: auto;
        padding: 1.25rem 0 1.5rem;
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1), rgba(6, 182, 212, 0.08));
    }

    .hero-banner .hero-content h2 {
        font-size: clamp(1.25rem, 6vw, 1.75rem);
        line-height: 1.25;
        overflow-wrap: anywhere;
        text-shadow: none;
    }

    .hero-banner .hero-content p {
        font-size: 0.9rem;
        line-height: 1.5;
        text-shadow: none;
        color: var(--text-muted);
    }
}

.home-banner-preview {
    max-width: 100%;
    overflow: hidden;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.home-banner-preview img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1700 / 244;
    object-fit: cover;
}
.hero-content h1,
.hero-content h2 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -1.5px;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-content p { color: var(--text-muted); font-size: 1.15rem; max-width: 640px; margin: 0 auto; line-height: 1.7; }

/* ── Community stats bar ── */
.community-stats-bar {
    padding: 0 0 0.5rem;
    margin-top: -0.5rem;
}

.community-stats-grid {
    margin-bottom: 0;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.community-stats-grid .stat-card {
    padding: 1.1rem 1.25rem;
    text-align: center;
}

.community-stats-grid .stat-value {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media (max-width: 768px) {
    .community-stats-bar {
        margin-top: 0;
        padding: 0.75rem 0;
    }
    .community-stats-grid {
        max-width: 100%;
    }
}

/* ── Layout grid (home m.fl. med sidebar; ellers fuld bredde) ── */
.page-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    padding: 2rem 0;
}
.page-grid:not(:has(.page-sidebar)),
.page-grid--single {
    display: block;
    grid-template-columns: 1fr;
}
.page-main { min-width: 0; width: 100%; }
.page-sidebar { display: flex; flex-direction: column; gap: 1.5rem; }

.main-content { flex: 1; min-width: 0; width: 100%; }

/* Ensartet sideindhold */
.page-content { padding: 2rem 0 3rem; }
.page-header-block {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.page-header-block h1 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; width: 100%; letter-spacing: -0.02em; }
.page-header-block .breadcrumb { width: 100%; }
.page-content > .page-header-block,
.page-header {
    margin-bottom: 1.5rem;
}
.page-content .card,
.container > .card { width: 100%; }
.page-content .table { width: 100%; }

/* Profile edit — one centered column */
.profile-edit-page .profile-edit-stack {
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.profile-edit-page .page-header-block {
    margin-bottom: 0;
}

.profile-edit-page .profile-edit-card,
.profile-edit-page .user-admin-panel-card {
    width: 100%;
    margin: 0;
}

.profile-edit-page .section {
    margin: 0;
}

.profile-edit-page .section h2 {
    margin: 0 0 1rem;
    font-size: 1.1rem;
}

.profile-edit-page .achievement-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.profile-edit-page .profile-edit-admin-note {
    margin: 0;
    font-size: 0.875rem;
}

.profile-edit-page .form-group:last-of-type {
    margin-bottom: 0;
}

.profile-edit-page .btn-primary[type="submit"] {
    margin-top: 0.5rem;
}

/* Profile */
.page-profile .container.profile-page { padding: 2rem 0 3rem; }
.profile-page-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}
.page-profile .achievement-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.page-header {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    padding: 2rem 0 1rem;
}
.page-header h1 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; }
.breadcrumb { color: var(--text-muted); font-size: .875rem; width: 100%; }
.breadcrumb:hover { color: var(--accent); }

.section { margin-bottom: 2.5rem; }
/* ── Section Headers ── */
.section-header { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    margin-bottom: 1.25rem; 
    gap: 0.75rem;
    flex-wrap: wrap;
}

.section-header h2 { 
    font-size: clamp(1.15rem, 3vw, 1.65rem); 
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.section-header h2::before {
    content: '';
    width: 4px;
    height: 1.35em;
    background: var(--gradient-1);
    border-radius: 2px;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .section-header h2 {
        font-size: 1rem;
    }
    .section-header .btn-ghost {
        padding: 0.35rem 0.65rem;
        font-size: 0.8125rem;
    }
}

/* ── News Grid ── */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }

.twitch-live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.twitch-live-card { padding: 0; overflow: hidden; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.twitch-live-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(145, 70, 255, .25); }
.twitch-live-thumb { position: relative; aspect-ratio: 16/9; background: #1a1a2e; overflow: hidden; }
.twitch-live-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.twitch-live-badge { position: absolute; top: .5rem; left: .5rem; background: #eb0400; color: #fff; font-size: .7rem; font-weight: 700; padding: .15rem .45rem; border-radius: 4px; letter-spacing: .05em; }
.twitch-viewer-count { position: absolute; bottom: .5rem; left: .5rem; background: rgba(0,0,0,.75); color: #fff; font-size: .75rem; padding: .2rem .45rem; border-radius: 4px; }
.twitch-live-body { padding: 1rem; }
.twitch-live-streamer { display: flex; align-items: center; gap: .65rem; margin-bottom: .5rem; }
.twitch-live-streamer strong { display: block; font-size: .95rem; }
.twitch-live-streamer .text-muted { font-size: .8rem; }
.twitch-live-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.twitch-live-title { font-size: .875rem; margin: .35rem 0 .5rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.twitch-sidebar-card h3 { margin-bottom: .75rem; }
.twitch-sidebar-list { display: flex; flex-direction: column; gap: .85rem; }
.twitch-sidebar-item { display: flex; gap: .75rem; text-decoration: none; color: inherit; border-radius: var(--radius); padding: .35rem; margin: -.35rem; transition: background .15s; }
.twitch-sidebar-item:hover { background: rgba(145, 70, 255, .08); }
.twitch-sidebar-thumb { position: relative; width: 96px; flex-shrink: 0; aspect-ratio: 16/9; border-radius: 6px; overflow: hidden; background: #1a1a2e; }
.twitch-sidebar-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.twitch-sidebar-thumb .twitch-live-badge { top: .25rem; left: .25rem; font-size: .6rem; padding: .1rem .3rem; }
.twitch-sidebar-meta { min-width: 0; flex: 1; }
.twitch-sidebar-streamer { display: flex; align-items: center; gap: .45rem; margin-bottom: .25rem; }
.twitch-sidebar-streamer strong { display: block; font-size: .85rem; line-height: 1.2; }
.twitch-sidebar-streamer .text-muted { font-size: .72rem; }
.twitch-sidebar-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex-shrink: 0; font-size: .7rem; display: flex; align-items: center; justify-content: center; }
.twitch-sidebar-title { font-size: .78rem; margin: 0 0 .35rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--text-muted); }
.badge-sm { font-size: .65rem; padding: .1rem .35rem; }

.profile-name-row { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; margin-bottom: .25rem; }
.profile-name-row h1 { margin: 0; }
.profile-twitch-live-badge { display: inline-flex; align-items: center; gap: .4rem; background: #9146ff; color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .05em; padding: .25rem .55rem; border-radius: 999px; text-decoration: none; transition: background .15s, transform .15s; }
.profile-twitch-live-badge:hover { background: #7c3aed; transform: scale(1.03); color: #fff; }
.profile-twitch-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: twitch-pulse 1.4s ease-in-out infinite; }
@keyframes twitch-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .5; transform: scale(.85); } }
.profile-twitch-live-card { margin-top: .75rem; padding: .85rem; max-width: 360px; }
.profile-twitch-live-card-header { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.profile-twitch-live-thumb { width: 100%; border-radius: 6px; aspect-ratio: 16/9; object-fit: cover; display: block; margin-bottom: .5rem; }
.profile-twitch-live-title { font-size: .875rem; margin: 0 0 .35rem; }
.profile-twitch-live-title a { color: inherit; text-decoration: none; }
.profile-twitch-live-title a:hover { color: #9146ff; }

.news-card {
    overflow: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}
.news-card-img { width: 100%; height: 180px; object-fit: cover; display: block; }
.news-card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.news-card-body time {
    font-size: .75rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}
.news-card-body h3 { margin: .5rem 0; font-size: 1.1rem; line-height: 1.3; }
.news-card-body h3 a { color: var(--text); }
.news-card-body h3 a:hover { color: var(--primary); }
.news-card-body p { color: var(--text-muted); font-size: .875rem; margin-bottom: .75rem; flex: 1; }

/* ── Forum ── */
.forum-category-card {
    display: flex; align-items: center; gap: 1.25rem;
    margin-bottom: 1rem; padding: 1.25rem 1.5rem;
}
.forum-cat-icon { font-size: 2rem; width: 2rem; height: 2rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.forum-cat-icon-img { width: 2rem; height: 2rem; object-fit: contain; display: block; border-radius: 6px; }
.forum-cat-info { flex: 1; }
.forum-cat-info h3 a { color: var(--text); font-size: 1.05rem; }
.forum-cat-info p { color: var(--text-muted); font-size: .875rem; }
.forum-cat-stats { text-align: right; font-size: .8125rem; color: var(--text-muted); }

/* ── Shop ── */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem; }
.shop-card { display: flex; flex-direction: column; }
.shop-card-img { width: 100%; height: 140px; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: 1rem; }
.shop-card h3 { font-size: 1rem; margin-bottom: .5rem; }
.shop-card p { color: var(--text-muted); font-size: .875rem; flex: 1; }
.shop-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.price { font-weight: 700; font-size: 1.1rem; color: var(--accent); }
.points-card { text-align: center; }
.points-shop-grid { max-width: 900px; }
.points-card .points-amount {
    font-size: 1.35rem;
    font-weight: 700;
    margin: .5rem 0;
}
.points-buy-form { margin-top: 1rem; }
.points-info-card {
    margin-top: 2rem;
    max-width: 640px;
}
.points-info-card h2 {
    margin: 0 0 .75rem;
    font-size: 1.1rem;
}
.points-info-list {
    margin: 0 0 1rem 1.1rem;
    color: var(--text-muted);
    line-height: 1.6;
}
.points-amount { font-size: 1.5rem; font-weight: 700; color: var(--primary); margin: .5rem 0; }

.osrs-item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.osrs-item-card { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; }
.osrs-item-card img { image-rendering: pixelated; flex-shrink: 0; }

.bond-pouch-grid { max-width: none; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.bond-pouch-account-grid { display: flex; flex-wrap: wrap; gap: 1.25rem; justify-content: space-between; align-items: flex-start; }
.bond-pouch-progress { text-align: right; padding: .75rem 1rem; background: var(--surface-2, rgba(255,255,255,.04)); border-radius: var(--radius-sm); border: 1px solid var(--border); min-width: 140px; }
.bond-pouch-progress-label { display: block; font-size: .8125rem; color: var(--text-muted); margin-bottom: .25rem; }
.bond-pouch-character-row { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--border); max-width: 320px; }
.bond-pouch-card { text-align: left; }
.bond-pouch-card.is-claimed { opacity: .82; }
.bond-pouch-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; margin-bottom: .5rem; }
.bond-pouch-card-head h3 { margin: 0; font-size: 1.05rem; display: flex; align-items: center; gap: .5rem; }
.bond-pouch-card-icon { font-size: 1.35rem; line-height: 1; }
.bond-pouch-card-desc { font-size: .875rem; margin: 0 0 1rem; min-height: 2.5rem; }
.bond-pouch-items { list-style: none; padding: 0; margin: 0 0 1rem; font-size: .875rem; flex: 1; }
.bond-pouch-items li { display: flex; align-items: center; gap: .65rem; padding: .35rem 0; border-bottom: 1px solid var(--border); }
.bond-pouch-items li:last-child { border-bottom: 0; }
.bond-pouch-items img { image-rendering: pixelated; flex-shrink: 0; }
.bond-pouch-card-footer { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--border); }
.bond-pouch-claimed-note { margin: 0; font-size: .875rem; text-align: center; }
.bond-pouch-info { max-width: none; }

/* ── Tables ── */
.table-wrap,
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table { width: 100%; border-collapse: collapse; min-width: 640px; }
.table th, .table td { padding: .75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 600; }
.table tr.clickable { cursor: pointer; transition: background var(--transition); }
.table tr.clickable:hover { background: var(--bg-hover); }

/* ── Forms ── */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .375rem; color: var(--text-muted); }
/* ── Form Controls Mobile ── */
.form-control {
    width: 100%; padding: .7rem .95rem;
    background: rgba(0, 0, 0, 0.22); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text);
    font-family: var(--font); font-size: .9rem;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    min-height: 44px; /* Touch target for iOS */
}

@media (max-width: 480px) {
    .form-control {
        font-size: 16px; /* Forhindrer zoom på iOS */
        padding: .5rem .75rem;
        min-height: 40px;
    }
}

.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.checkbox-label { display: flex; align-items: center; gap: .5rem; font-size: .875rem; margin-bottom: 1rem; cursor: pointer; }
select.form-control { appearance: auto; }

/* ── Auth ── */
.auth-page { display: flex; justify-content: center; padding: 3rem 0; }
.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 2rem 1.75rem;
}
.auth-card h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.65rem;
    font-weight: 800;
}
.auth-divider { display: flex; align-items: center; gap: 1rem; margin: 1.5rem 0; color: var(--text-muted); font-size: .8125rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: .875rem; color: var(--text-muted); }

/* ── Profile ── */
.profile-header { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
/* ── Stats Grid og Card ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }
    .stat-card {
        padding: 1rem 0.75rem;
    }
    .stat-value {
        font-size: 1.5rem;
    }
    .stat-label {
        font-size: 0.75rem;
    }
}

@media (max-width: 380px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

.stat-card { text-align: center; padding: 1.25rem; }
.stat-value { display: block; font-size: 1.75rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: .8125rem; color: var(--text-muted); }
.profile-status-badges { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0; }
.profile-badge {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .2rem .65rem; border-radius: 999px; font-size: .75rem; font-weight: 600;
    background: color-mix(in srgb, var(--badge-color) 18%, transparent);
    color: var(--badge-color); border: 1px solid color-mix(in srgb, var(--badge-color) 35%, transparent);
}
.profile-badge-icon { font-size: .85rem; line-height: 1; }
.inline-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1rem; height: 1rem; margin-left: .2rem; border-radius: 50%;
    font-size: .65rem; font-weight: 700; vertical-align: middle;
}
.inline-badge-verified { background: rgba(6,182,212,.2); color: #06b6d4; }
.inline-badge-owner { background: rgba(251,191,36,.25); font-size: .55rem; width: auto; border-radius: .25rem; padding: 0 .2rem; }
.inline-badge-donor { background: rgba(239,68,68,.2); font-size: .55rem; width: auto; border-radius: .25rem; padding: 0 .2rem; }
.inline-badge-admin { background: rgba(99,102,241,.2); font-size: .55rem; width: auto; border-radius: .25rem; padding: 0 .2rem; }
.achievement-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .75rem;
}
.achievement-card {
    display: flex; align-items: flex-start; gap: .75rem; padding: 1rem;
    border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface);
    position: relative; transition: border-color .15s, opacity .15s;
}
.achievement-card.earned { border-color: color-mix(in srgb, var(--badge-color) 40%, var(--border)); }
.achievement-card.locked { opacity: .45; filter: grayscale(.6); }
.achievement-icon {
    width: 2.5rem; height: 2.5rem; border-radius: .75rem; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 1.25rem;
    background: color-mix(in srgb, var(--badge-color) 15%, transparent);
}
.achievement-body strong { display: block; font-size: .875rem; margin-bottom: .15rem; }
.achievement-body p { margin: 0; font-size: .75rem; color: var(--text-muted); line-height: 1.4; }
.achievement-check {
    position: absolute; top: .5rem; right: .5rem; width: 1.25rem; height: 1.25rem;
    border-radius: 50%; background: var(--success); color: #fff; font-size: .7rem;
    display: flex; align-items: center; justify-content: center; font-weight: 700;
}

/* ── Avatars ── */
.avatar-sm { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.avatar-md { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.avatar-lg { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; }
.avatar-placeholder {
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff; font-weight: 700; font-size: 1.5rem;
}

/* ── Posts / Comments ── */
.post-content { margin-bottom: 1rem; }
.post-author { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; font-size: .875rem; }
.post-author time { color: var(--text-muted); }
.post-body { line-height: 1.7; }
.reply-post { margin-left: 1rem; border-left: 3px solid var(--primary); }
.admin-reply { border-left-color: var(--accent); }
.comment-card { margin-bottom: .75rem; padding: 1rem; }
.comment-header { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; font-size: .875rem; }
.comment-header time { color: var(--text-muted); margin-left: auto; }

/* ── Badges ── */
.badge {
    display: inline-block; padding: .2rem .6rem;
    border-radius: 999px; font-size: .75rem; font-weight: 600;
    background: var(--bg-hover); color: var(--text-muted);
}
.badge-points { background: rgba(99,102,241,.15); color: var(--primary); }
.badge-success { background: rgba(34,197,94,.15); color: var(--success); }
.badge-warning { background: rgba(245,158,11,.15); color: #f59e0b; }
.badge-error { background: rgba(239,68,68,.15); color: var(--error); }
.badge-ghost { background: var(--bg-hover); color: var(--text-muted); }
.badge-muted { background: var(--bg-hover); color: var(--text-muted); }

/* ── Alerts ── */
.alert { padding: .875rem 1.25rem; border-radius: var(--radius-sm); margin: 1rem 0; font-size: .875rem; }
.alert-success { background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.3); color: var(--success); }
.alert-error { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); color: var(--error); }
.alert-info { background: rgba(6,182,212,.1); border: 1px solid rgba(6,182,212,.3); color: var(--accent); }

/* ── FAQ ── */
.faq-item { margin-bottom: .5rem; cursor: pointer; }
.faq-item summary { font-weight: 600; padding: .25rem 0; list-style: none; }
.faq-item summary::before { content: '▸ '; color: var(--primary); }
.faq-item[open] summary::before { content: '▾ '; }
.faq-answer { padding: .75rem 0; color: var(--text-muted); font-size: .875rem; }

/* ── Poll ── */
.poll-card h3 {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: clamp(0.9rem, 3.5vw, 1.05rem);
    margin-bottom: 0.75rem;
}

.poll-card h3::before {
    content: '📊';
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .poll-card {
        padding: 1rem;
    }
    .poll-card h3 {
        font-size: 0.95rem;
    }
}

.poll-option {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .625rem; border-radius: var(--radius-sm);
    cursor: pointer; transition: background var(--transition);
    margin-bottom: .375rem;
}
.poll-option:hover { background: var(--bg-hover); }

/* ── Countdown ── */
.countdown-card { text-align: center; margin-bottom: 1.5rem; }
.countdown-timer { display: flex; justify-content: center; gap: 1.5rem; margin-top: 1rem; }
.countdown-timer div { text-align: center; }
.countdown-timer span { display: block; font-size: 2rem; font-weight: 700; color: var(--primary); }
.countdown-timer small { font-size: .75rem; color: var(--text-muted); }

/* ── Progress ── */
.progress-bar { height: 8px; background: rgba(255, 255, 255, 0.08); border-radius: 999px; overflow: hidden; margin: .75rem 0; }
.progress-fill { height: 100%; background: var(--gradient-1); border-radius: 999px; transition: width .5s ease; }

/* ── Home server status + shared server cards ── */
.home-servers-section {
    margin: 0 auto 2rem;
}

.section-header-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--success);
}

.live-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
    animation: live-pulse 1.8s infinite;
}

@keyframes live-pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
    70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.server-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.server-status-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-lg);
    padding: 1.35rem;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.server-status-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gradient-2);
}

.server-status-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(99, 102, 241, 0.35);
}

.server-status-card-head {
    display: flex;
    align-items: center;
    gap: .85rem;
    margin-bottom: .85rem;
    text-align: left;
}

.server-status-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
    background: var(--gradient-1);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.server-status-card-icon--cs2 { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.server-status-card-icon--csgo { background: linear-gradient(135deg, #22c55e, #06b6d4); }
.server-status-card-icon--css { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.server-status-card-icon--osrs { background: linear-gradient(135deg, #8b5cf6, #ec4899); }

.server-status-card-info h3 {
    margin: 0 0 .15rem;
    font-size: 1.05rem;
    color: var(--text);
    line-height: 1.25;
}

.server-status-card-info span {
    font-size: .8rem;
    color: var(--text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.server-status-pill {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .4rem .85rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    margin-bottom: .85rem;
}

.server-status-pill.online {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.server-status-pill.offline {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.server-status-stats {
    display: flex;
    gap: .75rem;
    padding-top: .85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.server-status-stat {
    flex: 1;
    text-align: center;
    min-width: 0;
}

.server-status-stat-value {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.server-status-stat-label {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    margin-top: .15rem;
}

.server-status-card-link {
    display: inline-block;
    margin-top: .9rem;
    font-size: .85rem;
    color: var(--text-muted);
}

.server-status-card-link:hover {
    color: var(--primary);
}

.home-feature-banner {
    margin-bottom: 1.5rem;
}

.home-feature-card {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: center;
    justify-content: space-between;
}

.home-feature-card h2 {
    margin: 0 0 .35rem;
    font-size: 1.25rem;
}

.home-feature-card .text-muted {
    margin: 0;
}

.home-feature-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.news-card-placeholder {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: var(--gradient-1);
    opacity: 0.85;
}

/* ── Servers page ── */
.server-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.25rem;
}
.server-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .45rem .85rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-card);
    color: var(--text);
    font-size: .875rem;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.server-filter-btn:hover {
    border-color: var(--primary);
}
.server-filter-btn.active {
    background: var(--gradient-1);
    border-color: transparent;
    color: #fff;
}
.server-filter-count {
    font-size: .75rem;
    opacity: .85;
}
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.server-card {
    text-align: left;
    padding: 1.25rem;
}
.server-card:hover {
    transform: translateY(-4px);
}
.server-map-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 140px;
    margin: 0 0 1rem;
    border-radius: var(--radius);
    background: var(--bg);
    overflow: hidden;
    border: 1px solid var(--border);
}
.server-map-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.server-map-label {
    position: absolute;
    left: .5rem;
    bottom: .5rem;
    right: .5rem;
    padding: .2rem .45rem;
    border-radius: .35rem;
    background: rgba(0, 0, 0, .75);
    color: #fff;
    font-size: .7rem;
    font-weight: 600;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.server-hostname { font-size: .8rem; margin: -.25rem 0 .65rem; }
.server-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: .75rem;
}
.server-card .server-status-pill { margin-bottom: 0; }
.server-card .server-status-stats { margin-bottom: .75rem; }
.server-ip { font-family: monospace; color: var(--accent); margin: .5rem 0; }
.server-status { display: flex; align-items: center; gap: .5rem; margin-top: .75rem; font-size: .875rem; }
.server-map { margin-top: .5rem; font-size: .875rem; color: var(--text-muted); }
.server-players { margin-top: 1rem; text-align: left; border-top: 1px solid var(--border); padding-top: .75rem; }
.server-players h4 { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: .5rem; font-weight: 600; }
.server-player-list { list-style: none; margin: 0; padding: 0; max-height: 180px; overflow-y: auto; }
.server-player-row { display: flex; align-items: center; gap: .5rem; padding: .35rem 0; font-size: .8125rem; border-bottom: 1px solid var(--border); }
.server-player-row:last-child { border-bottom: none; }
.server-player-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.server-player-score { color: var(--accent); font-variant-numeric: tabular-nums; font-size: .75rem; }
.server-player-time { color: var(--text-muted); font-variant-numeric: tabular-nums; font-size: .75rem; margin-left: auto; }
.server-players-empty { font-size: .8125rem; margin: 0; text-align: center; }
.server-join { margin-top: .75rem; }
.server-join + .server-join { margin-left: .35rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-dot.online { background: var(--success); box-shadow: 0 0 8px var(--success); }
.status-dot.offline { background: var(--error); }

/* ── Crew ── */
.crew-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.5rem; }
.crew-card { text-align: center; padding: 2rem 1.5rem; }
.crew-card h3 { margin: .75rem 0 .5rem; }

/* ── Footer ── */
.footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2.5rem 0;
    margin-top: auto;
    background: rgba(15, 15, 26, 0.55);
    backdrop-filter: blur(12px);
}
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.footer-brand strong {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.1rem;
}
.footer-brand p { color: var(--text-muted); font-size: .875rem; margin-top: .25rem; }
.footer-social { display: flex; gap: 1rem; }
.footer-social a { color: var(--text-muted); font-size: .875rem; }
.footer-social a:hover { color: var(--primary); }
.footer-copy { width: 100%; text-align: center; color: var(--text-muted); font-size: .8125rem; margin-top: 1rem; }

/* ── Error ── */
.error-page { display: flex; justify-content: center; padding: 4rem 0; }
.error-card { text-align: center; max-width: 400px; }
.error-card h1 { font-size: 4rem; font-weight: 800; color: var(--primary); margin-bottom: .5rem; }

/* ── Misc ── */
.text-muted { color: var(--text-muted); }
/* ── Quick Links ── */
.link-list {
    list-style: none;
    margin: .35rem 0 0;
    padding: 0;
}

.link-list li {
    margin-bottom: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.link-list li:last-child { border-bottom: none; }

.link-list a {
    color: var(--text-muted);
    font-size: .875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0;
    transition: color var(--transition), padding-left var(--transition);
}

.link-list a:hover {
    color: var(--text);
    padding-left: .2rem;
}

@media (max-width: 480px) {
    .link-list li {
        margin-bottom: 0.35rem;
    }
    .link-list a {
        font-size: 0.8125rem;
        padding: 0.3rem 0;
    }
}
.pagination { display: flex; gap: .375rem; justify-content: center; margin: 2rem 0; }
.article-content { line-height: 1.8; }
.article-content a { color: var(--accent); text-decoration: underline; word-break: break-word; }
.article-content a:hover { color: var(--primary); }
.article-content h2, .article-content h3 { margin: 1.5rem 0 .75rem; }
.search-form {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    max-width: 100%;
    width: 100%;
}
.search-form .form-control { flex: 1; min-width: min(280px, 100%); }

/* Legacy: hide removed right-side search button if cached HTML still has it */
a.nav-search-page-link { display: none !important; }

/* ── Site search (/search page) ── */
.nav-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: .35rem;
    flex: 0 0 auto;
    width: min(220px, 28vw);
    min-width: 140px;
    margin: 0 .5rem 0 0;
    flex-shrink: 0;
}
.nav-search-input {
    width: 100%;
    padding: .4rem .65rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font-size: .875rem;
}
.nav-search-input:focus {
    outline: none;
    border-color: var(--primary);
}
.nav-search-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    padding: .25rem;
    line-height: 1;
}
.nav-search-suggest {
    position: absolute;
    top: calc(100% + .35rem);
    left: 0;
    right: 0;
    z-index: 230;
    background: var(--bg-card, #1e293b);
    border: 1px solid var(--border);
    border-radius: var(--radius, 12px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}
.nav-search-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem .75rem;
    color: inherit;
    text-decoration: none;
}
.nav-search-item:hover { background: rgba(99, 102, 241, 0.12); }
.nav-search-item span { display: flex; flex-direction: column; gap: .1rem; font-size: .8rem; }
.nav-search-all, .nav-search-empty {
    display: block;
    padding: .55rem .75rem;
    font-size: .8rem;
    color: var(--accent);
    text-decoration: none;
    border-top: 1px solid var(--border);
}
.nav-search-empty { color: var(--text-muted); }
.search-page { margin-bottom: 2rem; }
.search-page-form {
    display: flex;
    gap: .75rem;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.search-page-form .form-control { flex: 1; min-width: 220px; }
.search-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1rem;
}
.search-tab {
    padding: .4rem .85rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    text-decoration: none;
    font-size: .875rem;
}
.search-tab.active, .search-tab:hover {
    border-color: var(--primary);
    color: var(--text);
    background: rgba(99, 102, 241, 0.12);
}
.search-section { margin-bottom: 1rem; padding: 1.25rem; }
.search-section h2 { margin: 0 0 1rem; font-size: 1.1rem; }
.search-user-list { list-style: none; padding: 0; margin: 0; }
.search-user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .65rem 0;
    border-bottom: 1px solid var(--border);
}
.search-user-main {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: inherit;
    text-decoration: none;
    min-width: 0;
    flex: 1;
}
.search-user-steam {
    font-size: .8125rem;
    white-space: nowrap;
}
.search-user-steam a {
    color: var(--accent);
}
.search-user-row:last-child { border-bottom: none; }
.search-user-meta { display: flex; flex-direction: column; gap: .15rem; font-size: .875rem; }
.search-link-list { list-style: none; padding: 0; margin: 0; }
.search-link-list li { padding: .5rem 0; border-bottom: 1px solid var(--border); }
.search-link-list li:last-child { border-bottom: none; }
.search-link-list a { color: var(--accent); font-weight: 500; }
.search-empty, .search-hint { margin-top: 1rem; }

@media (max-width: 1100px) {
    .nav-search-wrap { width: min(180px, 22vw); min-width: 120px; }
}

@media (max-width: 900px) {
    .nav-search-wrap {
        order: 5;
        width: 100%;
        min-width: 0;
        max-width: none;
        margin: 0;
        flex: 1 1 100%;
    }
    .nav-inner { flex-wrap: wrap; height: auto; padding: .5rem 0; }
    .nav-links { order: 10; }
    .nav-actions { order: 6; margin-left: 0; width: 100%; justify-content: flex-end; }
}
.permissions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .5rem; margin: 1rem 0; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.admin-table th, .admin-table td { padding: .5rem .75rem; text-align: left; border-bottom: 1px solid var(--border); }
.color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.color-grid input[type=color] { width: 100%; height: 40px; border: none; border-radius: var(--radius-sm); cursor: pointer; }
.menu-form-card { max-width: 820px; }
.menu-picker-block { padding: 1rem; margin: 1rem 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-hover); }
.menu-picker-hint { font-size: .8125rem; margin-top: .35rem; }
.icon-picker { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .75rem; max-height: 160px; overflow-y: auto; padding: .5rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.icon-picker-btn {
    width: 2.25rem; height: 2.25rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg-card); font-size: 1.1rem; cursor: pointer; transition: border-color .15s, transform .1s;
    display: flex; align-items: center; justify-content: center; padding: 0;
}
.icon-picker-btn:hover { border-color: var(--primary); transform: scale(1.08); }
.icon-picker-btn.active { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 30%, transparent); background: color-mix(in srgb, var(--primary) 12%, var(--bg-card)); }
.icon-picker-custom { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.icon-picker-custom .form-control { max-width: 5rem; text-align: center; font-size: 1.25rem; }
.icon-picker-custom .text-muted { font-size: .8125rem; }

/* ── CS2 Ranks page ── */
.ranks-page { display: grid; gap: 1.25rem; margin-bottom: 2rem; }
.ranks-my-stats h2, .ranks-ladder-card h2 { margin: 0 0 1rem; font-size: 1.1rem; }
.ranks-my-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    align-items: center;
}
.ranks-my-name { margin: .35rem 0 0; font-weight: 600; }
.ranks-stat-block { display: flex; flex-direction: column; gap: .15rem; }
.ranks-stat-label { font-size: .75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.ranks-search-form { display: flex; gap: .5rem; flex-wrap: wrap; }
.ranks-search-form .form-control { flex: 1; min-width: 220px; }
.ranks-search-result { margin-top: .85rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.rank-badge {
    display: inline-block;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
}
.rank-none { background: #4b5563; color: #fff; }
.rank-silver { background: #94a3b8; color: #111; }
.rank-gn { background: #fbbf24; color: #111; }
.rank-mg { background: #34d399; color: #111; }
.rank-eagle { background: #60a5fa; color: #111; }
.rank-supreme { background: #c084fc; color: #111; }
.rank-global { background: linear-gradient(90deg, #fde047, #f97316); color: #111; }
.ranks-table .ranks-pos { width: 3rem; font-weight: 700; color: var(--text-muted); }
.ranks-ladder { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .5rem; }
.ranks-ladder-row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .35rem 0; border-bottom: 1px solid var(--border); }

/* ── Responsive ── */
body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

body.nav-open {
    overflow: hidden;
}

@media (max-width: 900px) {
    .page-grid { grid-template-columns: 1fr; }
    .page-sidebar { order: -1; }
    .form-row { grid-template-columns: 1fr; }
    .profile-stats-grid { grid-template-columns: 1fr; }

    .nav-search-wrap {
        order: 5;
        width: 100%;
        min-width: 0;
        max-width: none;
        margin: 0;
        flex: 1 1 100%;
    }
    .nav-inner {
        flex-wrap: wrap;
        height: auto;
        padding: .5rem 0;
        gap: 0.5rem;
    }
    .nav-links { order: 10; }
    .nav-actions {
        order: 3;
        margin-left: auto;
        width: auto;
        justify-content: flex-end;
    }

    .nav-search-input {
        font-size: 16px;
        padding: 0.5rem 0.75rem;
    }

    .page-header-block {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
    .footer-social { justify-content: center; }
}

@media (min-width: 901px) and (max-width: 1100px) {
    .profile-stats-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .container { padding: 0 1rem; }
    .site-shell { padding: 0 1rem; }
    .page-content { padding: 1.25rem 0 2rem; }
    .footer { padding: 1.75rem 0; padding-bottom: calc(1.75rem + env(safe-area-inset-bottom)); }

    .nav-inner {
        display: grid;
        grid-template-columns: 1fr auto auto;
        grid-template-areas:
            "brand toggle actions"
            "search search search";
        align-items: center;
        gap: 0.5rem 0.75rem;
        padding: 0.5rem 0;
    }
    .nav-brand { grid-area: brand; min-width: 0; }
    .nav-brand span {
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 42vw;
    }
    .nav-toggle {
        grid-area: toggle;
        display: flex;
    }
    .nav-actions {
        grid-area: actions;
        gap: .375rem;
        margin-left: 0;
        width: auto;
    }
    .nav-search-wrap {
        grid-area: search;
        order: unset;
        width: 100%;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border);
        padding: 0.75rem;
        box-shadow: var(--shadow);
        max-height: calc(100dvh - 120px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .nav-links.open { display: flex; overflow: visible; z-index: 205; }
    .nav-link {
        padding: 0.65rem 1rem;
        border-radius: var(--radius-sm);
        width: 100%;
        text-align: left;
        min-height: 44px;
        white-space: normal;
    }
    .nav-dropdown { z-index: auto; width: 100%; }
    .nav-dropdown > .nav-link { display: flex; justify-content: space-between; align-items: center; }
    .nav-dropdown-menu {
        position: static;
        display: none;
        margin-top: .25rem;
        margin-left: 0;
        padding-left: 0.5rem;
        box-shadow: none;
        border: none;
        background: rgba(255, 255, 255, 0.04);
        border-radius: var(--radius-sm);
        min-width: 0;
        width: 100%;
    }
    .nav-dropdown.open .nav-dropdown-menu { display: block; }
    .nav-dropdown-menu a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    .nav-user-trigger .nav-user-name,
    .nav-user-trigger .badge-points,
    .nav-user-trigger .nav-user-chevron { display: none; }
    .nav-user-dropdown .nav-dropdown-menu {
        position: absolute;
        right: 0;
        left: auto;
        width: auto;
        min-width: 210px;
        padding-left: 0;
        background: var(--bg-card);
        border: 1px solid var(--border);
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    }
    .forum-category-card { flex-direction: column; text-align: center; }
    .forum-cat-stats { text-align: center; }
    .profile-header { flex-direction: column; text-align: center; }
    .table { font-size: .8125rem; }
    .table th, .table td { padding: .5rem .625rem; }
    .hero:not(.hero-banner) { padding: 2.5rem 0 2rem; }
    .countdown-timer { gap: .75rem; }
    .countdown-timer span { font-size: 1.5rem; }

    .card > .table-wrap,
    .card > .table-responsive {
        margin-left: -1rem;
        margin-right: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
        width: calc(100% + 2rem);
    }
}

@media (max-width: 480px) {
    .news-grid, .shop-grid, .server-grid, .crew-grid { grid-template-columns: 1fr; }
    .btn { padding: .55rem .95rem; }
    .btn-sm { padding: .35rem .65rem; }
    .nav-inner { gap: .5rem; }
    .nav-brand span { font-size: 1rem; }
    .nav-search-btn { padding: .4rem .55rem; }
}

@media (max-width: 640px) {
    .table-wrap,
    .table-responsive {
        margin-left: -1rem;
        margin-right: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .table-wrap .table,
    .table-responsive .table {
        min-width: 0;
    }

    .table-wrap .table th,
    .table-wrap .table td,
    .table-responsive .table th,
    .table-responsive .table td {
        white-space: normal;
        word-break: break-word;
    }

    .table-wrap::after,
    .table-responsive::after {
        content: '';
        display: block;
        height: 1px;
    }
}

/* ── Cookie consent ── */
.cookie-consent {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    padding: 1rem;
    pointer-events: none;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity .35s ease, transform .35s ease;
}

.cookie-consent.is-visible {
    display: block;
    pointer-events: auto;
    opacity: 1;
    transform: translateY(0);
}

.cookie-consent-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.cookie-consent-text p {
    margin: 0;
    font-size: .875rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.cookie-consent-text a {
    color: var(--accent);
    text-decoration: underline;
}

.cookie-consent-actions {
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .cookie-consent {
        padding: 1rem;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }

    .cookie-consent-inner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
}

/* ── Theme (lys / mørk) ── */
html { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }

html[data-theme="light"] {
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: rgba(0, 0, 0, 0.08);
    --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 10px 40px rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] body::before {
    background:
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 50% 20%, rgba(6, 182, 212, 0.06) 0%, transparent 40%);
}

html[data-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.92);
}

html[data-theme="light"] .hero-gradient {
    background: transparent;
}

html[data-theme="light"] .card::before {
    opacity: 1;
}

html[data-theme="light"] .form-control {
    background: #fff;
}

html[data-theme="light"] .link-list li {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .server-status-card,
html[data-theme="light"] .server-status-stats {
    border-color: rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .hero-banner-overlay {
    background: linear-gradient(rgba(248, 250, 252, 0.15), rgba(248, 250, 252, 0.55));
}

html[data-theme="light"] .hero-banner .hero-content h2,
html[data-theme="light"] .hero-banner .hero-content p {
    text-shadow: none;
    color: var(--text);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--transition), border-color var(--transition);
}

.theme-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.theme-toggle__icon {
    width: 1.15rem;
    height: 1.15rem;
}

html[data-theme="dark"] .theme-toggle__icon--sun { display: block; }
html[data-theme="dark"] .theme-toggle__icon--moon { display: none; }
html[data-theme="light"] .theme-toggle__icon--sun { display: none; }
html[data-theme="light"] .theme-toggle__icon--moon { display: block; }

.auth-theme-toggle {
    position: fixed;
    top: calc(0.75rem + env(safe-area-inset-top));
    right: calc(0.75rem + env(safe-area-inset-right));
    z-index: 300;
}
