/* Onlyfrag "Fire Strike" Design System */
:root {
    /* Colors - Onlyfrag Theme */
    --bg-dark: #0a0a0a;
    /* Deepest black */
    --bg-panel: rgba(18, 18, 18, 0.85);
    /* Darker panel for readability */
    --accent-gold: #ff6b35;
    /* Onlyfrag Orange - Primary */
    --accent-blue: #ff9500;
    /* Yellow-Orange - Secondary */
    --accent-red: #e63946;
    /* Vibrant Red - Alerts */
    --text-main: #ffffff;
    --text-muted: #d1d1d1;
    /* Lighter gray for better contrast */
    --border-light: rgba(255, 107, 53, 0.15);
    /* Orange tint */

    /* Fonts */
    --font-head: 'Rajdhani', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Effects */
    --glass-blur: blur(12px);
    --tech-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

/* Base Setup */
body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
    /* Static background fallback */
    background: var(--bg-dark);
}

/* Cinematic Background - Fixed */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: url('assets/images/onlyfrag_bg.jpg') no-repeat center center/cover;
    /* Darken overlay for text readability */
    filter: brightness(0.5) contrast(1.15);
}

/* Noise Overlay for Texture */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDAiIGhlaWdodD0iMjAwIj48ZmlsdGVyIGlkPSJnoiPjxmZVR1cmJ1bGVuY2UgdHlwZT0iZnJhY3RhbE5vaXNlIiBiYXNlRnJlcXVlbmN5PSIwLjY1IiBudW1PY3RhdmVzPSIzIiBzdGl0Y2hUaWxlcz0ic3RpdGNoIi8+PC9maWx0ZXI+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsdGVyPSJ1cmwoI2cpIiBvcGFjaXR5PSIwLjAzIi8+PC9zdmc+');
    pointer-events: none;
    opacity: 0.4;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Header & Nav */
header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 0;
    text-align: center;
}

h1 {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 3.5em;
    /* Adjusted sizing */
    text-transform: uppercase;
    color: var(--text-main);
    letter-spacing: 4px;
    margin: 0;
    text-shadow: 0 0 30px rgba(75, 98, 132, 0.5);
}

.subtitle {
    font-family: var(--font-head);
    color: var(--accent-gold);
    font-size: 1.2em;
    letter-spacing: 2px;
    margin-top: 10px;
    text-transform: uppercase;
    opacity: 0.9;
}

.main-nav {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    background: rgba(13, 15, 22, 0.85);
    /* Slightly darker for contrast */
    padding: 8px;
    border-radius: 4px;
    border: 1px solid var(--border-light);
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--tech-shadow);
}

.nav-link {
    font-family: var(--font-head);
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 1.1em;
    padding: 10px 25px;
    text-transform: uppercase;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-main);
    background: linear-gradient(to top, rgba(238, 188, 81, 0.1), transparent);
    border-bottom: 2px solid var(--accent-gold);
}

.nav-link#nav-login-btn {
    color: var(--accent-gold);
}

.nav-link#nav-logout-btn {
    color: var(--accent-red);
    border-color: var(--accent-red);
}

.nav-link#nav-logout-btn:hover {
    background: linear-gradient(to top, rgba(211, 47, 47, 0.1), transparent);
    border-bottom-color: var(--accent-red);
}

/* Sections */
section {
    margin-bottom: 60px;
}

h2 {
    font-family: var(--font-head);
    font-size: 2.5em;
    color: var(--text-main);
    text-transform: uppercase;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
}

h2::after {
    content: '';
    flex-grow: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--accent-gold), transparent);
    display: block;
}

h3 {
    font-family: var(--font-head);
    font-size: 1.5em;
    color: var(--accent-gold);
    margin-top: 20px;
    margin-bottom: 15px;
}

/* Landing Grid (Home Page) */
.landing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.landing-card {
    background: linear-gradient(145deg, rgba(30, 35, 50, 0.6) 0%, rgba(20, 25, 35, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    /* Tech corners */
    padding: 30px;
    backdrop-filter: var(--glass-blur);
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    clip-path: polygon(0 0,
            100% 0,
            100% calc(100% - 15px),
            calc(100% - 15px) 100%,
            0 100%);
}

.landing-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-gold);
    box-shadow: 0 10px 40px rgba(238, 188, 81, 0.1);
}

