/* Landing Page Styles */
:root {
    --primary-color: #2f90e2;
    --primary-dark: #1e7ce8;
    --secondary-color: #34495e;
    --accent-color: #e74c3c;
    --danger-color: #ef4444;
    --dark-bg: #0f172a;
    --darker-bg: #020617;
    --card-bg: rgba(15, 23, 42, 0.8);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-light: #f8fafc;
    --text-muted: #cbd5e1;
    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    --gradient-secondary: linear-gradient(135deg, var(--secondary-color), #059669);
    --gradient-accent: linear-gradient(135deg, var(--accent-color), #d97706);
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cinzel', serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--text-light);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Background Animation */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bg-unit {
    position: absolute;
    width: 60px;
    height: 60px;
    opacity: 0.1;
    animation: float 20s infinite linear;
}

.bg-unit:nth-child(1) {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.bg-unit:nth-child(2) {
    top: 20%;
    right: 15%;
    animation-delay: 5s;
}

.bg-unit:nth-child(3) {
    bottom: 30%;
    left: 20%;
    animation-delay: 10s;
}

.bg-unit:nth-child(4) {
    bottom: 20%;
    right: 10%;
    animation-delay: 15s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(90deg); }
    50% { transform: translateY(0px) rotate(180deg); }
    75% { transform: translateY(-10px) rotate(270deg); }
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    padding: 0.75rem 0;
}

.nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.logo {
    height: 40px;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.auth-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Main Content */
.main-content {
    padding-top: 5px;
    min-height: 100vh;
}

/* Announcement Section */
.announcement-section {
    padding-top: 80px; /* Account for fixed header */
    padding-bottom: 5px;
    background: transparent;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 1rem;
}

/* Top Section - Two Columns */
.top-section {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 3rem;
    margin-bottom: 4rem;
    padding: 2rem 0;
}

/* Left Column - Action Buttons */
.action-buttons-column {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: 
        linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.9)),
        linear-gradient(45deg, rgba(47, 144, 226, 0.1), rgba(231, 76, 60, 0.1)),
        url('/imgs/background.png') center/cover no-repeat;
    background-size: cover, cover, cover;
    background-position: center;
    min-height: 400px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.action-buttons-column::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 10%;
    width: 80px;
    height: 80px;
    background: url('imgs/heroes/trarex_blue.png') center/contain no-repeat;
    opacity: 0.2;
    animation: float-left 6s ease-in-out infinite;
    z-index: 1;
}

.action-buttons-column::after {
    content: '';
    position: absolute;
    bottom: 15%;
    right: 15%;
    width: 70px;
    height: 70px;
    background: url('imgs/assassin_red.png') center/contain no-repeat;
    opacity: 0.25;
    animation: float-right 8s ease-in-out infinite reverse;
    z-index: 1;
}

@keyframes float-left {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.2;
    }
    50% {
        transform: translateY(-15px) rotate(5deg);
        opacity: 0.3;
    }
}

@keyframes float-right {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.25;
    }
    50% {
        transform: translateY(-10px) rotate(-5deg);
        opacity: 0.35;
    }
}

/* Game Statistics Section */
.game-stats-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.stats-grid {
    display: flex;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(47, 144, 226, 0.1), rgba(59, 130, 246, 0.05));
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

.stat-card:hover::before {
    left: 100%;
}

.stat-icon {
    font-size: 2rem;
    margin-right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 50%;
    border: 2px solid rgba(59, 130, 246, 0.3);
}

.stat-content {
    width: 200px;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: #60a5fa;
    margin-bottom: 0.25rem;
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.5px;
}

