/* MazeScape - Main Stylesheet */

/* Performance optimizations for all elements */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* GPU acceleration for better performance */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Optimize hardware acceleration for animations */
.modal-overlay,
.menu-buttons,
.blog-panel,
#mobile-controls,
.control-btn,
.game-button {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

html, body {
    border: none;
    outline: none;
    /* Disable text selection for better touch experience */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    /* Prevent pull-to-refresh on mobile */
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
}

/* Responsive Typography Base */
html {
    font-size: 16px; /* Base font size */
}

/* Ultra-wide screens */
@media (min-width: 2560px) {
    html { font-size: 20px; }
}

/* Large desktop */
@media (min-width: 1920px) and (max-width: 2559px) {
    html { font-size: 18px; }
}

/* Standard desktop */
@media (min-width: 1400px) and (max-width: 1919px) {
    html { font-size: 17px; }
}

/* Medium desktop */
@media (min-width: 1200px) and (max-width: 1399px) {
    html { font-size: 16px; }
}

/* Small desktop/tablet */
@media (min-width: 900px) and (max-width: 1199px) {
    html { font-size: 15px; }
}

/* Tablet */
@media (min-width: 600px) and (max-width: 899px) {
    html { font-size: 14px; }
}

/* Mobile */
@media (min-width: 400px) and (max-width: 599px) {
    html { font-size: 13px; }
}

/* Small mobile */
@media (max-width: 399px) {
    html { font-size: 12px; }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #16213e 100%);
    color: white;
    overflow: hidden;
    height: 100vh;
    margin: 0;
    padding: 0;
}

/* Responsive Header Styles */
.menu-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(15px);
    border-bottom: 2px solid #00BFFF;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 150;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.logo-text {
    color: #00BFFF;
    font-size: 26px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}

/* User Info Styles */
.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-welcome {
    color: #39FF14;
    font-size: 16px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    padding: 8px 16px;
    background: rgba(57, 255, 20, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(57, 255, 20, 0.3);
    transition: all 0.3s ease;
}

#menuHeaderWelcomeText {
    transition: font-size 0.3s ease, opacity 0.2s ease;
}

.score-info {
    color: #FFD700;
    font-size: 16px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    padding: 8px 16px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    display: none;
}

/* Main Title Styles */
.main-title {
    font-size: 48px;
    font-weight: 700;
    color: #00BFFF;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
}

.main-subtitle {
    color: #888;
    font-size: 16px;
    margin: 10px 0 0 0;
    letter-spacing: 1px;
    font-weight: 300;
}

/* Responsive Header & Title - Much larger for mobile */
@media (max-width: 900px) {
    .menu-header {
        height: 60px;
        padding: 0 20px;
    }
    
    .logo-text {
        font-size: 24px;
    }
    
    .main-title {
        font-size: 42px; /* Increased from 36px */
        letter-spacing: 2px;
    }
    
    .main-subtitle {
        font-size: 16px; /* Increased from 14px */
    }
    
    .user-info {
        gap: 15px;
    }
    
    .user-welcome {
        font-size: 16px; /* Increased from 14px */
        padding: 8px 14px;
    }
    
    .score-info {
        font-size: 18px; /* Increased from 16px */
        padding: 8px 14px;
    }
}

@media (max-width: 600px) {
    .menu-header {
        height: 60px; /* Increased from 50px */
        padding: 0 15px;
    }
    
    .logo-text {
        font-size: 22px; /* Increased from 18px */
        letter-spacing: 0.8px;
    }
    
    .main-title {
        font-size: 38px; /* Increased from 28px */
        letter-spacing: 1.5px;
    }
    
    .main-subtitle {
        font-size: 15px; /* Increased from 12px */
        margin: 10px 0 0 0;
    }
    
    .user-info {
        gap: 12px;
    }
    
    .user-welcome {
        font-size: 14px; /* Increased from 12px */
        padding: 6px 10px;
        border-radius: 8px;
    }
    
    .score-info {
        font-size: 16px; /* Increased from 14px */
        padding: 6px 10px;
        border-radius: 8px;
    }
    
    #menuHeaderWelcomeText {
        font-size: 14px; /* Increased from 12px */
    }
}

@media (max-width: 400px) {
    .menu-header {
        height: 55px; /* Increased from 45px */
        padding: 0 12px;
    }
    
    .logo-text {
        font-size: 20px; /* Increased from 16px */
        letter-spacing: 0.5px;
    }
    
    .main-title {
        font-size: 32px; /* Increased from 24px */
        letter-spacing: 1.2px;
    }
    
    .main-subtitle {
        font-size: 13px; /* Increased from 11px */
        margin: 8px 0 0 0;
    }
    
    .user-info {
        gap: 10px;
    }
    
    .user-welcome {
        font-size: 12px; /* Increased from 10px */
        padding: 4px 8px;
        border-radius: 6px;
    }
    
    .score-info {
        font-size: 14px; /* Increased from 12px */
        padding: 4px 8px;
        border-radius: 6px;
    }
    
    #menuHeaderWelcomeText {
        font-size: 12px; /* Increased from 10px */
    }
    
    /* Show score info on small screens if space allows */
    .score-info {
        display: block !important;
    }
}

#gameContainer {
    position: relative;
    width: 100vw;
    height: calc(100vh - 80px);
    margin-top: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #0a0a1f 0%, #1a1a2e 50%, #0f0f23 100%);
    overflow: hidden;
    padding: 0.5rem;
}