.card-icon {
    font-size: 3em;
    margin-bottom: 20px;
    color: var(--accent-gold);
    text-shadow: 0 0 15px rgba(238, 188, 81, 0.4);
}

.landing-card h2 {
    font-size: 1.8em;
    justify-content: center;
}

.landing-card h2::after {
    display: none;
    /* Remove line for cards */
}

.landing-card p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.card-btn {
    display: inline-block;
    padding: 10px 25px;
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
    text-decoration: none;
    font-family: var(--font-head);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 1.1em;
    transition: all 0.3s;
    background: rgba(0, 0, 0, 0.2);
}

.landing-card:hover .card-btn {
    background: var(--accent-blue);
    color: var(--text-main);
    box-shadow: 0 0 15px rgba(75, 98, 132, 0.5);
}

/* Team Grid (Roster) */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

/* Reusing player-card styles from prototype, adapted for generated content */
.player-card {
    background: linear-gradient(145deg, rgba(30, 35, 50, 0.6) 0%, rgba(20, 25, 35, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: var(--glass-blur);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%);
    display: flex;
    flex-direction: column;
}

.player-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-gold);
    box-shadow: 0 10px 40px rgba(238, 188, 81, 0.15);
}

.card-img-container {
    height: 250px;
    width: 100%;
    /* Gradient background for player images if transparent */
    background: radial-gradient(circle at center, #2d3241 0%, #0d0f16 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border-bottom: 2px solid var(--accent-blue);
}

.player-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.player-card:hover img {
    transform: scale(1.05);
}

/* Player Overlay (Edit Button) */
.player-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.btn-edit-profile {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    padding: 5px 10px;
    cursor: pointer;
    font-family: var(--font-head);
    font-weight: bold;
    border-radius: 4px;
    backdrop-filter: blur(4px);
    transition: all 0.2s;
}

.btn-edit-profile:hover {
    background: var(--accent-gold);
    color: #000;
}

.card-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-align: center;
    align-items: center;
}

.card-info h3 {
    margin: 0;
    font-family: var(--font-head);
    font-size: 1.8em;
    text-transform: uppercase;
    color: var(--text-main);
}

