:root {
    /* Travel-Inspired Color Palette */
    --bg-deep: #0b0f19;
    /* Deep Ocean/Twilight */
    --bg-gradient: linear-gradient(135deg, #0b0f19 0%, #061c27 100%);
    --accent-orange: #ff6a00;
    /* Neon Sunrise Orange */
    --accent-orange-hover: #ff8c3a;
    --accent-teal: #00f0d1;
    /* Neon Tropical Teal */
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    /* Brightened for better readability against map */
    --card-bg: rgba(15, 23, 42, 0.5);
    --card-border: rgba(255, 255, 255, 0.08);

    /* Semantic Colors */
    --error: #ef4444;
    --success: #10b981;
    --info: #3b82f6;

    /* Shadows & Transitions */
    --shadow-soft: 0 15px 50px -10px rgba(0, 0, 0, 0.7);
    --shadow-glow: 0 0 25px rgba(255, 106, 0, 0.5);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    line-height: var(--line-height-base);
    background-color: var(--bg-dark);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    /* Added relative context for absolute children */
}

/* ==========================================================================
   Map Background Styles (D3.js Animated)
   ========================================================================== */

#map-container,
#signup-map-container,
#auth-map-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

#map-container {
    background: radial-gradient(circle at center, rgba(15, 23, 42, 0.8) 0%, #0f172a 100%);
    /* Applied dark navy/charcoal focus for legibility */
}

#signup-map-container,
#auth-map-container {
    background: radial-gradient(circle at center, rgba(15, 23, 42, 0.8) 0%, #0f172a 100%);
    /* Deep navy/charcoal focus for the signup page */
}

#map-container svg,
#signup-map-container svg,
#auth-map-container svg {
    /* Slight blur and desaturation on the general map layer */
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
}

.city {
    transition: fill 0.3s ease, stroke-width 0.3s ease, stroke 0.3s ease;
    cursor: default;
}

/* Neon Glow Effect for Kocaeli */
.neon-highlight {
    stroke: var(--accent-orange-hover) !important;
    stroke-width: 0.3px !important;
    fill: rgba(234, 88, 12, 0.05) !important;
    filter: drop-shadow(0 0 2px var(--accent-orange-hover)) drop-shadow(0 0 8px var(--accent-orange-hover));
    animation: pulse-glow 3s infinite alternate;
}

@keyframes pulse-glow {
    0% {
        filter: drop-shadow(0 0 2px var(--accent-orange-hover)) drop-shadow(0 0 6px var(--accent-orange-hover));
    }

    100% {
        filter: drop-shadow(0 0 4px var(--accent-orange)) drop-shadow(0 0 12px var(--accent-orange));
    }
}

/* Map Pin Styling */
.map-pin circle {
    vector-effect: non-scaling-stroke;
    /* Ensure border width stays constant when zoomed */
}

.pin-head {
    filter: drop-shadow(0 0 5px var(--accent-orange));
}

/* Traveling Sparkle on Path */
.path-sparkle {
    fill: var(--accent-orange-hover);
    filter: drop-shadow(0 0 5px var(--accent-orange-hover)) drop-shadow(0 0 0.5px var(--accent-orange-hover));
    pointer-events: none;
}

/* ==========================================================================
   Layout Components
   ========================================================================== */

/* Base UI Elements */
.btn {
    padding: 0.6rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-ghost {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

/* Navbar Profile Link Hover States */
.user-badge {
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-badge:hover {
    transform: scale(1.05);
    border-color: rgba(249, 115, 22, 0.4) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.2);
}

.user-badge:hover .navbar-username {
    color: var(--accent-orange) !important;
}

.user-badge:hover .avatar {
    box-shadow: 0 0 15px rgba(249, 115, 22, 0.8) !important;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-orange);
    border-color: var(--accent-orange);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.2);
}

.btn-primary {
    background: var(--accent-orange);
    color: #fff;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
}