/* Responsive adjustments for gameContainer */
@media (max-width: 900px) {
    #gameContainer {
        height: calc(100vh - 60px);
        margin-top: 60px;
        padding: 0.25rem;
    }
}

@media (max-width: 768px) {
    #gameContainer {
        height: calc(100vh - 60px); /* Updated for larger header */
        margin-top: 60px;
        padding: 0.125rem;
        /* Account for mobile controls - larger padding */
        padding-bottom: 140px;
    }
}

@media (max-width: 600px) {
    #gameContainer {
        height: calc(100vh - 60px); /* Updated for larger header */
        margin-top: 60px;
        padding: 0.1rem;
        padding-bottom: 120px;
    }
}

@media (max-width: 400px) {
    #gameContainer {
        height: calc(100vh - 55px); /* Updated for larger header */
        margin-top: 55px;
        padding: 0.05rem;
        padding-bottom: 100px;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    #gameContainer {
        height: 100vh;
        margin-top: 0;
        padding: 0;
    }
}


#ui-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 31, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    animation: fadeIn 0.4s ease-in-out;
}

.modal {
    background: linear-gradient(135deg, #1a1a2e 0%, #2a2a3e 100%);
    border: 2px solid #00BFFF;
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 31.25rem; /* 500px */
    min-width: 20rem; /* 320px */
    width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5),
                0 0 30px rgba(0, 191, 255, 0.3);
    position: relative;
    overflow: hidden;
}

/* Responsive modal adjustments */
@media (max-width: 600px) {
    .modal {
        padding: 1.5rem;
        border-radius: 15px;
        width: 95vw;
        max-height: 85vh;
    }
}

@media (max-width: 400px) {
    .modal {
        padding: 1rem;
        border-radius: 10px;
        width: 98vw;
        max-height: 80vh;
        min-width: auto;
    }
}

.modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #00BFFF, transparent);
}

.modal h2 {
    color: #00BFFF;
    margin-bottom: 1.5rem;
    font-size: 1.75rem; /* 28px at base 16px */
    font-weight: 600;
    text-shadow: 0 0 20px rgba(0, 191, 255, 0.5);
    letter-spacing: 1px;
    line-height: 1.2;
}

/* Responsive modal header - Larger text for mobile */
@media (max-width: 600px) {
    .modal h2 {
        font-size: 1.75rem; /* Increased from 1.5rem */
        margin-bottom: 1.25rem;
        letter-spacing: 0.75px;
    }
}

@media (max-width: 400px) {
    .modal h2 {
        font-size: 1.5rem; /* Increased from 1.25rem */
        margin-bottom: 1rem;
        letter-spacing: 0.5px;
    }
}

.modal p {
    margin: 0.9375rem 0; /* 15px equivalent */
    line-height: 1.6;
    font-size: 1rem; /* 16px at base */
}

/* Responsive modal text - Larger for mobile */
@media (max-width: 600px) {
    .modal p {
        margin: 0.875rem 0;
        font-size: 1rem; /* Increased from 0.9rem */
        line-height: 1.6;
    }
}

@media (max-width: 400px) {
    .modal p {
        margin: 0.75rem 0;
        font-size: 0.95rem; /* Increased from 0.85rem */
        line-height: 1.5;
    }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

.glow-text {
    text-shadow: 0 0 10px currentColor;
}

.primary-color {
    color: #00BFFF;
}

.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #00BFFF;
    font-size: 18px;
    z-index: 9999;
}

/* Static Information Panels */
#instructions {
    position: absolute;
    bottom: 1.25rem; /* 20px */
    left: 1.25rem;
    background: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(10px);
    padding: 0.9375rem; /* 15px */
    border-radius: 0.75rem; /* 12px */
    border: 2px solid #00BFFF;
    font-size: 0.8125rem; /* 13px */
    line-height: 1.5;
    max-width: 12.5rem; /* 200px */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    color: #E0E0E0;
    z-index: 50;
}

/* Responsive instructions panel */
@media (max-width: 1200px) {
    #instructions {
        max-width: 11rem; /* 176px */
        font-size: 0.75rem; /* 12px */
        padding: 0.75rem;
    }
}

@media (max-width: 900px) {
    #instructions {
        bottom: 1rem;
        left: 1rem;
        max-width: 10rem; /* 160px */
        font-size: 0.7rem; /* 11px */
        padding: 0.625rem;
    }
}

@media (max-width: 600px) {
    #instructions {
        bottom: 0.75rem;
        left: 0.75rem;
        max-width: 9rem; /* 144px */
        font-size: 0.65rem; /* 10px */
        padding: 0.5rem;
        border-radius: 0.5rem;
    }
}

@media (max-width: 400px) {
    #instructions {
        bottom: 0.5rem;
        left: 0.5rem;
        max-width: 8rem; /* 128px */
        font-size: 0.6rem; /* 9px */
        padding: 0.375rem;
    }
}

#instructions h4 {
    color: #00BFFF;
    margin-bottom: 0.625rem; /* 10px */
    font-size: 0.875rem; /* 14px */
    font-weight: 600;
    text-shadow: 0 0 10px rgba(0, 191, 255, 0.3);
    text-align: center;
}

/* Responsive instructions header */
@media (max-width: 900px) {
    #instructions h4 {
        font-size: 0.8rem; /* 12.8px */
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 600px) {
    #instructions h4 {
        font-size: 0.75rem; /* 12px */
        margin-bottom: 0.375rem;
    }
}