.stat-label {
    font-size: 0.85rem;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.action-buttons-wrapper {
    text-align: center;
    max-width: 400px;
    position: relative;
    z-index: 2;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, 
        rgba(255, 107, 53, 0.15) 0%, 
        rgba(15, 23, 42, 0.8) 30%, 
        rgba(100, 50, 30, 0.6) 70%, 
        rgba(255, 140, 66, 0.12) 100%
    );
    border-radius: 20px;
    border: 2px solid rgba(255, 107, 53, 0.4);
    backdrop-filter: blur(20px);
    box-shadow: 
        0 15px 45px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(255, 107, 53, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.action-buttons-wrapper:hover {
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(255, 107, 53, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 107, 53, 0.6);
}

.main-title {
    font-family: 'Cinzel', serif;
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #2f90a6, #3498db, #2980b9);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    text-shadow: 0 0 30px rgba(47, 144, 226, 0.3);
}

.main-subtitle {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 100;
    background: linear-gradient(90deg, #f8fafc 40%, #60a5fa 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 16px rgba(47,144,226,0.18), 0 1px 0 #fff;
    margin-bottom: 2rem;
    line-height: 1.6;
    text-align: center;
    padding: 0.5rem 0 1.2rem 0;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

@keyframes subtle-glow {
    from {
        text-shadow: 0 0 10px rgba(47, 144, 226, 0.3);
    }
    to {
        text-shadow: 0 0 20px rgba(47, 144, 226, 0.5);
    }
}

.action-buttons {
    display: flex;
    flex-direction: row; flex-wrap: wrap; justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.unit-showcase-small {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.unit-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.unit-item img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid transparent;
    padding: 8px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    box-shadow: 0 0 0 0 rgba(47, 144, 226, 0);
}

.unit-item:hover img {
    transform: scale(1.05);
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(47, 144, 226, 0.6);
    background: rgba(47, 144, 226, 0.1);
}

.unit-item.clickable {
    cursor: poCinzel;
    transition: all 0.3s ease;
    position: relative;
}

.unit-item.clickable::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(47, 144, 226, 0.15), transparent 60%);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: -1;
}

.unit-item.clickable:hover::before {
    opacity: 1;
    transform: translateX(-50%) scale(1.1);
}

.unit-item.clickable:hover {
    transform: translateY(-8px);
}

.unit-item.clickable:hover img {
    transform: scale(1.15);
    border-color: var(--primary-color);
    box-shadow: 
        0 0 20px rgba(47, 144, 226, 0.8),
        0 0 35px rgba(47, 144, 226, 0.4);
    background: rgba(47, 144, 226, 0.2);
}

.unit-item.clickable:hover span {
    color: var(--primary-color);
    font-weight: 700;
    text-shadow: 0 0 10px rgba(47, 144, 226, 0.6);
}

.unit-item span {
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

/* Right Column - Welcome */
.welcome-column {
    background: var(--card-bg);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.welcome-wrapper {
    padding: 2rem;
    height: 100%;
}

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

.welcome-header h2 {
    font-size: 1.8rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #2f90e2, #3498db);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.welcome-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.5;
    margin: 0;
}

.welcome-content {
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: rgba(47, 144, 226, 0.05);
    border: 1px solid rgba(47, 144, 226, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-2px);
    border-color: rgba(47, 144, 226, 0.3);
    box-shadow: 0 4px 12px rgba(47, 144, 226, 0.1);
    background: rgba(47, 144, 226, 0.08);
}

.feature-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.feature-details h3 {
    color: var(--text-light);
    font-size: 1.1rem;
    margin: 0 0 0.5rem 0;
    font-weight: 600;
}

.feature-details p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

.welcome-cta {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.btn-community {
    background: linear-gradient(135deg, #e74c3c, #d97706);
    border: none;
    color: white;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}

.btn-community:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(231, 76, 60, 0.4);
    background: linear-gradient(135deg, #d97706, #e74c3c);
}

/* Bottom Section - Lobby Chat */
.lobby-section {
    background: var(--card-bg);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    margin-bottom: 4rem;
}

.lobby-chat-wrapper {
    padding: 2rem;
}

.lobby-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.lobby-header h2 {
    font-size: 1.5rem;
    color: var(--text-light);
}

.online-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
}

.online-indicator {
    width: 8px;
    height: 8px;
    background: var(--secondary-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

.lobby-content {
    display: grid;
    grid-template-columns: 1fr 250px;
    gap: 1.5rem;
    min-height: 400px;
}

/* Chat Area */
.lobby-chat-area {
    display: flex;
    flex-direction: column;
    height: 400px;
}

.chat-messages {
    width: 100%;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 12px;
    padding: 1rem;
    overflow-y: auto;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
    min-height: 0; /* Important for flex child overflow */
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.chat-message {
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.3);
}

.chat-message.system-message {
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid var(--primary-color);
    font-style: italic;
}

.timestamp {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-right: 0.5rem;
}

.chat-input-wrapper {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0; /* Prevent input from shrinking */
}

.chat-input-wrapper input {
    width: 200px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.chat-input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(47, 144, 226, 0.2);
}

.send-btn {
    background: var(--gradient-primary);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0; /* Prevent button from shrinking */
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(47, 144, 226, 0.3);
}

/* Online Users Sidebar */
.online-users-sidebar {
    display: flex;
    flex-direction: column;
    background: rgba(15, 23, 42, 0.3);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    height: 400px;
}

.online-users-sidebar h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-light);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    flex-shrink: 0; /* Header doesn't shrink */
}

.users-list {
    width: 100%;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
    min-height: 0; /* Important for flex child overflow */
}

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

.users-list::-webkit-scrollbar-track {
    background: transparent;
}

.users-list::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

.user-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    transition: background 0.3s ease;
}

.user-item:hover {
    background: rgba(47, 144, 226, 0.1);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}

.user-name {
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.btn-hero {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    min-width: 250px;
    width: 200px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(47, 144, 226, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(47, 144, 226, 0.4);
}

.btn-play {
    background: var(--gradient-secondary);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-play:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.btn-ai {
    background: var(--gradient-accent);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-ai:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--text-light);
    border: 2px solid var(--border-color);
}

.btn-outline:hover {
    background: rgba(47, 144, 226, 0.1);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Announcement Bar */
#announcement-container {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 10px;
    margin: 20px auto;
    border: 1px solid #4a4a4a;
    max-width: 1200px;
    width: 90%;
    position: relative;
    z-index: 100;
}

#announcement-marquee {
    color: #4a90e2; /* Blue color like AI page */
    font-family: 'Cinzel', serif; /* Same font as lobby */
    font-size: 1.1em;
    font-weight: 600;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    height: 35px;
    line-height: 35px;
}

#announcement-text {
    display: inline-block;
    animation: marquee 25s linear infinite;
    padding-left: 100%;
}

.announcement-item {
    margin-right: 50px; /* Space between announcements */
}

.announcement-datetime {
    color: #357abd; /* Darker blue for datetime */
    font-weight: bold;
    margin-right: 10px;
}

.announcement-content {
    color: #4a90e2; /* Blue for content */
    font-weight: 600;
}

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

/* Heroes Section */
.heroes-section {
    padding: 2rem 0;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.8), rgba(30, 41, 59, 0.6));
    margin-top: 1rem;
}

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

.heroes-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #2f90a6, #3498db, #2980b9);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.heroes-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 780px;
    margin: 0 auto;
    line-height: 1.6;
}

.heroes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-card {
    background: var(--card-bg);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
}

.hero-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.hero-image-container {
    position: relative;
    padding: 2rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(47, 144, 226, 0.1), rgba(77, 166, 255, 0.1));
}

.hero-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    padding: 8px;
    background: rgba(47, 144, 226, 0.1);
    transition: all 0.3s ease;
}