.btn-primary:hover {
    background: var(--accent-orange-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Neon Glow Effect specifically for the Register Button */
#submitSignupBtn {
    transition: all 0.4s ease;
}

#submitSignupBtn:hover {
    box-shadow: 0 0 15px rgba(249, 115, 22, 0.6), 0 0 25px rgba(249, 115, 22, 0.4);
    background: var(--accent-orange);
    /* Ensure color consistency */
}

.btn-primary:disabled {
    background: #64748b;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

#startGameBtn {
    animation: neon-pulse 2s infinite;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
}

@keyframes neon-pulse {
    0% {
        box-shadow: 0 0 10px rgba(255, 106, 0, 0.3);
    }

    50% {
        box-shadow: 0 0 25px rgba(255, 106, 0, 0.6), 0 0 40px rgba(255, 106, 0, 0.2);
    }

    100% {
        box-shadow: 0 0 10px rgba(255, 106, 0, 0.3);
    }
}

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    border-radius: 14px;
}

.btn-full {
    width: 100%;
    padding: 0.9rem;
    font-size: 1rem;
    margin-top: 1rem;
}

/* Background Atmosphere Elements */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg width="40" height="40" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"><circle cx="20" cy="20" r="1" fill="rgba(255,255,255,0.03)"/></svg>') repeat;
    z-index: -2;
}

body::after {
    content: '';
    position: absolute;
    top: -20%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(20, 184, 166, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
}

/* Navigation */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 6%;
    position: absolute;
    top: 0;
    width: 100%;
    z-index: 10;
    animation: fadeInDown 0.6s ease;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #fff, var(--text-muted));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-actions {
    display: flex;
    gap: 1rem;
}

/* Hero Section Layout */
.hero-section {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8rem 6% 4rem;
    min-height: 100vh;
    gap: 4rem;
    position: relative;
    z-index: 1;
}

/* Typography & Hero Content */
.hero-content {
    flex: 1.2;
    max-width: 650px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: fadeInLeft 0.8s ease forwards;
}

.badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: rgba(20, 184, 166, 0.1);
    color: var(--accent-teal);
    border: 1px solid rgba(20, 184, 166, 0.2);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-content h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 1.2rem;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
    /* Added shadow for contrast */
}

.hero-content .highlight {
    color: var(--accent-orange);
    text-shadow: 0 0 15px rgba(249, 115, 22, 0.4);
}

.hero-content p {
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 90%;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.8);
    /* Added shadow for contrast */
    font-weight: 400;
    /* Ensured it's not too thin */
}

.cta-btn svg {
    transition: transform 0.3s ease;
}

.cta-btn:hover svg {
    transform: translateX(4px);
}

/* Auth Section (Glassmorphism Form) */
.auth-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards 0.3s;
}

.auth-wrapper.visible {
    opacity: 1;
    transform: none;
    animation: none;
}

.signup-page-layout {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 6rem 1rem 2rem;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.glass-card {
    background: rgba(15, 23, 42, 0.85); /* Deep slate navy replacing older values */
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2.5rem 3rem;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1); 
    /* Fixed black blocky artifacts by using cleaner rgba syntax here */
}

/* Modal Close "X" Button Animations */
.close-modal {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s ease;
}

.close-modal:hover {
    color: var(--accent-orange);
    transform: rotate(90deg) scale(1.1);
}

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

.card-header h2 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.card-header .subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
}

.input-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-left: 0.2rem;
}

.input-group input {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--card-border);
    padding: 0.85rem 1rem;
    border-radius: 10px;
    color: var(--text-main);
    font-size: 1rem;
    width: 100%;
    min-width: 0;
    /* Prevents flex flex-grow input overflow */
    transition: var(--transition);
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-orange);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
    background: rgba(0, 0, 0, 0.4);
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.password-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 0.2rem;
    opacity: 0.7;
}

/* Feedback Messages */
.form-messages {
    margin-top: 1rem;
    font-size: 0.95rem;
    text-align: center;
    min-height: 24px;
    border-radius: 8px;
    padding: 0.5rem;
    display: none;
}

.form-messages.show {
    display: block;
    animation: fadeInUp 0.3s ease;
}

.msg-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.msg-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero-content h1 {
        font-size: 3rem;
    }
}