@media (max-width: 400px) {
    #instructions h4 {
        font-size: 0.7rem; /* 11.2px */
        margin-bottom: 0.25rem;
    }
}

#status {
    position: absolute;
    top: 1.25rem; /* 20px */
    right: 1.25rem;
    background: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(10px);
    padding: 0.9375rem; /* 15px */
    border-radius: 0.75rem; /* 12px */
    border: 2px solid #39FF14;
    font-size: 0.8125rem; /* 13px */
    line-height: 1.5;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4),
                0 0 20px rgba(57, 255, 20, 0.2);
    color: #E0E0E0;
    z-index: 50;
    min-width: 8rem; /* 128px */
}

/* Status panel structure */
.status-header h4 {
    color: #39FF14;
    margin: 0 0 8px 0;
    font-size: inherit;
}

.status-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.status-label {
    color: #E0E0E0;
    font-weight: 500;
}

.status-value {
    color: #FFD700;
    font-weight: 600;
}

/* Responsive status panel */
@media (max-width: 1200px) {
    #status {
        font-size: 0.9rem; /* 14.4px */
        padding: 0.875rem;
        min-width: 8rem;
    }
}

@media (max-width: 900px) {
    #status {
        top: 1rem;
        right: 1rem;
        font-size: 0.85rem; /* 13.6px */
        padding: 0.75rem;
        min-width: 7.5rem;
    }
}

@media (max-width: 600px) {
    #status {
        top: 0.1rem;
        right: 0.1rem;
        font-size: 0.65rem; /* Increased from 0.55rem for even better visibility */
        padding: 0.25rem 0.35rem; /* Even more padding for larger appearance */
        border-radius: 0.3rem;
        min-width: 4.5rem; /* Increased width */
        max-width: 5.5rem; /* Increased max width */
        border-width: 1px;
        line-height: 1.2;
    }
    
    .status-header h4 {
        font-size: 10px; /* Increased from 8px for even better visibility */
        margin-bottom: 4px; /* More spacing */
    }
    
    .status-content {
        gap: 2px; /* Smaller gap for mobile */
    }
    
    .status-item {
        font-size: 0.6rem; /* Slightly smaller for mobile */
    }
}

@media (max-width: 400px) {
    #status {
        top: 0.1rem;
        right: 0.1rem;
        font-size: 0.5rem; /* Further increased for better visibility */
        padding: 0.18rem 0.25rem; /* More padding for larger appearance */
        min-width: 3.5rem; /* Increased width */
        max-width: 4.5rem; /* Increased max width */
        border-width: 1px;
        border-radius: 0.2rem;
        line-height: 1.2;
    }
}

/* Powerup Notifications */
#powerup-notifications {
    position: absolute;
    top: 140px;
    right: 20px;
    width: 200px;
    z-index: 60;
    pointer-events: none;
}

.powerup-notification {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    padding: 12px 15px;
    border-radius: 10px;
    border: 2px solid #FFD700;
    font-size: 13px;
    color: #FFD700;
    margin-bottom: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4),
                0 0 15px rgba(255, 215, 0, 0.3);
    animation: slideInRight 0.4s ease-out, fadeOut 0.5s ease-in 2.5s forwards;
    transform: translateX(100%);
}

.powerup-notification.show {
    transform: translateX(0);
}

/* Responsive Notifications */
@media (max-width: 900px) {
    #powerup-notifications {
        top: 100px;
        right: 15px;
        width: 180px;
    }
    
    .powerup-notification {
        padding: 10px 12px;
        font-size: 12px;
        border-radius: 8px;
    }
}

@media (max-width: 600px) {
    #powerup-notifications {
        top: 25px;
        right: 3px;
        left: auto;
        width: 100px;
        max-width: 100px;
    }
    
    .powerup-notification {
        padding: 1px 3px;
        font-size: 5px;
        border-radius: 2px;
        margin-bottom: 1px;
        border-width: 1px;
        animation: slideInDown 0.15s ease-out, fadeOut 0.15s ease-in 1s forwards;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (max-width: 400px) {
    #powerup-notifications {
        top: 30px;
        right: 3px;
        left: auto;
        width: 120px;
        max-width: 120px;
    }
    
    .powerup-notification {
        padding: 2px 3px;
        font-size: 6px;
        border-width: 1px;
        margin-bottom: 2px;
        border-radius: 2px;
        box-shadow: none;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

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

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

#status h4 {
    color: #39FF14;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
    text-align: center;
}

@media (max-width: 400px) {
    #status h4 {
        font-size: 5px; /* Increased from 3px */
        margin-bottom: 1px; /* Increased margin */
    }
}