.hero-card:hover .hero-image {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(47, 144, 226, 0.5);
}

.hero-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(47, 144, 226, 0.3), transparent);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hero-card:hover .hero-glow {
    opacity: 1;
}

.hero-content {
    padding: 0 2rem 2rem 2rem;
}

.hero-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.hero-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.hero-title {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.stat-badge {
    background: rgba(47, 144, 226, 0.2);
    color: var(--text-light);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(47, 144, 226, 0.3);
}

.stat-badge.hp {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
}

.stat-badge.speed {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.3);
}

.stat-badge.range {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.3);
}

.stat-badge.special {
    background: rgba(77, 166, 255, 0.2);
    border-color: rgba(77, 166, 255, 0.3);
}

.hero-ability {
    background: rgba(47, 144, 226, 0.1);
    border-left: 3px solid var(--primary-color);
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 0 8px 8px 0;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-light);
}

.hero-ability strong {
    color: var(--primary-color);
}

.hero-biography {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.hero-biography h4 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

.hero-biography p {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.9rem;
}

/* Units Section */
.units-section {
    padding: 2rem 0;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.8), rgba(30, 41, 59, 0.6));
    margin-top: 1rem;
}

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

.units-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #2f90a6, #3498db, #2980b9);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.units-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 780px;
    margin: 0 auto;
    line-height: 1.6;
    padding: 0 0.5rem;
}

.units-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.unit-card {
    background: var(--card-bg);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
}

.unit-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.unit-image-container {
    position: relative;
    padding: 2rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(47, 144, 226, 0.1), rgba(77, 166, 255, 0.1));
}

.unit-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    padding: 8px;
    background: rgba(47, 144, 226, 0.1);
    transition: all 0.3s ease;
}

.unit-card:hover .unit-image {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(47, 144, 226, 0.5);
}

.unit-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(47, 144, 226, 0.3), transparent);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.unit-card:hover .unit-glow {
    opacity: 1;
}

.unit-content {
    padding: 0 2rem 2rem 2rem;
}

.unit-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.unit-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.unit-title {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

.unit-stats {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.unit-ability {
    background: rgba(47, 144, 226, 0.1);
    border-left: 3px solid var(--primary-color);
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 0 8px 8px 0;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-light);
}

.unit-ability strong {
    color: var(--primary-color);
}

.unit-biography {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.unit-biography h4 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

.unit-biography p {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.9rem;
}

/* Battle Section */
.battle-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin: 2rem 0;
    padding: 0 0.5rem;
}

.battle-header {
    text-align: center;
    margin-bottom: 4rem;
}

.battle-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #2f90a6, #3498db, #2980b9);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.battle-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 780px;
    margin: 0 auto;
    line-height: 1.6;
    padding: 0 0.5rem;
}

.battle-content {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 3rem;
    max-width: 1400px;
    margin: 0 auto;
    min-width: 0;
    overflow: hidden;
}

