/* ===== RESPONSIVE DESIGN FOR AI GAME HUB ===== */
/* Optimized for Mobile, Tablet, and Desktop devices */

/* ===== DEVICE WARNING MODAL ===== */
.device-warning-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.device-warning-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.warning-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.warning-modal-content {
    position: relative;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 2px solid #d4af37;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    margin: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
    text-align: center;
}

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

.warning-icon {
    font-size: 4rem;
    color: #f39c12;
    margin-bottom: 20px;
    animation: warningPulse 2s infinite;
}

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

.warning-modal-content h2 {
    color: #d4af37;
    font-size: 1.8rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.warning-message {
    color: #ffffff;
    text-align: left;
    margin-bottom: 25px;
    line-height: 1.6;
}

.warning-message p {
    margin-bottom: 15px;
}

.warning-message strong {
    color: #d4af37;
}

.warning-message ul {
    margin: 15px 0;
    padding-left: 20px;
}

.warning-message li {
    margin-bottom: 8px;
    color: #ff6b6b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.warning-message li i {
    color: #f39c12;
    width: 16px;
    text-align: center;
}

.warning-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.warning-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.warning-btn.primary {
    background: linear-gradient(135deg, #d4af37, #f1c40f);
    color: #000;
}

.warning-btn.primary:hover {
    background: linear-gradient(135deg, #f1c40f, #d4af37);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

.warning-btn.secondary {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: #fff;
    border: 1px solid #d4af37;
}

.warning-btn.secondary:hover {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.2);
}

.warning-footer {
    border-top: 1px solid #404040;
    padding-top: 20px;
    margin-top: 20px;
}

.dont-show-again {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #888;
    cursor: pointer;
    font-size: 0.9rem;
}

.dont-show-again input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #d4af37;
}

.dont-show-again:hover {
    color: #d4af37;
}

/* Device-specific tip styling */
.device-specific-tip {
    animation: tipSlideIn 0.5s ease-out 0.3s both;
}

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

/* Enhanced accessibility */
.device-warning-modal[aria-hidden="false"] {
    display: flex;
}

.device-warning-modal[aria-hidden="true"] {
    display: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .warning-modal-content {
        background: #000;
        border: 3px solid #fff;
    }
    
    .warning-btn.primary {
        background: #fff;
        color: #000;
        border: 2px solid #000;
    }
    
    .warning-btn.secondary {
        background: #000;
        color: #fff;
        border: 2px solid #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .warning-modal-content {
        animation: none;
    }
    
    .warning-icon {
        animation: none;
    }
    
    .device-specific-tip {
        animation: none;
    }
    
    .device-warning-modal {
        transition: none;
    }
    
    .warning-btn {
        transition: none;
    }
}

/* Tablet specific adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
    .warning-modal-content {
        max-width: 600px;
        padding: 35px;
    }
    
    .warning-actions {
        flex-direction: row;
    }
    
    .warning-icon {
        font-size: 4.5rem;
    }
}

/* Landscape mobile adjustments */
@media (max-width: 767px) and (orientation: landscape) {
    .warning-modal-content {
        max-height: 85vh;
        padding: 20px;
    }
    
    .warning-icon {
        font-size: 2.5rem;
        margin-bottom: 15px;
    }
    
    .warning-modal-content h2 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }
    
    .warning-message {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }
}

/* ===== RESPONSIVE BREAKPOINTS ===== */
/* Mobile: 320px - 767px */
/* Tablet: 768px - 1023px */
/* Desktop: 1024px+ */

/* ===== MOBILE FIRST APPROACH ===== */

/* ===== GENERAL RESPONSIVE UTILITIES ===== */
.mobile-only {
    display: block;
}

.tablet-only,
.desktop-only {
    display: none;
}

/* ===== NAVIGATION RESPONSIVE ===== */
@media (max-width: 1023px) {
    .navbar {
        padding: 0 15px;
    }
    
    .navbar-container {
        justify-content: space-between;
    }
    
    .navbar-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: linear-gradient(135deg, rgba(0, 0, 0, 0.98), rgba(20, 20, 20, 0.95));
        backdrop-filter: blur(20px);
        transition: left 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
        flex-direction: column;
        justify-content: flex-start;
        padding: 40px 20px;
    }
    
    .navbar-menu.active {
        left: 0;
    }
    
    .navbar-nav {
        flex-direction: column;
        gap: 20px;
        margin-bottom: 40px;
    }
    
    .nav-link {
        padding: 15px 20px;
        border-radius: 12px;
        border: 1px solid rgba(212, 175, 55, 0.3);
        background: rgba(212, 175, 55, 0.05);
        font-size: 1.1em;
        justify-content: center;
        width: 100%;
    }
    
    .nav-link:hover,
    .nav-link.active {
        background: linear-gradient(135deg, #d4af37, #b8860b);
        color: #000;
        transform: translateY(-2px);
    }
    
    .navbar-toggle {
        display: flex;
    }
    
    .github-btn {
        width: 100%;
        justify-content: center;
        padding: 15px;
        font-size: 1.1em;
    }
}

/* ===== HERO SECTION RESPONSIVE ===== */
@media (max-width: 1023px) {
    .hero-header {
        padding: 100px 20px 60px;
        min-height: auto;
        background: 
            radial-gradient(circle at 30% 20%, rgba(212, 175, 55, 0.08) 0%, transparent 40%),
            radial-gradient(circle at 70% 80%, rgba(52, 152, 219, 0.05) 0%, transparent 40%);
    }
    
    .hero-container {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
        max-width: 800px;
        margin: 0 auto;
    }
    
    .hero-content {
        order: 2;
        max-width: 100%;
    }
    
    .hero-visual {
        order: 1;
        justify-self: center;
    }
    
    .hero-badge {
        margin-bottom: 25px;
        display: flex;
        justify-content: center;
    }
    
    .badge-content {
        padding: 10px 18px;
        font-size: 0.95em;
        border-radius: 25px;
    }
    
    .hero-title {
        font-size: 3.2rem;
        margin-bottom: 15px;
        line-height: 1.2;
    }
    
    .title-decoration {
        gap: 12px;
        margin-top: 12px;
    }
    
    .decoration-line {
        width: 50px;
    }
    
    .hero-subtitle {
        margin-bottom: 30px;
    }
    
    .subtitle-main {
        font-size: 1.2rem;
        margin-bottom: 8px;
    }
    
    .subtitle-secondary {
        font-size: 1.05rem;
    }
    
    .hero-features {
        margin-bottom: 35px;
    }
    
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .feature-item {
        padding: 16px;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .feature-icon {
        font-size: 1.5em;
        margin-bottom: 5px;
    }
    
    .feature-text h3 {
        font-size: 1.1em;
        margin-bottom: 4px;
    }
    
    .feature-text p {
        font-size: 0.9em;
        margin: 0;
    }
    
    .hero-cta {
        flex-direction: column;
        gap: 15px;
        align-items: center;
        max-width: 350px;
        margin: 0 auto;
    }
    
    .cta-primary,
    .cta-secondary {
        width: 100%;
        padding: 15px 25px;
        font-size: 1.1em;
        border-radius: 12px;
    }
    
    .ai-brain-container {
        width: 280px;
        height: 280px;
        margin: 0 auto;
    }
}

@media (max-width: 767px) {
    .hero-header {
        padding: 80px 15px 50px;
        background: 
            radial-gradient(circle at 40% 10%, rgba(212, 175, 55, 0.1) 0%, transparent 35%),
            radial-gradient(circle at 60% 90%, rgba(52, 152, 219, 0.06) 0%, transparent 35%);
    }
    
    .hero-container {
        gap: 30px;
        padding: 0 10px;
    }
    
    .hero-badge {
        margin-bottom: 20px;
    }
    
    .badge-content {
        padding: 8px 15px;
        font-size: 0.85rem;
        gap: 8px;
    }
    
    .badge-content i {
        font-size: 1em;
    }
    
    .hero-title {
        font-size: 2.5rem;
        margin-bottom: 12px;
        line-height: 1.1;
    }
    
    .title-decoration {
        gap: 10px;
        margin-top: 10px;
    }
    
    .decoration-line {
        width: 40px;
        height: 1.5px;
    }
    
    .decoration-diamond {
        font-size: 1em;
    }
    
    .hero-subtitle {
        margin-bottom: 25px;
    }
    
    .subtitle-main {
        font-size: 1.1rem;
        margin-bottom: 6px;
        line-height: 1.3;
    }
    
    .subtitle-secondary {
        font-size: 0.95rem;
        line-height: 1.4;
    }
    
    .hero-features {
        margin-bottom: 30px;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .feature-item {
        padding: 14px;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(212, 175, 55, 0.25);
    }
    
    .feature-icon {
        font-size: 1.3em;
        color: #d4af37;
    }
    
    .feature-text h3 {
        font-size: 1em;
        margin-bottom: 3px;
        color: #ffffff;
    }
    
    .feature-text p {
        font-size: 0.85em;
        color: #cccccc;
        margin: 0;
    }
    
    .hero-cta {
        gap: 12px;
        max-width: 300px;
    }
    
    .cta-primary,
    .cta-secondary {
        padding: 14px 20px;
        font-size: 1em;
        border-radius: 10px;
    }
    
    .cta-primary i,
    .cta-secondary i {
        font-size: 1.1em;
    }
    
    .ai-brain-container {
        width: 220px;
        height: 220px;
    }
    
    /* Brain animation scaling for mobile */
    .brain-core {
        transform: scale(0.9);
    }
}

/* ===== EXTRA SMALL SCREENS (320px - 480px) ===== */
@media (max-width: 480px) {
    .hero-header {
        padding: 70px 10px 40px;
    }
    
    .hero-container {
        gap: 25px;
        padding: 0 5px;
    }
    
    .hero-title {
        font-size: 2.2rem;
        margin-bottom: 10px;
    }
    
    .subtitle-main {
        font-size: 1rem;
        padding: 0 10px;
    }
    
    .subtitle-secondary {
        font-size: 0.9rem;
        padding: 0 10px;
    }
    
    .feature-item {
        padding: 12px;
        gap: 8px;
    }
    
    .feature-icon {
        font-size: 1.2em;
    }
    
    .feature-text h3 {
        font-size: 0.95em;
    }
    
    .feature-text p {
        font-size: 0.8em;
    }
    
    .hero-cta {
        gap: 10px;
        max-width: 280px;
    }
    
    .cta-primary,
    .cta-secondary {
        padding: 12px 18px;
        font-size: 0.95em;
    }
    
    .ai-brain-container {
        width: 180px;
        height: 180px;
    }
}

/* ===== LANDSCAPE MODE OPTIMIZATIONS ===== */
@media (max-width: 1023px) and (orientation: landscape) and (max-height: 600px) {
    .hero-header {
        padding: 40px 20px 30px;
        min-height: auto;
    }
    
    .hero-container {
        grid-template-columns: 1fr 0.8fr;
        gap: 30px;
        align-items: center;
    }
    
    .hero-content {
        order: 1;
        text-align: left;
    }
    
    .hero-visual {
        order: 2;
    }
    
    .hero-badge {
        margin-bottom: 15px;
        display: flex;
        justify-content: flex-start;
    }
    
    .hero-title {
        font-size: 2.8rem;
        margin-bottom: 10px;
    }
    
    .hero-subtitle {
        margin-bottom: 20px;
    }
    
    .hero-features {
        margin-bottom: 25px;
    }
    
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .feature-item {
        padding: 10px;
        flex-direction: row;
        gap: 8px;
    }
    
    .hero-cta {
        flex-direction: row;
        gap: 15px;
        justify-content: flex-start;
        max-width: none;
    }
    
    .cta-primary,
    .cta-secondary {
        width: auto;
        padding: 10px 20px;
        font-size: 0.9em;
    }
    
    .ai-brain-container {
        width: 200px;
        height: 200px;
    }
}

/* ===== GAME CONTAINERS RESPONSIVE ===== */
@media (max-width: 1023px) {
    .game-container {
        margin: 40px 20px;
        padding: 30px 20px;
    }
    
    .game-header h2 {
        font-size: 2rem;
    }
    
    .game-description {
        font-size: 1rem;
        margin-bottom: 25px;
    }
    
    .game-controls {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .game-button {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
    }
    
    /* Canvas containers responsive */
    .pong-canvas-container,
    .shooter-canvas-container,
    .snake-canvas-container,
    .catch-canvas-container,
    .flappy-canvas-container {
        margin: 20px 0;
        overflow: hidden;
    }
    
    /* Canvas scaling for tablets */
    canvas {
        max-width: 100%;
        height: auto;
        display: block;
        margin: 0 auto;
    }
    
    /* Game info responsive */
    .pong-info,
    .shooter-info,
    .snake-info,
    .catch-info,
    .flappy-info {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
    }
    
    .pong-stats,
    .shooter-stats,
    .snake-stats,
    .catch-stats,
    .flappy-stats {
        justify-content: center;
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .stat-item {
        min-width: auto;
        flex: 1;
        min-width: 120px;
    }
}

@media (max-width: 767px) {
    .game-container {
        margin: 30px 15px;
        padding: 25px 15px;
    }
    
    .game-header h2 {
        font-size: 1.8rem;
    }
    
    .game-description {
        font-size: 0.95rem;
    }
    
    /* Mobile canvas optimization */
    canvas {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        border-radius: 8px;
    }
    
    /* Smaller stats for mobile */
    .stat-item {
        min-width: 100px;
        padding: 10px;
    }
    
    .stat-value {
        font-size: 1.1rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
}

/* ===== ENHANCED MOBILE TOUCH CONTROLS ===== */
.mobile-controls {
    display: none;
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(20, 20, 20, 0.6));
    border: 2px solid rgba(212, 175, 55, 0.4);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

@media (max-width: 1023px) {
    .mobile-controls {
        display: block;
    }
}

.controls-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}

.controls-header i {
    color: #d4af37;
    font-size: 1.2em;
}

.controls-header span {
    color: #ffffff;
    font-weight: 600;
    font-size: 1.1em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.touch-button {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(255, 215, 0, 0.1));
    border: 2px solid rgba(212, 175, 55, 0.5);
    border-radius: 12px;
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    touch-action: manipulation;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-height: 80px;
    justify-content: center;
}

.touch-button:hover,
.touch-button:active {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.4), rgba(255, 215, 0, 0.3));
    border-color: #d4af37;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4);
}

.touch-button i {
    font-size: 1.5em;
    color: #d4af37;
}

.touch-button span {
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== DIRECTIONAL PAD FOR SNAKE/MOVEMENT GAMES ===== */
.dpad-container {
    display: grid;
    grid-template-areas: 
        ". up ."
        "left center right"
        ". down .";
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    gap: 8px;
    max-width: 200px;
    margin: 0 auto;
    aspect-ratio: 1;
}

.dpad-button {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.3), rgba(255, 215, 0, 0.2));
    border: 2px solid rgba(212, 175, 55, 0.6);
    border-radius: 50%;
    color: #d4af37;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    touch-action: manipulation;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    min-height: 60px;
}

.dpad-button:hover,
.dpad-button:active {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.5), rgba(255, 215, 0, 0.4));
    border-color: #ffd700;
    transform: scale(0.95);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
}

