/* ── Design tokens ── */
:root {
    --bg-1: #0d0d14;
    --bg-2: #12121e;
    --bg-3: #1a1a2e;
    --card: rgba(255, 255, 255, 0.04);
    --card-hover: rgba(255, 255, 255, 0.07);
    --line: rgba(255, 255, 255, 0.08);
    --line-solid: #1e1e30;
    --ink: #e8e8f0;
    --ink-dim: #b0b0c8;
    --muted: #7a7a9a;
    --brand: #7c3aed;
    --brand-2: #a855f7;
    --brand-3: #c084fc;
    --brand-glow: rgba(124, 58, 237, 0.35);
    --cyan: #06b6d4;
    --green: #10b981;
    --red: #f87171;
    --orange: #fb923c;
    --radius-sm: 0.5rem;
    --radius: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px var(--brand-glow);
}

/* ── Reset ── */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    color: var(--ink);
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    background: var(--bg-1);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(124, 58, 237, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 80%, rgba(6, 182, 212, 0.06) 0%, transparent 50%);
    -webkit-font-smoothing: antialiased;
}

h1:focus {
    outline: none;
}

a {
    color: var(--brand-3);
    text-decoration: none;
}

a:hover {
    color: var(--brand-2);
}

/* ── Typography helpers ── */
.gradient-text {
    background: linear-gradient(135deg, var(--brand-2), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Cards ── */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    backdrop-filter: blur(12px);
    transition: background 0.2s, border-color 0.2s;
}

.card:hover {
    background: var(--card-hover);
    border-color: rgba(255, 255, 255, 0.12);
}

/* ── Form controls ── */
label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ink-dim);
    margin-bottom: 0.35rem;
    letter-spacing: 0.01em;
}

input, select {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.85rem;
    font: inherit;
    font-size: 0.95rem;
    color: var(--ink);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    outline: none;
}

input::placeholder {
    color: var(--muted);
}

input:focus, select:focus {
    border-color: var(--brand-2);
    background: rgba(124, 58, 237, 0.08);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

select option {
    background: var(--bg-3);
    color: var(--ink);
}

/* ── Buttons ── */
button {
    border: 0;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s, box-shadow 0.2s;
}

button:hover:not(:disabled) {
    opacity: 0.9;
    box-shadow: 0 4px 20px var(--brand-glow);
    transform: translateY(-1px);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 0;
    border-radius: var(--radius-sm);
    padding: 0.7rem 1.5rem;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.15s, transform 0.1s, box-shadow 0.2s;
    letter-spacing: 0.01em;
}

.btn-primary:hover {
    opacity: 0.88;
    box-shadow: 0 6px 28px var(--brand-glow);
    transform: translateY(-1px);
    color: #fff;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1.5px solid rgba(168, 85, 247, 0.5);
    border-radius: var(--radius-sm);
    padding: 0.65rem 1.4rem;
    background: rgba(124, 58, 237, 0.1);
    color: var(--brand-3);
    font-weight: 600;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.1s;
}

.btn-secondary:hover {
    background: rgba(124, 58, 237, 0.2);
    border-color: var(--brand-2);
    color: var(--brand-2);
    transform: translateY(-1px);
}

.btn-ghost {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.875rem;
    font-family: inherit;
    padding: 0.35rem 0.7rem;
    border-radius: var(--radius-sm);
    transition: color 0.2s, background 0.2s;
}

.btn-ghost:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.06);
}

.btn-full { width: 100%; justify-content: center; text-align: center; }

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
}

.btn-plan {
    display: block;
    margin-top: 1.25rem;
    text-align: center;
    padding: 0.65rem;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    transition: opacity 0.15s, box-shadow 0.2s;
}

.btn-plan:hover {
    opacity: 0.88;
    box-shadow: 0 4px 20px var(--brand-glow);
    color: #fff;
}

.btn-success {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 0;
    border-radius: var(--radius-sm);
    padding: 0.65rem 1.4rem;
    background: var(--green);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
}

.btn-success:hover {
    opacity: 0.88;
    transform: translateY(-1px);
    color: #fff;
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 0;
    border-radius: var(--radius-sm);
    padding: 0.65rem 1.4rem;
    background: var(--red);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
}

.btn-danger:hover {
    opacity: 0.88;
    transform: translateY(-1px);
    color: #fff;
}