/* Recent Matches Column */
.recent-matches-column {
    background: var(--card-bg);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.recent-matches-wrapper {
    padding: 2rem;
    height: 100%;
    min-height: 450px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.recent-matches-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.recent-matches-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.view-all-matches-btn {
    font-size: 0.9rem;
    color: var(--text-light);
    background: linear-gradient(135deg, #2f90a6, #3498db);
    padding: 0.4rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(47, 144, 226, 0.3);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-all-matches-btn:hover {
    background: linear-gradient(135deg, #2980b9, #2471a3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(47, 144, 226, 0.3);
    color: white;
}

.recent-matches-list {
    max-height: 60vh;
    min-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 780px;
}

.recent-matches-list::-webkit-scrollbar {
    width: 6px;
}

.recent-matches-list::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.3);
    border-radius: 3px;
}

.recent-matches-list::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.match-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 1.2rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.match-item:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.08));
    border-color: rgba(129, 140, 248, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(47, 144, 226, 0.2);
}

.match-content {
    display: flex;
    width: 100%;
    flex-direction: column;
    gap: 1rem;
}

/* Hàng 1: Tên game + Ngày giờ */
.match-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.match-name {
    font-weight: 700;
    color: #e0e7ff;
    font-size: 1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.match-time {
    font-size: 0.8rem;
    color: #aed6f1;
    background: rgba(47, 144, 226, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    font-weight: 500;
}

/* Hàng 2: Người chơi + Nút replay */
.match-battle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.players-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 200px;
}

.player-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #cbd5e1;
    transition: all 0.3s ease;
}

.player-name.winner {
    color: #34d399;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(52, 211, 153, 0.4);
}

.vs-text {
    font-weight: 700;
    color: #5dade2;
    font-size: 0.8rem;
    background: linear-gradient(135deg, #2f90a6, #3498db);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.winner-indicator {
    font-size: 0.75rem;
    color: #fbbf24;
    font-weight: 600;
    margin-left: 0.5rem;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 5px rgba(251, 191, 36, 0.5); }
    to { text-shadow: 0 0 15px rgba(251, 191, 36, 0.8); }
}

.review-btn {
    background: linear-gradient(135deg, #2f90a6, #3498db);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: poCinzel;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 8px rgba(47, 144, 226, 0.3);
}

.review-btn:hover {
    background: linear-gradient(135deg, #2f90a6, #3498db);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(47, 144, 226, 0.4);
}

.btn-icon {
    font-size: 0.9rem;
}

.btn-text {
    font-size: 0.8rem;
}

/* Top Players Column */
.top-players-column {
    background: var(--card-bg);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    backdrop-filter: blur(10px);
    min-width: 0;
    width: 100%;
}

.top-players-wrapper {
    padding: 2rem;
    height: 100%;
}

.top-players-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.top-players-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.leaderboard-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    background: rgba(47, 144, 226, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    border: 1px solid rgba(47, 144, 226, 0.2);
}

.top-players-list {
    max-height: 500px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.top-players-list::-webkit-scrollbar {
    width: 6px;
}

.top-players-list::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.3);
    border-radius: 3px;
}

.top-players-list::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.player-item {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    justify-content: center;
}

.player-item:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(47, 144, 226, 0.2);
}

.player-rank {
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary-color);
    min-width: 30px;
}

.player-rank.rank-1 {
    color: #ffd700;
}

.player-rank.rank-2 {
    color: #c0c0c0;
}

.player-rank.rank-3 {
    color: #cd7f32;
}

.player-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    object-fit: cover;
}

.player-details {
    width: 200px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
    overflow: hidden;
}

.player-username {
    font-weight: 600;
    color: var(--text-light);
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    flex-wrap: nowrap;
    min-width: 0;
}

.stat-item {
    color: var(--text-muted);
}

.stat-value {
    font-weight: 600;
    color: var(--text-light);
}

.player-level {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
}

/* Loading and Error Messages */
.loading-message {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    font-style: italic;
}

.error-message {
    text-align: center;
    color: var(--danger-color);
    padding: 2rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    max-width: 800px;
    max-height: 80vh;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tutorial-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.language-switcher {
    display: flex;
    gap: 0.5rem;
}

.lang-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    border-radius: 6px;
    cursor: poCinzel;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: rgba(47, 144, 226, 0.1);
    border-color: var(--primary-color);
    color: var(--text-light);
}

