/**
 * StreetWarz Idle - Main Stylesheet
 * Modern, accessible, and performant CSS for the main website
 */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.2rem;
}

.logo img {
    width: 40px;
    height: 40px;
}

/* Authentication */
.auth-btn {
    background: #ff6b35;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.3s;
}

.auth-btn:hover {
    background: #ff8c42;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
}

.user-name {
    font-weight: 600;
}

.user-stats {
    display: flex;
    gap: 10px;
    font-size: 0.9rem;
}

.stat {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 0;
    color: white;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #ff6b35, #ffad5a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Buttons */
.cta-button {
    background: linear-gradient(45deg, #ff6b35, #ff8c42);
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.3s, box-shadow 0.3s;
    margin: 10px;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 107, 53, 0.3);
}

/* Features Section */
.features {
    padding: 4rem 0;
    background: rgba(255, 255, 255, 0.05);
}

.features h2 {
    text-align: center;
    color: white;
    margin-bottom: 3rem;
    font-size: 2.5rem;
}

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

.feature-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card h3 {
    margin-bottom: 1rem;
    color: #ff6b35;
    font-size: 1.2rem;
}

/* Pre-Registration Section */
.pre-register {
    padding: 4rem 0;
    text-align: center;
}

.pre-register h2 {
    color: white;
    margin-bottom: 2rem;
    font-size: 2.5rem;
}

.register-form {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 10px;
    max-width: 500px;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: white;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

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

.form-group input:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.3);
}