.server-card {
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.server-card:last-of-type {
    margin-bottom: 1.5rem;
}

.server-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.server-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.add-server-panel {
    margin: 1rem 0;
    padding: 1.25rem;
    background: var(--card);
    border: 1px solid var(--brand);
    border-radius: var(--radius-lg);
}

.add-server-panel h3 {
    margin: 0 0 1rem;
    font-weight: 600;
    color: var(--brand-3);
}

.add-server-panel .section-divider {
    margin: 1.25rem 0;
}

/* ── Alerts ── */
.alert {
    margin-top: 0.85rem;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
}

.alert-error {
    background: rgba(248, 113, 113, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(248, 113, 113, 0.25);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.alert-warn {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.msg { margin-top: 0.6rem; color: var(--green); }
.err { margin-top: 0.6rem; color: var(--red); }

/* ── Notification bell ── */
.notification-bell {
    position: relative;
    display: inline-block;
    margin-left: 1rem;
    cursor: pointer;
    font-size: 1.25rem;
}
.notification-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: var(--red);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
}
.notification-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 280px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 100;
    padding: 0.5rem;
}
.notification-bell:hover .notification-dropdown {
    display: block;
}
.notification-item {
    padding: 0.5rem;
    border-bottom: 1px solid #334155;
}
.notification-item:last-child {
    border-bottom: none;
}
.notification-title {
    font-weight: 600;
    font-size: 0.85rem;
}
.notification-message {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 0.2rem;
}
.notification-budget_exceeded .notification-title {
    color: var(--red);
}
.notification-variance_alert .notification-title {
    color: var(--orange);
}
.notification-dismiss {
    margin-top: 0.3rem;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    background: #334155;
    color: #94a3b8;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.notification-dismiss:hover {
    background: #475569;
    color: #fff;
}

/* ── Budget progress bar ── */
.budget-bar-container {
    width: 100%;
    height: 8px;
    background: #1e293b;
    border-radius: 4px;
    overflow: hidden;
    margin: 0.5rem 0 0.25rem;
}
.budget-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}
.budget-bar-ok { background: var(--green); }
.budget-bar-warn { background: var(--orange); }
.budget-bar-danger { background: var(--red); }
.budget-label {
    font-size: 0.8rem;
    color: #94a3b8;
}
.budget-over {
    color: var(--red);
    font-weight: 600;
}

/* ── Budget range slider ── */
.form-range {
    width: 100%;
    margin: 0.25rem 0;
    accent-color: var(--accent);
}

/* ── Table ── */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table th {
    text-align: left;
    padding: 0.5rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
}

.table td {
    text-align: left;
    padding: 0.55rem 0.6rem;
    border-bottom: 1px solid var(--line);
    color: var(--ink-dim);
    overflow-wrap: break-word;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.invite-url-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin: 0.4rem 0;
}

.invite-url-row code {
    flex: 1;
    padding: 0.4rem 0.6rem;
    font-size: 0.82rem;
    word-break: break-all;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 4px;
}

.btn-icon {
    background: var(--bg);
    border: 1px solid var(--line);
    padding: 0.4rem 0.75rem;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink-dim);
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}

.btn-icon:hover {
    color: var(--ink);
    border-color: var(--brand);
}

/* ── Nav ── */
.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 62px;
    border-bottom: 1px solid var(--line);
    background: rgba(13, 13, 20, 0.85);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--brand-2), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-links a,
.nav-links button {
    color: var(--ink-dim);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.4rem 0.7rem;
    border-radius: var(--radius-sm);
    transition: color 0.2s, background 0.2s;
}

.nav-links a:hover,
.nav-links button:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.06);
}

.nav-user {
    font-size: 0.8rem;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.06);
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    margin-right: 0.25rem;
}