.lang-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.modal-header h2 {
    margin: 0;
    color: var(--text-light);
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: poCinzel;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.modal-body {
    padding: 2rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: var(--card-bg);
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

/* Tutorial Specific Styles */
.tutorial-title h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 2rem;
    font-size: 2rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tutorial-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(47, 144, 226, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(47, 144, 226, 0.1);
}

.tutorial-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tutorial-section p {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.tutorial-section ul,
.tutorial-section ol {
    color: var(--text-light);
    padding-left: 1.5rem;
    line-height: 1.6;
}

.tutorial-section li {
    margin-bottom: 0.5rem;
}

.tutorial-section li strong {
    color: var(--primary-color);
}

.tutorial-section li em {
    color: var(--text-muted);
    font-style: italic;
}

/* Status Message Styles */
.status-message {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin: 0.5rem 0;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
}

.status-message.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.status-message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.status-message.pending {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #f59e0b;
}

/* Profile Modal Styles */
#user-profile-modal .modal-content {
    max-width: 780px;
    max-height: 90vh;
    overflow-y: auto;
}

#profile-details {
    padding: 1rem;
}

#profile-details p {
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

#profile-details strong {
    color: var(--primary-color);
}

#profile-details hr.solid {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1rem 0;
}

/* Compact layout for profile stats */
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 1rem 0;
}

.profile-match-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 1rem 0;
}

.stat-item-profile {
    background: rgba(47, 144, 226, 0.1);
    border: 1px solid rgba(47, 144, 226, 0.2);
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
}

.stat-item-profile .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-item-profile .stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-light);
}

.stat-item-profile.wins .stat-value {
    color: #34d399;
}

.stat-item-profile.losses .stat-value {
    color: #ef4444;
}

.stat-item-profile.draws .stat-value {
    color: #fbbf24;
}

.form-group {
    margin-bottom: 0.75rem;
}

.form-group label {
    display: block;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-light);
    font-size: 0.875rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(47, 144, 226, 0.1);
}

.username-change-section {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.username-change-section input {
    width: 200px;
    padding: 0.75rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-light);
    font-size: 0.875rem;
}

.username-change-section button {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: poCinzel;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.username-change-section button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(47, 144, 226, 0.3);
}

.profile-avatar-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.profile-avatar-display,
.profile-avatar-preview-display {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    object-fit: cover;
}

.custom-file-upload-label {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--gradient-primary);
    color: white;
    border-radius: 6px;
    cursor: poCinzel;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-right: 1rem;
}

.custom-file-upload-label:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(47, 144, 226, 0.3);
}

#profile-upload-avatar-btn {
    background: var(--gradient-secondary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: poCinzel;
    transition: all 0.3s ease;
}

#profile-upload-avatar-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.collapsible-section {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.collapsible-toggle-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(47, 144, 226, 0.1);
    border: none;
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s ease;
}

.collapsible-toggle-btn:hover {
    background: rgba(47, 144, 226, 0.2);
}

.toggle-icon {
    color: var(--primary-color);
    font-size: 0.875rem;
    font-weight: bold;
}

.collapsible-content {
    padding: 1rem;
}

.collapsible-content h4 {
    color: var(--text-light);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.referral-section {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.referral-section h4 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.referral-input-inline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.referral-input-inline input {
    width: 200px;
    padding: 0.5rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-light);
    font-size: 0.875rem;
}

.referral-input-inline button {
    background: var(--gradient-secondary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.referral-input-inline button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.referral-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
    margin-top: 0.5rem;
    font-style: italic;
}

#profile-submit-refer-btn,
#profile-change-password-btn,
#profile-save-username-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: poCinzel;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

#profile-submit-refer-btn:hover,
#profile-change-password-btn:hover,
#profile-save-username-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(47, 144, 226, 0.3);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .battle-section {
        grid-template-columns: 2fr 3fr;
        gap: 1.5rem;
    }
}