/* Modern Button Styles */
.game-button {
    background: linear-gradient(135deg, #2a2a3e 0%, #3a3a5e 100%);
    border: 2px solid #00BFFF;
    color: #FFFFFF;
    padding: 1rem 1.75rem; /* 16px 28px */
    font-size: 0.9375rem; /* 15px */
    font-family: 'Segoe UI', sans-serif;
    font-weight: 600;
    border-radius: 0.75rem; /* 12px */
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0.375rem; /* 6px */
    text-transform: uppercase;
    letter-spacing: 1.2px;
    min-width: 10rem; /* 160px */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 20px rgba(0, 191, 255, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    pointer-events: auto;
    white-space: nowrap;
}

/* Responsive button styles - Significantly larger for mobile */
@media (max-width: 1200px) {
    .game-button {
        padding: 1rem 1.75rem; /* 16px 28px */
        font-size: 1rem; /* 16px */
        min-width: 10rem; /* 160px */
        letter-spacing: 1px;
    }
}

@media (max-width: 900px) {
    .game-button {
        padding: 1.25rem 1.75rem; /* 20px 28px */
        font-size: 1.125rem; /* 18px */
        min-width: 12rem; /* 192px */
        margin: 0.5rem;
        border-radius: 0.75rem; /* 12px */
        border-width: 3px;
    }
}

@media (max-width: 600px) {
    .game-button {
        padding: 0.8rem 1.2rem; /* Much smaller for mobile */
        font-size: 0.9rem; /* Smaller text */
        min-width: 8rem; /* Much narrower */
        letter-spacing: 0.5px;
        border-radius: 0.5rem;
        border-width: 2px;
        font-weight: 600;
        margin: 0.3rem;
    }
}

@media (max-width: 400px) {
    .game-button {
        padding: 0.7rem 1rem; /* Much smaller for tiny screens */
        font-size: 0.8rem; /* Smaller text */
        min-width: 7rem; /* Much narrower */
        letter-spacing: 0.3px;
        width: auto; /* Don't force full width */
        margin: 0.2rem;
        border-width: 2px;
        font-weight: 600;
    }
}

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

.game-button:hover::before {
    left: 100%;
}

.game-button:hover {
    background: linear-gradient(135deg, #00BFFF 0%, #0080CC 100%);
    border-color: #39FF14;
    color: #000000;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    transform: translateY(-3px);
}

.game-button:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.game-button.primary {
    background: linear-gradient(135deg, #39FF14 0%, #2ECC0F 100%);
    border-color: #39FF14;
    color: #000000;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 6px 25px rgba(57, 255, 20, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.game-button.primary:hover {
    background: linear-gradient(135deg, #45FF20 0%, #39FF14 100%);
    border-color: #FFFFFF;
    color: #000000;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    box-shadow: 0 10px 40px rgba(57, 255, 20, 0.5);
}

.game-button.secondary {
    background: linear-gradient(135deg, #FF453A 0%, #CC3328 100%);
    border-color: #FF453A;
    color: #FFFFFF;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.game-button.secondary:hover {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF4444 100%);
    border-color: #FFFFFF;
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 69, 58, 0.4);
}

.game-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #2D2D3C;
    border-color: #555555;
    color: #888888;
    text-shadow: none;
    box-shadow: none;
}

.game-button:disabled:hover {
    transform: none;
    background: #2D2D3C;
    border-color: #555555;
}

/* Mobile A* Blog Button - Hidden on mobile for responsive design */
.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .mobile-only {
        display: none !important; /* Hide A* algorithm button on mobile */
    }
}

/* Custom Scrollbar Styles */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, rgba(240, 240, 240, 0.8) 50%, rgba(220, 220, 220, 0.9) 100%);
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(250, 250, 250, 0.95) 50%, rgba(240, 240, 240, 1) 100%);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
}

::-webkit-scrollbar-thumb:active {
    background: linear-gradient(180deg, rgba(230, 230, 230, 0.8) 0%, rgba(210, 210, 210, 0.9) 50%, rgba(200, 200, 200, 1) 100%);
}

/* Firefox scrollbar styling */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.7) rgba(255, 255, 255, 0.1);
}

/* Menu Button Container */
.menu-buttons {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 100;
    margin-top: 0;
    padding: 2.5rem; /* 40px */
    background: rgba(26, 26, 46, 0.6);
    border-radius: 1.25rem; /* 20px */
    backdrop-filter: blur(15px);
    border: 2px solid rgba(0, 191, 255, 0.4);
    pointer-events: auto;
    width: calc(50vw - 3.75rem); /* calc(50vw - 60px) */
    max-width: 37.5rem; /* 600px */
    min-width: 25rem; /* 400px */
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    margin-left: 1.875rem; /* 30px */
}

/* Responsive menu container */
@media (max-width: 1200px) {
    .menu-buttons {
        width: calc(55vw - 3rem);
        max-width: 35rem; /* 560px */
        min-width: 22rem; /* 352px */
        padding: 2rem;
        margin-left: 1.5rem;
    }
}

@media (max-width: 900px) {
    .menu-buttons {
        width: calc(90vw - 2.5rem);
        max-width: 28rem; /* 448px */
        min-width: 18rem; /* 288px */
        left: 50%;
        transform: translate(-50%, -50%);
        margin-left: 0;
        padding: 1.5rem;
        border-radius: 1rem;
    }
}

@media (max-width: 600px) {
    .menu-buttons {
        width: calc(95vw - 2rem);
        max-width: 25rem; /* 400px */
        min-width: 16rem; /* 256px */
        padding: 1.25rem;
        border-radius: 0.875rem;
    }
}

@media (max-width: 400px) {
    .menu-buttons {
        width: calc(98vw - 1rem);
        max-width: 22rem; /* 352px */
        min-width: 14rem; /* 224px */
        padding: 1rem;
        border-radius: 0.75rem;
    }
}

.button-row {
    display: flex;
    gap: 1.5625rem; /* 25px */
    margin: 0.9375rem 0; /* 15px */
    flex-wrap: wrap;
    justify-content: center;
    pointer-events: auto;
    width: 100%;
}

/* Responsive button rows */
@media (max-width: 900px) {
    .button-row {
        gap: 1rem; /* 16px */
        margin: 0.75rem 0;
    }
}

