:root {
    --bg: #08060e;
    --bg-soft: #0f0c18;
    --card: rgba(20, 16, 30, 0.72);
    --card-solid: #141018;
    --border: rgba(168, 85, 247, 0.28);
    --border-strong: rgba(168, 85, 247, 0.55);
    --primary: #a855f7;
    --primary-dim: #7c3aed;
    --accent: #f43f5e;
    --accent-light: #c77dff;
    --text: #f7f4ff;
    --muted: #9c96ad;
    --error: #ff6b6b;
    --approve: #2ecc71;
    --deny: #e74c3c;
    --radius: 16px;
    --radius-sm: 10px;
    --font-display: 'Syne', 'Segoe UI', sans-serif;
    --font-ui: 'DM Sans', 'Segoe UI', system-ui, sans-serif;
    --shadow: 0 16px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(168, 85, 247, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-ui);
    margin: 0;
    min-height: 100vh;
    position: relative;
    line-height: 1.55;
}

.bg-glow {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse 900px 500px at 15% -10%, rgba(168, 85, 247, 0.22), transparent 60%),
        radial-gradient(ellipse 700px 500px at 100% 10%, rgba(244, 63, 94, 0.14), transparent 55%),
        radial-gradient(ellipse 800px 600px at 50% 120%, rgba(124, 58, 237, 0.18), transparent 60%),
        var(--bg);
}

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

h1, h2, h3 {
    font-family: var(--font-display);
    letter-spacing: -0.01em;
}

/* Header */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 2rem;
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(8, 6, 14, 0.72);
    backdrop-filter: blur(16px) saturate(1.3);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--text);
    text-decoration: none;
    letter-spacing: 0.02em;
}

.brand-logo {
    height: 34px;
    width: 34px;
    border-radius: 8px;
    box-shadow: 0 0 16px rgba(168, 85, 247, 0.45);
}

.nav {
    display: flex;
    gap: 1.75rem;
}

.navlink {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    position: relative;
    padding-bottom: 4px;
    transition: color 0.15s ease;
}
.navlink::after {
    content: '';
    position: absolute;
    left: 0;
    right: 100%;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: right 0.2s ease;
    border-radius: 2px;
}
.navlink:hover {
    color: var(--text);
}
.navlink:hover::after {
    right: 0;
}
.navlink.active {
    color: var(--accent-light);
}
.navlink.active::after {
    right: 0;
}

.btn-small {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--primary-dim));
    color: #fff;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
}

.userbox {
    display: flex;
    align-items: center;
}
.userbox-name {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.9rem;
}
.userbox a {
    color: var(--muted);
    margin-left: 1rem;
    text-decoration: none;
    font-size: 0.9rem;
}
.userbox a:hover {
    color: var(--text);
}

/* Layout */
.container {
    max-width: 720px;
    margin: 3rem auto;
    padding: 0 1.25rem;
}

.container.wide {
    max-width: 1150px;
}

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

.card.center {
    text-align: center;
}

h1 {
    color: var(--text);
    margin-top: 0;
    font-weight: 800;
}

.muted {
    color: var(--muted);
}
.small {
    font-size: 0.85rem;
}
.error {
    color: var(--error);
}

label {
    display: block;
    margin-bottom: 1.25rem;
    font-weight: 600;
    font-size: 0.92rem;
}

input,
textarea,
select {
    display: block;
    width: 100%;
    margin-top: 0.4rem;
    padding: 0.65rem 0.75rem;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent-light);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

.btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--primary-dim));
    color: #fff;
    border: none;
    padding: 0.8rem 1.7rem;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.45);
}

.btn-approve {
    background: var(--approve);
}
.btn-deny {
    background: var(--deny);
}

.app-card {
    background: var(--card);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1rem;
}

dl {
    margin: 0;
}
dt {
    color: var(--accent-light);
    font-weight: 600;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
dd {
    margin: 0.25rem 0 0;
    white-space: pre-wrap;
}

.actions {
    margin-top: 1.25rem;
    display: flex;
    gap: 0.75rem;
}

/* Homepage */
.hero {
    text-align: center;
    padding: 4rem 1rem 3rem;
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1rem;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-image: url('/public/images/logo-hero.png');
    background-size: cover;
    background-position: center 20%;
    opacity: 0.28;
    filter: saturate(1.3);
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent 90%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent 90%);
    z-index: -1;
}

.hero-crest {
    height: 96px;
    width: 96px;
    border-radius: 20px;
    box-shadow: 0 0 40px rgba(168, 85, 247, 0.5);
    margin-bottom: 1.25rem;
}