@media (max-width: 1024px) {
    .battle-section {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .nav {
        padding: 0 1rem;
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
    
    .logo {
        height: 35px;
    }
    
    .container {
        max-width: 100%;
        padding: 0 0.5rem 1rem;
    }
    
    /* Top section responsive - xuống dòng */
    .top-section {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-bottom: 3rem;
    }
    
    .main-title {
        font-size: 2.5rem;
    }
    
    .action-buttons {
        gap: 0.75rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .btn-hero {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
        min-width: 180px;
        width: 200px;
        max-width: 250px;
    }
    
    .unit-showcase-small {
        gap: 1rem;
    }
    
    .unit-item img {
        width: 65px;
        height: 65px;
        padding: 6px;
    }

    .unit-item.clickable::before {
        width: 75px;
        height: 75px;
        top: -4px;
    }
    
    .lobby-chat-wrapper {
        padding: 1.5rem;
    }
    
    .chat-messages {
        height: 300px;
    }
    
    .auth-buttons {
        gap: 0.5rem;
    }
    
    .auth-buttons .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        min-width: auto;
    }

    /* Stats responsive */
    .game-stats-section {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .stat-icon {
        font-size: 1.5rem;
        width: 40px;
        height: 40px;
        margin-right: 0.75rem;
    }
    
    .stat-number {
        font-size: 1.4rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    /* Announcement responsive */
    .announcement-section {
        padding-top: 70px;
        padding-bottom: 5px;
    }
    
    #announcement-container {
        margin: 10px auto;
        width: calc(100% - 20px);
        padding: 8px;
    }
    
    #announcement-marquee {
        font-size: 0.9rem;
        height: 30px;
        line-height: 30px;
    }
    
    .announcement-datetime {
        font-size: 0.8rem;
    }
    
    .announcement-content {
        font-size: 0.9rem;
    }
    
    /* Heroes responsive - horizontal scroll */
    .heroes-section {
        padding: 3rem 0;
    }
    
    .heroes-header h2 {
        font-size: 2rem;
    }
    
    .heroes-subtitle {
        font-size: 1rem;
        padding: 0 0.5rem;
    }
    
    .heroes-grid {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 1.5rem;
        padding: 0 0.5rem;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: rgba(59, 130, 246, 0.3) transparent;
    }
    
    .heroes-grid::-webkit-scrollbar {
        height: 6px;
    }
    
    .heroes-grid::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 3px;
    }
    
    .heroes-grid::-webkit-scrollbar-thumb {
        background: rgba(59, 130, 246, 0.5);
        border-radius: 3px;
    }
    
    .hero-card {
        flex: 0 0 280px;
        scroll-snap-align: start;
    }
    
    .hero-image {
        width: 60px;
        height: 60px;
    }
    
    .hero-content {
        padding: 0 1.5rem 1.5rem 1.5rem;
    }
    
    .hero-biography {
        padding: 1rem;
    }

    /* Battle responsive - xuống dòng */
    .battle-section {
        padding: 3rem 0;
    }

    .battle-header h2 {
        font-size: 2rem;
    }

    .battle-subtitle {
        font-size: 1rem;
        padding: 0 0.5rem;
    }

    .battle-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 0.5rem;
    }

    .recent-matches-wrapper,
    .top-players-wrapper {
        padding: 1.5rem;
    }

    .recent-matches-header h3,
    .top-players-header h3 {
        font-size: 1.2rem;
    }

    .match-item {
        padding: 1rem;
    }

    .player-item {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .player-avatar {
        width: 35px;
        height: 35px;
    }

    .player-stats {
        gap: 0.5rem;
        font-size: 0.75rem;
    }

    /* Units responsive - horizontal scroll */
    .units-section {
        padding: 3rem 0;
    }

    .units-header h2 {
        font-size: 2rem;
    }

    .units-subtitle {
        font-size: 1rem;
        padding: 0 0.5rem;
    }

    .units-grid {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 1.5rem;
        padding: 0 0.5rem;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: rgba(59, 130, 246, 0.3) transparent;
    }
    
    .units-grid::-webkit-scrollbar {
        height: 6px;
    }
    
    .units-grid::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 3px;
    }
    
    .units-grid::-webkit-scrollbar-thumb {
        background: rgba(59, 130, 246, 0.5);
        border-radius: 3px;
    }
    
    .unit-card {
        flex: 0 0 280px;
        scroll-snap-align: start;
    }

    .unit-image {
        width: 60px;
        height: 60px;
    }

    .unit-content {
        padding: 0 1.5rem 1.5rem 1.5rem;
    }

    .unit-biography {
        padding: 1rem;
    }

    /* Welcome features responsive - horizontal scroll */
    .welcome-wrapper {
        padding: 1.5rem;
    }

    .feature-list {
        display: flex;
        flex-direction: row; flex-wrap: wrap; justify-content: center;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 1.5rem;
        padding: 0 0.5rem;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: rgba(59, 130, 246, 0.3) transparent;
        margin-bottom: 2rem;
    }
    
    .feature-list::-webkit-scrollbar {
        height: 6px;
    }
    
    .feature-list::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 3px;
    }
    
    .feature-list::-webkit-scrollbar-thumb {
        background: rgba(59, 130, 246, 0.5);
        border-radius: 3px;
    }
    
    .feature-item {
        flex: 0 0 280px;
        scroll-snap-align: start;
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }
    
    .feature-icon {
        font-size: 2.5rem;
        margin-bottom: 1rem;
        align-self: center;
    }
    
    .feature-details h3 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .feature-details p {
        font-size: 0.9rem;
        line-height: 1.6;
    }
    
    /* Lobby content responsive */
    .lobby-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        min-height: auto;
    }
    
    .online-users-sidebar {
        order: -1;
        height: 200px;
        background: rgba(15, 23, 42, 0.3);
        border-radius: 12px;
        border: 1px solid var(--border-color);
    }
    
    .lobby-chat-area {
        height: 350px;
    }
    
    /* Recent matches responsive fixes */
    .recent-matches-list {
        max-height: 300px;
    }
    
    .match-content {
        overflow: hidden;
    }
    
    .match-header-row,
    .match-battle-row {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    /* About creator modal responsive */
    .modal-content {
        max-width: 95vw;
        margin: 2vh auto;
        max-height: 96vh;
        overflow-y: auto;
    }
    
    .modal-body {
        padding: 1rem;
        max-height: calc(96vh - 120px);
    }
}