@media (max-width: 600px) {
    .button-row {
        gap: 0.75rem; /* 12px */
        margin: 0.625rem 0;
    }
}

@media (max-width: 400px) {
    .button-row {
        gap: 0.5rem; /* 8px */
        margin: 0.5rem 0;
        flex-direction: column;
    }
    .game-button {
        width: 100%;
    }
}

/* Enhanced Input Styles */
.game-input {
    background: rgba(42, 42, 62, 0.9);
    border: 2px solid #00BFFF;
    color: #FFFFFF;
    padding: 1rem 1.25rem; /* 16px 20px */
    font-size: 0.9375rem; /* 15px */
    font-family: 'Segoe UI', sans-serif;
    border-radius: 0.625rem; /* 10px */
    margin: 0.625rem; /* 10px */
    min-width: 13.75rem; /* 220px */
    width: 100%;
    max-width: 20rem; /* 320px */
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Responsive input styles */
@media (max-width: 600px) {
    .game-input {
        padding: 0.875rem 1rem; /* 14px 16px */
        font-size: 0.875rem; /* 14px */
        margin: 0.5rem; /* 8px */
        min-width: 12rem; /* 192px */
        max-width: 18rem; /* 288px */
        border-radius: 0.5rem; /* 8px */
    }
}

@media (max-width: 400px) {
    .game-input {
        padding: 0.75rem 0.875rem; /* 12px 14px */
        font-size: 0.8125rem; /* 13px */
        margin: 0.375rem; /* 6px */
        min-width: 10rem; /* 160px */
        max-width: 16rem; /* 256px */
    }
}

.game-input:focus {
    outline: none;
    border-color: #39FF14;
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.3),
                inset 0 2px 5px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.game-input::placeholder {
    color: #888888;
    text-align: center;
    font-weight: 400;
}

/* Enhanced Auth Form Styles */
.auth-form {
    background: rgba(26, 26, 46, 0.95);
    border: 2px solid #00BFFF;
    border-radius: 1.25rem; /* 20px */
    padding: 2.5rem; /* 40px */
    margin: 1.25rem; /* 20px */
    max-width: 26.25rem; /* 420px */
    width: 90vw;
    text-align: center;
    animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(15px);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4),
                0 0 30px rgba(0, 191, 255, 0.2);
}

/* Responsive auth form */
@media (max-width: 600px) {
    .auth-form {
        padding: 1.5rem; /* 24px */
        margin: 0.75rem; /* 12px */
        border-radius: 1rem; /* 16px */
        width: 95vw;
        max-width: 22rem; /* 352px */
    }
}

@media (max-width: 400px) {
    .auth-form {
        padding: 1rem; /* 16px */
        margin: 0.5rem; /* 8px */
        border-radius: 0.75rem; /* 12px */
        width: 98vw;
        max-width: 20rem; /* 320px */
    }
}

.auth-form h3 {
    color: #00BFFF;
    margin-bottom: 1.5625rem; /* 25px */
    font-size: 1.625rem; /* 26px */
    font-weight: 600;
    text-shadow: 0 0 15px rgba(0, 191, 255, 0.5);
    letter-spacing: 1px;
    line-height: 1.2;
}

/* Responsive auth form headers */
@media (max-width: 600px) {
    .auth-form h3 {
        font-size: 1.375rem; /* 22px */
        margin-bottom: 1.25rem; /* 20px */
        letter-spacing: 0.5px;
    }
}

@media (max-width: 400px) {
    .auth-form h3 {
        font-size: 1.25rem; /* 20px */
        margin-bottom: 1rem; /* 16px */
    }
}

/* Enhanced Side Panel Styles */
.side-panel {
    position: absolute;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95), rgba(30, 30, 55, 0.95));
    backdrop-filter: blur(15px);
    border-radius: 18px;
    padding: 25px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #E0E0E0;
    border: 2px solid transparent;
    background-clip: padding-box;
    z-index: 100;
}

.side-panel.left {
    left: 25px;
    border-color: #00BFFF;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

.side-panel.right {
    right: 25px;
    border-color: #39FF14;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5),
                0 0 30px rgba(57, 255, 20, 0.2);
}

.side-panel h4 {
    margin-bottom: 18px;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 1px;
    text-shadow: 0 0 15px currentColor;
}

.side-panel.left h4 {
    color: #00BFFF;
}

.side-panel.right h4 {
    color: #39FF14;
}

.panel-content {
    font-size: 14px;
    line-height: 1.8;
}

.panel-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 3px solid;
    transition: all 0.3s ease;
}

.side-panel.left .panel-item {
    border-left-color: #00BFFF;
}

.side-panel.right .panel-item {
    border-left-color: #39FF14;
}

.panel-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.panel-value {
    color: #FFD700;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.db-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
}

.db-status.connected {
    background: rgba(57, 255, 20, 0.1);
    border: 1px solid rgba(57, 255, 20, 0.3);
    color: #39FF14;
}

.db-status.disconnected {
    background: rgba(255, 69, 58, 0.1);
    border: 1px solid rgba(255, 69, 58, 0.3);
    color: #FF453A;
}

.db-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.db-status.connected .db-status-dot {
    background: #39FF14;
}

.db-status.disconnected .db-status-dot {
    background: #FF453A;
}

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

#status h4 {
    color: #39FF14;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
}

/* Mobile controls with improved touch performance */
#mobile-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    display: none; /* Hidden by default, shown only during gameplay */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    /* Performance optimizations for mobile */
    will-change: opacity, transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-perspective: 1000;
    perspective: 1000;
}

