/* Enhanced Desktop & Mobile UI */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    color: #ffffff;
    min-height: 100vh;
    line-height: 1.6;
}

/* Desktop-First Container System */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.wide-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

/* Enhanced Navigation */
.navbar {
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(76, 175, 80, 0.2);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.nav-logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: #4CAF50;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 8px;
    align-items: center;
}

.nav-links li a {
    color: #ffffff;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.nav-links li a:hover {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    transform: translateY(-2px);
}

/* Enhanced Cards */
.dashboard-card {
    background: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 30px;
    margin: 20px 0;
    border: 1px solid rgba(76, 175, 80, 0.1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
    border-color: rgba(76, 175, 80, 0.3);
}

/* Enhanced Button System */
.btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    min-height: 48px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
    background: linear-gradient(135deg, #45a049, #4CAF50);
}

.btn:active {
    transform: translateY(-1px);
}

.btn-secondary {
    background: linear-gradient(135deg, #666, #555);
    box-shadow: 0 4px 15px rgba(102, 102, 102, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #777, #666);
    box-shadow: 0 8px 25px rgba(102, 102, 102, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #d32f2f, #f44336);
    box-shadow: 0 8px 25px rgba(244, 67, 54, 0.4);
}

/* Enhanced Grid System */
.btn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

/* Desktop: 3 columns for large screens */
@media (min-width: 1200px) {
    .btn-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Desktop: 2 columns for medium screens */
@media (min-width: 768px) and (max-width: 1199px) {
    .btn-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Enhanced Character Cards */
.character-card {
    background: rgba(42, 42, 42, 0.9);
    backdrop-filter: blur(15px);
    border-radius: 16px;
    padding: 24px;
    margin: 16px 0;
    border-left: 4px solid #4CAF50;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.character-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.character-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.stat {
    text-align: center;
    padding: 12px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.stat-value {
    font-size: 1.4rem;
    font-weight: bold;
    color: #4CAF50;
    margin-bottom: 4px;
}

/* Enhanced Forms */
input, select, textarea {
    background: rgba(42, 42, 42, 0.8);
    border: 2px solid rgba(76, 175, 80, 0.3);
    border-radius: 12px;
    padding: 14px 18px;
    color: #ffffff;
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
    background: rgba(42, 42, 42, 0.95);
}

/* Enhanced Hero Section */
.hero-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    background: 
        radial-gradient(circle at 20% 80%, rgba(76, 175, 80, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(33, 150, 243, 0.1) 0%, transparent 50%);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #4CAF50, #8BC34A);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.4rem;
    color: #b0b0b0;
    margin-bottom: 40px;
    line-height: 1.5;
}

/* Enhanced Message System */
.message {
    position: fixed;
    top: 100px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 12px;
    font-weight: 600;
    z-index: 10000;
    transform: translateX(400px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
}

.message.show {
    transform: translateX(0);
}

.message.success {
    background: rgba(76, 175, 80, 0.9);
    border: 1px solid rgba(76, 175, 80, 0.5);
}

.message.error {
    background: rgba(244, 67, 54, 0.9);
    border: 1px solid rgba(244, 67, 54, 0.5);
}

/* Mobile Auth Pages */
.mobile-input {
    font-size: 16px !important; /* Prevents zoom on iOS */
    padding: 12px;
    min-height: 48px;
    border-radius: 8px;
    border: 2px solid #ddd;
    width: 100%;
    box-sizing: border-box;
}

.mobile-input:focus {
    border-color: #4CAF50;
    outline: none;
}

.mobile-link {
    display: inline-block;
    padding: 10px;
    min-height: 44px;
    line-height: 24px;
    text-decoration: none;
    color: #4CAF50;
}

.mobile-link:hover {
    text-decoration: underline;
}

/* Mobile Form Optimizations */
@media (max-width: 768px) {
    .auth-container {
        padding: 10px;
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .auth-card, .card {
        width: 100%;
        max-width: 400px;
        margin: 0;
        padding: 20px;
        border-radius: 12px;
    }
    
    .auth-form .form-group {
        margin-bottom: 20px;
    }
    
    .auth-form label {
        font-size: 16px;
        margin-bottom: 8px;
        display: block;
    }
    
    .auth-links {
        display: flex;
        flex-direction: column;
        gap: 10px;
        text-align: center;
        margin-top: 20px;
    }
    
    .mobile-text {
        font-size: 14px;
        color: #666;
        text-align: center;
    }
}

/* Mobile Navigation */
.mobile-nav {
    background: #2c3e50;
    padding: 10px;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-nav .nav-brand {
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
}

.mobile-nav .nav-links {
    display: flex;
    gap: 5px;
}

.mobile-nav .btn-sm {
    padding: 8px 12px;
    font-size: 14px;
    min-height: 36px;
}

/* Mobile Layout Adjustments */
.welcome-section {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 15px;
    align-items: center;
}

.mobile-text {
    font-size: 0.9rem;
    color: #666;
}

.mobile-status {
    text-align: center;
    padding: 10px;
}

.status-icon {
    font-size: 2rem;
    margin-bottom: 5px;
}

.status-text {
    color: #4CAF50;
    font-weight: bold;
    font-size: 0.9rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.mobile-stats .stat-card {
    padding: 12px;
    text-align: center;
}

.mobile-btn {
    width: 100%;
    min-height: 48px;
    font-size: 16px;
    font-weight: bold;
}

.mobile-actions {
    margin: 15px 0;
}

.mobile-quests .quest-card {
    padding: 15px;
    margin-bottom: 10px;
}

.mobile-achievements .achievement-card {
    padding: 15px;
    margin-bottom: 10px;
}

/* Mobile Battle Interface */
.mobile-battle-interface {
    padding: 10px;
}

.mobile-battle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.mobile-character-display {
    display: flex;
    justify-content: space-between;
    margin: 15px 0;
}

.mobile-character-card {
    flex: 1;
    margin: 0 5px;
    padding: 10px;
    background: white;
    border-radius: 8px;
    border: 2px solid #ddd;
    text-align: center;
}

.mobile-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #e74c3c;
    margin: 0 10px;
}

/* Mobile Shop Interface */
.mobile-shop-header {
    position: sticky;
    top: 60px;
    background: white;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
    z-index: 50;
}

.mobile-category-tabs {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding: 5px 0;
}

.mobile-category-tabs .btn {
    white-space: nowrap;
    min-width: 80px;
    font-size: 14px;
}

.mobile-equipment-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px 0;
}

/* Mobile Tournament Interface */
.mobile-tournament-card {
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    background: white;
    border: 1px solid #ddd;
}

.mobile-tournament-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.mobile-tournament-actions {
    display: flex;
    gap: 10px;
}

/* Mobile Social Interface */
.mobile-chat-container {
    height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
}

.mobile-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background: #f8f9fa;
}

.mobile-chat-input {
    padding: 15px;
    background: white;
    border-top: 1px solid #ddd;
    display: flex;
    gap: 10px;
}

.mobile-chat-input input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 16px;
}

.mobile-chat-send {
    padding: 10px 20px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 16px;
}

/* Mobile Responsive Utilities */
@media (max-width: 768px) {
    .welcome-section {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .mobile-text {
        display: block;
    }
    
    .desktop-text {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .mobile-character-display {
        flex-direction: column;
    }
    
    .mobile-character-card {
        margin: 5px 0;
    }
    
    .mobile-vs {
        margin: 10px 0;
    }
}

@media (max-width: 480px) {
    .mobile-nav .nav-brand {
        font-size: 1rem;
    }
    
    .mobile-nav .btn-sm {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .mobile-tournament-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .mobile-tournament-actions {
        width: 100%;
    }
    
    .mobile-tournament-actions .btn {
        flex: 1;
    }
}

/* PWA Specific Styles */
@media (display-mode: standalone) {
    .mobile-nav {
        padding-top: env(safe-area-inset-top, 10px);
    }
    
    .mobile-chat-input {
        padding-bottom: env(safe-area-inset-bottom, 15px);
    }
}

/* Dark mode support for mobile */
@media (prefers-color-scheme: dark) {
    .mobile-nav {
        background: #1a1a1a;
    }
    
    .mobile-character-card {
        background: #2d2d2d;
        color: white;
        border-color: #444;
    }
    
    .mobile-chat-messages {
        background: #1a1a1a;
    }
    
    .mobile-chat-input {
        background: #2d2d2d;
        border-color: #444;
    }
    
    .mobile-chat-input input {
        background: #1a1a1a;
        color: white;
        border-color: #444;
    }
}
@media (max-width: 768px) {
    /* Touch-friendly buttons */
    .btn {
        min-height: 48px;
        padding: 12px 20px;
        font-size: 16px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Larger tap targets */
    .btn-grid .btn {
        min-height: 56px;
        padding: 16px;
    }
    
    /* Mobile navigation */
    .nav-container {
        flex-direction: column;
        padding: 10px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 10px;
    }
    
    .nav-links .btn {
        flex: 1;
        min-width: 120px;
    }
    
    /* Mobile containers */
    .container, .wide-container {
        padding: 10px;
        margin: 0;
    }
    
    .dashboard-card {
        margin-bottom: 15px;
        padding: 15px;
        border-radius: 8px;
    }
    
    /* Mobile forms */
    .form-group input, .form-group select, .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
        min-height: 48px;
    }
    
    /* Mobile tables */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        font-size: 14px;
    }
    
    /* Mobile modals */
    .modal-content {
        width: 95vw;
        max-width: none;
        margin: 20px auto;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    /* Mobile battle interface */
    .battle-container {
        padding: 10px;
    }
    
    .battle-actions {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        padding: 15px;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        z-index: 1000;
    }
    
    .battle-log {
        max-height: 200px;
        margin-bottom: 80px; /* Space for fixed actions */
    }
    
    /* Mobile character cards */
    .character-card {
        margin-bottom: 15px;
    }
    
    .character-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    /* Mobile rewards page */
    .rewards-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .currency-display {
        justify-content: center;
    }
    
    .daily-reward-card {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .quests-grid, .achievements-grid {
        grid-template-columns: 1fr;
    }
    
    /* Mobile shop */
    .shop-grid {
        grid-template-columns: 1fr;
    }
    
    .equipment-card {
        padding: 15px;
    }
    
    /* Mobile tournament brackets */
    .tournament-bracket {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Mobile social features */
    .chat-container {
        height: calc(100vh - 200px);
    }
    
    .chat-input {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 15px;
        background: white;
        border-top: 1px solid #ddd;
    }
    
    .chat-messages {
        padding-bottom: 80px;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .btn {
        font-size: 14px;
        padding: 10px 16px;
    }
    
    .dashboard-card h1 {
        font-size: 1.5rem;
    }
    
    .dashboard-card h2 {
        font-size: 1.3rem;
    }
    
    .stat-card {
        padding: 10px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    /* Compact navigation for very small screens */
    .nav-links .btn {
        padding: 8px 12px;
        font-size: 12px;
        min-width: 80px;
    }
    
    /* Single column layout for very small screens */
    .btn-grid {
        grid-template-columns: 1fr !important;
    }
    
    #quickStats {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Landscape mobile optimizations */
@media (max-width: 768px) and (orientation: landscape) {
    .battle-container {
        display: grid;
        grid-template-columns: 1fr 300px;
        gap: 15px;
        height: 100vh;
    }
    
    .battle-area {
        overflow-y: auto;
    }
    
    .battle-sidebar {
        overflow-y: auto;
    }
    
    .battle-actions {
        position: static;
        box-shadow: none;
    }
}

/* Touch-specific improvements */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .btn:hover {
        transform: none;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .character-card:hover {
        transform: none;
    }
    
    /* Add active states for touch feedback */
    .btn:active {
        transform: scale(0.98);
        background-color: #45a049;
    }
    
    .character-card:active {
        transform: scale(0.98);
    }
    
    /* Larger touch targets for interactive elements */
    .close-btn, .modal-close {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Swipe indicators */
    .swipeable::after {
        content: "← Swipe →";
        display: block;
        text-align: center;
        font-size: 12px;
        color: #666;
        margin-top: 5px;
    }
}
        gap: 15px;
        padding: 15px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    .nav-links li a {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .wide-container {
        padding: 15px;
    }
    
    .dashboard-card {
        padding: 20px;
        margin: 15px 0;
        border-radius: 15px;
    }
    
    .btn-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .btn {
        padding: 16px 24px;
        font-size: 1rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .character-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .message {
        right: 10px;
        left: 10px;
        transform: translateY(-100px);
    }
    
    .message.show {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .nav-logo {
        font-size: 1.4rem;
    }
    
    .dashboard-card {
        padding: 15px;
    }
    
    .btn {
        padding: 14px 20px;
        font-size: 0.9rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .character-card {
        padding: 16px;
    }
    
    .stat {
        padding: 8px;
    }
    
    .stat-value {
        font-size: 1.2rem;
    }
}

/* Class-specific colors */
.class-warrior { border-left-color: #f44336; }
.class-mage { border-left-color: #9c27b0; }
.class-archer { border-left-color: #4caf50; }
.class-rogue { border-left-color: #ff9800; }

/* Battle animations and effects */
@keyframes attackFlash {
    0% { background-color: rgba(255, 68, 68, 0.3); transform: scale(1); }
    50% { background-color: rgba(255, 68, 68, 0.6); transform: scale(1.05); }
    100% { background-color: transparent; transform: scale(1); }
}

@keyframes criticalHit {
    0% { background-color: rgba(255, 215, 0, 0.3); transform: scale(1) rotate(0deg); }
    25% { background-color: rgba(255, 215, 0, 0.8); transform: scale(1.1) rotate(-2deg); }
    75% { background-color: rgba(255, 215, 0, 0.8); transform: scale(1.1) rotate(2deg); }
    100% { background-color: transparent; transform: scale(1) rotate(0deg); }
}

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

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.attack-animation { animation: attackFlash 0.6s ease-in-out; }
.critical-animation { animation: criticalHit 0.8s ease-in-out; }
.fade-in-up { animation: fadeInUp 0.5s ease-out; }
.pulse-animation { animation: pulse 1s ease-in-out infinite; }

/* Loading spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(76, 175, 80, 0.3);
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Tooltips */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(42, 42, 42, 0.95);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.tooltip:hover::after {
    opacity: 1;
}

/* Enhanced accessibility */
.btn:focus,
input:focus,
select:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

/* Performance optimizations */
.character-card,
.dashboard-card,
.btn {
    will-change: transform;
    backface-visibility: hidden;
}

/* Dark theme enhancements */
h1, h2, h3, h4, h5, h6 {
    color: #ffffff;
    margin-bottom: 15px;
}

p {
    color: #cccccc;
    margin-bottom: 10px;
}

/* Form groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #4CAF50;
    font-weight: 600;
}

/* Battle-specific styles */
.battle-summary {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
}

.battle-log {
    max-height: 300px;
    overflow-y: auto;
    background: rgba(42, 42, 42, 0.5);
    border-radius: 10px;
    padding: 15px;
}

.battle-action {
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}

/* Character portraits */
.character-portrait {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 10px;
    border: 3px solid;
    position: relative;
    overflow: hidden;
}

.portrait-warrior { 
    background: linear-gradient(135deg, #f44336, #d32f2f);
    border-color: #f44336;
}

.portrait-mage { 
    background: linear-gradient(135deg, #9c27b0, #7b1fa2);
    border-color: #9c27b0;
}

.portrait-archer { 
    background: linear-gradient(135deg, #4caf50, #388e3c);
    border-color: #4caf50;
}

.portrait-rogue { 
    background: linear-gradient(135deg, #ff9800, #f57c00);
    border-color: #ff9800;
}

/* HP Bars */
.hp-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin: 5px 0;
}

.hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 4px;
    transition: width 0.5s ease-in-out;
}

.hp-fill.low { background: linear-gradient(90deg, #ff4444, #ff6666); }
.hp-fill.critical { background: linear-gradient(90deg, #d32f2f, #f44336); }
/* Enhanced Dashboard Styles */
.stat-card {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.2);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(76, 175, 80, 0.15);
    border-color: rgba(76, 175, 80, 0.4);
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.stat-info {
    flex: 1;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #4CAF50;
    line-height: 1;
}

.stat-label {
    color: #b0b0b0;
    font-size: 0.9rem;
    margin-top: 4px;
}

/* Enhanced Button Layout */
.btn {
    text-align: left;
    justify-content: flex-start;
}

.btn > div {
    flex: 1;
}

/* Mobile Dashboard Optimizations */
@media (max-width: 768px) {
    .dashboard-card > div:first-child {
        grid-template-columns: 1fr !important;
        text-align: center;
        gap: 20px;
    }
    
    .stat-card {
        padding: 15px;
        gap: 12px;
    }
    
    .stat-icon {
        font-size: 2rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .btn {
        text-align: center;
        justify-content: center;
        flex-direction: column;
        gap: 4px;
    }
    
    .btn span {
        font-size: 1.2rem !important;
    }
}

@media (max-width: 480px) {
    #quickStats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px;
    }
    
    .stat-card {
        padding: 12px;
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .stat-icon {
        font-size: 1.8rem;
    }
    
    .stat-number {
        font-size: 1.3rem;
    }
}
/* High contrast button visibility fixes */
.high-contrast .btn {
    background: #000 !important;
    border: 2px solid #fff !important;
    color: #fff !important;
}

.high-contrast .tutorial-restart-btn,
.high-contrast .notification-btn {
    background: #000 !important;
    border: 2px solid #fff !important;
    color: #fff !important;
}

.high-contrast .theme-toggle-btn {
    background: #000 !important;
    border: 2px solid #fff !important;
    color: #fff !important;
}
/* Enhanced Battle Arena Styles */
.battle-arena {
    position: relative;
    overflow: hidden;
    min-height: 500px;
}

.character-display {
    text-align: center;
    padding: 20px;
    position: relative;
}

.character-display[data-username] {
    border: 2px solid rgba(76, 175, 80, 0.3);
    border-radius: 15px;
    background: rgba(42, 42, 42, 0.6);
}

.character-name {
    margin: 10px 0;
    color: #4CAF50;
    font-size: 1.2rem;
}

.character-stats-mini {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}

.stat-mini {
    font-size: 0.9rem;
    color: #ccc;
}

.vs-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.vs-text {
    font-size: 2rem;
    font-weight: bold;
    color: #4CAF50;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
    margin-bottom: 10px;
}

.battle-timer {
    font-size: 1.2rem;
    color: #FFD700;
    font-weight: bold;
}

/* Enhanced HP Bar */
.hp-bar {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    overflow: hidden;
    margin: 10px 0;
    position: relative;
}

.hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 5px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

.hp-fill.low {
    background: linear-gradient(90deg, #FF9800, #FFB74D);
}

.hp-fill.critical {
    background: linear-gradient(90deg, #f44336, #ef5350);
    animation: criticalPulse 1s ease-in-out infinite alternate;
}

@keyframes criticalPulse {
    0% { opacity: 0.8; }
    100% { opacity: 1; }
}

/* Battle Log Enhancements */
.battle-log {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
    max-height: 250px;
    overflow-y: auto;
    margin-top: 20px;
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.battle-action {
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    animation: fadeInUp 0.3s ease-out;
}

.battle-action:last-child {
    border-bottom: none;
}

.critical-action {
    color: #FFD700 !important;
    font-weight: bold !important;
    text-shadow: 0 0 5px #FFD700 !important;
}

/* Mobile Battle Optimizations */
@media (max-width: 768px) {
    .battle-summary {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    .vs-indicator {
        order: 2;
        padding: 10px;
    }
    
    .vs-text {
        font-size: 1.5rem;
    }
    
    .character-display:first-child {
        order: 1;
    }
    
    .character-display:last-child {
        order: 3;
    }
    
    .character-portrait {
        width: 80px !important;
        height: 80px !important;
        font-size: 3rem !important;
    }
    
    .battle-log {
        max-height: 150px;
        font-size: 0.8rem;
    }
}
/* Enhanced Leaderboard Styles */
.leaderboard-table-container {
    overflow-x: auto;
    border-radius: 12px;
    background: rgba(42, 42, 42, 0.6);
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.leaderboard-table th {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    padding: 15px 12px;
    text-align: left;
    font-weight: bold;
    border-bottom: 2px solid rgba(76, 175, 80, 0.3);
}

.leaderboard-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    vertical-align: middle;
}

.leaderboard-table tr:hover {
    background: rgba(76, 175, 80, 0.1);
}

.current-player {
    background: rgba(76, 175, 80, 0.2) !important;
    border: 2px solid rgba(76, 175, 80, 0.5) !important;
}

.rank-cell {
    text-align: center;
    font-weight: bold;
    min-width: 80px;
}

.rank-number {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.rank-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.rank-badge.gold {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
}

.rank-badge.silver {
    background: linear-gradient(135deg, #C0C0C0, #A0A0A0);
    color: #000;
}

.rank-badge.bronze {
    background: linear-gradient(135deg, #CD7F32, #B8860B);
    color: #fff;
}

.player-cell {
    min-width: 120px;
}

.player-name {
    font-weight: bold;
    color: #fff;
    margin-bottom: 2px;
}

.you-badge {
    background: #4CAF50;
    color: white;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: bold;
}

.character-name {
    color: #4CAF50;
    font-weight: 500;
}

.class-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: capitalize;
}

.class-badge.class-warrior {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.class-badge.class-mage {
    background: rgba(156, 39, 176, 0.2);
    color: #9c27b0;
    border: 1px solid rgba(156, 39, 176, 0.3);
}

.class-badge.class-archer {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.class-badge.class-rogue {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.level-badge {
    background: rgba(33, 150, 243, 0.2);
    color: #2196f3;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 0.8rem;
}

.wins-value {
    color: #4CAF50;
    font-weight: bold;
}

.losses-value {
    color: #f44336;
    font-weight: bold;
}

.winrate-value {
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 8px;
}

.winrate-value.excellent {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.winrate-value.good {
    background: rgba(33, 150, 243, 0.2);
    color: #2196f3;
}

.winrate-value.average {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
}

.winrate-value.poor {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.gold-value {
    color: #FFD700;
    font-weight: bold;
}

.xp-value {
    color: #9c27b0;
    font-weight: 500;
}

.battles-value {
    color: #ccc;
    font-weight: 500;
}

/* Player Rank Card */
.player-rank-card {
    margin-top: 30px;
}

.rank-display-large {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 30px;
    align-items: center;
    padding: 20px;
}

.rank-number-large {
    font-size: 3rem;
    font-weight: bold;
    color: #4CAF50;
    text-align: center;
    margin-bottom: 10px;
}

.rank-text {
    font-size: 1.2rem;
    color: #fff;
    text-align: center;
    margin-bottom: 5px;
}

.rank-percentage {
    font-size: 1rem;
    color: #4CAF50;
    text-align: center;
    font-weight: bold;
}

.rank-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Mobile Leaderboard Optimizations */
@media (max-width: 768px) {
    .leaderboard-table {
        font-size: 0.8rem;
    }
    
    .leaderboard-table th,
    .leaderboard-table td {
        padding: 8px 6px;
    }
    
    .rank-display-large {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 20px;
    }
    
    .rank-actions {
        flex-direction: row;
        justify-content: center;
    }
    
    .class-badge {
        font-size: 0.7rem;
        padding: 2px 6px;
    }
    
    .player-name {
        font-size: 0.9rem;
    }
    
    .character-name {
        font-size: 0.8rem;
    }
}
/* Guild Modal Styles */
.guild-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.guild-modal .modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.guild-modal .modal-content {
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

.guild-search {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.guild-search input {
    flex: 1;
}

.guild-list {
    max-height: 400px;
    overflow-y: auto;
}

.guild-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin: 10px 0;
    background: rgba(42, 42, 42, 0.6);
    border-radius: 10px;
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.guild-info h4 {
    color: #4CAF50;
    margin: 0 0 5px 0;
}

.guild-info p {
    color: #ccc;
    margin: 0 0 5px 0;
    font-size: 0.9rem;
}

.guild-info span {
    color: #999;
    font-size: 0.8rem;
}

.members-list {
    max-height: 300px;
    overflow-y: auto;
}

.member-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 15px;
    align-items: center;
    padding: 10px;
    margin: 5px 0;
    background: rgba(42, 42, 42, 0.6);
    border-radius: 8px;
}

.member-role {
    color: #4CAF50;
    font-weight: bold;
    text-transform: capitalize;
}

.member-joined {
    color: #999;
    font-size: 0.8rem;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .guild-modal .modal-content {
        width: 95%;
        padding: 20px;
    }
    
    .guild-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .guild-item button {
        align-self: stretch;
    }
    
    .member-item {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .form-actions {
        flex-direction: column;
    }
}
/* Gem Shop Styles */
.gem-packages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.gem-package {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(76, 175, 80, 0.1));
    border: 2px solid rgba(76, 175, 80, 0.3);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.gem-package:hover {
    transform: translateY(-5px);
    border-color: rgba(76, 175, 80, 0.6);
    box-shadow: 0 10px 25px rgba(76, 175, 80, 0.3);
}

.gem-package.popular {
    border-color: rgba(255, 215, 0, 0.6);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.1));
}

.gem-amount {
    font-size: 1.5rem;
    font-weight: bold;
    color: #4CAF50;
    margin-bottom: 10px;
}

.gem-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
}

.gem-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: bold;
}