@media (max-width: 868px) {
    .hero-section {
        flex-direction: column;
        padding-top: 8rem;
        text-align: center;
        gap: 3rem;
    }

    .hero-content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .hero-content p {
        margin-bottom: 2rem;
    }

    .glass-card {
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 1rem 5%;
    }

    .hero-section {
        padding-top: 6rem;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    .form-row {
        flex-direction: column;
        gap: 1.2rem;
    }

    .glass-card {
        padding: 1.5rem;
        border-radius: 20px;
    }
}

/* ==========================================================================
   Modal & Wizard Styles
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--accent-orange);
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Wizard Steps */
.step-indicator {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.step.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: background 0.3s, transform 0.3s;
}

.step.dot.active {
    background: var(--accent-orange);
    transform: scale(1.3);
}

.wizard-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.wizard-step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Option Cards for Modal Items */
.options-grid {
    display: grid;
    gap: 1rem;
}

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

.options-grid.vertical {
    grid-template-columns: 1fr; /* Force vertical stacking */
}

.option-card {
    position: relative;
    background: rgba(255, 255, 255, 0.05); /* Clean light grey glass backdrop */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 1.2rem;
    color: var(--text-main);
    cursor: pointer;
    text-align: left;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
    overflow: hidden;
    user-select: none;
}

.option-card:not(.disabled):hover {
    background: rgba(255, 255, 255, 0.08); /* slight brightness increase on hover */
    border-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.option-card.active {
    background: linear-gradient(135deg, rgba(255, 106, 0, 0.15), rgba(15, 23, 42, 0.6)); /* Subtle dark orange tint */
    border-color: var(--accent-orange);
    box-shadow: 0 0 15px rgba(255, 106, 0, 0.25), inset 0 0 10px rgba(255, 106, 0, 0.1);
}

.option-card.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none; /* Make unclickable natively */
    background: rgba(0, 0, 0, 0.3);
}

.option-card h5 {
    font-size: 1.15rem;
    margin-bottom: 0.3rem;
    font-weight: 700;
    color: #ffffff;
}

.option-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Coming Soon Badge Pill */
.badge-coming-soon {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    background: rgba(255, 255, 255, 0.15); /* Sleek grey backing */
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0; /* Crisp light grey instead of pure white */
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.options-grid.horizontal .option-card {
    text-align: center;
    padding: 1rem;
    font-weight: bold;
    font-size: 1.1rem;
}

/* Custom Sleek Range Slider */
/* --- Deep Space Gradient Mesh Animation --- */
@keyframes ambientMesh {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.lobby-animated-bg {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0; /* Sit entirely in background */
    background: linear-gradient(-45deg, #0B1320, #0F172A, #16243A, #0a1128);
    background-size: 400% 400%;
    animation: ambientMesh 25s ease infinite;
    pointer-events: none; /* Do not block clicks */
}

/* --- Animations for Hangar --- */
@keyframes cyanPulse {
    0%   { text-shadow: 0 0 5px rgba(20, 184, 166, 0.2); transform: scale(1); }
    50%  { text-shadow: 0 0 20px rgba(20, 184, 166, 0.8), 0 0 30px rgba(20, 184, 166, 0.4); transform: scale(1.02); }
    100% { text-shadow: 0 0 5px rgba(20, 184, 166, 0.2); transform: scale(1); }
}

.cyan-pulse {
    animation: cyanPulse 2s ease-in-out infinite;
}

@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.stagger-item {
    opacity: 0;
    animation: slideInRight 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Stagger Delays */
.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }

.custom-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px; /* Thicker track */
    /* Dynamic Track Fill using CSS variables set by JS */
    background: linear-gradient(to right, var(--slider-color, var(--accent-orange)) var(--slider-progress, 50%), rgba(255, 255, 255, 0.08) var(--slider-progress, 50%));
    border-radius: 6px;
    outline: none;
    margin: 1.5rem 0;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.5); /* Inner depth */
}

/* Range Slider Thumb */
.custom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-orange);
    cursor: pointer;
    box-shadow: 0 0 15px rgba(249, 115, 22, 0.6), inset 0 2px 4px rgba(255,255,255,0.4); 
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
    border: 2px solid #fff; /* Crisp white ring */
}