#mobile-controls.visible {
    opacity: 1;
    transform: translateY(0);
}

.control-pad {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    /* Performance optimization */
    transform: translateZ(0);
}

.control-row {
    display: flex;
    gap: 10px;
}

.control-btn {
    width: 50px; /* Reduced from 60px */
    height: 50px; /* Reduced from 60px */
    background: rgba(26, 26, 46, 0.9);
    border: 2px solid #00BFFF;
    color: #FFFFFF;
    font-size: 20px; /* Reduced from 24px */
    font-weight: bold;
    border-radius: 50%;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    touch-action: manipulation;
    transition: all 0.1s ease;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 191, 255, 0.3);
    position: relative;
    overflow: hidden;
    /* Performance optimizations */
    will-change: transform, background-color;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Add ripple effect for touch feedback */
.control-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
    pointer-events: none;
}

.control-btn:active::before {
    width: 100%;
    height: 100%;
}

.control-btn:active,
.control-btn.active {
    background: #00BFFF !important;
    color: #000000 !important;
    transform: scale(0.9);
    box-shadow: 0 2px 8px rgba(0, 191, 255, 0.5);
    border-color: #FFD700;
}

/* Hide controls on desktop only */
@media (min-width: 769px) {
    #mobile-controls {
        display: none !important;
    }
}

/* Mobile responsive adjustments - Even larger for better usability */
@media (max-width: 768px) {
    #mobile-controls {
        /* Remove !important to allow JavaScript control */
        bottom: 20px; /* Better positioning */
        right: 20px;
        left: 20px;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .control-btn {
        width: 100px;  /* Increased from 90px */
        height: 100px;  /* Increased from 90px */
        font-size: 40px;  /* Increased from 36px */
        border-width: 4px;  /* Increased border */
        /* Better touch targets for mobile */
        box-shadow: 0 8px 25px rgba(0, 191, 255, 0.4);
    }
    
    .control-pad {
        gap: 25px;  /* Increased gap */
    }
    
    .control-row {
        gap: 25px;
    }
}

/* Tablet landscape */
@media (max-width: 700px) {
    #mobile-controls {
        bottom: 20px;
        right: 15px;
        left: 15px;
    }
    
    .control-btn {
        width: 95px;  /* Increased from 85px */
        height: 95px;  /* Increased from 85px */
        font-size: 36px;  /* Increased from 32px */
        border-width: 3px;
    }
    
    .control-pad {
        gap: 22px;  /* Increased gap */
    }
    
    .control-row {
        gap: 22px;
    }
}

/* Mobile portrait */
@media (max-width: 600px) {
    #mobile-controls {
        bottom: 20px;
        right: 10px;
        left: 10px;
    }
    
    .control-btn {
        width: 90px;  /* Increased from 80px */
        height: 90px;  /* Increased from 80px */
        font-size: 34px;  /* Increased from 30px */
        border-width: 3px;
    }
    
    .control-pad {
        gap: 20px;  /* Increased gap */
    }
    
    .control-row {
        gap: 20px;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    #mobile-controls {
        bottom: 20px;
        right: 8px;
        left: 8px;
    }
    
    .control-btn {
        width: 85px;  /* Increased from 75px */
        height: 85px;  /* Increased from 75px */
        font-size: 32px;  /* Increased from 28px */
        border-width: 3px;
    }
    
    .control-pad {
        gap: 18px;  /* Increased gap */
    }
    
    .control-row {
        gap: 18px;
    }
}

/* Very small mobile */
@media (max-width: 400px) {
    #mobile-controls {
        bottom: 15px;
        right: 5px;
        left: 5px;
    }
    
    .control-btn {
        width: 80px;  /* Increased from 70px */
        height: 80px;  /* Increased from 70px */
        font-size: 30px;  /* Increased from 26px */
        border-width: 3px;
        padding: 0;
    }
    
    .control-pad {
        gap: 16px;  /* Increased gap */
    }
    
    .control-row {
        gap: 16px;
    }
}

/* Extra small screens */
@media (max-width: 320px) {
    #mobile-controls {
        bottom: 15px;
        right: 3px;
        left: 3px;
    }
    
    .control-btn {
        width: 75px;  /* Increased from 65px */
        height: 75px;  /* Increased from 65px */
        font-size: 28px;  /* Increased from 24px */
        border-width: 3px;
    }
    
    .control-pad {
        gap: 14px;  /* Increased gap */
    }
    
    .control-row {
        gap: 14px;
    }
}

/* Landscape orientation on mobile devices */
@media (max-width: 768px) and (orientation: landscape) {
    #mobile-controls {
        bottom: 40px;
        right: 15px;
        transform: scale(0.9);
    }
    
    .control-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .control-pad {
        gap: 8px;
    }
    
    .control-row {
        gap: 8px;
    }
}

/* Small landscape screens */
@media (max-height: 500px) and (orientation: landscape) {
    #mobile-controls {
        bottom: 20px;
        right: 10px;
        transform: scale(0.8);
    }
    
    .control-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

/* Touch device optimizations */
@media (pointer: coarse) {
    .control-btn {
        /* Increase touch target size for accessibility */
        min-width: 48px;
        min-height: 48px;
    }
    
    .control-btn:hover {
        /* Remove hover effects on touch devices */
        transform: none;
        background: rgba(26, 26, 46, 0.9);
    }
    
    .control-btn:active {
        /* Enhanced active state for touch */
        background: #00BFFF !important;
        color: #000000 !important;
        transform: scale(0.95);
        box-shadow: 0 2px 8px rgba(0, 191, 255, 0.8);
    }
}

