:root {
    --bg: #0b1120;
    --panel: rgba(10, 14, 26, 0.88);
    --panel-border: rgba(176, 190, 214, 0.42);
    --text: #f8fafc;
    --muted: #94a3b8;
    --accent: #38bdf8;
    --accent-soft: rgba(56, 189, 248, 0.12);
    --online: #4ade80;
    --offline: #f87171;
    --shadow: 0 18px 40px rgba(2, 6, 23, 0.55);
    --hero-bg: rgba(10, 14, 26, 0.9);
}

html[data-theme="light"] {
    --bg: #f1f5f9;
    --panel: #ffffff;
    --panel-border: rgba(15, 23, 42, 0.1);
    --text: #0f172a;
    --muted: #64748b;
    --accent: #0284c7;
    --accent-soft: rgba(2, 132, 199, 0.1);
    --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    --hero-bg: rgba(255, 255, 255, 0.9);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: "DM Sans", "Segoe UI", sans-serif;
    color: var(--text);
    background-color: #050508;
}

/* Full-bleed gothic corridor — infinite tunnel via staggered scale/opacity layers */
.tunnel-backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background: #050508;
}

.tunnel-layer {
    position: absolute;
    inset: -8%;
    background:
        url("/assets/dungeon-tunnel.jpg") center center / cover no-repeat;
    transform-origin: 50% 48%;
    will-change: transform, opacity;
    backface-visibility: hidden;
}

.tunnel-layer-a {
    animation: tunnel-zoom 28s linear infinite;
}

.tunnel-layer-b {
    animation: tunnel-zoom 28s linear infinite;
    animation-delay: -14s;
}

.tunnel-vignette {
    position: absolute;
    inset: 0;
    z-index: 2;
    background:
        radial-gradient(ellipse 72% 68% at 50% 48%, transparent 18%, rgba(2, 4, 10, 0.35) 55%, rgba(2, 4, 10, 0.78) 100%),
        linear-gradient(180deg, rgba(2, 4, 10, 0.45) 0%, transparent 18%, transparent 78%, rgba(2, 4, 10, 0.55) 100%);
}

@keyframes tunnel-zoom {
    0% {
        transform: scale(1);
        opacity: 0;
    }
    8% {
        opacity: 1;
    }
    42% {
        opacity: 1;
    }
    50% {
        transform: scale(1.22);
        opacity: 0;
    }
    100% {
        transform: scale(1.22);
        opacity: 0;
    }
}

html[data-theme="light"] .tunnel-backdrop {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .tunnel-layer-a,
    .tunnel-layer-b {
        animation: none;
    }

    .tunnel-layer-a {
        opacity: 1;
        transform: scale(1.04);
        inset: 0;
    }

    .tunnel-layer-b {
        display: none;
    }
}

@media (max-width: 640px) {
    .tunnel-layer {
        inset: -4%;
    }

    .tunnel-layer-a,
    .tunnel-layer-b {
        animation-duration: 36s;
    }

    .tunnel-layer-b {
        animation-delay: -18s;
    }
}

html[data-theme="light"] body {
    background-color: var(--bg);
    background-image:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.1), transparent 28%),
        radial-gradient(circle at top right, rgba(232, 197, 71, 0.08), transparent 24%);
}

.page {
    position: relative;
    z-index: 1;
    width: min(1320px, calc(100% - 24px));
    margin: 0 auto;
    padding: 20px 0 48px;
}

.maintenance-banner {
    display: none;
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(250, 204, 21, 0.35);
    background: rgba(250, 204, 21, 0.12);
    color: #fde68a;
    font-size: 0.9rem;
}

.maintenance-banner.visible { display: block; }

html[data-theme="light"] .maintenance-banner {
    color: #92400e;
    background: rgba(250, 204, 21, 0.2);
}

.hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 10px;
    padding: 22px 24px;
    border-radius: 18px;
    border: 1px solid var(--panel-border);
    background:
        radial-gradient(ellipse at top left, rgba(232, 197, 71, 0.1), transparent 42%),
        var(--hero-bg);
    box-shadow: var(--shadow);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    backdrop-filter: blur(16px) saturate(1.2);
}

.hero-copy {
    min-width: 0;
    flex: 1;
}