.custom-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.8), inset 0 2px 4px rgba(255,255,255,0.4);
}

.custom-slider:active::-webkit-slider-thumb {
    transform: scale(0.95);
    box-shadow: 0 0 25px rgba(249, 115, 22, 1);
}

/* Custom iOS-style Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px; /* Wider footprint */
    height: 28px; /* Taller */
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.15); /* Sleek Off-state */
    transition: .4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 34px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5); /* Deep inset */
}

/* The thumb circle */
.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff; /* Crisp white */
    transition: .4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}

.toggle-switch input:checked+.toggle-slider {
    background-color: var(--accent-orange); /* Vibrant Orange */
    box-shadow: 0 0 15px rgba(249, 115, 22, 0.4), inset 0 2px 4px rgba(0,0,0,0.2);
    border: none;
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(24px); /* Pushes thumb to exactly the right */
}

/* Teal Slider Overrides for Teams View */
.teal-slider::-webkit-slider-thumb {
    background: var(--accent-teal);
    box-shadow: 0 0 15px rgba(0, 240, 209, 0.6), inset 0 2px 4px rgba(255,255,255,0.4);
}

.teal-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 0 20px rgba(0, 240, 209, 0.8), inset 0 2px 4px rgba(255,255,255,0.4);
}

.teal-slider:active::-webkit-slider-thumb {
    box-shadow: 0 0 25px rgba(0, 240, 209, 1);
}

/* Dynamic Animations */
@keyframes popValue {
    0% { transform: scale(1); }
    50% { transform: scale(1.18); text-shadow: 0 0 30px rgba(249, 115, 22, 0.8); }
    100% { transform: scale(1); }
}

.anim-pop {
    animation: popValue 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pulseReady {
    0% { transform: scale(1); box-shadow: 0 0 15px rgba(249, 115, 22, 0.3); }
    50% { transform: scale(1.02); box-shadow: 0 0 25px rgba(249, 115, 22, 0.6); }
    100% { transform: scale(1); box-shadow: 0 0 15px rgba(249, 115, 22, 0.3); }
}

.pulse-ready {
    animation: pulseReady 2s infinite ease-in-out;
}

/* Button Hover Utilities */
#wizardNextBtn:hover, #wizardLaunchBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.45) !important;
}

#wizardBackBtn:hover {
    transform: translateX(-3px);
    opacity: 0.8 !important;
}

/* --- Dynamic Lobby Styles --- */

.team-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 1.5rem;
    position: relative;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    flex: 1 1 280px;
    max-width: 350px;
}

/* ==========================================================================
   Game HUD (Heads Up Display) Styles - Master Prompt Spec
   ========================================================================== */

.hud-box {
    position: absolute;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.85);
    /* Slightly darker for better contrast */
    padding: 15px;
    border-radius: 8px;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

/* Typography for Top Left component */
.hud-brand-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 0.8rem;
}

.hud-brand-container svg {
    width: 28px;
    height: 28px;
    color: var(--accent-orange); /* Vibrant orange brand color */
    filter: drop-shadow(0 0 5px rgba(255, 106, 0, 0.4));
}

.hud-brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.hud-progress-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.hud-round-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

