:root {
    --bg-primary: #0b0b0f;
    --bg-secondary: #111118;
    --bg-card: #16161d;
    --bg-card-hover: #1c1c26;
    --border: #222230;
    --border-light: #2a2a3a;
    --accent: #22C55E;
    --accent-hover: #16A34A;
    --text-primary: #e4e4e7;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --green: #22c55e;
    --green-dim: rgba(34, 197, 94, 0.15);
    --red: #ef4444;
    --red-dim: rgba(239, 68, 68, 0.15);
    --radius: 8px;
    --radius-sm: 6px;
    --radius-lg: 12px;
}

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

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

a:hover {
    color: var(--accent-hover);
}

h1, h2, h3 {
    margin: 0;
    font-weight: 600;
}

p {
    margin: 0;
}

/* Layout */

.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding-bottom: 3rem;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* Top Nav */

.top-nav {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-brand:hover {
    color: var(--text-primary);
}

.nav-logo {
    display: flex;
    align-items: center;
}

.nav-logo svg {
    width: 42px;
    height: 42px;
}

/* Nav Menu Button */

.nav-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.nav-menu-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-light);
    background: var(--bg-card);
}

.nav-menu-btn.active {
    color: var(--accent);
    border-color: rgba(34, 197, 94, 0.3);
    background: var(--green-dim);
}

/* Nav Dropdown */

.nav-dropdown-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99;
}

.nav-dropdown {
    position: fixed;
    top: 57px;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 0;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.nav-dropdown-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.75rem;
}

.nav-dropdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.375rem;
}

.nav-dropdown-item {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.15s;
}

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

.nav-dropdown-item.active {
    color: var(--accent);
    background: var(--green-dim);
}

/* Hero */

.hero {
    text-align: center;
    padding: 3rem 0 2rem;
    user-select: none;
    -webkit-user-select: none;
}

.hero h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
    outline: none;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1.75rem;
}

/* Page content (SEO copy) */

.page-content {
    margin: 3.5rem 0 1rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    color: var(--text-secondary);
    line-height: 1.7;
}

.page-content h2 {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.page-content h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1.75rem 0 0.5rem;
}

.page-content p {
    margin-bottom: 0.875rem;
    font-size: 0.9375rem;
}

.page-content em {
    color: var(--text-primary);
    font-style: normal;
    font-weight: 600;
}

.page-content a {
    color: var(--accent, #84cc16);
    text-decoration: none;
}

.page-content a:hover {
    text-decoration: underline;
}

.content-links {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
}

.content-links li {
    font-size: 0.9375rem;
}

/* Search Row */

.search-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    max-width: 540px;
    margin: 0 auto;
}

.search-row .search-bar {
    flex: 1;
    max-width: none;
    margin: 0;
}

/* Search Bar */

.search-bar .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-bar {
    position: relative;
    overflow: hidden;
    max-width: 540px;
    margin: 0 auto;
}

.search-bar input {
    width: 100%;
    padding: 0.8125rem 1rem 0.8125rem 2.875rem;
    border: 1px solid rgba(255,255,255,0.04);
    border-top: none;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3), 0 6px 20px rgba(0,0,0,0.15);
    color: var(--text-primary);
    font-size: 0.9375rem;
    outline: none;
    transition: all 0.3s;
}

.search-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 30%;
    right: 30%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transition: left 0.35s ease, right 0.35s ease, background 0.35s;
    pointer-events: none;
    z-index: 1;
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.search-bar:focus-within::after {
    left: 5%;
    right: 5%;
    background: linear-gradient(90deg, transparent, rgba(34, 197, 94, 0.4), transparent);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.06);
}

.search-bar:focus-within input {
    border-color: rgba(34, 197, 94, 0.08);
}

/* Filter Button */

.filter-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8125rem 1.125rem;
    border: 1px solid rgba(255,255,255,0.04);
    border-top: none;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3), 0 6px 20px rgba(0,0,0,0.15);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 25%;
    right: 25%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transition: left 0.35s ease, right 0.35s ease, background 0.35s;
}

.filter-btn:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.filter-btn:hover::before {
    left: 5%;
    right: 5%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.125rem;
    height: 1.125rem;
    padding: 0 0.3rem;
    border-radius: 9999px;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: var(--accent);
    font-size: 0.625rem;
    font-weight: 600;
    line-height: 1;
}

/* Filter Modal */

.filter-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
}

.filter-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}