/* Footer */
footer {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal h2 {
    color: white;
    margin-bottom: 1rem;
    text-align: center;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #ff6b35;
}

/* Message Styles */
.success-message {
    background: #4caf50;
    color: white;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    text-align: center;
    animation: messageSlideIn 0.3s ease;
}

.error-message {
    background: #f44336;
    color: white;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    text-align: center;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Rewards Roadmap */
.rewards-roadmap {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    text-align: center;
}

.rewards-roadmap h3 {
    color: white;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.progress-container {
    margin-bottom: 2rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, #ff6b35, #ff8c42);
    width: 0%;
    transition: width 0.5s ease;
}

.progress-text {
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
}

.milestones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.milestone {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    color: white;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.milestone.unlocked {
    border-color: #4caf50;
    background: rgba(76, 175, 80, 0.2);
    animation: milestoneUnlock 0.5s ease;
}

.milestone.next {
    border-color: #ff6b35;
    background: rgba(255, 107, 53, 0.2);
    animation: milestoneNext 1s ease infinite alternate;
}

@keyframes milestoneUnlock {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes milestoneNext {
    0% {
        box-shadow: 0 0 5px rgba(255, 107, 53, 0.3);
    }
    100% {
        box-shadow: 0 0 15px rgba(255, 107, 53, 0.6);
    }
}

.milestone-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.milestone-count {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.milestone-reward {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip to Content Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #ff6b35;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
    font-weight: bold;
}

.skip-link:focus {
    top: 6px;
}

/* FAQ Section */
.faq {
    padding: 5rem 0;
    background: linear-gradient(135deg, #16213e 0%, #1a1a2e 100%);
}

.faq h2 {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
}

.faq-grid {
    display: grid;
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 107, 53, 0.3);
    transform: translateY(-2px);
}

.faq-item h3 {
    background: rgba(255, 107, 53, 0.1);
    padding: 1.5rem;
    margin: 0;
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: none;
    width: 100%;
    text-align: left;
}

.faq-item h3:hover {
    background: rgba(255, 107, 53, 0.2);
}

.faq-item h3:focus {
    outline: 2px solid #ff6b35;
    outline-offset: -2px;
    background: rgba(255, 107, 53, 0.2);
}

.faq-item h3::after {
    content: '+';
    font-size: 1.5rem;
    color: #ff6b35;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.faq-item h3[aria-expanded="true"]::after {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-answer:not([hidden]) {
    max-height: 500px;
    padding: 1.5rem;
}

.faq-answer p {
    color: #cccccc;
    line-height: 1.6;
    margin: 0;
}

/* Focus styles for accessibility */
a:focus,
button:focus,
input:focus,
.modal:focus {
    outline: 2px solid #ff6b35;
    outline-offset: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .milestones-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cta-button {
        width: 100%;
        margin: 10px 0;
    }
    
    .register-form {
        margin: 0 1rem;
    }
    
    /* Game UI Mobile Styles */
    .game-main {
        padding: 15px;
    }
    
    .player-stats {
        gap: 15px;
        justify-content: space-between;
    }
    
    .stat-item {
        min-width: 70px;
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .game-tabs {
        overflow-x: auto;
        justify-content: flex-start;
        gap: 8px;
        padding: 8px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .game-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .tab-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
        flex-shrink: 0;
    }
    
    .tab-content {
        padding: 20px 15px;
    }
    
    .business-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .business-card {
        padding: 15px;
    }
    
    .business-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .btn {
        padding: 12px;
        font-size: 0.95rem;
    }
    
    .enemy-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .health-bars {
        gap: 10px;
    }
    
    .battle-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .squad-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .equipment-slots {
        gap: 20px;
    }
    
    .equipment-slot {
        width: 100px;
        height: 100px;
    }
    
    .casino-games {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .notification {
        right: 15px;
        left: 15px;
        max-width: none;
        top: 80px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero {
        padding: 1.5rem 0;
    }
    
    .features {
        padding: 2rem 0;
    }
    
    .pre-register {
        padding: 2rem 0;
    }
    
    .milestones-grid {
        grid-template-columns: 1fr;
    }
    
    /* Game UI Small Mobile Styles */
    .top-hud {
        padding: 10px 15px;
    }
    
    .player-stats {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .stat-item {
        min-width: 60px;
        padding: 5px 10px;
        font-size: 0.8rem;
        gap: 5px;
    }
    
    .stat-item i {
        font-size: 1rem;
    }
    
    .game-main {
        padding: 10px;
    }
    
    .tab-content {
        padding: 15px 10px;
    }
    
    .business-section h2,
    .campaign-section h2,
    .allies-section h2,
    .equipment-section h2,
    .casino-section h2 {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }
    
    .business-card {
        padding: 12px;
    }
    
    .business-header {
        gap: 8px;
        margin-bottom: 12px;
    }
    
    .business-icon {
        font-size: 1.5rem;
    }
    
    .business-info h3 {
        font-size: 1.1rem;
    }
    
    .business-stat {
        padding: 6px 8px;
    }
    
    .campaign-stage {
        padding: 15px;
    }
    
    .stage-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .stage-info h3 {
        font-size: 1.2rem;
    }
    
    .enemy-stats {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .enemy-stat {
        padding: 8px;
    }
    
    .battle-area {
        padding: 15px;
    }
    
    .health-bars {
        flex-direction: column;
        gap: 15px;
    }
    
    .squad-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .squad-slot {
        max-width: 250px;
        margin: 0 auto;
    }
    
    .equipment-slots {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .equipment-slot {
        width: 90px;
        height: 90px;
    }
    
    .equipment-slot i {
        font-size: 2rem;
    }
    
    .casino-game {
        padding: 20px 15px;
    }
    
    .casino-game i {
        font-size: 2.5rem;
    }
    
    .casino-game h3 {
        font-size: 1.2rem;
    }
    
    .notification {
        padding: 12px 15px;
        font-size: 0.9rem;
        top: 70px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .feature-card,
    .register-form,
    .rewards-roadmap {
        border: 2px solid white;
    }
    
    .cta-button {
        border: 2px solid white;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Game UI Styles */
.game-ui {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

/* Top HUD */
.top-hud {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 50;
}

.player-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 80px;
    justify-content: center;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.2);
}

.stat-item i {
    color: #ff6b35;
    font-size: 1.1rem;
}

/* Game Main Area */
.game-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 20px;
}

/* Navigation Tabs */
.game-tabs {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 25px;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow-x: auto;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    min-width: max-content;
    white-space: nowrap;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-1px);
}

.tab-btn.active {
    background: linear-gradient(45deg, #ff6b35, #ff8c42);
    color: white;
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.3);
}

.tab-btn i {
    font-size: 1.1rem;
}

/* Tab Content */
.tab-content {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-panel.active {
    display: block;
}

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

/* Business Section */
.business-section h2,
.campaign-section h2,
.allies-section h2,
.equipment-section h2,
.casino-section h2 {
    color: white;
    margin-bottom: 20px;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.business-section h2 i,
.campaign-section h2 i,
.allies-section h2 i,
.equipment-section h2 i,
.casino-section h2 i {
    color: #ff6b35;
}

.business-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.business-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    color: white;
}

.business-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.business-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.business-icon {
    font-size: 2rem;
    color: #ff6b35;
}

.business-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.2rem;
}

.business-info p {
    margin: 0;
    opacity: 0.8;
    font-size: 0.9rem;
}

.business-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 15px 0;
}

.business-stat {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 12px;
    border-radius: 6px;
    text-align: center;
}

.business-stat label {
    display: block;
    font-size: 0.8rem;
    opacity: 0.7;
    margin-bottom: 2px;
}

.business-stat span {
    font-weight: 600;
    font-size: 0.95rem;
}

.business-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn {
    background: linear-gradient(45deg, #ff6b35, #ff8c42);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    flex: 1;
    font-size: 0.9rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.4);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.1);
}

/* Campaign Section */
.campaign-stage {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
    color: white;
}

.stage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.stage-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.4rem;
    color: #ff6b35;
}

.stage-info p {
    margin: 0;
    opacity: 0.8;
}

.enemy-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.enemy-stat {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}

.enemy-stat i {
    color: #ff6b35;
    font-size: 1.2rem;
    margin-bottom: 5px;
    display: block;
}

.battle-area {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.health-bars {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.health-bar {
    flex: 1;
    text-align: center;
}

.health-bar h4 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
}

.health-progress {
    background: rgba(255, 255, 255, 0.1);
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.health-fill {
    height: 100%;
    background: linear-gradient(45deg, #4caf50, #66bb6a);
    transition: width 0.3s ease;
    border-radius: 10px;
}

.health-fill.low {
    background: linear-gradient(45deg, #f44336, #ef5350);
}

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

/* Allies Section */
.squad-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.squad-slot {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.squad-slot:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #ff6b35;
    transform: translateY(-3px);
}

.ally-card {
    text-align: center;
    color: white;
    padding: 20px;
}

.ally-card img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 10px;
    border: 2px solid #ff6b35;
}

.ally-card h4 {
    margin: 10px 0 5px 0;
    font-size: 1.1rem;
}

.empty-slot {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    padding: 20px;
}

.empty-slot i {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

.recruit-section {
    text-align: center;
    margin-top: 25px;
}

/* Equipment Section */
.equipment-slots {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.equipment-slot {
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
}

.equipment-slot:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #ff6b35;
    color: white;
    transform: translateY(-3px);
}

.equipment-slot i {
    font-size: 2.5rem;
    margin-bottom: 8px;
    color: #ff6b35;
}

.equipment-slot span {
    font-weight: 600;
    font-size: 0.9rem;
}

.equipment-inventory {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Casino Section */
.casino-games {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.casino-game {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 30px 20px;
    text-align: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.casino-game:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(255, 107, 53, 0.2);
}

.casino-game i {
    font-size: 3rem;
    color: #ff6b35;
    margin-bottom: 15px;
    display: block;
}

.casino-game h3 {
    margin: 0 0 10px 0;
    font-size: 1.3rem;
}

.casino-game p {
    margin: 0;
    opacity: 0.8;
    font-size: 0.95rem;
}

/* Notifications */
.notification {
    position: fixed;
    top: 90px;
    right: 20px;
    background: linear-gradient(45deg, #ff6b35, #ff8c42);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: notificationSlide 0.3s ease;
    max-width: 300px;
    word-wrap: break-word;
}

.notification.success {
    background: linear-gradient(45deg, #4caf50, #66bb6a);
}

.notification.error {
    background: linear-gradient(45deg, #f44336, #ef5350);
}

.notification.level {
    background: linear-gradient(45deg, #9c27b0, #ba68c8);
}

@keyframes notificationSlide {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Loading States */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: white;
    flex-direction: column;
    gap: 15px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-left: 4px solid #ff6b35;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Game Container */
#game-container {
    display: none;
}

#game-container.active {
    display: block;
}

/* Error Handling and UX Styles */

/* Notification Container */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    max-width: 400px;
    pointer-events: none;
}

/* Individual Notifications */
.notification {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    margin-bottom: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    border-left: 4px solid;
    overflow: hidden;
}

.notification.success {
    border-left-color: #4caf50;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(129, 199, 132, 0.05));
}

.notification.error {
    border-left-color: #f44336;
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.1), rgba(239, 83, 80, 0.05));
}

.notification.warning {
    border-left-color: #ff9800;
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.1), rgba(255, 183, 77, 0.05));
}

.notification.info {
    border-left-color: #2196f3;
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.1), rgba(100, 181, 246, 0.05));
}

/* Notification Content */
.notification-content {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    gap: 12px;
}

.notification-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.notification.success .notification-icon {
    color: #4caf50;
}

.notification.error .notification-icon {
    color: #f44336;
}

.notification.warning .notification-icon {
    color: #ff9800;
}

.notification.info .notification-icon {
    color: #2196f3;
}

.notification-message {
    flex: 1;
    color: #333;
    font-weight: 500;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.notification-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

/* Error Modal */
.error-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    animation: fadeIn 0.3s ease;
}

.error-modal {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.error-modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 25px 25px 15px;
    gap: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.error-modal-header h3 {
    color: white;
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.error-icon {
    font-size: 2rem;
    color: #ff6b35;
}

.error-modal-body {
    padding: 25px;
    color: #ccc;
    line-height: 1.6;
    text-align: center;
}

.error-modal-actions {
    display: flex;
    gap: 15px;
    padding: 15px 25px 25px;
    justify-content: center;
}

.error-action-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(45deg, #ff6b35, #ff8c42);
    color: white;
}

.error-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2500;
    animation: fadeIn 0.3s ease;
}

.loading-content {
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left: 4px solid #ff6b35;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-message {
    font-size: 1.2rem;
    font-weight: 500;
    margin: 0;
    color: #fff;
}

.loading-dots {
    display: flex;
    gap: 8px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff6b35;
    animation: loadingDots 1.5s ease-in-out infinite;
}

.loading-dots span:nth-child(1) {
    animation-delay: 0ms;
}

.loading-dots span:nth-child(2) {
    animation-delay: 150ms;
}

.loading-dots span:nth-child(3) {
    animation-delay: 300ms;
}

@keyframes loadingDots {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Safe Mode Styles */
body.safe-mode {
    filter: grayscale(50%);
}

body.safe-mode::before {
    content: 'SAFE MODE';
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(45deg, #ff6b35, #ff8c42);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: bold;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.safe-mode .btn:disabled {
    opacity: 0.3 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* Input Validation Styles */
.input-error {
    border-color: #f44336 !important;
    box-shadow: 0 0 10px rgba(244, 67, 54, 0.3) !important;
}

.input-error::placeholder {
    color: rgba(244, 67, 54, 0.6) !important;
}

.validation-message {
    display: block;
    color: #f44336;
    font-size: 0.85rem;
    margin-top: 5px;
    font-weight: 500;
}

.validation-message.success {
    color: #4caf50;
}

/* Progress Indicators */
.progress-indicator {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b35, #ff8c42);
    border-radius: 2px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressShimmer 2s infinite;
}

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

/* Connection Status */
.connection-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 1500;
    display: none;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
}

.connection-status.offline {
    display: flex;
    background: rgba(244, 67, 54, 0.9);
    color: white;
}

.connection-status.reconnecting {
    display: flex;
    background: rgba(255, 152, 0, 0.9);
    color: white;
}

.connection-status.online {
    display: flex;
    background: rgba(76, 175, 80, 0.9);
    color: white;
    animation: fadeOut 3s forwards;
}

@keyframes fadeOut {
    0%, 70% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        display: none;
    }
}

/* Story Campaign Styles */

.story-campaign-container {
    color: white;
}

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

.campaign-header h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ff6b35;
}

.act-indicator {
    display: flex;
    align-items: center;
    gap: 15px;
}

.act-label {
    background: linear-gradient(45deg, #ff6b35, #ff8c42);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 0.9rem;
}

.faction-label {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.current-quest-panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.quest-info h3 {
    color: #ff6b35;
    margin: 0 0 10px 0;
    font-size: 1.3rem;
}

.quest-description {
    color: #ccc;
    margin: 10px 0;
    line-height: 1.5;
}

.quest-giver {
    color: #aaa;
    font-style: italic;
    margin: 5px 0;
}

.quest-objectives {
    margin-top: 15px;
}

.quest-objectives h4 {
    color: white;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

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

.objective {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    color: #ccc;
    transition: all 0.3s ease;
}

.objective.completed {
    color: #4caf50;
    text-decoration: line-through;
    opacity: 0.7;
}

.objective.completed i {
    color: #4caf50;
}

.objective.active i {
    color: #ff6b35;
}

.no-quest {
    text-align: center;
    padding: 40px 20px;
    color: #ccc;
}

.no-quest h3 {
    color: #ff6b35;
    margin-bottom: 10px;
}

.story-progress {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.progress-stats {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.stat-item:last-child {
    margin-bottom: 0;
}

.stat-label {
    color: #aaa;
    font-size: 0.9rem;
}

.stat-value {
    color: white;
    font-weight: 600;
}

.story-actions-list {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.character-gallery {
    margin-top: 20px;
}

.character-gallery h4 {
    color: white;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.character-portrait-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.character-portrait-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.2);
}

.character-thumb {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-bottom: 8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    object-fit: cover;
}

.character-name {
    display: block;
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.relationship {
    display: block;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 10px;
    text-transform: uppercase;
    font-weight: 500;
}

.relationship.ally {
    background: rgba(76, 175, 80, 0.3);
    color: #4caf50;
}

.relationship.enemy {
    background: rgba(244, 67, 54, 0.3);
    color: #f44336;
}

.relationship.neutral {
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
}

.relationship.creditor {
    background: rgba(255, 152, 0, 0.3);
    color: #ff9800;
}

.relationship.dead {
    background: rgba(158, 158, 158, 0.3);
    color: #9e9e9e;
}

/* Story Dialogue Modal */
.story-dialogue-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.story-dialogue-modal.active {
    opacity: 1;
}

.dialogue-container {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: dialogueSlideUp 0.3s ease;
}

@keyframes dialogueSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dialogue-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 25px 25px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.character-portrait {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid #ff6b35;
    object-fit: cover;
}

.character-name {
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}

.dialogue-content {
    padding: 25px;
}

.dialogue-text {
    color: #ccc;
    line-height: 1.6;
    font-size: 1.1rem;
    margin: 0;
}

.dialogue-choices {
    padding: 15px 25px 25px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dialogue-choice-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 15px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.dialogue-choice-btn:hover {
    background: linear-gradient(45deg, #ff6b35, #ff8c42);
    border-color: #ff6b35;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.3);
}

.choice-text {
    font-weight: 500;
    line-height: 1.4;
}

/* Story Cutscene Modal */
.story-cutscene-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.story-cutscene-modal.active {
    opacity: 1;
}

.cutscene-container {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    animation: cutsceneSlideUp 0.3s ease;
}

@keyframes cutsceneSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.cutscene-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 25px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cutscene-title {
    color: #ff6b35;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.cutscene-skip-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cutscene-skip-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.cutscene-content {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
}

.scene-text {
    color: #ccc;
    line-height: 1.7;
    font-size: 1.2rem;
    margin: 0;
    min-height: 100px;
}

.cutscene-controls {
    padding: 15px 25px 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.cutscene-continue-btn {
    background: linear-gradient(45deg, #ff6b35, #ff8c42);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cutscene-continue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.4);
}

/* Mobile responsiveness for story modals */
@media (max-width: 768px) {
    .dialogue-container,
    .cutscene-container {
        width: 95%;
        margin: 10px;
    }
    
    .dialogue-content,
    .cutscene-content {
        padding: 20px;
    }
    
    .dialogue-text,
    .scene-text {
        font-size: 1rem;
    }
    
    .character-portrait {
        width: 50px;
        height: 50px;
    }
    
    .character-name {
        font-size: 1.1rem;
    }
}

/* Dark mode support (future-proofing) */
@media (prefers-color-scheme: dark) {
    /* Already using dark theme, but could add variations here */
}