/* Geometric Trapezoid Progress Bar Wrapper */
.tour-progress-bar {
    display: flex;
    width: 160px;
    height: 12px;
    background: rgba(0, 0, 0, 0.5); /* dark track */
    /* Slice the right edge at an angle to create a sharp trapezoid */
    clip-path: polygon(0 0, 100% 0, 95% 100%, 0% 100%);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

/* Individual segment blocks inside */
.tour-segment {
    flex: 1;
    border-right: 1px solid rgba(0, 0, 0, 0.8);
    background: transparent;
    transition: all 0.3s ease;
}

.tour-segment:last-child {
    border-right: none;
}

/* Filled active segment - glowing turquoise */
.tour-segment.filled {
    background: var(--accent-teal, #00f0d1);
    box-shadow: 0 0 10px var(--accent-teal, #00f0d1);
}

/* Round change animation class */
.round-update-anim {
    animation: pop-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes pop-in {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Positioning Classes */
.hud-box.top-left {
    top: 25px;
    left: 25px;
    /* Use the requested sophisticated dark navy slate background */
    background: #1F2937; 
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 0, 0, 0.2);
    padding: 1rem 1.5rem;
    border-radius: 12px;
}

.hud-box.bottom-left {
    bottom: 20px;
    left: 20px;
}

.hud-box.top-center {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    padding: 10px 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    border-radius: 20px;
    /* Soft edges for the top-center timer */
}

.hud-box.top-right {
    top: 20px;
    right: 20px;
}

/* Exit Button inside HUD */
.hud-exit-btn {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 6px;
    cursor: pointer;
}

.hud-exit-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.8);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
    color: #ff6b6b;
}

/* Timer Urgency Animation */
.hud-box.urgent {
    border-color: #ff6a00;
    color: #ff6a00;
    animation: flashing 1s infinite alternate;
}

.hud-box.urgent #timerText {
    color: #ff6a00 !important;
}

@keyframes flashing {
    0% {
        box-shadow: 0 0 10px rgba(255, 106, 0, 0.2);
        background: rgba(15, 23, 42, 0.85);
        /* Dark base */
    }

    100% {
        box-shadow: 0 0 25px rgba(255, 106, 0, 0.8), inset 0 0 10px rgba(255, 106, 0, 0.3);
        background: rgba(40, 15, 15, 0.9);
        /* Reddish warning tint */
    }
}

.team-container:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

/* --- Custom Select Dropdown UI --- */
.custom-select-wrapper {
    position: relative;
    user-select: none;
    width: 100%;
}

.custom-select-trigger {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--card-border);
    padding: 0.85rem 1rem;
    border-radius: 10px;
    color: var(--text-main);
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
}

.custom-select-trigger:hover,
.custom-select-wrapper.open .custom-select-trigger {
    border-color: var(--accent-orange);
    box-shadow: 0 0 0 2px rgba(255, 106, 0, 0.15), inset 0 0 10px rgba(255, 106, 0, 0.05);
    background: rgba(0, 0, 0, 0.6);
}

.custom-select-wrapper .caret {
    width: 6px;
    height: 6px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg) translateY(-3px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: 10px;
}

.custom-select-wrapper.open .caret {
    transform: rotate(-135deg) translateY(-2px);
    border-color: var(--accent-orange);
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.98);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 50;
    overflow: hidden;
}