.filter-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.filter-modal-header h2 {
    font-size: 1rem;
    font-weight: 600;
}

.filter-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.filter-close:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.filter-modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.filter-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.filter-toggle-group {
    display: flex;
    gap: 0.375rem;
}

.filter-toggle {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.filter-toggle:hover {
    border-color: var(--border-light);
    color: var(--text-primary);
}

.filter-toggle.active {
    background: var(--green-dim);
    border-color: rgba(34, 197, 94, 0.3);
    color: var(--accent);
}

.filter-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s;
}

.filter-input::placeholder {
    color: var(--text-muted);
}

.filter-input:focus {
    border-color: var(--accent);
}

.filter-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border);
}

.filter-btn-reset {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.filter-btn-reset:hover {
    border-color: var(--border-light);
    color: var(--text-primary);
}

.filter-btn-apply {
    padding: 0.5rem 1.25rem;
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: var(--radius-sm);
    background: var(--green-dim);
    color: var(--accent);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.filter-btn-apply:hover {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.45);
}

/* Server Card */

.server-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.server-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    border: 1px solid rgba(255,255,255,0.04);
    border-top: none;
    border-radius: var(--radius);
    background: var(--bg-card);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3), 0 6px 20px rgba(0,0,0,0.15);
    transition: all 0.3s;
    color: var(--text-primary);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.server-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 30%;
    right: 30%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transition: left 0.35s ease, right 0.35s ease, background 0.35s;
}

.server-card:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.server-card:hover::before {
    left: 5%;
    right: 5%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
}

.server-icon-wrap {
    position: relative;
    flex-shrink: 0;
}

.server-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
}

.server-icon img {
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
}

.icon-placeholder {
    width: 48px;
    height: 48px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
}

.icon-placeholder.large {
    width: 96px;
    height: 96px;
    font-size: 1.25rem;
}

.status-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--bg-card);
}

.dot-online {
    background: var(--green);
    box-shadow: 0 0 6px rgba(34,197,94,0.5);
}

.dot-offline {
    background: var(--red);
    box-shadow: 0 0 6px rgba(239,68,68,0.4);
}

.server-body {
    flex: 1;
    min-width: 0;
}