@media (max-width: 600px) {
    .action-buttons {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
    }
    
    .btn-hero {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
        min-width: 160px;
        flex: 1 1 calc(50% - 0.375rem);
        max-width: 220px;
    }
    
    /* Ensure third button takes full width on new row */
    .btn-hero:nth-child(3) {
        flex: 1 1 100%;
        max-width: 280px;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 2rem;
    }
    
    .btn-hero {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
        min-width: 140px;
        width: 200px;
        max-width: 200px;
    }
    
    .action-buttons {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .unit-showcase-small {
        display: flex;
        gap: 0.75rem;
        justify-content: center;
    }
    
    /* Mobile stats responsive */
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .stat-card {
        padding: 0.5rem;
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon {
        margin-right: 0;
        margin-bottom: 0.5rem;
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }
    
    .stat-number {
        font-size: 1.2rem;
        margin-bottom: 0.15rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
    
    .lobby-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    /* Announcement mobile responsive */
    .announcement-section {
        padding-top: 65px;
        padding-bottom: 5px;
    }
    
    #announcement-container {
        margin: 5px auto;
        width: calc(100% - 10px);
        padding: 6px;
    }
    
    #announcement-marquee {
        font-size: 0.8rem;
        height: 25px;
        line-height: 25px;
    }
    
    .announcement-datetime {
        font-size: 0.7rem;
        margin-right: 5px;
    }
    
    .announcement-content {
        font-size: 0.8rem;
    }
    
    .announcement-item {
        margin-right: 30px;
    }
    
    /* Heroes mobile responsive */
    .heroes-section {
        padding: 2rem 0;
    }
    
    .heroes-header h2 {
        font-size: 1.8rem;
    }
    
    .heroes-subtitle {
        font-size: 0.9rem;
    }
    
    .heroes-grid {
        gap: 1rem;
        padding: 0 0.5rem;
    }
    
    .hero-image-container {
        padding: 1.5rem;
    }
    
    .hero-image {
        width: 50px;
        height: 50px;
    }
    
    .hero-content {
        padding: 0 1rem 1rem 1rem;
    }
    
    .hero-name {
        font-size: 1.2rem;
    }
    
    .hero-ability {
        padding: 0.75rem;
        font-size: 0.8rem;
    }
    
    .hero-biography {
        padding: 0.75rem;
    }
    
    .hero-biography p {
        font-size: 0.8rem;
    }
    
    /* Units mobile responsive */
    .units-section {
        padding: 2rem 0;
    }
    
    .units-header h2 {
        font-size: 1.8rem;
    }
    
    .units-subtitle {
        font-size: 0.9rem;
    }
    
    .units-grid {
        gap: 1rem;
        padding: 0 0.5rem;
    }
    
    .unit-image-container {
        padding: 1.5rem;
    }
    
    .unit-image {
        width: 50px;
        height: 50px;
    }
    
    .unit-content {
        padding: 0 1rem 1rem 1rem;
    }
    
    .unit-name {
        font-size: 1.2rem;
    }
    
    .unit-ability {
        padding: 0.75rem;
        font-size: 0.8rem;
    }
    
    .unit-biography {
        padding: 0.75rem;
    }
    
    .unit-biography p {
        font-size: 0.8rem;
    }

    /* Battle mobile responsive */
    .battle-section {
        padding: 2rem 0;
    }

    .battle-header h2 {
        font-size: 1.8rem;
    }

    .battle-subtitle {
        font-size: 0.9rem;
        padding: 0 0.5rem;
    }

    .battle-content {
        grid-template-columns: 1fr;
        padding: 0 0.5rem;
        gap: 1.5rem;
    }

    .recent-matches-wrapper,
    .top-players-wrapper {
        padding: 1rem;
    }

    .recent-matches-header,
    .top-players-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .recent-matches-header h3,
    .top-players-header h3 {
        font-size: 1.1rem;
    }

    .match-item {
        padding: 1rem;
    }

    .match-title {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .match-battle {
        flex-direction: column;
        gap: 0.75rem;
    }

    .player-section {
        min-width: 100%;
        padding: 0.5rem;
    }

    .vs-divider {
        min-width: auto;
    }

    .match-actions {
        margin-top: 0.5rem;
    }

    .player-item {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .player-avatar {
        width: 30px;
        height: 30px;
    }

    .player-details {
        gap: 0.125rem;
    }

    .player-username {
        font-size: 0.9rem;
    }

    .player-stats {
        gap: 0.25rem;
        font-size: 0.7rem;
        flex-wrap: wrap;
    }

    .player-level {
        font-size: 0.7rem;
        padding: 0.125rem 0.375rem;
        min-width: 45px;
    }
    
    /* Profile Modal Responsive */
    #user-profile-modal .modal-content {
        max-width: 95vw;
        margin: 5vh auto;
        max-height: 90vh;
    }
    
    .profile-avatar-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }
    
    .username-change-section {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .username-change-section input {
        width: 100%;
    }
    
    .custom-file-upload-label {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
} 

/* Match Item 2-Row Layout Styles */
.match-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.match-battle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.players-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 200px;
}

.player-name.winner {
    color: #34d399 !important;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(52, 211, 153, 0.4);
}

.winner-indicator {
    font-size: 0.75rem;
    color: #fbbf24;
    font-weight: 600;
    margin-left: 0.5rem;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 5px rgba(251, 191, 36, 0.5); }
    to { text-shadow: 0 0 15px rgba(251, 191, 36, 0.8); }
}

/* Decorative floating elements for action buttons column */
.action-buttons-column::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 10%;
    width: 80px;
    height: 80px;
    background: url('imgs/heroes/trarex_blue.png') center/contain no-repeat;
    opacity: 0.2;
    animation: float-left 6s ease-in-out infinite;
    z-index: 1;
}