main {
    padding: 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

/* ── Hero ── */
.hero {
    padding: 6rem 2rem 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-glow {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 700px;
    height: 400px;
    background: radial-gradient(ellipse at center, rgba(124, 58, 237, 0.22) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.hero-inner {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 800;
    margin: 0 0 1.25rem;
    line-height: 1.1;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #e8e8f0 30%, var(--brand-3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: 1.15rem;
    color: var(--ink-dim);
    max-width: 540px;
    margin: 0 auto 2.25rem;
    line-height: 1.65;
}

.hero .btn-primary,
.hero .btn-secondary {
    margin: 0.4rem;
}

/* ── Features ── */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    padding: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.feature-card {
    text-align: center;
    padding: 1.75rem 1.5rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
    background: var(--card-hover);
    border-color: rgba(168, 85, 247, 0.25);
    transform: translateY(-3px);
}

.feature-icon {
    font-size: 2.25rem;
    display: block;
    margin-bottom: 0.75rem;
}

.feature-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
}

.feature-card p {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

/* ── Game selector ── */
.game-selector {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.game-btn {
    padding: 0.4rem 1.2rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--ink);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: capitalize;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.game-btn:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.game-btn.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

/* ── Plans section ── */
.plans-section {
    padding: 3rem 2rem 4rem;
    text-align: center;
    max-width: 960px;
    margin: 0 auto;
}

.plans-section h2 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    margin-bottom: 0.5rem;
}

.plans-sub {
    color: var(--muted);
    margin-bottom: 2.25rem;
    font-size: 0.95rem;
}

.plan-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
}

.plan-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    text-align: left;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.plan-card:hover {
    background: var(--card-hover);
    border-color: rgba(168, 85, 247, 0.3);
    transform: translateY(-3px);
}

.plan-region {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.35rem;
}

.plan-specs {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 1rem;
}

.plan-price {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--brand-2), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.plan-price span {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--muted);
    -webkit-text-fill-color: var(--muted);
}

/* ── Auth ── */
.auth-page {
    display: flex;
    justify-content: center;
    padding: 5rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    padding: 2.25rem;
    backdrop-filter: blur(12px);
}

.auth-card h1 {
    margin: 0 0 0.5rem;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.auth-sub {
    color: var(--muted);
    margin-bottom: 1.75rem;
    font-size: 0.9rem;
    line-height: 1.55;
}

.optional {
    font-weight: 400;
    color: var(--muted);
    font-size: 0.8rem;
}

.form-group {
    margin-bottom: 1rem;
}

/* ── Dashboard ── */
.dashboard-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.dashboard-header h1 {
    margin: 0;
    flex: 1;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.user-badge {
    font-size: 0.8rem;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.06);
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--line);
}

.group-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.group-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.4rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    transition: background 0.2s, border-color 0.2s;
}

.group-card:hover {
    background: var(--card-hover);
    border-color: rgba(255, 255, 255, 0.12);
}

.group-info {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
}

.group-name {
    font-weight: 700;
    color: var(--ink);
}

.create-group-section {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--line);
}

.create-group-section h2 {
    margin: 0 0 1.25rem;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.015em;
}

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 220px;
}

.empty-state {
    color: var(--muted);
    padding: 2.5rem;
    text-align: center;
    background: var(--card);
    border: 1px dashed var(--line);
    border-radius: var(--radius-xl);
    margin-bottom: 0.5rem;
}

.dashboard-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* ── Badges & status ── */
.badge-owner {
    background: rgba(251, 146, 60, 0.15);
    color: var(--orange);
    border: 1px solid rgba(251, 146, 60, 0.25);
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.badge-member {
    background: rgba(124, 58, 237, 0.15);
    color: var(--brand-3);
    border: 1px solid rgba(124, 58, 237, 0.25);
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.game-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(6, 182, 212, 0.15);
    color: var(--cyan);
    border: 1px solid rgba(6, 182, 212, 0.25);
}

.status-ok { color: var(--green); font-weight: 600; }
.status-warn { color: var(--orange); font-weight: 600; }
.status-neutral { color: var(--muted); }

/* ── Group detail ── */
.page-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.page-header h1 {
    margin: 0;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.back-link {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.7rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.back-link:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.blade-nav {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--line);
    padding-bottom: 0;
}

.blade-nav-item {
    background: none;
    border: none;
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
}

.blade-nav-item:hover {
    color: var(--ink);
}

.blade-nav-item.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
}

.blade-content > .card + .card {
    margin-top: 1.25rem;
}

.form-inline {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    margin: 0.85rem 0;
}

.form-inline input {
    flex: 1;
    margin-bottom: 0;
}

.invite-token {
    font-size: 0.85rem;
    word-break: break-all;
    line-height: 1.6;
}

.invite-token code {
    display: block;
    margin: 0.35rem 0;
    font-family: "Fira Mono", "Consolas", monospace;
    background: rgba(255, 255, 255, 0.06);
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    font-size: 0.82rem;
    color: var(--cyan);
}

.server-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.server-game {
    font-weight: 700;
    font-size: 1.05rem;
}

.server-meta {
    font-size: 0.82rem;
    color: var(--muted);
}

.state-provisioning { color: var(--cyan); font-weight: 600; }
.state-running { color: var(--green); font-weight: 600; }
.state-stopped { color: var(--muted); font-weight: 600; }
.state-error { color: var(--red); font-weight: 600; }

/* ── Card section headings ── */
.card h2 {
    margin: 0 0 1.25rem;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink);
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--line);
}

.card h3 {
    margin: 1.25rem 0 0.5rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.72rem;
}

/* ── Section divider ── */
.section-divider {
    border: none;
    border-top: 1px solid var(--line);
    margin: 0;
}

