/* Mobile-specific styles for cybreco */
/* Base mobile overrides */
@media (max-width: 768px) {
    /* Hide desktop layout on mobile */
    .container {
        display: none !important;
    }
    
    /* Content box adjustments for mobile fallback */
    .content-box {
        width: 60px;
        height: 60px;
    }
    .center-bg-image {
        width: 120px;
        max-width: 30vw;
    }
    .title-text {
        font-size: 12px;
    }
}

/* Mobile layout */
.mobile-container {
    display: none;
}

@media (max-width: 768px) {
    /* Show and style mobile layout */
    .mobile-container {
        display: flex !important;
        flex-direction: column;
        width: 100vw;
        height: 100vh;
        background: #000;
        position: relative;
        overflow: hidden;
    }
    
    .mobile-horizon-vertical-full {
        position: absolute;
        left: 50%;
        top: 0;
        bottom: 0;
        width: 2px;
        background-color: #fff;
        z-index: 5;
        transform: translateX(-50%);
    }
    
    .mobile-header {
        text-align: center;
        padding: 30px 20px;
        z-index: 15;
        position: relative;
    }
    
    .mobile-name-image {
        height: 50px;
        width: auto;
        max-width: 250px;
        opacity: 1;
    }
    
    .mobile-content {
        flex: 1;
        position: relative;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 20px;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        /* Hide scrollbar */
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* Internet Explorer 10+ */
    }
    
    .mobile-content::-webkit-scrollbar {
        display: none; /* WebKit */
    }
    
    .mobile-boxes-container {
        position: relative;
        left: 50%;
        transform: translateX(-50%);
        /* Center the whole container horizontally */
        width: 100%;
        height: auto;
        min-height: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
        padding-bottom: 60px;
        z-index: 10;
    }
    .mobile-boxes-container > div {
        display: flex;
        align-items: center;
        margin-bottom: 18px;
        position: relative;
        justify-content: flex-start;
        left: 0;
        transform: none;
    }
    .mobile-content-box {
        position: relative !important;
        width: 70px;
        height: 70px;
        background-color: #222;
        border: 1px solid #fff; /* 1px white border for all mobile boxes */
        transition: all 0.3s ease;
        cursor: pointer;
        touch-action: manipulation;
        left: auto !important;
        top: auto !important;
        z-index: 15;
    }
    .mobile-content-box:active {
        transform: scale(0.95);
        border-color: #666;
        background-color: #333;
    }
    .mobile-content-box img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        filter: contrast(1.2) brightness(0.9);
        border-radius: 0;
        border: none;
        display: block;
    }
    .mobile-content-box.placeholder {
        background-color: #111;
        border: 2px dashed #333;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #666;
        font-size: 9px;
        text-align: center;
    }
    .mobile-box-number {
        position: absolute;
        width: 15px;
        height: 15px;
        background: #000;
        color: #fff;
        border: 1px solid #fff;
        font-family: 'Dogica', monospace;
        font-size: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10;
        pointer-events: none;
        user-select: none;
        box-sizing: border-box;
        top: -7px;
        left: -7px;
    }
    .mobile-box-title {
        display: inline-block;
        position: absolute;
        left: 80px;
        top: 50%;
        transform: translateY(-50%);
        color: #fff;
        font-family: 'Dogica', monospace;
        font-size: 9px;
        white-space: nowrap;
        pointer-events: none;
    }
    
    /* Main menu mobile centering */
    .mobile-boxes-container:not(.mobile-games-container) {
        display: flex;
        flex-direction: column;
        align-items: center;
        left: 0;
        transform: none;
        position: relative;
        width: 100%;
    }
    /* Games menu mobile centering: use left: 50% and transform: translateX(-50%) on the wrapper, not the container */
    .mobile-boxes-container {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        width: auto;
        position: relative;
        margin: 0;
        left: 50%;
        transform: translateX(-50%);
    }
    .mobile-boxes-container > div {
        display: flex;
        align-items: center;
        margin-bottom: 18px;
        position: relative;
        justify-content: flex-start;
        left: 0;
        transform: none;
    }
    .mobile-game-year-label {
        display: inline-block;
        position: static;
        min-width: 55px;
        margin-right: 8px;
        color: #fff;
        font-family: 'Dogica', monospace;
        font-size: 9px;
        letter-spacing: 1.5px;
        white-space: nowrap;
        opacity: 0.7;
        text-align: left;
        z-index: 16;
        padding-left: 10px;
        background: none;
        transform: none;
    }
    
    .mobile-content-box.mobile-game-box {
        margin-left: 0 !important;
    }
    
    .mobile-detail-popup {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.9);
        z-index: 100;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px;
    }
    
    .mobile-detail-content {
        background: #111;
        border: 1px solid #444;
        border-radius: 8px;
        padding: 25px;
        max-width: 90%;
        position: relative;
        text-align: center;
    }
    
    .mobile-detail-name {
        color: #fff;
        font-family: 'Dogica', monospace;
        font-size: 16px;
        margin-bottom: 15px;
        cursor: pointer;
        text-decoration: underline;
        text-decoration-color: #666;
        transition: color 0.3s;
    }
    
    .mobile-detail-name:hover {
        color: #ccc;
    }
    
    .mobile-detail-description {
        color: #aaa;
        font-family: 'Dogica', monospace;
        font-size: 11px;
        line-height: 1.4;
        margin-bottom: 10px;
    }
    
    .mobile-detail-close {
        position: absolute;
        top: 15px;
        right: 15px;
        color: #666;
        font-size: 18px;
        cursor: pointer;
        width: 25px;
        height: 25px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: color 0.3s;
    }
    
    .mobile-detail-close:hover {
        color: #fff;
    }
    
    .mobile-bit-symbol {
        position: absolute;
        font-family: 'Dogica', monospace;
        font-size: 8px;
        color: #666;
        opacity: 0.4;
        pointer-events: none;
        user-select: none;
    }
    
    .mobile-touch-controls {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(0,0,0,0.8);
        padding: 10px;
        z-index: 20;
        text-align: center;
    }
    
    .mobile-scroll-indicator {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }
    
    .mobile-scroll-text {
        color: #666;
        font-family: 'Dogica', monospace;
        font-size: 8px;
    }
    
    .mobile-scroll-arrow {
        color: #666;
        font-size: 12px;
        animation: bounce 2s infinite;
    }
    
    @keyframes bounce {
        0%, 20%, 50%, 80%, 100% {
            transform: translateY(0);
        }
        40% {
            transform: translateY(-3px);
        }
        60% {
            transform: translateY(-2px);
        }
    }
}
