/* Homepage Layout - Responsive Grid Design */

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

body {
    font-family: verdana, sans-serif;
    overflow-x: hidden;
}

/* Grid Container */
#app {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stage {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;
}

.grid-container {
    display: grid;
    width: max-content;
    gap: 2px 2px;
}

.grid-item {
    border: none;
    color: white;
    padding: 0;
    text-align: center;
    font-size: 10px;
    opacity: 1;
    transition: 0.5s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-item:hover {
    opacity: 0.25;
}

.grid-item img.cat {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

/* Flag Container */
.flag {
    cursor: pointer;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.flag img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Overlay */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.overlay-content {
    position: relative;
    width: 95vw;
    height: 92vh;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 36px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    z-index: 1001;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #000;
}

.overlay-content h2 {
    margin: 0 0 10px 0;
    color: #333;
    flex-shrink: 0;
    font-size: 1.5rem;
}

.iframe-container {
    width: 100%;
    flex: 1;
    min-height: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Desktop: 100×100px Blöcke, 12 Spalten × 6 Zeilen */
@media (min-width: 1025px) {
    .grid-container {
        grid-template-columns: repeat(12, 100px);
        grid-template-rows: repeat(6, 100px);
    }
}

/* Tablet: 80×80px Blöcke, 12 Spalten × 6 Zeilen */
@media (min-width: 769px) and (max-width: 1024px) {
    .grid-container {
        grid-template-columns: repeat(12, 80px);
        grid-template-rows: repeat(6, 80px);
    }
}

/* Mobile Hochkant: 60×60px Blöcke, 6 Spalten × 12 Zeilen */
@media (max-width: 768px) and (orientation: portrait) {
    .grid-container {
        grid-template-columns: repeat(6, 60px);
        grid-template-rows: repeat(12, 60px);
    }

    .grid-item {
        font-size: 8px;
    }

    .overlay-content {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        padding: 10px;
    }

    .overlay-content h2 {
        font-size: 1.2rem;
    }

    .close-btn {
        font-size: 32px;
        top: 5px;
        right: 10px;
    }
}

/* Mobile Querformat: 60×60px Blöcke, 12 Spalten × 6 Zeilen */
@media (max-width: 768px) and (orientation: landscape) {
    .grid-container {
        grid-template-columns: repeat(12, 60px);
        grid-template-rows: repeat(6, 60px);
    }

    .grid-item {
        font-size: 8px;
    }

    .overlay-content {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        padding: 10px;
    }

    .overlay-content h2 {
        font-size: 1.2rem;
    }

    .close-btn {
        font-size: 32px;
        top: 5px;
        right: 10px;
    }
}
