:root {
    --bg-main: #090c14;
    --bg-card: rgba(16, 22, 35, 0.92);
    --bg-sub: rgba(10, 14, 24, 0.78);
    --border-subtle: rgba(255, 255, 255, 0.09);
    --border-fire: rgba(249, 115, 22, 0.45);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-fire: #f97316;
    --accent-red: #ef4444;
    --accent-cyan: #38bdf8;
    --accent-green: #22c55e;
    --discord-blurple: #5865f2;
    --radius-lg: 16px;
    --radius-md: 11px;
}

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

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at 12% 8%, rgba(249, 115, 22, 0.12), transparent 36%),
        radial-gradient(circle at 88% 12%, rgba(239, 68, 68, 0.1), transparent 35%),
        var(--bg-main);
}

.hidden {
    display: none !important;
}

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

.muted {
    color: var(--text-muted);
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
}

/* HEADER */
.ff-header {
    position: sticky;
    top: 0;
    z-index: 90;
    background: rgba(9, 12, 20, 0.88);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    color: inherit;
}

.brand-badge {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.24), rgba(220, 38, 38, 0.28));
    border: 1px solid var(--border-fire);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.brand-title-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 900;
    font-size: 1.08rem;
    letter-spacing: 0.6px;
}

.brand-sub {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.live-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.75);
    display: inline-block;
}

/* NAVIGATION */
.main-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    background: rgba(15, 23, 42, 0.75);
    padding: 0.32rem;
    border-radius: 13px;
    border: 1px solid var(--border-subtle);
}

.nav-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #cbd5e1;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 0.48rem 0.9rem;
    border-radius: 9px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    transition: all 0.16s ease;
}

.nav-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.nav-btn.active {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.24), rgba(239, 68, 68, 0.22));
    border-color: var(--border-fire);
    color: #fff;
}

.nav-btn-org {
    border-color: rgba(56, 189, 248, 0.28);
    color: #7dd3fc;
}

.nav-count {
    background: rgba(249, 115, 22, 0.25);
    border: 1px solid rgba(249, 115, 22, 0.5);
    color: #fed7aa;
    font-size: 0.72rem;
    padding: 0.06rem 0.42rem;
    border-radius: 999px;
}

/* AUTH ZONE */
.auth-zone {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    padding: 0.28rem 0.65rem 0.28rem 0.32rem;
    border-radius: 999px;
}

.user-pill img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.role-tag {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.12rem 0.48rem;
    border-radius: 999px;
    background: rgba(249, 115, 22, 0.18);
    border: 1px solid rgba(249, 115, 22, 0.45);
    color: #fdba74;
}

/* BUTTONS */
.btn {
    font-family: inherit;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 0.56rem 1.05rem;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    transition: all 0.16s ease;
    color: #fff;
}

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

.btn-sm {
    font-size: 0.78rem;
    padding: 0.36rem 0.72rem;
    border-radius: 8px;
}

.btn-lg {
    font-size: 0.96rem;
    padding: 0.72rem 1.4rem;
}

.btn-primary {
    background: linear-gradient(135deg, #f97316, #dc2626);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(249, 115, 22, 0.32);
}

.btn-secondary {
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: #fff;
}

.btn-success {
    background: linear-gradient(135deg, #16a34a, #059669);
    color: #fff;
}

.btn-outline {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-subtle);
    color: var(--text-main);
}

.btn-outline:hover:not(:disabled) {
    border-color: rgba(249, 115, 22, 0.55);
    background: rgba(249, 115, 22, 0.1);
}

.btn-danger-outline {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.btn-discord {
    background: var(--discord-blurple);
    color: #fff;
}

.btn-discord:hover {
    background: #4752c4;
}

/* MAIN & CARDS */
.main-content {
    flex: 1;
    padding-top: 1.5rem;
    padding-bottom: 3rem;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.45rem;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.38);
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.15rem;
}

.card-header h2 {
    margin: 0.15rem 0 0;
    font-size: 1.35rem;
}

.kicker {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: #fb923c;
    background: rgba(249, 115, 22, 0.14);
    border: 1px solid rgba(249, 115, 22, 0.32);
    padding: 0.18rem 0.6rem;
    border-radius: 999px;
}

.sub-box {
    background: var(--bg-sub);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.95rem 1.05rem;
}

.divider {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: 1.25rem 0;
}

/* GATE SCREEN (NON CONNECTÉ / NON AUTORISÉ) */
.gate-card {
    max-width: 580px;
    margin: 2.5rem auto;
    background: linear-gradient(145deg, rgba(16, 22, 35, 0.96), rgba(32, 16, 24, 0.9));
    border: 1px solid var(--border-fire);
    border-radius: 20px;
    padding: 2.6rem 2rem;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.gate-icon {
    font-size: 3.3rem;
    margin-bottom: 0.7rem;
}

.gate-card h1 {
    margin: 0 0 0.6rem;
    font-size: 1.6rem;
}

/* FORMS */
.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.85rem;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.85rem;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: #cbd5e1;
    margin-bottom: 0.35rem;
}

.input {
    width: 100%;
    background: rgba(9, 13, 22, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 9px;
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    padding: 0.56rem 0.8rem;
    outline: none;
    transition: border-color 0.15s ease;
}

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

.input-sm {
    padding: 0.38rem 0.65rem;
    font-size: 0.8rem;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.84rem;
    color: #e2e8f0;
    cursor: pointer;
}

.teams-inputs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.55rem;
}

/* STEAM LIVE SEARCH */
.steam-search-wrap {
    position: relative;
}

.steam-input {
    border-color: rgba(56, 189, 248, 0.4);
    padding: 0.68rem 0.95rem;
    font-size: 0.94rem;
}

.steam-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 360px;
    overflow-y: auto;
    background: rgba(11, 16, 28, 0.98);
    border: 1px solid rgba(56, 189, 248, 0.5);
    border-radius: 12px;
    padding: 0.45rem;
    z-index: 60;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.72);
}