.server-top {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.server-name {
    font-size: 0.9375rem;
    font-weight: 600;
}

.server-version {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.server-mid {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.badge {
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 500;
    text-decoration: none;
}

.badge-category {
    background: rgba(34, 197, 94, 0.12);
    color: var(--accent);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge-region {
    background: var(--bg-card-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* ---- Agent profile: tags, markdown, monetization ---- */
.profile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.tag-chip {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    background: var(--bg-card-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.tag-chip.tag-primary {
    background: rgba(34, 197, 94, 0.12);
    color: var(--accent);
    border-color: rgba(34, 197, 94, 0.25);
    font-weight: 600;
}

.markdown-body {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.92rem;
}
.markdown-body p { margin: 0 0 0.75rem; }
.markdown-body ul { margin: 0 0 0.75rem; padding-left: 1.2rem; }
.markdown-body li { margin-bottom: 0.3rem; }
.markdown-body strong { color: var(--text-primary); font-weight: 600; }
.markdown-body h3, .markdown-body h4, .markdown-body h5 { color: var(--text-primary); margin: 0.5rem 0 0.4rem; font-size: 1rem; }
.markdown-body code { background: var(--bg-card-hover); border-radius: 4px; padding: 0.05rem 0.3rem; font-size: 0.85em; }

.monet-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-bottom: 0.75rem; }
.monet-badge {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.7rem;
    border-radius: 9999px;
}
.monet-green { background: rgba(34,197,94,0.14); color: var(--green); border: 1px solid rgba(34,197,94,0.25); }
.monet-blue { background: rgba(59,130,246,0.14); color: #3b82f6; border: 1px solid rgba(59,130,246,0.25); }
.monet-yellow { background: rgba(245,158,11,0.14); color: #f59e0b; border: 1px solid rgba(245,158,11,0.25); }
.monet-red { background: rgba(239,68,68,0.14); color: var(--red); border: 1px solid rgba(239,68,68,0.25); }
.monet-muted { background: var(--bg-card-hover); color: var(--text-muted); border: 1px solid var(--border-light); }
.monet-eula { font-size: 0.75rem; font-weight: 500; }
.monet-eula.ok { color: var(--green); }
.monet-eula.bad { color: var(--red); }
.monet-eula.warn { color: #f59e0b; }
.monet-meter-row { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; }
.monet-meter-label { font-size: 0.75rem; color: var(--text-muted); min-width: 5.5rem; }
.monet-meter { flex: 1; height: 7px; border-radius: 9999px; background: var(--bg-card-hover); overflow: hidden; }
.monet-meter-fill { height: 100%; border-radius: 9999px; }
.monet-meter-val { font-size: 0.78rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.monet-meter-val span { color: var(--text-muted); }
.monet-price { font-size: 0.85rem; color: var(--text-muted); margin: 0; }

.server-right {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.server-players {
    white-space: nowrap;
    display: flex;
    align-items: baseline;
    gap: 0.125rem;
}

.server-players .players-online {
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 700;
}

.server-players span {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 400;
}

.players-unverified {
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
}

.players-warn {
    color: #f59e0b;
    font-size: 0.875rem;
    font-weight: 700;
    white-space: nowrap;
}

.players-warn-sub {
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.count-warning {
    margin-top: 0.625rem;
    padding: 0.75rem 0.875rem;
    border: 1px solid rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.08);
    border-radius: 8px;
    color: #f59e0b;
    font-size: 0.8125rem;
    line-height: 1.5;
}

.count-warning strong { color: #fbbf24; }

.count-warning-btn {
    display: inline-block;
    margin-top: 0.625rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid rgba(245, 158, 11, 0.5);
    background: transparent;
    color: #fbbf24;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.count-warning-btn:hover { background: rgba(245, 158, 11, 0.15); }

.copy-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.125rem 0.5rem;
    cursor: pointer;
    transition: border-color 0.15s;
    color: var(--text-muted);
    font-size: 0.6875rem;
    position: relative;
    z-index: 2;
}

.copy-chip:hover {
    border-color: var(--border-light);
    color: var(--text-secondary);
}

.copy-state-default,
.copy-state-copied {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: opacity 0.2s, transform 0.2s;
}

.copy-state-copied {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    color: var(--accent);
}

.copy-chip.copied {
    border-color: rgba(34, 197, 94, 0.4);
}

.copy-chip.copied .copy-state-default {
    opacity: 0;
    transform: scale(0.8);
}

.copy-chip.copied .copy-state-copied {
    opacity: 1;
    transform: scale(1);
}

.mono {
    font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
}

/* Status Badge (detail page) */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
}

.status-online {
    color: var(--green);
    background: var(--green-dim);
}

.status-offline {
    color: var(--red);
    background: var(--red-dim);
}

.status-online .status-dot {
    position: static;
    width: 6px;
    height: 6px;
    border: none;
    box-shadow: none;
    background: var(--green);
}

.status-offline .status-dot {
    position: static;
    width: 6px;
    height: 6px;
    border: none;
    box-shadow: none;
    background: var(--red);
}

/* Pagination */

.pagination-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.125rem;
    padding: 1.5rem 0 1rem;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    height: 1.75rem;
    padding: 0 0.375rem;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 400;
    transition: color 0.15s ease;
}

.page-link:hover {
    color: var(--text-primary);
}

.page-link.active {
    color: var(--text-primary);
    font-weight: 600;
}

.page-link.disabled {
    pointer-events: none;
    opacity: 0.2;
}

.page-ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 1rem;
    height: 1.75rem;
    color: var(--text-muted);
    font-size: 0.625rem;
    user-select: none;
    letter-spacing: 0.1em;
}

/* Empty State */

.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-secondary);
}

.empty-state h1 {
    margin-bottom: 0.5rem;
}

.empty-state a {
    margin-top: 1rem;
    display: inline-block;
}

/* Server Detail */

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 0 1rem;
    font-size: 0.8125rem;
}

.breadcrumbs a {
    color: var(--text-secondary);
}

.breadcrumbs a:hover {
    color: var(--text-primary);
}

.breadcrumbs .sep {
    color: var(--text-muted);
}

.breadcrumbs span:last-child {
    color: var(--text-primary);
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.detail-version {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.detail-icon-wrap {
    position: relative;
    flex-shrink: 0;
}

.detail-status-dot {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 14px;
    height: 14px;
    border: 2.5px solid var(--bg-primary);
}

.detail-icon img {
    width: 96px;
    height: 96px;
    border-radius: var(--radius);
    image-rendering: pixelated;
}

.detail-title h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.detail-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 1.5rem;
    align-items: start;
}

.detail-section {
    margin-bottom: 1.5rem;
}

.detail-section h2 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.detail-section p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.motd-display {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.detail-card h3 {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.detail-row:not(:last-child) {
    border-bottom: 1px solid var(--border);
}

.detail-row .label {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.detail-row .value {
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
}

.detail-row .value.muted {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 0.8125rem;
}

.detail-row .value.text-green {
    color: var(--green);
}

.detail-row .value.text-red {
    color: var(--red);
}

.detail-url {
    font-size: 0.8125rem;
    color: var(--text-secondary) !important;
    text-decoration: none;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    text-align: right;
}

.detail-url:hover {
    color: var(--accent) !important;
}

.copy-block {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    position: relative;
    margin-bottom: 1rem;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.copy-block:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
}

.copy-block-default,
.copy-block-copied {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: opacity 0.2s, transform 0.2s;
}

.copy-block-default .mono {
    font-size: 0.9375rem;
    font-weight: 500;
}

.copy-block-copied {
    position: absolute;
    inset: 0;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    color: var(--accent);
    font-weight: 600;
    font-size: 0.875rem;
}

.copy-block.copied {
    border-color: rgba(34, 197, 94, 0.4);
    background: var(--green-dim);
}

.copy-block.copied .copy-block-default {
    opacity: 0;
    transform: scale(0.8);
}

.copy-block.copied .copy-block-copied {
    opacity: 1;
    transform: scale(1);
}

.player-bar {
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.player-bar-fill {
    height: 100%;
    background: var(--green);
    border-radius: 3px;
    transition: width 0.3s;
}

.detail-link {
    display: block;
    padding: 0.5rem 0;
    color: var(--accent);
    font-size: 0.875rem;
    font-weight: 500;
}

.detail-link:not(:last-child) {
    border-bottom: 1px solid var(--border);
}

/* Detail Tabs */

.detail-tabs {
    display: inline-flex;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3px;
    gap: 2px;
    margin-bottom: 1.5rem;
}

.detail-tab {
    padding: 0.4375rem 1.125rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.detail-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.detail-tab.active {
    color: var(--accent);
    background: var(--green-dim);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

/* Player Chart */

.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.chart-range-buttons {
    display: flex;
    gap: 0.25rem;
}

.chart-range-btn {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.chart-range-btn:hover {
    border-color: var(--border-light);
    color: var(--text-primary);
}

.chart-range-btn.active {
    background: var(--green-dim);
    border-color: rgba(34, 197, 94, 0.3);
    color: var(--accent);
}

.chart-loading,
.chart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Footer */

.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.footer-brand a {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.footer-tagline {
    display: block;
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    transition: color 0.15s;
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-social {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.footer-social-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.footer-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: color 0.15s, border-color 0.15s;
}

.footer-social-link:hover {
    color: var(--text-primary);
    border-color: var(--border-light);
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Add Server Page */

.add-server-page {
    max-width: 560px;
    margin: 0 auto;
    padding: 2.5rem 0;
}

.add-server-header {
    text-align: center;
    margin-bottom: 2rem;
}

.add-server-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.375rem;
}

.add-server-subtitle {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.add-server-form-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
}

.form-fields {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-label .required {
    color: var(--accent);
}

.form-field {
    width: 100%;
    padding: 0.5625rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s;
    font-family: inherit;
}

.form-field::placeholder {
    color: var(--text-muted);
}

.form-field:focus {
    border-color: var(--accent);
}

.form-field:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Custom Select */

.custom-select {
    position: relative;
}

.custom-select.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.custom-select-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5625rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
    text-align: left;
}

.custom-select-trigger:hover {
    border-color: var(--border-light);
}

.custom-select.open .custom-select-trigger {
    border-color: var(--accent);
}

.custom-select-trigger .select-placeholder {
    color: var(--text-muted);
}

.custom-select-chevron {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: transform 0.15s;
}

.custom-select.open .custom-select-chevron {
    transform: rotate(180deg);
}

.custom-select-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9;
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 10;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    max-height: 240px;
    overflow-y: auto;
    padding: 0.25rem;
}

.custom-select-option {
    width: 100%;
    display: block;
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: all 0.1s;
}

.custom-select-option:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.custom-select-option.selected {
    background: var(--green-dim);
    color: var(--accent);
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.form-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding: 0.75rem 1rem;
    background: var(--red-dim);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius-sm);
    color: var(--red);
    font-size: 0.8125rem;
    font-weight: 500;
}

.form-success {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding: 0.75rem 1rem;
    background: var(--green-dim);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: var(--radius-sm);
    color: var(--green);
    font-size: 0.8125rem;
    font-weight: 500;
}

.form-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding: 0.75rem 1rem;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: var(--radius-sm);
    color: rgb(147, 197, 253);
    font-size: 0.8125rem;
    font-weight: 500;
}

.form-info strong {
    color: rgb(191, 219, 254);
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.btn-secondary {
    padding: 0.5625rem 1.125rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.btn-secondary:hover {
    border-color: var(--border-light);
    color: var(--text-primary);
}

.btn-primary {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5625rem 1.25rem;
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: var(--radius-sm);
    background: var(--green-dim);
    color: var(--accent);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-primary:hover {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.45);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Ping Preview */

.ping-preview {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.ping-preview-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-bottom: 0.75rem;
}

.ping-preview-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    image-rendering: pixelated;
    flex-shrink: 0;
}

.ping-preview-info {
    min-width: 0;
}

.ping-preview-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.25rem;
}

.ping-preview-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ping-preview-players {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Blazor */

#blazor-error-ui {
    display: none;
}

.blazor-error-boundary {
    background: var(--bg-card);
    padding: 1rem;
    color: var(--red);
    border-radius: var(--radius);
}

/* Responsive */

@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.5rem;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .server-card {
        padding: 0.625rem 0.875rem;
        gap: 0.75rem;
    }

    .server-icon {
        width: 40px;
        height: 40px;
    }

    .server-name {
        font-size: 0.875rem;
    }

    .server-players .players-online {
        font-size: 1rem;
    }

    .server-players span {
        font-size: 0.6875rem;
    }

    .copy-chip {
        font-size: 0.625rem;
        padding: 0.0625rem 0.375rem;
    }

    .footer-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-dropdown-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.form-check-input:focus,
.form-control:focus,
.btn:focus {
    box-shadow: none;
}

.address-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.copy-chip-alt {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.375rem 0.625rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.15s;
    color: var(--text-muted);
    font-size: 0.75rem;
    position: relative;
}

.copy-chip-alt:hover {
    border-color: var(--border-light);
    color: var(--text-secondary);
}

.copy-chip-alt .copy-state-default,
.copy-chip-alt .copy-state-copied {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.copy-chip-alt .copy-state-copied {
    position: absolute;
    inset: 0;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    color: var(--accent);
}

.copy-chip-alt.copied {
    border-color: rgba(34, 197, 94, 0.4);
}

.copy-chip-alt.copied .copy-state-default {
    opacity: 0;
    transform: scale(0.8);
}

.copy-chip-alt.copied .copy-state-copied {
    opacity: 1;
    transform: scale(1);
}

.copy-chip-alt code {
    background: none;
    padding: 0;
    font-size: 0.75rem;
    color: var(--text-primary);
}

/* Banners tab */

.banner-intro {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.banner-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: #202028;
    background-image: radial-gradient(circle at 50% 35%, #2a2a34 0%, #1a1a20 75%);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.banner-preview-link {
    display: inline-flex;
    line-height: 0;
    border-radius: 14px;
    transition: transform 0.15s, filter 0.15s;
}

.banner-preview-link:hover {
    transform: translateY(-2px);
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.45));
}

.banner-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem 2rem;
    margin-bottom: 1.1rem;
}

.banner-control {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.banner-control-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: var(--text-muted);
}

.banner-chips {
    display: inline-flex;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3px;
    gap: 2px;
}

.banner-chip {
    padding: 0.375rem 0.875rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.banner-chip:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.banner-chip.active {
    color: var(--accent);
    background: var(--green-dim);
}

.banner-swatches {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    height: calc(0.375rem * 2 + 0.8125rem * 1.2 + 6px);
}

.banner-swatch {
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    background: var(--swatch);
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.12s;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.banner-swatch:hover {
    transform: scale(1.12);
}

.banner-swatch.active {
    border-color: var(--bg-primary);
    box-shadow: 0 0 0 2px var(--swatch);
}

.banner-swatch-custom {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: conic-gradient(from 0deg, #ef4444, #eab308, #22c55e, #3b82f6, #8b5cf6, #ef4444);
}

.banner-swatch-custom.active {
    background: var(--swatch);
}

.banner-swatch-custom input[type="color"] {
    position: absolute;
    inset: -4px;
    width: calc(100% + 8px);
    height: calc(100% + 8px);
    padding: 0;
    border: none;
    opacity: 0;
    cursor: pointer;
}

.banner-control-slider {
    flex: 1 1 100%;
    max-width: 320px;
}

.banner-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    outline: none;
    cursor: pointer;
}

.banner-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-primary);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.banner-range::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-primary);
    cursor: pointer;
}

.banner-advanced-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
    padding: 0.45rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.banner-advanced-toggle:hover {
    color: var(--text-primary);
    border-color: var(--border-light);
}

.banner-advanced-toggle svg {
    transition: transform 0.18s;
}

.banner-advanced-toggle.open svg {
    transform: rotate(180deg);
}

.banner-advanced {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 1.75rem;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.015);
}

.banner-adv-field {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.banner-adv-field.banner-control-slider {
    max-width: 340px;
}

/* Background preview tiles */

.banner-bg-tiles {
    display: flex;
    gap: 0.75rem;
}

.banner-bg-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
}

.banner-bg-swatch {
    width: 70px;
    height: 40px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    transition: border-color 0.12s, box-shadow 0.12s;
}

.banner-bg-tile:hover .banner-bg-swatch {
    border-color: var(--border-light);
}

.banner-bg-tile.active .banner-bg-swatch {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.banner-bg-grad {
    background: linear-gradient(180deg, #2a2a34, #131319);
}

.banner-bg-solid {
    background: #1b1b24;
}

.banner-bg-tint {
    background: linear-gradient(160deg, color-mix(in srgb, var(--swatch, var(--accent)) 42%, #131319), #131319);
}

.banner-bg-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.banner-bg-tile.active .banner-bg-label {
    color: var(--text-primary);
}

/* Toggle switches */

.banner-toggle-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
    gap: 0.75rem 1.25rem;
}

.banner-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
}

.banner-toggle-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.banner-switch {
    position: relative;
    width: 38px;
    height: 22px;
    flex-shrink: 0;
    padding: 0;
    border: none;
    border-radius: 11px;
    background: var(--border-light);
    cursor: pointer;
    transition: background 0.15s;
}

.banner-switch.on {
    background: var(--accent);
}

.banner-switch-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s;
}

.banner-switch.on .banner-switch-knob {
    transform: translateX(16px);
}

/* Style / theme preview pickers + modal */

.banner-select {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 150px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.banner-select:hover {
    border-color: var(--border-light);
    background: var(--bg-card-hover);
}

.banner-select-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.banner-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    animation: bannerFade 0.12s ease;
}

@keyframes bannerFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.banner-modal {
    width: 100%;
    max-width: 780px;
    max-height: 85vh;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.banner-modal-head {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}

.banner-modal-head h3 {
    font-size: 0.95rem;
    font-weight: 600;
}

.banner-modal-close {
    display: inline-flex;
    padding: 0.3rem;
    border: none;
    background: none;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}

.banner-modal-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.banner-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 1rem;
    padding: 1.25rem;
}

.banner-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    padding: 1rem;
    min-height: 120px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background-color: #202028;
    background-image: radial-gradient(circle at 50% 40%, #2a2a34 0%, #1a1a20 80%);
    cursor: pointer;
    transition: border-color 0.15s, transform 0.12s;
}

.banner-option:hover {
    transform: translateY(-2px);
    border-color: var(--border-light);
}

.banner-option.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.banner-option-preview {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.banner-option-preview svg {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 88px;
}

.banner-option-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.banner-option.active .banner-option-name {
    color: var(--accent);
}

.banner-embeds {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.banner-embed {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    overflow: hidden;
}

.banner-embed-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.banner-embed-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.banner-copy-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.banner-copy-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-light);
}

.banner-copy-btn .copy-state-default,
.banner-copy-btn .copy-state-copied {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.banner-copy-btn .copy-state-copied {
    position: absolute;
    inset: 0;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    color: var(--accent);
}

.banner-copy-btn.copied {
    border-color: rgba(34, 197, 94, 0.4);
}

.banner-copy-btn.copied .copy-state-default {
    opacity: 0;
}

.banner-copy-btn.copied .copy-state-copied {
    opacity: 1;
    transform: scale(1);
}

.banner-embed-code {
    margin: 0;
    padding: 0.75rem;
    background: var(--bg-primary);
}

.banner-embed-code code {
    display: block;
    background: none;
    padding: 0;
    font-family: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, Monaco, Consolas, monospace;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--text-secondary);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