/* Additional responsive positioning adjustments */
@media (max-height: 600px) {
    #mobile-controls {
        bottom: 10px;
        padding: 8px;
    }
    
    .control-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .directional-pad {
        gap: 8px;
    }
}

/* Very small screens - both width and height constraints */
@media (max-width: 320px), (max-height: 480px) {
    #mobile-controls {
        bottom: 5px;
        padding: 6px;
        transform: scale(0.85);
    }
    
    .control-btn {
        width: 42px;
        height: 42px;
        font-size: 16px;
        border-width: 1px;
    }
    
    .directional-pad {
        gap: 5px;
    }
    
    .control-actions {
        gap: 6px;
    }
}

/* Ultra-wide screens - landscape gaming optimization */
@media (min-aspect-ratio: 16/9) and (orientation: landscape) and (min-width: 1024px) {
    #mobile-controls {
        flex-direction: row;
        justify-content: space-between;
        width: calc(100% - 40px);
        padding: 15px 20px;
        bottom: 20px;
        left: 20px;
        right: 20px;
        border-radius: 25px;
        background: rgba(0, 0, 0, 0.3);
        backdrop-filter: blur(10px);
    }
    
    .directional-pad {
        order: 1;
    }
    
    .control-actions {
        order: 2;
        flex-direction: row;
        gap: 15px;
    }
}