.dpad-up { grid-area: up; }
.dpad-left { grid-area: left; }
.dpad-center { 
    grid-area: center; 
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(255, 215, 0, 0.05));
    border-color: rgba(212, 175, 55, 0.3);
    pointer-events: none;
}
.dpad-right { grid-area: right; }
.dpad-down { grid-area: down; }

/* ===== FLAPPY BIRD TAP ZONE ===== */
.flap-zone {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(255, 215, 0, 0.05));
    border: 3px dashed rgba(212, 175, 55, 0.5);
    border-radius: 15px;
    padding: 30px;
    margin: 20px 0;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    touch-action: manipulation;
}

.flap-zone:hover,
.flap-zone:active {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(255, 215, 0, 0.1));
    border-color: #d4af37;
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(212, 175, 55, 0.3);
}

.flap-zone i {
    font-size: 2.5em;
    color: #d4af37;
    margin-bottom: 10px;
    display: block;
}

.flap-zone .zone-text {
    color: #ffffff;
    font-weight: 600;
    font-size: 1.2em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.flap-zone .zone-hint {
    color: #cccccc;
    font-size: 0.9em;
    margin-top: 5px;
    opacity: 0.8;
}

/* ===== PONG PADDLE CONTROLS ===== */
.paddle-controls {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin: 20px 0;
}

.paddle-control {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.paddle-button {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(255, 215, 0, 0.1));
    border: 2px solid rgba(212, 175, 55, 0.5);
    border-radius: 12px;
    color: #ffffff;
    font-weight: 600;
    font-size: 1.1em;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    touch-action: manipulation;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 70px;
}

.paddle-button:hover,
.paddle-button:active {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.4), rgba(255, 215, 0, 0.3));
    border-color: #d4af37;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4);
}

