/* Teenage Engineering EP-133 K.O. II - Buttons Style */

/* Import Montserrat font */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600&display=swap');

/* Import Arcade Gamer font */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');

/* TV Buttons Container */
.tv-buttons-container {
    position: absolute;
    bottom: 16%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    gap: 2rem;
}

/* Teenage Engineering Button Style with Images */
.teenage-btn {
    width: 5.7em;
    height: 5.7em;
    border: none;
    outline: none;
    background: none;
    cursor: pointer;
    transition: 0.1s ease-in-out;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
}

.teenage-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: 0.1s ease-in-out;
}

/* Button Text Below Image */
.teenage-btn-text {
    margin-top: 0.5em;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: 0.7em;
    color: #53d8d7;
    text-shadow:
        0 0 5px #53d8d7,
        0 0 10px #53d8d7,
        0 0 15px #53d8d7;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    pointer-events: none;
    z-index: 10;
    transition: 0.1s ease-in-out;
    text-align: center;
}

/* Button Active State */
.teenage-btn:active {
    transform: translateY(1px) scale(0.98);
}

.teenage-btn:active img {
    transform: scale(0.95);
}

.teenage-btn:active .teenage-btn-text {
    transform: scale(0.95);
}

/* Button Hover State */
.teenage-btn:hover {
    transform: scale(1.05);
}

.teenage-btn:hover img {
    filter: brightness(1.1);
}

.teenage-btn:hover .teenage-btn-text {
    text-shadow:
        0 0 8px #53d8d7,
        0 0 15px #53d8d7,
        0 0 25px #53d8d7;
    transform: scale(1.05);
}

/* Specific Button Styles */
.teenage-btn.video-btn {
    /* Video button specific styles */
    transform: translateY(-0.5em);
}

/* Text alignment for GAME button */
.teenage-btn.video-btn .teenage-btn-text {
    margin-top: 2.2em;
}

/* Button Container for proper spacing */
.teenage-btn-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5em;
}

.teenage-btn.game-btn {
    /* Game button specific styles */
}

.teenage-btn.third-btn {
    /* Third button specific styles */
}

/* Responsive Design */
@media (max-width: 768px) {
    .tv-buttons-container {
        bottom: 15%;
        gap: 1.5rem;
    }

    .teenage-btn {
        width: 4.5em;
        height: 4.5em;
    }

    .teenage-btn-text {
        font-size: 0.6em;
        margin-top: 0.4em;
    }

    .teenage-btn.video-btn .teenage-btn-text {
        margin-top: 0.6em;
    }
}

@media (max-width: 480px) {
    .tv-buttons-container {
        bottom: 13%;
        gap: 1.2rem;
    }

    .teenage-btn {
        width: 4em;
        height: 4em;
    }

    .teenage-btn-text {
        font-size: 0.55em;
        margin-top: 0.3em;
    }

    .teenage-btn.video-btn .teenage-btn-text {
        margin-top: 0.5em;
    }
}

@media (max-width: 360px) {
    .tv-buttons-container {
        bottom: 11%;
        gap: 1rem;
    }

    .teenage-btn {
        width: 3.5em;
        height: 3.5em;
    }

    .teenage-btn-text {
        font-size: 0.5em;
        margin-top: 0.25em;
    }

    .teenage-btn.video-btn .teenage-btn-text {
        margin-top: 0.45em;
    }
}

/* Game Controls - Layout with EXIT on Left and Cross on Right */
.game-controls-container {
    position: absolute;
    bottom: 13%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    /* align-items: center; */
    gap: 3rem;
}

/* EXIT Button on Left - Fixed Size */
.game-btn-exit {
    order: 1;
    width: 3.5em !important;
    height: 3.5em !important;
    flex-shrink: 0;
}

/* START Button on Right - Fixed Size */
.game-btn-start {
    order: 3;
    width: 3.5em !important;
    height: 3.5em !important;
    flex-shrink: 0;
}