.custom-select-wrapper.open .custom-select-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.custom-select-option {
    padding: 0.85rem 1.2rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.custom-select-option:hover {
    background: rgba(255, 106, 0, 0.08);
    color: var(--text-main);
    border-left-color: var(--accent-orange);
}

.custom-select-option.selected {
    background: rgba(0, 240, 209, 0.08);
    color: var(--accent-teal);
    font-weight: 600;
    border-left-color: var(--accent-teal);
}

.team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.team-name-input {
    background: transparent;
    border: none;
    color: var(--accent-orange);
    font-size: 1.5rem;
    font-weight: bold;
    font-family: 'Outfit', sans-serif;
    width: 100%;
    outline: none;
    transition: all 0.3s;
}

.team-name-input.editable {
    border-bottom: 1px dashed var(--accent-orange);
    background: rgba(249, 115, 22, 0.05);
}

.team-name-input.editable:focus {
    background: rgba(249, 115, 22, 0.1);
    border-bottom-style: solid;
}

.player-slot.moderator-glow {
    border-color: var(--accent-teal);
    background: rgba(20, 184, 166, 0.05);
    box-shadow: 0 0 15px rgba(20, 184, 166, 0.2);
}

.player-slot.moderator-glow .slot-avatar {
    background: var(--accent-teal);
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(22px);
    background-color: #ffffff;
}

/* Teal Slider for Teams */
.teal-slider::-webkit-slider-thumb {
    background: var(--accent-teal);
    box-shadow: 0 0 10px rgba(20, 184, 166, 0.5);
}

/* --- Dynamic Lobby Styles --- */

.team-container {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
    transition: all 0.3s ease;
}

.team-container:hover {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}

.team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.team-name-input {
    background: transparent;
    border: none;
    color: var(--accent-orange);
    font-size: 1.5rem;
    font-weight: bold;
    font-family: 'Outfit', sans-serif;
    width: 100%;
    outline: none;
    transition: all 0.3s;
}

.team-name-input.editable {
    border-bottom: 1px dashed var(--accent-orange);
    background: rgba(249, 115, 22, 0.05);
}

.team-name-input.editable:focus {
    background: rgba(249, 115, 22, 0.1);
    border-bottom-style: solid;
}

.player-slot.moderator-glow {
    border-color: var(--accent-teal);
    background: rgba(20, 184, 166, 0.05);
    box-shadow: 0 0 15px rgba(20, 184, 166, 0.2);
}

.player-slot.moderator-glow .slot-avatar {
    background: var(--accent-teal);
    box-shadow: 0 0 10px rgba(20, 184, 166, 0.5);
}

/* Utility to override pointer events for non-players */
.disabled-interaction {
    pointer-events: none;
    opacity: 0.6;
}

/* ==========================================================================
   Game Waiting Screen - Neon Map Animations
   ========================================================================== */
#d3MapContainer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    /* Below the overlays, but above gameMap when waiting */
    pointer-events: none;
    background: radial-gradient(circle at center, rgba(15, 23, 42, 0.9) 0%, #0b0f19 100%);
}

.tr-outline-neon {
    stroke: var(--accent-teal);
    stroke-width: 0.8px;
    fill: rgba(20, 184, 166, 0.05);
    filter: drop-shadow(0 0 5px var(--accent-teal));
}

.waiting-text {
    animation: breathingText 3s ease-in-out infinite;
}

@keyframes breathingText {

    0%,
    100% {
        opacity: 0.7;
        transform: translate(-50%, -50%) scale(0.98);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.02);
    }
}

/* =========================================================================
   USER PROFILE SCREEN
   ========================================================================= */

@keyframes profileFadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.profile-card {
    animation: profileFadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    max-width: 500px;
    margin: 4rem auto;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes spinAvatarRing {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.avatar-wrapper {
    position: relative;
    width: 130px;
    height: 130px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-wrapper::before {
    content: '';
    position: absolute;
    top: -4px; left: -4px; right: -4px; bottom: -4px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        var(--accent-teal) 45deg,
        var(--accent-orange) 135deg,
        transparent 180deg,
        var(--accent-teal) 225deg,
        var(--accent-orange) 315deg
    );
    animation: spinAvatarRing 4s linear infinite;
    z-index: 0;
    filter: blur(2px);
}

.profile-avatar {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #0F172A;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
    color: #fff;
    border: 3px solid #0B1320;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

.profile-identity {
    text-align: center;
    margin-bottom: 2.5rem;
}

.profile-identity h1 {
    font-size: 2rem;
    color: #ffffff;
    margin-bottom: 0.3rem;
    font-weight: 700;
}

.profile-identity h2 {
    font-size: 1rem;
    color: var(--accent-teal);
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    width: 100%;
    margin-bottom: 3rem;
}

.stat-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-box:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.02), 0 5px 15px rgba(0, 0, 0, 0.3);
}

.stat-value {
    font-size: 1.8rem;
    color: #ffffff;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.stat-label {
    font-size: 0.75rem;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-actions {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.btn-danger-ghost {
    background: transparent;
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    transition: all 0.3s ease;
    flex: 1;
}

.btn-danger-ghost:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
}

/* Nav back button specific */
#backNavBtn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
#backNavBtn svg {
    transition: transform 0.3s ease;
}

#backNavBtn:hover svg {
    transform: translateX(-4px);
}

/* ==========================================================================
   Profile Redesign: Dynamic Map & Angled Hologram Layout
   ========================================================================== */

#profile-map-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at center, #061c27 0%, #0b0f19 100%);
}

.profile-layout-container {
    padding: 8rem 2rem 4rem 8%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Push card to the left */
    z-index: 1;
    position: relative;
    perspective: 1200px; /* Essential for 3D tilt effect */
}

