/* CS 1.6 Theme - Custom Styles from Example.html */

body {
    background-color: #1b1e1b;
    color: #bfbfbf;
    overflow-x: hidden;
}

/* --- Dynamic Background --- */
.cyber-grid {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        linear-gradient(rgba(93, 127, 69, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(93, 127, 69, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: center top;
    transform: perspective(500px) rotateX(60deg) scale(2.5);
    transform-origin: top center;
    animation: gridMove 15s linear infinite;
    z-index: -2;
    opacity: 0.3;
    pointer-events: none;
}

.vignette {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle, transparent 40%, #0d0f0d 95%);
    z-index: -1;
    pointer-events: none;
}

@keyframes gridMove {
    0% { transform: perspective(500px) rotateX(60deg) scale(2.5) translateY(0); }
    100% { transform: perspective(500px) rotateX(60deg) scale(2.5) translateY(50px); }
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #151715; }
::-webkit-scrollbar-thumb { background: #5d7f45; border: 2px solid #151715; }

/* --- Glitch Effect for Titles --- */
.glitch-wrapper { position: relative; display: inline-block; }
.glitch {
    position: relative;
    color: #fff;
    font-weight: 900;
}
.glitch::before, .glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #1b1e1b;
}
.glitch::before {
    left: 2px; text-shadow: -1px 0 #de9b35; clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}
.glitch::after {
    left: -2px; text-shadow: -1px 0 #5d7f45; clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(31px, 9999px, 9px, 0); }
    5% { clip: rect(70px, 9999px, 7px, 0); }
    10% { clip: rect(12px, 9999px, 60px, 0); }
    15% { clip: rect(65px, 9999px, 93px, 0); }
    20% { clip: rect(46px, 9999px, 10px, 0); }
    25% { clip: rect(2px, 9999px, 2px, 0); }
    100% { clip: rect(64px, 9999px, 98px, 0); }
}
@keyframes glitch-anim2 {
    0% { clip: rect(66px, 9999px, 59px, 0); }
    5% { clip: rect(4px, 9999px, 5px, 0); }
    10% { clip: rect(25px, 9999px, 12px, 0); }
    15% { clip: rect(93px, 9999px, 79px, 0); }
    20% { clip: rect(12px, 9999px, 86px, 0); }
    25% { clip: rect(21px, 9999px, 20px, 0); }
    100% { clip: rect(3px, 9999px, 34px, 0); }
}

/* --- Hud Box Styles --- */
.hud-box {
    background: rgba(38, 43, 38, 0.8);
    border: 1px solid rgba(93, 127, 69, 0.3);
    position: relative;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}
.hud-box:hover {
    border-color: #de9b35;
    box-shadow: 0 0 20px rgba(93, 127, 69, 0.2);
    transform: translateY(-5px);
}
.hud-corner {
    position: absolute;
    width: 10px; height: 10px;
    border: 2px solid #5d7f45;
    transition: all 0.3s;
}
.hc-tl { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.hc-tr { top: -1px; right: -1px; border-left: 0; border-bottom: 0; }
.hc-bl { bottom: -1px; left: -1px; border-right: 0; border-top: 0; }
.hc-br { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.hud-box:hover .hc-tl { border-color: #de9b35; transform: translate(-2px, -2px); }
.hud-box:hover .hc-tr { border-color: #de9b35; transform: translate(2px, -2px); }
.hud-box:hover .hc-bl { border-color: #de9b35; transform: translate(-2px, 2px); }
.hud-box:hover .hc-br { border-color: #de9b35; transform: translate(2px, 2px); }

/* --- Button Effects --- */
.btn-gamatic {
    background: linear-gradient(45deg, #de9b35, #b07824); 
    color: #1b1e1b;
    font-weight: 800;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
    overflow: hidden;
    transition: color 0.4s;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.btn-gamatic::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(45deg, #5d7f45, #3e5c2e); 
    z-index: -1;
    transition: left 0.4s ease;
}
.btn-gamatic:hover::before {
    left: 0;
}
.btn-gamatic:hover {
    color: #fff;
    box-shadow: 0 0 20px rgba(93, 127, 69, 0.6);
}

/* --- Map Card --- */
.map-card {
    overflow: hidden;
    position: relative;
    border-bottom: 2px solid #5d7f45;
}
.map-card img {
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.map-card:hover img {
    transform: scale(1.15) rotate(2deg);
}
.map-overlay {
    background: linear-gradient(to top, rgba(27, 30, 27, 0.95), transparent);
    position: absolute; inset: 0;
}

/* Stats Loader Animation */
.stat-loading {
    display: inline-block;
    width: 12px; height: 12px;
    border: 2px solid #5d7f45;
    border-bottom-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Rank Badges --- */
.rank-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    font-family: 'Orbitron', sans-serif;
}

.rank-bronze { background: linear-gradient(135deg, #cd7f32 0%, #8b5a2b 100%); color: #fff; }
.rank-silver { background: linear-gradient(135deg, #c0c0c0 0%, #808080 100%); color: #000; }
.rank-gold { background: linear-gradient(135deg, #ffd700 0%, #b8860b 100%); color: #000; }
.rank-platinum { background: linear-gradient(135deg, #e5e4e2 0%, #a0b2c6 100%); color: #000; }
.rank-diamond { background: linear-gradient(135deg, #b9f2ff 0%, #00a6ed 100%); color: #000; }
.rank-master { background: linear-gradient(135deg, #ff0080 0%, #7928ca 100%); color: #fff; }
.rank-grandmaster { background: linear-gradient(135deg, #ff6b6b 0%, #4ecdc4 100%); color: #fff; }
.rank-legendary { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); color: #fff; }

/* --- Button Styles --- */
.sort-btn, .event-filter-btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sort-btn::before, .event-filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(222, 155, 53, 0.3), transparent);
    transition: left 0.5s ease;
}

.sort-btn:hover::before, .event-filter-btn:hover::before {
    left: 100%;
}

.sort-btn.active, .event-filter-btn.active {
    background: #de9b35;
    color: #1b1e1b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(222, 155, 53, 0.4);
}

/* --- Chat Widget --- */
#chatWidget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    max-height: 500px;
    z-index: 1000;
}

#chatMessages {
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #de9b35 #262b26;
}

#chatMessages::-webkit-scrollbar {
    width: 8px;
}

#chatMessages::-webkit-scrollbar-track {
    background: #262b26;
}

#chatMessages::-webkit-scrollbar-thumb {
    background: #de9b35;
    border-radius: 4px;
}

/* --- Pulsing Effect --- */
.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* --- Modal Backdrop --- */
.modal-backdrop {
    backdrop-filter: blur(8px);
    background-color: rgba(27, 30, 27, 0.8);
}

/* --- Table Hover Effect --- */
tbody tr {
    transition: all 0.3s ease;
}

tbody tr:hover {
    transform: translateX(4px);
    box-shadow: -4px 0 0 #de9b35;
}

/* --- Progress Bar --- */
.progress-bar {
    height: 8px;
    background: #1b1e1b;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #5d7f45 0%, #de9b35 100%);
    transition: width 0.5s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    #chatWidget {
        width: calc(100% - 40px);
        bottom: 10px;
        right: 20px;
        left: 20px;
    }

    .hud-corner {
        width: 8px;
        height: 8px;
    }
}

/* --- Text Selection --- */
::selection {
    background: #de9b35;
    color: #1b1e1b;
}

::-moz-selection {
    background: #de9b35;
    color: #1b1e1b;
}

/* --- Focus Styles --- */
input:focus, textarea:focus, button:focus {
    outline: 2px solid #de9b35;
    outline-offset: 2px;
}

/* --- Notification Badge --- */
.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #a62828;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}