/* Cross Layout Container */
.game-cross-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    gap: 0;
    /* No gap - buttons touching */
    width: 10.5em;
    /* 3.5em * 3 = 10.5em for exact fit */
    height: 6em;
    /* 3.5em * 3 = 10.5em for exact fit */
    place-items: stretch;
    /* Stretch to fill grid cells completely */
    order: 2;
    flex-shrink: 0;
    align-content: stretch;
    justify-content: space-evenly;
    align-items: baseline;
    justify-items: stretch;
}

/* Individual Button Positioning in Cross Layout */
.game-btn-up {
    grid-column: 2;
    grid-row: 1;
}

.game-btn-left {
    grid-column: 1;
    grid-row: 2;
}

.game-btn-right {
    grid-column: 3;
    grid-row: 2;
}

.game-btn-down {
    grid-column: 2;
    grid-row: 3;
}

/* Center spacer - removed, buttons will touch directly */

.game-control-btn {
    width: 100%;
    /* Fill grid cell completely */
    height: 100%;
    /* Fill grid cell completely */
    border-radius: 0;
    /* No border radius for perfect touching */
    border: none;
    outline: none;
    background: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.1s ease-in-out;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 0;
    /* Remove any default margins */
    box-sizing: border-box;
    /* Include borders in size calculation */
}

.game-control-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: 0.1s ease-in-out;
}

/* Game Button Text - Overlaid on Button */
.game-control-btn .game-btn-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: 0.7em;
    color: #53d8d7;
    text-shadow:
        0 0 5px #53d8d7,
        0 0 10px #53d8d7,
        0 0 15px #53d8d7;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    pointer-events: none;
    z-index: 15;
    transition: 0.1s ease-in-out;
    text-align: center;
    white-space: nowrap;
}

.game-control-btn:hover {
    transform: scale(1.05);
}

.game-control-btn:hover img {
    filter: brightness(1.1);
}

.game-control-btn:hover .game-btn-text {
    transform: translate(-50%, -50%) scale(1.1);
    text-shadow:
        0 0 8px #53d8d7,
        0 0 12px #53d8d7,
        0 0 20px #53d8d7;
}

.game-control-btn:active {
    transform: translateY(1px) scale(0.98);
}

.game-control-btn:active img {
    transform: scale(0.95);
}

.game-control-btn:active .game-btn-text {
    transform: translate(-50%, -50%) scale(0.95);
}

/* Responsive Game Controls */
@media (max-width: 768px) {
    .game-controls-container {
        bottom: 6%;
        gap: 1.2rem;
    }

    .game-btn-exit {
        width: 3em !important;
        height: 3em !important;
    }

    .game-btn-start {
        width: 3em !important;
        height: 3em !important;
    }

    .game-cross-container {
        width: 9em;
        /* 3em * 3 = 9em */
        height: 9em;
        /* 3em * 3 = 9em */
    }

    .game-control-btn .game-btn-text {
        font-size: 0.6em;
    }
}

@media (max-width: 480px) {
    .game-controls-container {
        bottom: 5%;
        gap: 1rem;
    }

    .game-btn-exit {
        width: 2.5em !important;
        height: 2.5em !important;
    }

    .game-btn-start {
        width: 2.5em !important;
        height: 2.5em !important;
    }

    .game-cross-container {
        width: 7.5em;
        /* 2.5em * 3 = 7.5em */
        height: 7.5em;
        /* 2.5em * 3 = 7.5em */
    }

    .game-control-btn .game-btn-text {
        font-size: 0.55em;
    }
}

@media (max-width: 360px) {
    .game-controls-container {
        bottom: 4%;
        gap: 0.8rem;
    }

    .game-btn-exit {
        width: 2em !important;
        height: 2em !important;
    }

    .game-btn-start {
        width: 2em !important;
        height: 2em !important;
    }

    .game-cross-container {
        width: 6em;
        /* 2em * 3 = 6em */
        height: 6em;
        /* 2em * 3 = 6em */
    }

    .game-control-btn .game-btn-text {
        font-size: 0.5em;
    }
}