/* Responsive Canvas Scaling with performance optimizations */
#gameCanvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    /* Performance optimizations for mobile */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    /* Disable image smoothing for crisp pixels and better performance */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: -moz-crisp-edges;
    image-rendering: pixelated;
    /* Better touch handling */
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* Blog Panel Styles - Background Overlay */
.blog-panel {
    position: absolute;
    background: rgba(15, 15, 23, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 2.5rem 2.5rem 3.75rem 2.5rem; /* 40px 40px 60px 40px */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: rgba(224, 224, 224, 0.9);
    border: 1px solid rgba(0, 191, 255, 0.2);
    background-clip: padding-box;
    z-index: 50;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Responsive blog panel */
@media (max-width: 1200px) {
    .blog-panel {
        padding: 2rem 2rem 3rem 2rem; /* 32px 32px 48px 32px */
    }
}

@media (max-width: 900px) {
    .blog-panel {
        padding: 1.5rem 1.5rem 2.5rem 1.5rem; /* 24px 24px 40px 24px */
    }
}

@media (max-width: 600px) {
    .blog-panel {
        padding: 1rem 1rem 2rem 1rem; /* 16px 16px 32px 16px */
    }
}

@media (max-width: 400px) {
    .blog-panel {
        padding: 0.75rem 0.75rem 1.5rem 0.75rem; /* 12px 12px 24px 12px */
    }
}

/* Add subtle scroll indicator */
.blog-panel.left::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60px;
    background: linear-gradient(to bottom, transparent, rgba(0, 191, 255, 0.3), transparent);
    border-radius: 2px;
    opacity: 0.5;
    animation: scrollIndicator 3s ease-in-out infinite;
}

@keyframes scrollIndicator {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

.blog-panel.left {
    border: none;
    box-shadow: none;
    left: 0;
    top: 0;
    width: 50vw;
    height: 100vh;
    overflow-y: auto;
    background: linear-gradient(
        135deg, 
        rgba(10, 10, 31, 0.5) 0%, 
        rgba(26, 26, 46, 0.4) 50%, 
        rgba(15, 15, 35, 0.5) 100%
    );
    backdrop-filter: blur(3px);
    padding-bottom: 5rem; /* 80px */
}

/* Responsive blog panel left */
@media (max-width: 1200px) {
    .blog-panel.left {
        width: 45vw;
        padding-bottom: 4rem; /* 64px */
    }
}

@media (max-width: 900px) {
    .blog-panel.left {
        width: 40vw;
        padding-bottom: 3rem; /* 48px */
    }
}

@media (max-width: 700px) {
    .blog-panel.left {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100vw;
        height: 30vh;
        max-height: 200px;
        z-index: 200;
        background: linear-gradient(
            135deg, 
            rgba(10, 10, 31, 0.95) 0%, 
            rgba(26, 26, 46, 0.95) 50%, 
            rgba(15, 15, 35, 0.95) 100%
        );
        backdrop-filter: blur(10px);
        border-top: 2px solid rgba(0, 191, 255, 0.4);
        border-radius: 15px 15px 0 0;
        transform: translateY(calc(100% - 40px));
        transition: transform 0.3s ease;
        overflow-y: auto;
        padding: 0.75rem 0.75rem 1.5rem 0.75rem;
    }
    
    .blog-panel.left.expanded {
        transform: translateY(0);
    }
    
    .blog-panel.left::before {
        content: '📚 A* Algorithm - Tap to expand';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 40px;
        background: rgba(0, 191, 255, 0.1);
        border-bottom: 1px solid rgba(0, 191, 255, 0.3);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.8rem;
        font-weight: 600;
        color: #00BFFF;
        cursor: pointer;
        z-index: 201;
    }
    
    .blog-panel.left.expanded::before {
        content: '📚 A* Algorithm - Tap to collapse';
        background: rgba(255, 107, 107, 0.1);
        border-bottom: 1px solid rgba(255, 107, 107, 0.3);
        color: #ff6b6b;
    }
    
    .blog-panel.left.expanded::before {
        content: '📚 A* Algorithm - Tap to collapse';
    }
}

.blog-panel h4 {
    margin-bottom: 1.5625rem; /* 25px */
    font-size: 1.5rem; /* 24px */
    font-weight: 700;
    text-align: left;
    letter-spacing: 1px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    color: #00BFFF;
    margin-top: 1.25rem; /* 20px */
    line-height: 1.2;
}

/* Responsive blog headers */
@media (max-width: 1200px) {
    .blog-panel h4 {
        font-size: 1.375rem; /* 22px */
        margin-bottom: 1.25rem; /* 20px */
        margin-top: 1rem; /* 16px */
    }
}

@media (max-width: 900px) {
    .blog-panel h4 {
        font-size: 1.25rem; /* 20px */
        margin-bottom: 1rem; /* 16px */
        margin-top: 0.75rem; /* 12px */
        letter-spacing: 0.5px;
    }
}

.blog-panel h5 {
    font-weight: 600;
    margin-bottom: 0.75rem; /* 12px */
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
    color: #00BFFF;
    font-size: 1rem; /* 16px */
    line-height: 1.3;
}

/* Responsive blog h5 */
@media (max-width: 1200px) {
    .blog-panel h5 {
        font-size: 0.9375rem; /* 15px */
        margin-bottom: 0.625rem; /* 10px */
    }
}

@media (max-width: 900px) {
    .blog-panel h5 {
        font-size: 0.875rem; /* 14px */
        margin-bottom: 0.5rem; /* 8px */
    }
}

.blog-content {
    font-size: 0.875rem; /* 14px */
    line-height: 1.7;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

/* Responsive blog content */
@media (max-width: 1200px) {
    .blog-content {
        font-size: 0.8125rem; /* 13px */
        line-height: 1.6;
    }
}

@media (max-width: 900px) {
    .blog-content {
        font-size: 0.75rem; /* 12px */
        line-height: 1.5;
    }
}

.blog-section {
    margin-bottom: 1.5625rem; /* 25px */
    padding: 0;
}

.blog-section:last-child {
    margin-bottom: 3.75rem; /* 60px */
}

.blog-section p {
    margin-bottom: 0.75rem; /* 12px */
    text-align: left;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
    color: rgba(240, 240, 240, 0.95);
    line-height: 1.6;
}

.blog-section ul, .blog-section ol {
    margin-bottom: 0.9375rem; /* 15px */
    margin-left: 1rem; /* 16px */
}

.blog-section li {
    margin-bottom: 0.375rem; /* 6px */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
    color: rgba(240, 240, 240, 0.95);
    line-height: 1.5;
}

/* Responsive blog sections */
@media (max-width: 1200px) {
    .blog-section {
        margin-bottom: 1.25rem; /* 20px */
    }
    
    .blog-section:last-child {
        margin-bottom: 3rem; /* 48px */
    }
    
    .blog-section p {
        margin-bottom: 0.625rem; /* 10px */
        line-height: 1.5;
    }
    
    .blog-section ul, .blog-section ol {
        margin-bottom: 0.75rem; /* 12px */
        margin-left: 0.875rem; /* 14px */
    }
    
    .blog-section li {
        margin-bottom: 0.25rem; /* 4px */
        line-height: 1.4;
    }
}

@media (max-width: 900px) {
    .blog-section {
        margin-bottom: 1rem; /* 16px */
    }
    
    .blog-section:last-child {
        margin-bottom: 2.5rem; /* 40px */
    }
    
    .blog-section p {
        margin-bottom: 0.5rem; /* 8px */
        line-height: 1.4;
    }
    
    .blog-section ul, .blog-section ol {
        margin-bottom: 0.625rem; /* 10px */
        margin-left: 0.75rem; /* 12px */
    }
    
    .blog-section li {
        margin-bottom: 0.125rem; /* 2px */
        line-height: 1.3;
    }
}

/* Custom scrollbar for blog panel - Invisible */
.blog-panel {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.blog-panel::-webkit-scrollbar {
    display: none; /* WebKit browsers */
}

/* Hide blog panel during gameplay */
.blog-panel.hidden {
    opacity: 0;
    transform: translateX(-100%);
    pointer-events: none;
}

/* Responsive design for blog panel */
@media (max-width: 1400px) {
    .blog-panel.left {
        width: 50vw;
        font-size: 13px;
        padding: 35px 35px 70px 35px; /* Adjusted bottom padding */
    }
    
    .blog-panel h4 {
        font-size: 22px;
    }
    
    .blog-panel h5 {
        font-size: 15px;
    }
    
    .menu-buttons {
        width: calc(50vw - 50px);
        max-width: 550px;
        min-width: 350px;
        margin-left: 25px;
    }
}

@media (max-width: 1200px) {
    .blog-panel.left {
        width: 50vw;
        padding: 30px 30px 60px 30px; /* Adjusted bottom padding */
    }
    
    .blog-panel h4 {
        font-size: 20px;
    }
    
    .menu-buttons {
        width: calc(50vw - 40px);
        max-width: 500px;
        min-width: 320px;
        padding: 35px;
        margin-left: 20px;
    }
}

@media (max-width: 900px) {
    .blog-panel.left {
        display: none;
    }
    
    .menu-buttons {
        width: calc(90vw - 40px);
        max-width: 450px;
        min-width: 300px;
        left: 50%;
        transform: translate(-50%, -50%);
        margin-left: 0;
    }
}