.hero h1 {
    font-size: clamp(2.4rem, 6vw, 4rem);
    margin: 0 0 0.2rem;
    background: linear-gradient(135deg, #ffffff, var(--accent-light) 60%, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 800;
}

.tagline {
    font-size: 1.2rem;
    color: var(--text);
    font-weight: 600;
    margin: 0 0 0.6rem;
    letter-spacing: 0.03em;
}

.hero-actions {
    margin-top: 1.75rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-outline {
    display: inline-block;
    background: rgba(168, 85, 247, 0.06);
    color: var(--accent-light);
    border: 1px solid var(--border-strong);
    padding: 0.8rem 1.7rem;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.15s ease;
}
.btn-outline:hover {
    border-color: var(--accent-light);
    background: rgba(199, 125, 255, 0.14);
    transform: translateY(-2px);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-top: 2.5rem;
}

.feature-card {
    background: var(--card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.6rem;
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.feature-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
}

.feature-card h3 {
    color: var(--text);
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
}

.feature-card p {
    color: var(--muted);
    margin: 0;
    font-size: 0.92rem;
}

/* Team */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.team-card {
    background: var(--card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem 1.25rem;
    text-align: center;
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.team-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
}

.team-avatar {
    height: 88px;
    width: 88px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-strong);
    box-shadow: 0 0 24px rgba(168, 85, 247, 0.3);
    margin-bottom: 1rem;
}

.team-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 0.3rem;
}

.team-role {
    display: inline-block;
    color: var(--accent-light);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Rules */
.rules-intro {
    margin-bottom: 2rem;
}

.rules-section {
    margin-bottom: 1.75rem;
    padding-left: 1.25rem;
    border-left: 2px solid var(--border);
}

.rules-section h2 {
    font-size: 1.15rem;
    color: var(--text);
    margin: 0 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rules-section h2 .num {
    color: var(--accent-light);
    font-family: var(--font-display);
}

.rules-list {
    margin: 0;
    padding-left: 1.1rem;
    color: #d8d3e8;
}
.rules-list li {
    margin-bottom: 0.55rem;
    font-size: 0.95rem;
}
.rules-list li::marker {
    color: var(--accent-light);
}

/* Tables (admin) */
table.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}
table.data-table th, table.data-table td {
    text-align: left;
    padding: 0.65rem 0.8rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
table.data-table th {
    color: var(--accent-light);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.badge-pending { background: rgba(241, 196, 15, 0.18); color: #f1c40f; }
.badge-approved { background: rgba(46, 204, 113, 0.18); color: #2ecc71; }
.badge-denied { background: rgba(231, 76, 60, 0.18); color: #e74c3c; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-tile {
    background: var(--card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem;
    text-align: center;
}

.stat-tile .stat-value {
    font-family: var(--font-display);
    font-size: 2.1rem;
    font-weight: 700;
    color: var(--accent-light);
}

.stat-tile .stat-label {
    color: var(--muted);
    font-size: 0.82rem;
    margin-top: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.admin-tabs a {
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    text-decoration: none;
    color: var(--muted);
    border: 1px solid var(--border);
    font-size: 0.85rem;
    font-weight: 700;
}
.admin-tabs a.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dim));
    color: #fff;
    border-color: transparent;
}

.inline-form {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.inline-form label {
    margin-bottom: 0;
    font-size: 0.85rem;
}

.inline-form input, .inline-form select {
    margin-top: 0.25rem;
}

.warning-box {
    background: rgba(255, 107, 107, 0.08);
    border: 1px solid var(--error);
    border-radius: var(--radius-sm);
    padding: 1rem 1.2rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

/* Stream */
.live-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1.2rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.live-dot {
    height: 10px;
    width: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 rgba(244, 63, 94, 0.6);
    animation: live-pulse 1.6s infinite;
    flex-shrink: 0;
}

@keyframes live-pulse {
    0% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.6); }
    70% { box-shadow: 0 0 0 10px rgba(244, 63, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); }
}

.stream-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.stream-grid iframe {
    display: block;
    border-radius: var(--radius);
}

.stream-follow {
    margin-top: 2rem;
}

@media (max-width: 820px) {
    .stream-grid {
        grid-template-columns: 1fr;
    }
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 3rem 1rem 2.5rem;
    color: var(--muted);
    font-size: 0.85rem;
}
.footer-logo {
    height: 36px;
    width: 36px;
    border-radius: 8px;
    opacity: 0.85;
    margin-bottom: 0.75rem;
}
.site-footer p {
    margin: 0.2rem 0;
}
.site-footer a {
    color: var(--muted);
    text-decoration: none;
}
.site-footer a:hover {
    color: var(--accent-light);
}