.brand,
.eyebrow {
    margin: 0 0 8px;
    color: #e8c547;
    font-size: clamp(1.55rem, 4.2vw, 2.15rem);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    line-height: 1.15;
}

.hero-title,
.hero h1 {
    margin: 0;
    font-size: clamp(0.95rem, 1.4vw, 1.05rem);
    font-weight: 500;
    color: var(--muted);
    opacity: 0.78;
    letter-spacing: 0.02em;
}

.hero-lead {
    margin: 8px 0 0;
    max-width: 36rem;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.hero-sub {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid var(--panel-border);
    background: color-mix(in srgb, var(--hero-bg) 88%, #e8c547 6%);
    box-shadow: var(--shadow);
    -webkit-backdrop-filter: blur(16px) saturate(1.15);
    backdrop-filter: blur(16px) saturate(1.15);
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.btn-cta {
    min-height: 44px;
    padding-inline: 18px;
    font-size: 0.9rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    align-self: flex-start;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--panel-border);
    background: rgba(15, 23, 42, 0.72);
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.84rem;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

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

.btn:hover { transform: translateY(-1px); }

.btn-green {
    background: linear-gradient(135deg, rgba(74, 140, 90, 0.24), rgba(45, 90, 58, 0.12));
    border-color: rgba(110, 168, 120, 0.42);
    color: #a8d5b0;
}

.btn-gold {
    background: linear-gradient(135deg, rgba(180, 140, 30, 0.28), rgba(120, 90, 15, 0.14));
    border-color: rgba(201, 162, 39, 0.45);
    color: #e8c547;
}

.btn-discord {
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.28), rgba(88, 101, 242, 0.12));
    border-color: rgba(88, 101, 242, 0.45);
    color: #c7d2fe;
}

.btn-ghost { background: transparent; }

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.stat {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--panel-border);
    background: var(--panel);
    box-shadow: var(--shadow);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    backdrop-filter: blur(16px) saturate(1.2);
}

.stat-label {
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.35rem;
    font-weight: 700;
}

.events-panel, .gallery-panel, .section-panel {
    margin-bottom: 20px;
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid var(--panel-border);
    background: var(--panel);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.07);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    backdrop-filter: blur(18px) saturate(1.2);
}

.section-panel {
    margin-bottom: 0;
}

.voice-section-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.directory-section .directory-toolbar {
    background: rgba(2, 6, 23, 0.35);
    box-shadow: none;
}

.directory-section .section-header {
    margin-bottom: 12px;
}

.admin-panel {
    margin-bottom: 0;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--panel-border);
    background: var(--panel);
    box-shadow: var(--shadow);
    width: auto;
    max-width: 100%;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.main-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.main-panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
    align-items: start;
}

.main-panel-grid > .grid {
    grid-column: 1 / -1;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.section-header h2 {
    margin: 0;
    font-size: 1.05rem;
}

.section-header p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.section-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    font-size: 1rem;
}

.content-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.sidebar {
    position: sticky;
    top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-gallery {
    margin-bottom: 0;
    padding: 12px 14px;
}

.sidebar-gallery .section-header {
    margin-bottom: 10px;
}

.sidebar-gallery .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.sidebar-gallery .gallery-grid img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
}

.sidebar-panel, .card {
    background: rgba(24, 34, 56, 0.92);
    border: 1px solid rgba(186, 200, 220, 0.38);
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(2, 6, 23, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    overflow: hidden;
    -webkit-backdrop-filter: blur(16px) saturate(1.15);
    backdrop-filter: blur(16px) saturate(1.15);
}

html[data-theme="light"] .sidebar-panel,
html[data-theme="light"] .card {
    background: var(--panel);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.card-media {
    position: relative;
    height: 120px;
    overflow: hidden;
}

.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    background: rgba(2, 6, 23, 0.72);
    color: #fff;
}

.status-badge.online { color: var(--online); }
.status-badge.offline { color: var(--offline); }

.status-badge .dot,
.voice-status .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
    flex-shrink: 0;
}

.status-badge .dot.pulse,
.voice-status .dot.pulse {
    box-shadow: 0 0 0 0 currentColor;
    animation: status-pulse 1.8s ease-out infinite;
}