/* 3D Tilted Glass Card */
.left-angled-hologram {
    transform: rotateY(15deg) rotateX(5deg) translateZ(0); /* The magic tilt */
    transform-style: preserve-3d;
    box-shadow: 
        -20px 20px 40px rgba(0, 0, 0, 0.6), 
        inset 2px 2px 10px rgba(255, 255, 255, 0.05),
        0 0 20px rgba(20, 184, 166, 0.15); /* Subtle teal glow */
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    border-left: 2px solid rgba(255, 255, 255, 0.15); /* Enhance the leading edge */
    backdrop-filter: blur(16px);
    background: rgba(15, 23, 42, 0.65); /* slightly lighter for depth */
}

.left-angled-hologram:hover {
    transform: rotateY(10deg) rotateX(2deg) translateZ(20px);
    box-shadow: 
        -15px 15px 35px rgba(0, 0, 0, 0.5), 
        inset 2px 2px 10px rgba(255, 255, 255, 0.1),
        0 0 30px rgba(20, 184, 166, 0.25);
}

/* Level Indicator UI */
.level-indicator-container {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.level-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-orange);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255, 106, 0, 0.5);
    margin: 0;
}

/* Trapezoid Bar Shape */
.trapezoid-bar-wrapper {
    width: 80%;
    height: 24px;
    position: relative;
    filter: drop-shadow(0 0 5px rgba(20, 184, 166, 0.3));
}

.trapezoid-bar-border {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Right side sloped inward */
    clip-path: polygon(0 0, 100% 0, 95% 100%, 0% 100%);
    position: relative;
    overflow: hidden;
}

.trapezoid-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-teal), #00b39f);
    /* Match the sloped right edge on the fill too, though container overflow hidden helps */
    clip-path: polygon(0 0, 100% 0, calc(100% - 2px) 100%, 0% 100%);
    box-shadow: inset 0 0 10px rgba(255,255,255,0.3);
    transition: width 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.level-xp-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* ==========================================================================
   Friends Sidebar (Arkadaşlar)
   ========================================================================== */

/* Hamburger Button */
.sidebar-hamburger {
    display: none; /* hidden until session check adds .visible */
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.sidebar-hamburger.visible {
    display: flex;
}

.sidebar-hamburger:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-orange);
    box-shadow: 0 0 15px rgba(249, 115, 22, 0.25);
    transform: scale(1.05);
}

.sidebar-hamburger svg {
    pointer-events: none;
}

/* Sidebar Overlay (backdrop) */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.sidebar-overlay.open {
    opacity: 1;
    pointer-events: all;
}

/* Sidebar Panel */
.friends-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 340px;
    max-width: 85vw;
    height: 100vh;
    z-index: 999;
    background: rgba(11, 15, 25, 0.97);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.6);
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.friends-sidebar.open {
    transform: translateX(0);
}

/* Sidebar Header */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #ffffff, var(--accent-orange));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-close-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.sidebar-close-btn:hover {
    color: var(--accent-orange);
    border-color: var(--accent-orange);
    transform: rotate(90deg);
}

/* Search Bar */
.sidebar-search {
    padding: 1rem 1.5rem;
}

.sidebar-search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.6rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.3);
    color: #ffffff;
    font-size: 0.92rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    outline: none;
}

.sidebar-search-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.sidebar-search-input:focus {
    border-color: var(--accent-orange);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
    background: rgba(0, 0, 0, 0.45);
}

.sidebar-search-wrapper {
    position: relative;
}

.sidebar-search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    opacity: 0.6;
}

/* Search Results */
.sidebar-search-results {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
    max-height: 200px;
    overflow-y: auto;
}

/* Sidebar Body (scrollable) */
.sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 1.5rem 1.5rem;
}

.sidebar-body::-webkit-scrollbar {
    width: 4px;
}

.sidebar-body::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Section Labels */
.sidebar-section-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    margin: 1.2rem 0 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

/* User Item (friend row / search result) */
.sidebar-user-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.5rem;
    border-radius: 10px;
    transition: background 0.2s ease;
    list-style: none;
}