.card-info .role {
    margin-bottom: 15px;
    margin-top: 5px;
    /* Added spacing */
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Neon Roles */
/* Neon Roles - Specificity boosted */
.card-info .role.role-arzzreon {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
}

.card-info .role.role-lenoune,
.card-info .role.role-lenounesam,
.card-info .role.role-noune {
    color: #00d4ff;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.7);
}

.card-info .role.role-redskull {
    color: #ff8c00;
    text-shadow: 0 0 10px rgba(255, 140, 0, 0.7);
}

.card-info .role.role-romeyy {
    color: #00ff00;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.7);
}

.card-info .role.role-saeko {
    color: #9d00ff;
    text-shadow: 0 0 10px rgba(157, 0, 255, 0.7);
}

.player-socials {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: auto;
    padding-top: 20px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.social-btn img {
    height: 24px;
    width: auto;
    filter: brightness(0.9);
    /* Almost full brightness by default */
    transition: all 0.3s ease;
}

.social-btn:hover {
    background: rgba(238, 188, 81, 0.1);
    border-color: var(--accent-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.social-btn:hover img {
    filter: brightness(1.2);
    transform: scale(1.1);
    filter: drop-shadow(0 0 5px rgba(238, 188, 81, 0.5));
}

/* Modals */
/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    /* Darker dim */
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(135deg, #161b28 0%, #0d0f16 100%);
    border: 1px solid var(--accent-gold);
    border-radius: 4px;
    padding: 40px;
    width: 90%;
    max-width: 900px;
    /* Much wider */
    max-height: 90vh;
    /* Allow it to be tall */
    overflow-y: auto;
    /* Scroll if content overflows screen */
    position: relative;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
    color: var(--text-main);
}

.modal-close {
    position: absolute;
    top: 5px;
    /* Closer to top */
    right: 15px;
    /* Closer to right */
    font-size: 2.5em;
    /* Larger */
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
    z-index: 10;
}

.modal-close:hover {
    color: var(--accent-red);
    /* Red on hover */
    transform: scale(1.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-control {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-light);
    color: var(--text-main);
    border-radius: 4px;
    font-family: var(--font-body);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 10px rgba(238, 188, 81, 0.2);
}

/* Buttons (Download/Submit) */
/* Navigation */
.main-nav {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 30px;
    /* Increased gap */
    flex-wrap: wrap;
    padding: 15px 40px;
    /* Increased padding */
    background: rgba(13, 15, 22, 0.6);
    /* Slight background */
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    /* Subtle border */
    backdrop-filter: blur(10px);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.nav-link {
    text-decoration: none;
    color: #fff;
    padding: 12px 30px;
    /* Larger click area */
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 1.1em;
    /* Larger text */
    letter-spacing: 1px;
}

/* Add Strategy Button (Centered & Visible) */
.btn-download {
    background: linear-gradient(135deg, var(--accent-gold) 0%, #d4a034 100%);
    border: none;
    padding: 15px 40px;
    /* Larger */
    color: #0d0f16;
    font-family: var(--font-head);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 1.2em;
    cursor: pointer;
    clip-path: polygon(15px 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%, 0 15px);
    /* More aggressive tactic shape */
    transition: all 0.2s;
    width: auto;
    display: block;
    /* Centering */
    margin: 0 auto;
    /* Centering */
    text-align: center;
    box-shadow: 0 0 20px rgba(238, 188, 81, 0.4);
}

.btn-download:hover {
    transform: translateY(-2px) scale(1.02);
    filter: brightness(1.2);
    box-shadow: 0 0 30px rgba(238, 188, 81, 0.6);
}

/* Strategy Action Buttons */
.strat-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.2em;
}

.btn-icon:hover {
    background: var(--bg-panel);
    color: var(--text-main);
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

.btn-fullscreen:hover {
    background: var(--accent-blue);
    color: white;
    box-shadow: 0 0 10px rgba(75, 98, 132, 0.5);
}

.btn-edit:hover {
    background: var(--accent-gold);
    color: #000;
    border-color: var(--accent-gold);
    box-shadow: 0 0 10px rgba(238, 188, 81, 0.5);
}

.btn-delete:hover {
    background: var(--accent-red);
    color: white;
    border-color: var(--accent-red);
    box-shadow: 0 0 10px rgba(211, 47, 47, 0.5);
}

.btn-download:hover {
    transform: translateX(2px);
    filter: brightness(1.2);
}

/* Map Grid (Playbook) */
.map-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.map-card {
    background: var(--bg-panel);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.map-card:hover {
    border-color: var(--accent-gold);
    transform: translateY(-5px);
}

.map-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-bottom: 2px solid var(--accent-gold);
}

.map-card .map-info {
    padding: 20px;
    text-align: center;
}

.map-card .map-title {
    font-family: var(--font-head);
    color: var(--text-main);
    font-size: 1.6em;
    margin-bottom: 15px;
    text-transform: uppercase;
    font-weight: 700;
}

.map-link {
    display: inline-block;
    padding: 8px 20px;
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
    border-radius: 4px;
    text-decoration: none;
    font-family: var(--font-head);
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.map-card:hover .map-link {
    background: var(--accent-blue);
    color: var(--text-main);
    box-shadow: 0 0 10px rgba(75, 98, 132, 0.4);
}

/* Footer */
footer {
    text-align: center;
    margin-top: 80px;
    padding-top: 30px;
    border-top: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: 0.9em;
}

/* Admin Banner */
.admin-banner {
    text-align: center;
    padding: 20px;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 10px;
    margin-bottom: 30px;
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2.2em;
    }

    h2 {
        font-size: 1.8em;
    }

    .main-nav {
        flex-direction: column;
        width: 100%;
    }

    .nav-link {
        width: 100%;
        text-align: center;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }

    100% {
        transform: translateX(0);
    }
}

/* --- PLANNING PAGE SPECIFIC STYLES --- */
/* Darker and blurred background for better readability on planning page */
body.planning-page::before {
    filter: brightness(0.3) contrast(1.1) blur(6px);
}

/* --- STRATEGY & PLAYBOOK UI (RESTORED) --- */

/* Controls & Filters */
.strategy-controls {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.strategy-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    background: var(--bg-panel);
    padding: 10px;
    border-radius: 30px;
    border: 1px solid var(--border-light);
    backdrop-filter: var(--glass-blur);
    align-items: center;
}

.search-input {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-light);
    color: var(--text-main);
    padding: 8px 15px;
    border-radius: 20px;
    font-family: var(--font-body);
    outline: none;
    transition: all 0.3s ease;
    min-width: 200px;
}

.search-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 10px rgba(75, 98, 132, 0.3);
}

.filter-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--font-head);
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.filter-btn.active {
    background: var(--accent-gold);
    color: #000;
    box-shadow: 0 0 15px rgba(238, 188, 81, 0.4);
}

/* Strategy Grid */
.strategy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    /* Larger cards */
    gap: 25px;
}

/* Strategy Card */
.strategy-card {
    background: linear-gradient(145deg, rgba(30, 35, 50, 0.6) 0%, rgba(20, 25, 35, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    padding: 25px;
    /* More padding */
    backdrop-filter: var(--glass-blur);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.strategy-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-gold);
}

.strat-header {
    margin-bottom: 20px;
}

/* Action Buttons - positioned relative to the CARD, not the header */
.strat-actions {
    position: absolute;
    top: 25px;
    /* Align with card padding */
    right: 25px;
    /* Align with card padding */
    display: flex;
    gap: 5px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.6);
    padding: 6px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.strategy-title {
    margin: 0;
    font-family: var(--font-head);
    color: var(--text-main);
    font-size: 1.5em;
    line-height: 1.3;
    max-width: calc(100% - 150px);
    /* Reserve space for buttons */
    word-wrap: break-word;
}

.strategy-body {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 20px;
    margin-top: auto;
    /* Push to bottom if needed, but flex-col handles it */
    margin-bottom: 15px;
    max-height: 500px;
    /* Taller content area */
    overflow-y: auto;
    color: var(--text-muted);
    font-size: 1.05em;
    /* Slightly larger text */
    scrollbar-width: thin;
    scrollbar-color: var(--accent-blue) rgba(0, 0, 0, 0.3);
    flex-grow: 1;
    /* Fill remaining space */
}

/* Limit image size in strategy card preview */
.strategy-body img,
.strat-preview img {
    max-width: 100%;
    max-height: 250px;
    object-fit: contain;
    display: block;
    margin: 10px auto;
    border-radius: 4px;
}

/* Hide images when carousel is present in fullscreen */
.hidden-in-carousel {
    display: none !important;
}

/* Stuff Link Buttons - appears in strategy content */
.stuff-link {
    display: inline-block;
    padding: 4px 12px;
    margin: 2px 4px;
    background: linear-gradient(135deg, rgba(238, 188, 81, 0.2) 0%, rgba(238, 188, 81, 0.1) 100%);
    border: 1px solid var(--accent-gold);
    border-radius: 4px;
    color: var(--accent-gold);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.stuff-link:hover {
    background: linear-gradient(135deg, rgba(238, 188, 81, 0.3) 0%, rgba(238, 188, 81, 0.2) 100%);
    border-color: var(--accent-gold);
    transform: translateY(-1px);
    box-shadow: 0 0 10px rgba(238, 188, 81, 0.4);
    color: #fff;
}

/* Strategy Footer (Tags & Meta) */
.strat-footer-container {
    margin-top: 15px;
    /* Separation from body */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.strat-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    /* Spacing between tags */
}

.tag {
    font-size: 0.85em;
    /* Larger */
    padding: 4px 10px;
    /* Bigger touch target */
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    /* More visible background */
    border: 1px solid rgba(255, 255, 255, 0.2);
    /* brighter border */
    color: #eee;
    /* Brighter text */
    text-transform: uppercase;
    font-weight: 700;
    /* Bold */
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    /* Slight depth */
}

.tag.tag-side-t {
    color: #ffcc00;
    /* Bright gold */
    background: rgba(255, 204, 0, 0.15);
    border-color: rgba(255, 204, 0, 0.5);
}

.tag.tag-side-ct {
    color: #00d4ff;
    /* Bright blue */
    background: rgba(0, 212, 255, 0.15);
    border-color: rgba(0, 212, 255, 0.5);
}

.tag.tag-site {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.1);
}

/* Editor & Modal Specifics */
.editor-container {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    overflow: hidden;
}

.rich-text-toolbar {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.toolbar-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-main);
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.2s;
}

.toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

#editor-content {
    min-height: 500px;
    /* Much taller for big strategies */
    padding: 15px;
    color: var(--text-main);
    outline: none;
    line-height: 1.6;
}

#editor-content img {
    max-width: 100%;
    border-radius: 4px;
    display: block;
    margin: 10px 0;
}

/* Map Header Specifics - Enhanced */
.header-content {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-bottom: 40px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    padding: 30px;
    background: linear-gradient(135deg, rgba(30, 35, 50, 0.8) 0%, rgba(13, 15, 22, 0.9) 100%);
    border-radius: 8px;
    border: 1px solid var(--accent-gold);
    position: relative;
    overflow: hidden;
}

.header-text {
    flex: 1;
    text-align: center;
}

.header-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
            var(--accent-gold) 0%,
            var(--accent-blue) 50%,
            var(--accent-gold) 100%);
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.map-header-image {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
    border: 3px solid var(--accent-gold);
    box-shadow: 0 0 30px rgba(238, 188, 81, 0.6),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.header-content:hover .map-header-image {
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(238, 188, 81, 0.8);
}

.header-text h1 {
    font-size: 3.5em;
    text-align: center;
    margin-bottom: 5px;
    background: linear-gradient(135deg, var(--accent-gold) 0%, #fff 50%, var(--accent-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(238, 188, 81, 0.3);
    letter-spacing: 2px;
    line-height: 1.1;
}

.header-text .subtitle {
    text-align: center;
    font-size: 1.3em;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 600;
}

/* Responsive adjustments for Map Header */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .header-text h1,
    .header-text .subtitle {
        text-align: center;
    }
}

/* --- DYNAMIC MODALS (Fullscreen & Confirm) --- */

/* Fullscreen Strategy Modal */
.fullscreen-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

.fullscreen-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.fullscreen-content {
    background: #161b28;
    width: 90%;
    height: 90%;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid var(--accent-gold);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

.fullscreen-body {
    flex: 1;
    overflow-y: auto;
    color: var(--text-main);
    padding: 20px;
    font-size: 1.1em;
    line-height: 1.6;
}

.fullscreen-body img {
    max-width: 100%;
    border-radius: 4px;
    margin: 10px 0;
}

/* Confirm Delete Modal */
.confirm-modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.confirm-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.confirm-content {
    background: var(--bg-panel);
    border: 1px solid var(--accent-red);
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 0 30px rgba(211, 47, 47, 0.3);
}

.confirm-content h3 {
    color: var(--accent-red);
    margin-top: 0;
}

.confirm-actions {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.btn-confirm-yes {
    background: var(--accent-red);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.btn-confirm-no {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-confirm-no:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Carousel Styles */
.carousel-container {
    position: relative;
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    margin-bottom: 20px;
    overflow: hidden;
    height: 60vh;
    /* Fixed height for carousel area */
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide {
    display: none;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
}

.carousel-slide.active {
    display: flex;
}

.carousel-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.carousel-slide img.zoom-mode {
    cursor: zoom-in;
    transform: none;
    /* Controlled by JS mousemove */
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 2em;
    padding: 10px;
    cursor: pointer;
    z-index: 10;
}

.carousel-prev {
    left: 10px;
}

.carousel-next {
    right: 10px;
}

.carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
}

.carousel-dot.active {
    background: var(--accent-gold);
    box-shadow: 0 0 5px var(--accent-gold);
}

.carousel-controls-extra {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.btn-zoom-toggle {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border-light);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9em;
}

.btn-zoom-toggle.active {
    background: var(--accent-gold);
    color: black;
}

/* ============================================
   MOBILE RESPONSIVE FIXES
   ============================================ */

@media (max-width: 768px) {

    /* --- NAVIGATION --- */
    /* Reduce navigation size on mobile */
    .main-nav {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
        width: 100%;
        align-items: center;
        /* Center buttons */
    }

    .nav-link {
        padding: 10px 20px;
        /* Reduced side padding */
        font-size: 0.9em;
        width: auto;
        /* Allow auto width */
        min-width: 200px;
        /* Minimum width for consistency */
        text-align: center;
        display: block;
        /* Ensure block behavior */
    }

    /* --- ADMIN BANNER --- */
    .admin-banner {
        padding: 15px;
        margin-bottom: 20px;
    }

    .admin-banner h3 {
        font-size: 1.2em;
        margin-top: 10px;
    }

    /* --- HEADERS & TITLES --- */
    /* Reduce header sizes to save vertical space */
    header h1,
    .hero-title {
        font-size: 1.8em !important;
        margin-bottom: 10px;
    }

    .subtitle,
    .hero-subtitle {
        font-size: 0.95em !important;
    }

    h2 {
        font-size: 1.4em !important;
    }

    h3 {
        font-size: 1.1em !important;
    }

    /* --- STRATEGY FILTERS (CRITICAL FIX) --- */
    /* Make filter buttons touch-friendly (44x44px minimum) */
    .filter-btn {
        min-width: 44px !important;
        min-height: 44px !important;
        padding: 12px 16px !important;
        font-size: 0.95em !important;
        margin: 4px !important;
    }

    /* --- STRATEGY CARDS --- */
    /* Make action buttons larger for touch */
    .strategy-actions button,
    .strategy-actions .btn-icon {
        min-width: 44px !important;
        min-height: 44px !important;
        padding: 10px !important;
        font-size: 1.2em !important;
    }

    /* Stack strategy cards vertically */
    .strategies-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    /* --- SEARCH INPUT --- */
    .search-input {
        width: 100% !important;
        font-size: 16px !important;
        /* Prevent zoom on iOS */
    }

    /* --- PLAYER CARDS (MOBILE CAROUSEL) --- */
    .team-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 20px;
        padding-bottom: 25px;
        /* Space for scrollbar */
        padding-top: 20px;
        /* Center the first item: 15vw padding on sides (since item is 70vw) */
        padding-left: 15vw;
        padding-right: 15vw;
        margin: 0;
        width: 100%;
        -webkit-overflow-scrolling: touch;
        /* Smooth scroll on iOS */
    }

    .team-grid::-webkit-scrollbar {
        height: 4px;
        /* Thinner */
    }

    .team-grid::-webkit-scrollbar-track {
        background: transparent;
        margin: 0 15vw;
    }

    .team-grid::-webkit-scrollbar-thumb {
        background: var(--accent-gold);
        border-radius: 4px;
    }

    .player-card {
        min-width: 70vw;
        /* Carousel card width - allows peeking */
        width: 70vw;
        scroll-snap-align: center;
        flex-shrink: 0;
        margin-right: 0;
        max-width: none;

        /* 3D Effect Setup */
        transform: scale(0.9);
        opacity: 0.6;
        transition: all 0.3s ease;
        filter: grayscale(0.5);
    }

    /* Active State (controlled by JS IntersectionObserver) */
    .player-card.active {
        transform: scale(1);
        opacity: 1;
        filter: grayscale(0);
        box-shadow: 0 10px 40px rgba(238, 188, 81, 0.3);
        /* Glow */
        z-index: 5;
        border-color: var(--accent-gold);
    }

    /* Larger social icons for touch */
    .player-socials a {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Edit button more visible */
    .btn-edit-profile {
        min-width: 80px !important;
        min-height: 36px !important;
        font-size: 0.9em !important;
    }

    /* --- PLAYBOOK MAP CARDS --- */
    .map-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }

    .map-card {
        min-height: auto;
    }

    /* --- PLANNING PAGE --- */
    /* Reduce timeline marker size */
    .timeline-marker {
        width: 40px;
        height: 40px;
        font-size: 1em;
    }

    .timeline-item {
        padding-left: 60px;
    }

    /* Stack defaut cards */
    .defaut-container {
        grid-template-columns: 1fr !important;
    }

    /* Stack legend items */
    .legend-grid {
        grid-template-columns: 1fr !important;
    }

    /* --- MODAL & FULLSCREEN --- */
    .modal-content {
        max-width: 95%;
        padding: 20px;
        max-height: 95vh;
    }

    .fullscreen-content {
        padding: 15px;
    }

    .modal-close {
        font-size: 1.5em;
        top: 10px;
        right: 15px;
    }

    /* --- TABLES --- */
    /* Make tables scrollable if too wide */
    .table-wrapper {
        overflow-x: auto;
    }

    table {
        font-size: 0.85em;
    }

    th,
    td {
        padding: 10px 12px;
    }

    /* --- GENERAL SPACING --- */
    /* Reduce padding on mobile */
    .container {
        padding: 15px;
    }

    section {
        margin-bottom: 30px;
    }

    /* --- LANDING CARDS --- */
    .landing-grid {
        grid-template-columns: 1fr !important;
    }

    /* --- BUTTONS --- */
    /* Ensure all interactive elements are touch-friendly */
    button,
    .btn,
    .card-btn,
    .nav-link,
    a[role="button"] {
        min-height: 44px;
        padding: 12px 20px;
    }
}

/* Extra small devices (phones in portrait, less than 375px) */
@media (max-width: 374px) {
    header h1 {
        font-size: 1.5em !important;
    }

    .filter-btn {
        padding: 10px 12px !important;
        font-size: 0.85em !important;
    }

    .nav-link {
        font-size: 0.85em;
        padding: 8px 12px;
    }
}

/* --- Editor Dropdown Fix --- */
.toolbar-dropdown {
    position: absolute;
    z-index: 2000;
    /* Above modal (1000) */
    background: #161b28;
    border: 1px solid var(--accent-gold);
    border-radius: 4px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    padding: 5px;
    max-height: 300px;
    overflow-y: auto;
    color: var(--text-main);
    min-width: 150px;
}

.toolbar-dropdown .dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95em;
}

.toolbar-dropdown .dropdown-item:hover {
    background: rgba(238, 188, 81, 0.2);
    color: var(--accent-gold);
}

/* --- FACEIT ELO BADGE --- */
.faceit-stats-container {
    margin: 10px 0;
    min-height: 38px;
    /* Reserve space */
    display: flex;
    justify-content: center;
}

.faceit-badge {
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 5px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(4px);
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.faceit-badge:hover {
    border-color: #ff5500;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 85, 0, 0.2);
}

.player-card .faceit-logo-icon {
    width: 18px !important;
    height: 18px !important;
    object-fit: contain;
    margin-right: 6px;
    border-bottom: none;
    /* specific override just in case */
    border-radius: 0;
}

/* Loader */
.faceit-loader {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid var(--accent-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-badge {
    opacity: 0.7;
    cursor: wait;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.faceit-level-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    color: #000;
    font-size: 0.9em;
    font-family: var(--font-head);
    background: #eee;
}

.faceit-elo {
    color: #fff;
    font-weight: 600;
    font-family: var(--font-head);
    font-size: 1.1em;
    letter-spacing: 1px;
}

/* Faceit Level Colors */
/* Levels 1-3 (Grey/White) */
.level-1,
.level-2,
.level-3 {
    background-color: #EEEEEE;
    color: #111;
}

/* Levels 4-7 (Yellow) */
.level-4,
.level-5,
.level-6,
.level-7 {
    background-color: #FFD700;
    color: #111;
}

/* Levels 8-9 (Orange) */
.level-8,
.level-9 {
    background-color: #FF8C00;
    color: #fff;
}

/* Level 10 (Red) */
.level-10 {
    background-color: #FE3131;
    color: #fff;
}