.status-badge.offline .dot.pulse,
.voice-status.offline .dot.pulse {
    animation: none;
    opacity: 0.85;
}

.update-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: calc(100% - 88px);
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #f97316;
    background: rgba(2, 6, 23, 0.82);
    border: 1px solid rgba(249, 115, 22, 0.35);
    box-shadow: 0 2px 10px rgba(249, 115, 22, 0.12);
    z-index: 1;
}

.update-badge .update-dot {
    font-size: 0.58rem;
    line-height: 1;
    flex-shrink: 0;
}

.card.has-update {
    border-color: rgba(249, 115, 22, 0.22);
}

.card.has-update.online {
    border-color: rgba(249, 115, 22, 0.28);
}

@media (max-width: 520px) {
    .update-badge {
        top: auto;
        bottom: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
    }
}

@keyframes status-pulse {
    0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55); }
    70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.card.online {
    border-color: rgba(74, 222, 128, 0.22);
}

.card.offline {
    border-color: rgba(248, 113, 113, 0.16);
}

.card-body { padding: 14px; }

.game-type {
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}

.card-body h3 {
    margin: 0 0 8px;
    font-size: 1.02rem;
}

.motd {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

.server-note {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(251, 191, 36, 0.45);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.18), rgba(245, 158, 11, 0.08));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.server-note-label {
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #fbbf24;
    margin-bottom: 4px;
}

.server-note-text {
    color: #fef3c7;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.45;
}

html[data-theme="light"] .server-note {
    border-color: rgba(217, 119, 6, 0.35);
    background: linear-gradient(135deg, rgba(254, 243, 199, 0.95), rgba(253, 230, 138, 0.55));
}

html[data-theme="light"] .server-note-label {
    color: #b45309;
}

html[data-theme="light"] .server-note-text {
    color: #78350f;
}

.player-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.8rem;
}

.player-count {
    font-weight: 700;
    color: var(--accent);
}

.player-names {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.player-name-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid var(--panel-border);
    background: rgba(2, 6, 23, 0.22);
    color: var(--text);
    font-size: 0.74rem;
    font-weight: 600;
}

html[data-theme="light"] .player-name-tag {
    background: rgba(255, 255, 255, 0.85);
}

.player-name-tag.in-discord {
    border-color: rgba(88, 101, 242, 0.6);
    background: rgba(88, 101, 242, 0.16);
    color: #c7d2fe;
}

html[data-theme="light"] .player-name-tag.in-discord {
    background: rgba(88, 101, 242, 0.14);
    color: #4f46e5;
}

.player-name-discord {
    height: 11px;
    width: auto;
    margin-right: 5px;
    flex-shrink: 0;
}

.uptime-line,
.card-meta {
    color: var(--muted);
    font-size: 0.74rem;
    margin-bottom: 8px;
}

.card-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
    margin-top: 4px;
}

.card-actions .join-btn {
    width: auto;
}

.copy-btn-gold {
    background: rgba(232, 197, 71, 0.14);
    color: #e8c547;
}

.sparkline {
    width: 100%;
    height: 28px;
    margin-bottom: 10px;
}

.sparkline polyline {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
}

.discord-badge {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(88, 101, 242, 0.15);
    color: #c7d2fe;
    font-size: 0.7rem;
}

.ip-box {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--panel-border);
    background: rgba(2, 6, 23, 0.35);
    margin-bottom: 8px;
}

html[data-theme="light"] .ip-box { background: #f8fafc; }

.ip-box code {
    flex: 1;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.copy-btn, .join-btn {
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-weight: 700;
    font-size: 0.74rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.copy-btn {
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent);
}

.copy-btn.copied { background: rgba(74, 222, 128, 0.2); color: var(--online); }

.join-btn {
    width: 100%;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(14, 165, 233, 0.1));
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: var(--text);
}

.join-btn.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.join-btn.discord {
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.25), rgba(88, 101, 242, 0.1));
    border-color: rgba(88, 101, 242, 0.4);
    color: #c7d2fe;
}

.voice-card { padding: 12px; }
.voice-card.discord {
    border-color: rgba(88, 101, 242, 0.45);
    background: linear-gradient(180deg, rgba(88, 101, 242, 0.14), rgba(22, 28, 48, 0.95));
}
.voice-card.teamspeak {
    border-color: rgba(45, 212, 191, 0.4);
    background: linear-gradient(180deg, rgba(45, 212, 191, 0.12), rgba(22, 28, 48, 0.95));
}