.sidebar-user-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.sidebar-user-item.request-item {
    background: rgba(249, 115, 22, 0.06);
    border: 1px solid rgba(249, 115, 22, 0.1);
    margin-bottom: 0.4rem;
}

/* Avatar */
.sidebar-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-orange), #ff8c3a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.3);
}

.sidebar-avatar.request {
    background: linear-gradient(135deg, var(--accent-teal), #00b39f);
    box-shadow: 0 0 10px rgba(0, 240, 209, 0.3);
}

/* Username */
.sidebar-username {
    flex: 1;
    font-size: 0.92rem;
    font-weight: 500;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Status Dot (online indicator for friends) */
.sidebar-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
    flex-shrink: 0;
}

/* Status Badges */
.sidebar-status-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.sidebar-status-badge.accepted {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.sidebar-status-badge.pending {
    background: rgba(249, 115, 22, 0.12);
    color: var(--accent-orange);
    border: 1px solid rgba(249, 115, 22, 0.2);
}

/* Add Friend Button (in search results) */
.sidebar-add-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    border: 1px solid rgba(249, 115, 22, 0.3);
    background: rgba(249, 115, 22, 0.1);
    color: var(--accent-orange);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.sidebar-add-btn:hover {
    background: var(--accent-orange);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(249, 115, 22, 0.4);
    transform: scale(1.1);
}

.sidebar-add-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Request Accept / Decline Buttons */
.sidebar-request-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

.sidebar-accept-btn,
.sidebar-decline-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.sidebar-accept-btn {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.sidebar-accept-btn:hover {
    background: var(--success);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.sidebar-decline-btn {
    background: rgba(239, 68, 68, 0.12);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.sidebar-decline-btn:hover {
    background: var(--error);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

/* Empty / Loading states */
.sidebar-loading,
.sidebar-empty {
    list-style: none;
    text-align: center;
    padding: 1rem 0.5rem;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.sidebar-loading {
    animation: pulse-text 1.5s infinite;
}

@keyframes pulse-text {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Spinner for loading buttons */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.spin {
    animation: spin 0.8s linear infinite;
}

/* Friends list */
.sidebar-friends-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Incoming requests section */
.sidebar-incoming-section {
    display: none;
    margin-bottom: 0.5rem;
}

.sidebar-requests-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .friends-sidebar {
        width: 100vw;
        max-width: 100vw;
    }
}

/* ==========================================================================
   Lobby Invites Sidebar (Sol Menü)
   ========================================================================== */

.invite-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 12rem);
    position: sticky;
    top: 24px;
}

.invite-list-container {
    padding: 1rem 0;
    overflow-y: auto;
    flex: 1;
}

.invite-list-container::-webkit-scrollbar {
    width: 4px;
}

.invite-list-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.invite-user-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    transition: background 0.2s ease;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.invite-user-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.invite-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-orange), #ff8c3a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.3);
}

.invite-username {
    flex: 1;
    font-size: 0.92rem;
    font-weight: 500;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.invite-btn {
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    background: rgba(249, 115, 22, 0.1);
    color: var(--accent-orange);
    border: 1px solid rgba(249, 115, 22, 0.3);
    transition: all 0.25s ease;
}

.invite-btn:hover:not(:disabled) {
    background: var(--accent-orange);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.4);
    transform: translateY(-1px);
}

.invite-btn:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border-color: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ==========================================================================
   Global Toast Notification
   ========================================================================== */

#globalToastContainer {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: none;
}

.toast {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--accent-orange);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 15px rgba(249, 115, 22, 0.15);
    padding: 1.25rem;
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: all;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(249, 115, 22, 0.15);
    color: var(--accent-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.2rem;
}

.toast-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.toast-actions {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.toast-btn {
    flex: 1;
    padding: 0.5rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-align: center;
}

.toast-btn.accept {
    background: var(--accent-orange);
    color: #ffffff;
}

.toast-btn.accept:hover {
    background: var(--accent-orange-hover);
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.4);
}

.toast-btn.decline {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

.toast-btn.decline:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}