.theme-label {
    display: inline-flex;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.25rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 999px;
    color: #ffd6f7;
    border: 1px solid rgba(255, 214, 247, 0.35);
    background: rgba(255, 214, 247, 0.1);
}

body.theme-anime {
    --bg-1: #130f2b;
    --bg-2: #1d163d;
    --bg-3: #281d58;
    --card: rgba(255, 255, 255, 0.06);
    --card-hover: rgba(255, 255, 255, 0.1);
    --line: rgba(255, 255, 255, 0.14);
    --ink: #f7f2ff;
    --ink-dim: #d4c5f7;
    --muted: #9f90c9;
    --brand: #ec4899;
    --brand-2: #a855f7;
    --brand-3: #f5a5f0;
    --brand-glow: rgba(236, 72, 153, 0.35);
    --cyan: #22d3ee;
    background-image:
        radial-gradient(ellipse 90% 60% at 10% -10%, rgba(236, 72, 153, 0.2) 0%, transparent 62%),
        radial-gradient(ellipse 75% 55% at 90% 90%, rgba(34, 211, 238, 0.12) 0%, transparent 58%),
        linear-gradient(180deg, #100b24 0%, #171236 100%);
}

body.theme-anime .hero-glow {
    background: radial-gradient(ellipse at center, rgba(236, 72, 153, 0.25) 0%, transparent 72%);
}

body.theme-anime .nav-brand,
body.theme-anime .plan-price {
    background: linear-gradient(135deg, #f472b6, #c084fc, #67e8f9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.member-share-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.member-share-row label {
    flex: 1;
    font-size: 0.875rem;
}

.share-input {
    width: 5rem;
    text-align: right;
}

.share-total {
    margin-top: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
}

.share-total-ok {
    color: var(--green, #22c55e);
}

.share-total-warn {
    color: var(--red, #ef4444);
}

.share-warning {
    margin-left: 0.5rem;
    font-weight: 400;
    font-size: 0.75rem;
}

/* ── Server logs viewer ── */
.server-logs {
    margin-top: 1.5rem;
    border-top: 1px solid var(--line);
    padding-top: 1rem;
}

.server-logs h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    margin: 0 0 0.5rem;
}

.log-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--muted);
}

.poll-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    display: inline-block;
}

.poll-dot.live {
    background: var(--green, #22c55e);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.65);
    animation: log-pulse 1.6s infinite;
}

.poll-dot.paused {
    background: var(--muted);
    opacity: 0.7;
}

.log-count {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.15rem 0.5rem;
}

.log-filter {
    width: 100%;
    margin-bottom: 0.6rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.82rem;
    padding: 0.45rem 0.6rem;
}

.log-filter:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent);
}

.log-viewer {
    background: #0d1117;
    color: #e6edf3;
    font-family: "Cascadia Code", "Fira Code", "JetBrains Mono", "Consolas", monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    padding: 0.75rem;
    border-radius: 6px;
    max-height: 480px;
    min-height: 120px;
    overflow-y: auto;
    margin: 0;
    word-wrap: break-word;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.log-line {
    white-space: pre;
    min-height: 1.2em;
}

.log-line-info { color: #7ee787; }
.log-line-warn { color: #f2cc60; }
.log-line-error,
.log-line-fatal { color: #ff7b72; }
.log-line-debug { color: #8b949e; }

.log-placeholder {
    color: rgba(230, 237, 243, 0.4);
    font-style: italic;
}

.log-viewer::-webkit-scrollbar {
    width: 6px;
}

.log-viewer::-webkit-scrollbar-track {
    background: transparent;
}

.log-viewer::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

@keyframes log-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.65);
    }
    70% {
        box-shadow: 0 0 0 7px rgba(34, 197, 94, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* ── Console viewer (xterm.js remote terminal) ── */
.console-viewer {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.console-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--line);
}

.console-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-connected .status-dot { background: var(--green); }
.status-connecting .status-dot { background: var(--orange); }
.status-disconnected .status-dot { background: var(--muted); }
.status-error .status-dot { background: var(--red); }

.status-connected { color: var(--green); }
.status-connecting { color: var(--orange); }
.status-disconnected { color: var(--muted); }
.status-error { color: var(--red); }

.console-session {
    font-size: 0.75rem;
    color: var(--muted);
    margin-left: auto;
}

.console-output {
    min-height: 400px;
}

.console-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: var(--muted);
    text-align: center;
    gap: 0.5rem;
}

.console-placeholder p {
    margin: 0;
}

/* xterm.js overrides */
#terminal .xterm {
    padding: 8px;
}

#terminal .xterm-viewport {
    scrollbar-width: thin;
}