.steam-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.45rem 0.6rem;
    border-radius: 9px;
    cursor: pointer;
    transition: background 0.14s ease;
}

.steam-result-item:hover {
    background: rgba(56, 189, 248, 0.15);
}

.steam-result-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.steam-result-left img {
    width: 96px;
    height: 45px;
    border-radius: 6px;
    object-fit: cover;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
}

/* SAVED GAMES CHIPS */
.saved-games-bar {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-top: 0.6rem;
}

.saved-game-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.78rem;
    color: #e2e8f0;
    cursor: pointer;
}

.saved-game-chip:hover {
    border-color: var(--accent-fire);
    background: rgba(249, 115, 22, 0.12);
}

/* DRAFT GAMES LIST */
.draft-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 0.85rem;
}

.draft-game-card {
    background: var(--bg-sub);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.draft-game-banner {
    width: 100%;
    aspect-ratio: 460 / 215;
    object-fit: cover;
    background: linear-gradient(135deg, #1e293b, #0f172a);
}

.draft-game-body {
    padding: 0.75rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* LIVE SESSION CARD */
.session-card {
    background: var(--bg-card);
    border: 1px solid rgba(249, 115, 22, 0.32);
    border-radius: 18px;
    padding: 1.45rem;
    margin-bottom: 1.35rem;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
}

.session-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 1.1rem;
}

.session-meta-pills {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-top: 0.4rem;
}

.meta-pill {
    font-size: 0.76rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    color: #e2e8f0;
}

.meta-pill.timer {
    border-color: rgba(250, 204, 21, 0.45);
    color: #fde047;
    background: rgba(250, 204, 21, 0.1);
}

/* LOBBY & TEAMS */
.lobby-box {
    background: var(--bg-sub);
    border: 1px solid var(--border-subtle);
    border-radius: 13px;
    padding: 1rem 1.1rem;
    margin-bottom: 1.2rem;
}

.participants-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.player-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0.25rem 0.68rem 0.25rem 0.3rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
}

.player-chip.me {
    border-color: rgba(34, 197, 94, 0.6);
    background: rgba(34, 197, 94, 0.14);
}

.player-chip img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 0.75rem;
    margin-top: 0.8rem;
}

.team-col {
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid var(--border-subtle);
    border-radius: 11px;
    padding: 0.75rem 0.85rem;
}

.team-col.active-team {
    border-color: rgba(56, 189, 248, 0.55);
}

/* VOTING GAME CARDS */
.vote-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.95rem;
}

.vote-game-card {
    background: var(--bg-sub);
    border: 1.5px solid var(--border-subtle);
    border-radius: 13px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.16s ease;
}

.vote-game-card.voted {
    border-color: var(--accent-fire);
    box-shadow: 0 0 22px rgba(249, 115, 22, 0.22);
}

.vote-game-banner-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 460 / 215;
    background: linear-gradient(135deg, #1e293b, #090d16);
    display: flex;
    align-items: center;
    justify-content: center;
}

.vote-game-banner-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vote-game-fallback {
    font-size: 2.2rem;
    opacity: 0.75;
}

.vote-game-body {
    padding: 0.85rem 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    flex: 1;
}

.vote-bar-track {
    height: 7px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 999px;
    overflow: hidden;
}

.vote-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #f97316, #ef4444);
    border-radius: 999px;
    transition: width 0.25s ease;
}

.voter-avatars {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    min-height: 22px;
}

.voter-avatars img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    object-fit: cover;
}

/* WHITELIST TWO COLUMNS */
.wl-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.members-scroll-list {
    max-height: 410px;
    overflow-y: auto;
    background: var(--bg-sub);
    border: 1px solid var(--border-subtle);
    border-radius: 11px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.member-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.45rem 0.6rem;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.member-row-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.member-row-left img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.feedback {
    margin-top: 0.85rem;
    padding: 0.65rem 0.9rem;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: rgba(15, 23, 42, 0.85);
    font-size: 0.85rem;
}

/* FOOTER */
.ff-footer {
    border-top: 1px solid var(--border-subtle);
    padding: 1.1rem 0;
    font-size: 0.82rem;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

@media (max-width: 720px) {
    .card,
    .session-card {
        padding: 1.05rem;
    }
}