.voice-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.voice-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.voice-icon.discord-icon {
    border-radius: 50%;
    background: #5865F2;
}

.voice-meta { min-width: 0; flex: 1; }
.voice-label {
    color: var(--muted);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
}
.voice-meta h3 {
    margin: 0;
    font-size: 0.98rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.discord-panel-body {
    margin-bottom: 10px;
    border-top: 1px solid var(--panel-border);
    border-bottom: 1px solid var(--panel-border);
    max-height: 300px;
    overflow-y: auto;
    padding: 6px 0;
}

.discord-member {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 4px;
}

.discord-member-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
}

.discord-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.discord-status-dot.online { background: #43b581; }
.discord-status-dot.idle { background: #faa61a; }
.discord-status-dot.dnd { background: #f04747; }

.discord-member-name { font-size: 0.82rem; font-weight: 600; }
.discord-member-game { font-size: 0.68rem; color: var(--muted); }

.discord-voice-channel {
    margin-bottom: 8px;
}

.discord-voice-channel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.74rem;
    font-weight: 700;
    color: #a5b4fc;
    padding: 4px;
}

.discord-voice-channel-name {
    min-width: 0;
}

.discord-voice-channel-count {
    flex-shrink: 0;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--muted);
}

.discord-section-label {
    color: var(--muted);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 700;
    padding: 8px 4px 4px;
    border-top: 1px solid var(--panel-border);
    margin-top: 4px;
}

.voice-stats {
    color: var(--muted);
    font-size: 0.74rem;
    margin-bottom: 8px;
}

.voice-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    font-weight: 700;
}

.voice-status.online { color: var(--online); }
.voice-status.offline { color: var(--offline); }

.directory-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--panel-border);
    background: rgba(17, 24, 39, 0.78);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

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

.directory-toolbar input[type="search"],
.directory-toolbar select {
    min-width: 0;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--panel-border);
    background: rgba(2, 6, 23, 0.35);
    color: var(--text);
    font: inherit;
    font-size: 0.86rem;
}

html[data-theme="light"] .directory-toolbar input[type="search"],
html[data-theme="light"] .directory-toolbar select {
    background: #fff;
}

#server-search {
    flex: 1 1 180px;
    min-width: 160px;
}

#filter-game,
#filter-players {
    flex: 0 1 160px;
}

.filter-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.filter-check input {
    accent-color: #e8c547;
    width: 16px;
    height: 16px;
}

.filter-count {
    margin-left: auto;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.discord-voice-channel-empty,
.discord-member-list.empty {
    padding: 8px 4px;
    color: var(--muted);
    font-size: 0.72rem;
    font-style: italic;
}


.event-list, .gallery-grid {
    display: grid;
    gap: 10px;
}

.event-item {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--panel-border);
    background: rgba(2, 6, 23, 0.2);
}

.event-date {
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.gallery-grid img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--panel-border);
}

.gallery-empty {
    color: var(--muted);
    font-size: 0.85rem;
}

.sidebar-downloads {
    margin-bottom: 0;
    padding: 12px 14px;
}

.sidebar-downloads .section-header {
    margin-bottom: 10px;
}

.downloads-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.downloads-hint {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.admin-form {
    display: grid;
    gap: 10px;
}

.admin-login {
    display: flex;
    gap: 10px;
    align-items: center;
}

.admin-login input {
    flex: 1;
    min-width: 0;
}

.admin-settings {
    display: grid;
    gap: 10px;
}

.admin-settings[hidden] {
    display: none !important;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.conan-workshop-fix-btn {
    margin-top: 0;
    width: auto;
    flex: 0 0 auto;
}

.conan-workshop-fix {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--panel-border);
}

.conan-workshop-fix-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
}

.conan-workshop-fix-hint {
    margin: 0 0 8px;
    font-size: 0.75rem;
    color: var(--muted);
    line-height: 1.35;
}

.conan-workshop-fix-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.conan-workshop-fix-row input[type="password"],
.conan-workshop-password,
#admin-conan-workshop-password {
    flex: 1 1 140px;
    min-width: 120px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--panel-border);
    background: rgba(2, 6, 23, 0.25);
    color: var(--text);
    font: inherit;
}