.paddle-button i {
    font-size: 1.3em;
    color: #d4af37;
}

/* ===== SHOOTER CONTROLS ===== */
.shooter-joystick-container {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    margin: 20px 0;
}

.movement-joystick,
.action-buttons {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.joystick-label {
    color: #d4af37;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.action-buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    width: 100%;
    max-width: 200px;
}

.action-button {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.3), rgba(192, 57, 43, 0.2));
    border: 2px solid rgba(231, 76, 60, 0.6);
    border-radius: 50%;
    color: #ffffff;
    font-weight: 600;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    touch-action: manipulation;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    min-height: 70px;
}

.action-button:hover,
.action-button:active {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.5), rgba(192, 57, 43, 0.4));
    border-color: #e74c3c;
    transform: scale(0.95);
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.6);
}

.action-button i {
    font-size: 1.5em;
    color: #e74c3c;
}

/* ===== CONTROLS INSTRUCTIONS ===== */
.controls-instructions {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    border-left: 4px solid #d4af37;
}

.controls-instructions h4 {
    color: #d4af37;
    font-size: 1em;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.controls-instructions ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.controls-instructions li {
    color: #cccccc;
    font-size: 0.9em;
    margin-bottom: 5px;
    padding-left: 20px;
    position: relative;
}

.controls-instructions li::before {
    content: "▶";
    position: absolute;
    left: 0;
    color: #d4af37;
    font-size: 0.8em;
}

/* ===== TABLET OPTIMIZATIONS ===== */
@media (min-width: 768px) and (max-width: 1023px) {
    .mobile-only {
        display: none;
    }
    
    .tablet-only {
        display: block;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .game-container {
        margin: 50px 30px;
        padding: 35px 25px;
    }
    
    .touch-controls-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .touch-button {
        padding: 20px;
        min-height: 100px;
    }
    
    .dpad-container {
        max-width: 250px;
    }
    
    .dpad-button {
        min-height: 75px;
        font-size: 1.8em;
    }
    
    .paddle-controls {
        gap: 30px;
    }
    
    .paddle-button {
        padding: 25px;
        min-height: 90px;
        font-size: 1.3em;
    }
    
    .shooter-joystick-container {
        gap: 40px;
    }
    
    .action-button {
        min-height: 80px;
        font-size: 1.4em;
    }
    
    .flap-zone {
        padding: 40px;
        margin: 30px 0;
    }
    
    .flap-zone i {
        font-size: 3em;
    }
    
    .flap-zone .zone-text {
        font-size: 1.4em;
    }
}

/* ===== LANDSCAPE MODE OPTIMIZATIONS ===== */
@media (max-width: 1023px) and (orientation: landscape) {
    .hero-header {
        padding: 80px 20px 60px;
    }
    
    .hero-container {
        flex-direction: row;
        align-items: center;
    }
    
    .hero-content {
        flex: 1;
        text-align: left;
    }
    
    .hero-visual {
        flex: 0 0 300px;
        order: 1;
    }
    
    .ai-brain-container {
        width: 200px;
        height: 200px;
    }
    
    .game-container {
        margin: 30px 20px;
    }
    
    .mobile-controls {
        margin-top: 15px;
        padding: 15px;
    }
    
    .touch-controls-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
    
    .touch-button {
        padding: 12px;
        min-height: 60px;
    }
    
    .dpad-container {
        max-width: 180px;
    }
    
    .dpad-button {
        min-height: 50px;
        font-size: 1.3em;
    }
    
    .paddle-controls {
        gap: 15px;
        margin: 15px 0;
    }
    
    .paddle-button {
        padding: 15px;
        min-height: 60px;
        font-size: 1em;
    }
    
    .flap-zone {
        padding: 25px;
        margin: 15px 0;
    }
    
    .flap-zone i {
        font-size: 2em;
    }
    
    .flap-zone .zone-text {
        font-size: 1.1em;
    }
}

/* ===== HERO VISUAL ELEMENTS RESPONSIVE ===== */
@media (max-width: 1023px) {
    /* Neural network animation scaling */
    .neural-network {
        transform: scale(0.9);
    }
    
    .neural-node {
        width: 8px;
        height: 8px;
    }
    
    .neural-connection {
        height: 1px;
    }
    
    /* Brain pulse animation */
    .brain-pulse {
        animation: brainPulseMobile 2s ease-in-out infinite;
    }
    
    @keyframes brainPulseMobile {
        0%, 100% { 
            transform: scale(1);
            opacity: 0.8;
        }
        50% { 
            transform: scale(1.05);
            opacity: 1;
        }
    }
}

@media (max-width: 767px) {
    /* Further scaling for mobile */
    .neural-network {
        transform: scale(0.8);
    }
    
    .neural-node {
        width: 6px;
        height: 6px;
    }
    
    /* Reduce animation intensity on mobile for performance */
    .brain-pulse {
        animation: brainPulseMobileLite 3s ease-in-out infinite;
    }
    
    @keyframes brainPulseMobileLite {
        0%, 100% { 
            transform: scale(1);
            opacity: 0.7;
        }
        50% { 
            transform: scale(1.03);
            opacity: 0.9;
        }
    }
    
    /* Optimize text animations for mobile */
    .title-highlight {
        animation: textShineMobile 4s ease-in-out infinite;
    }
    
    @keyframes textShineMobile {
        0%, 100% { background-position: 0% 50%; }
        50% { background-position: 100% 50%; }
    }
    
    .decoration-diamond {
        animation: diamondRotateMobile 6s linear infinite;
    }
    
    @keyframes diamondRotateMobile {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }
}

/* ===== HERO ACCESSIBILITY IMPROVEMENTS ===== */
@media (prefers-reduced-motion: reduce) {
    .hero-header .brain-pulse,
    .hero-header .title-highlight,
    .hero-header .decoration-diamond,
    .hero-header .badge-glow {
        animation: none !important;
    }
    
    .hero-header .neural-connection {
        animation: none !important;
    }
    
    .feature-item:hover {
        transform: none !important;
    }
    
    .cta-primary:hover,
    .cta-secondary:hover {
        transform: none !important;
    }
}

/* ===== HIGH DPI DISPLAYS ===== */
@media (min-resolution: 2dppx) and (max-width: 767px) {
    .hero-title {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    .ai-brain-container {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */
@media (hover: none) and (pointer: coarse) {
    .feature-item {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(212, 175, 55, 0.3);
    }
    
    .cta-primary,
    .cta-secondary {
        min-height: 48px;
        touch-action: manipulation;
    }
    
    .cta-primary:active,
    .cta-secondary:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}

/* ===== FOOTER RESPONSIVE ===== */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .footer-info {
        text-align: center;
    }
    
    .footer-logo {
        justify-content: center;
    }
    
    .social-links {
        grid-template-columns: 1fr;
        gap: 12px;
        max-width: 300px;
        margin: 0 auto 20px;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .footer-links {
        justify-content: center;
        gap: 15px;
    }
    
    .footer-links a {
        font-size: 0.8em;
        padding: 6px 10px;
    }
}

@media (max-width: 1023px) {
    .main-footer {
        padding: 60px 0 0;
        margin-top: 60px;
    }
    
    .footer-content {
        padding: 0 20px 40px;
        gap: 40px;
    }
    
    .footer-logo span {
        font-size: 1.8em;
    }
    
    .social-media-section h3 {
        font-size: 1.6em;
        margin-bottom: 25px;
    }
    
    .social-btn {
        padding: 14px 18px;
        font-size: 0.9em;
    }
    
    .footer-bottom {
        padding: 25px 0;
    }
}

@media (max-width: 767px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .footer-info {
        text-align: center;
    }
    
    .footer-logo {
        justify-content: center;
    }
    
    .social-links {
        grid-template-columns: 1fr;
        gap: 12px;
        max-width: 300px;
        margin: 0 auto 20px;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .footer-links {
        justify-content: center;
        gap: 15px;
    }
    
    .footer-links a {
        font-size: 0.8em;
        padding: 6px 10px;
    }
}

@media (max-width: 480px) {
    .main-footer {
        padding: 40px 0 0;
        margin-top: 40px;
    }
    
    .footer-content {
        padding: 0 15px 30px;
        gap: 30px;
    }
    
    .footer-logo span {
        font-size: 1.5em;
    }
    
    .social-media-section h3 {
        font-size: 1.4em;
        margin-bottom: 20px;
    }
    
    .social-btn {
        padding: 12px 16px;
        font-size: 0.85em;
    }
    
    .social-btn i {
        font-size: 1.2em;
    }
    
    .footer-bottom {
        padding: 20px 0;
    }
    
    .footer-links {
        gap: 10px;
    }
    
    .footer-links a {
        font-size: 0.75em;
        padding: 5px 8px;
    }
}

/* ===== LEADERBOARD RESPONSIVE ===== */
@media (max-width: 768px) {
    .leaderboard-section {
        padding: 50px 0;
    }
    
    .leaderboard-header h2 {
        font-size: 2.2em;
        letter-spacing: 2px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .game-stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1023px) {
    .leaderboard-section {
        padding: 60px 20px;
    }
    
    .leaderboard-header h2 {
        font-size: 2.5em;
        letter-spacing: 3px;
    }
    
    .leaderboard-header p {
        font-size: 1.2em;
        padding: 0 20px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
    }
    
    .stat-card {
        padding: 20px;
        gap: 15px;
    }
    
    .stat-icon {
        width: 55px;
        height: 55px;
        font-size: 1.3em;
    }
    
    .stat-value {
        font-size: 2em;
    }
    
    .game-stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .game-stat-card {
        padding: 18px;
        gap: 12px;
    }
}

@media (max-width: 767px) {
    .leaderboard-section {
        padding: 50px 15px;
    }
    
    .leaderboard-header h2 {
        font-size: 2.2em;
        letter-spacing: 2px;
    }
    
    .leaderboard-header p {
        font-size: 1.1em;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .stat-card {
        padding: 20px;
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .stat-icon {
        width: 60px;
        height: 60px;
        font-size: 1.4em;
    }
    
    .stat-value {
        font-size: 2.2em;
    }
    
    .stat-label {
        font-size: 1em;
    }
    
    .game-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .game-stat-card {
        padding: 15px;
        gap: 15px;
    }
    
    .game-icon {
        width: 45px;
        height: 45px;
        font-size: 1.2em;
    }
    
    .game-name {
        font-size: 1em;
    }
    
    .game-record {
        gap: 10px;
        font-size: 0.85em;
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .leaderboard-header h2 {
        font-size: 1.8em;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2em;
    }
    
    .stat-value {
        font-size: 1.8em;
    }
    
    .game-stat-card {
        padding: 15px;
    }
    
    .game-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1em;
    }
}

/* ===== ENHANCED STYLING FOR WARNING MESSAGE ICONS AND RECOMMENDATION BOX ===== */
.recommendation-box {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(241, 196, 15, 0.1));
    border: 1px solid #d4af37;
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: recommendationGlow 3s infinite;
}

.recommendation-box i {
    color: #f1c40f;
    font-size: 1.2rem;
    flex-shrink: 0;
}

@keyframes recommendationGlow {
    0%, 100% { 
        box-shadow: 0 0 5px rgba(212, 175, 55, 0.3);
    }
    50% { 
        box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
    }
}