.action-buttons-column::after {
    content: '';
    position: absolute;
    bottom: 15%;
    right: 15%;
    width: 70px;
    height: 70px;
    background: url('imgs/assassin_red.png') center/contain no-repeat;
    opacity: 0.25;
    animation: float-right 8s ease-in-out infinite reverse;
    z-index: 1;
}

@keyframes float-left {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.2;
    }
    50% {
        transform: translateY(-15px) rotate(5deg);
        opacity: 0.3;
    }
}

@keyframes float-right {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.25;
    }
    50% {
        transform: translateY(-10px) rotate(-5deg);
        opacity: 0.35;
    }
}

/* Enhanced decorative particles */
.action-buttons-wrapper::before {
    content: '';
    position: absolute;
    top: -15px;
    right: -15px;
    width: 30px;
    height: 30px;
    background: radial-gradient(circle, 
        rgba(255, 107, 53, 0.8) 0%, 
        rgba(255, 107, 53, 0.4) 40%, 
        transparent 70%
    );
    border-radius: 50%;
    animation: sparkle 3s ease-in-out infinite;
    z-index: 3;
    box-shadow: 0 0 15px rgba(255, 107, 53, 0.5);
}

.action-buttons-wrapper::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: -20px;
    width: 35px;
    height: 35px;
    background: radial-gradient(circle, 
        rgba(255, 171, 112, 0.7) 0%, 
        rgba(255, 140, 66, 0.3) 40%, 
        transparent 70%
    );
    border-radius: 50%;
    animation: sparkle 4s ease-in-out infinite reverse;
    z-index: 3;
    box-shadow: 0 0 20px rgba(255, 171, 112, 0.4);
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0.4;
        transform: scale(0.8) rotate(0deg);
    }
    25% {
        opacity: 0.7;
        transform: scale(1.1) rotate(90deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.3) rotate(180deg);
    }
    75% {
        opacity: 0.7;
        transform: scale(1.1) rotate(270deg);
    }
}

/* Mobile responsive for profile modal */
@media (max-width: 768px) {
    .profile-stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .profile-match-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stat-item-profile {
        padding: 0.5rem;
    }
    
    .profile-avatar-section {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .username-change-section {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .collapsible-content {
        padding: 0.75rem;
    }
    
    .referral-input-inline {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
    
    .referral-input-inline label {
        margin-bottom: 0.25rem;
    }
}

@media (max-width: 480px) {
    .profile-match-stats {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .stat-item-profile {
        padding: 0.4rem;
    }
    
    .stat-item-profile .stat-label {
        font-size: 0.7rem;
    }
    
    .stat-item-profile .stat-value {
        font-size: 1rem;
    }
    
    /* Welcome features mobile responsive */
    .welcome-wrapper {
        padding: 1rem;
    }

    .feature-list {
        gap: 1rem;
        padding: 0 0.5rem;
    }

    .feature-item {
        flex: 0 0 250px;
        padding: 1.25rem;
    }

    .feature-icon {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }

    .feature-details h3 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .feature-details p {
        font-size: 0.9rem;
        line-height: 1.6;
    }
}

@media (max-width: 600px) {
    .action-buttons {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
    }
    
    .btn-hero {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
        min-width: 160px;
        flex: 1 1 calc(50% - 0.375rem);
        max-width: 220px;
    }
    
    /* Ensure third button takes full width on new row */
    .btn-hero:nth-child(3) {
        flex: 1 1 100%;
        max-width: 280px;
    }
}