#conan-workshop-done-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.65);
    padding: 1.5rem;
}

#conan-workshop-done-overlay[hidden] {
    display: none !important;
}

.conan-workshop-done-modal {
    max-width: 28rem;
    width: 100%;
    background: #1a1f2e;
    color: #f0f2f8;
    border: 1px solid #3d4a66;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.conan-workshop-done-modal h2 {
    margin: 0 0 0.75rem;
    font-size: 1.15rem;
}

.conan-workshop-done-modal p {
    margin: 0 0 1.25rem;
    line-height: 1.45;
    white-space: pre-wrap;
}

.conan-workshop-done-modal .btn {
    min-width: 5rem;
}

.conan-workshop-status {
    margin-top: 6px;
}

.admin-status {
    min-height: 1.25rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.admin-status.is-error {
    color: #f87171;
}

.admin-status.is-success {
    color: #4ade80;
}

.admin-form input, .admin-form textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--panel-border);
    background: rgba(2, 6, 23, 0.25);
    color: var(--text);
    font: inherit;
}

html[data-theme="light"] .admin-form input,
html[data-theme="light"] .admin-form textarea {
    background: #fff;
}

.admin-label {
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 4px;
}

.admin-hint {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.admin-server-notes {
    display: grid;
    gap: 8px;
}

.admin-server-note-label {
    font-size: 0.82rem;
    font-weight: 600;
    margin-top: 2px;
}

.empty, .error {
    text-align: center;
    padding: 36px 20px;
    border-radius: 14px;
    border: 1px dashed var(--panel-border);
    color: var(--muted);
    grid-column: 1 / -1;
}

.empty-themed,
.error-themed {
    border-style: solid;
    border-color: rgba(232, 197, 71, 0.28);
    background:
        radial-gradient(circle at top, rgba(232, 197, 71, 0.1), transparent 55%),
        rgba(17, 24, 39, 0.72);
}

html[data-theme="light"] .empty-themed,
html[data-theme="light"] .error-themed {
    background:
        radial-gradient(circle at top, rgba(232, 197, 71, 0.16), transparent 55%),
        #fff;
}

.empty-title {
    color: #e8c547;
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.empty-themed p,
.error-themed p {
    margin: 0 auto 14px;
    max-width: 28rem;
    line-height: 1.45;
    font-size: 0.9rem;
}

.error-themed {
    border-color: rgba(248, 113, 113, 0.35);
}

.error-themed .empty-title {
    color: #fbbf24;
}

.footer-note {
    margin-top: 20px;
    text-align: center;
    color: var(--muted);
    font-size: 0.82rem;
}

@media (max-width: 980px) {
    .content-layout { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-count { margin-left: 0; width: 100%; }
}

@media (max-width: 640px) {
    .page { width: min(100%, calc(100% - 16px)); padding-top: 14px; }
    .hero {
        flex-direction: column;
        padding: 18px 16px;
    }
    .brand,
    .eyebrow {
        font-size: clamp(1.35rem, 7vw, 1.75rem);
        letter-spacing: 0.08em;
    }
    .hero-title,
    .hero h1 {
        font-size: 0.92rem;
        opacity: 0.72;
    }
    .hero-cta { width: 100%; }
    .hero-cta .btn { flex: 1 1 auto; justify-content: center; }
    .hero-sub { padding: 12px; }
    .hero-actions {
        justify-content: flex-start;
        width: 100%;
    }
    .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat { padding: 12px; }
    .stat-value { font-size: 1.15rem; }
    .directory-toolbar { padding: 10px; gap: 8px; }
    #server-search,
    #filter-game,
    #filter-players {
        flex: 1 1 100%;
    }
    .grid { grid-template-columns: 1fr; gap: 12px; }
    .main-panel-grid { grid-template-columns: 1fr; }
    .card-media { height: 108px; }
    .card-body { padding: 12px; }
    .card-body h3 { font-size: 0.98rem; }
    .card-actions { grid-template-columns: 1fr; }
    .btn { min-height: 44px; }
    .copy-btn, .join-btn { min-height: 44px; }
}
