:root {
    --bg-dark: #1a1a1a;
    --bg-panel: #2d2d2d;
    --border-light: #b8860b;
    --border-dark: #654321;
    --text-gold: #ffd700;
    --text-white: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Press Start 2P', monospace, sans-serif;
    color: var(--text-white);
    min-height: 100vh;
    font-size: 10px;
    overflow-x: hidden;
}

/* Animated Background */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/greenbrick.png');
    background-repeat: repeat;
    z-index: -1;
}

/* Main Container */
.game-container {
    max-width: 100%;
    padding: 15px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Title */
.header {
    text-align: center;
    margin-bottom: 15px;
}


/* Main Window - GIF Display */
.main-window {
    background: linear-gradient(180deg, var(--bg-panel), #1f1f1f);
    border: 2px double var(--border-light);
    border-radius: 4px;
    padding: 5px;
    margin-bottom: 20px;
    position: relative;
}

.window-frame {
    border: 2px outset var(--border-light);
    padding: 5px;
    background: #000;
}

.main-gif {
    width: 100%;
    height: 630px;
    display: block;
    border: 1px inset var(--border-dark);
}

/* Menu Bar */
.menu-bar {
    background: #225000;
    border: 3px ridge var(--border-light);
    border-radius: 4px;
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    position: sticky;
    bottom: 0;
}

/* RPG Buttons */
.rpg-button {
    background: #2d2d2d;
    border: 3px outset var(--border-light);
    color: var(--text-white);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    position: relative;
    text-decoration: none;
    min-height: 70px;
}

.rpg-button::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    height: 1px;
    background: rgba(255,255,255,0.25);
    pointer-events: none;
}

.rpg-button-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    border: 1px inset var(--border-dark);
    border-radius: 4px;
    overflow: hidden;
}

.rpg-button-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.rpg-button-label {
    font-family: 'Press Start 2P', monospace, sans-serif;
    font-size: 7px;
    text-transform: uppercase;
    text-shadow: 1px 1px 0 #000;
    white-space: nowrap;
}

.rpg-button:hover {
    background: linear-gradient(180deg, #5a5a5a, #3d3d3d);
    border-color: var(--text-gold);
}

.rpg-button:active {
    border-style: inset;
    transform: translateY(2px);
    background: linear-gradient(180deg, #2d2d2d, #4a4a4a);
}

.rpg-button:active .rpg-button-icon {
    border-style: inset;
}

/* Button Color Accents */
.rpg-button:nth-child(1):hover { border-color: #c0392b; }
.rpg-button:nth-child(2):hover { border-color: #2980b9; }
.rpg-button:nth-child(3):hover { border-color: #27ae60; }
.rpg-button:nth-child(4):hover { border-color: #f39c12; }
.rpg-button:nth-child(5):hover { border-color: #9b59b6; }



/* Mobile Touch Optimization */
@media (hover: none) and (pointer: coarse) {
    .rpg-button {
        min-height: 75px;
    }

    .rpg-button-icon {
        width: 45px;
        height: 45px;
    }

    .rpg-button-icon img {
        width: 36px;
        height: 36px;
    }
}

/* Smaller Screens */
@media (max-width: 400px) {
    .game-title {
        font-size: 12px;
    }

    .rpg-button-label {
        font-size: 6px;
    }
}

/* Larger Mobile Screens */
@media (min-width: 500px) {
    .game-container {
        max-width: 500px;
        margin: 0 auto;
    }
}


/* ===== OVERLAY GALLERY ON TOP OF THE GIF ===== */
.gallery-overlay {
    position: absolute;
    inset: 0;                      /* Stretch exactly over the GIF */
    display: flex;
    flex-direction: column;
    overflow: hidden;              /* Keep overlay clipped to the GIF area */
    background: rgba(26, 26, 26, 0.15); /* Semi-transparent so GIF animates behind */
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
}

.section-title {
    color: var(--text-gold);
    font-size: 11px;
    margin: 10px 10px 8px;
    text-align: center;
    text-shadow: 2px 2px 0 #000;
    border-bottom: 1px dotted var(--border-light);
    padding-bottom: 6px;
    flex-shrink: 0;
}

/* Vertical Scroll Container */
.gallery-container {
    flex: 1;
    overflow-y: auto;              /* Vertical scrolling */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;         /* Stack items vertically */
    align-items: center;
    gap: 12px;
    padding: 5px 10px 15px;
}

/* Custom Scrollbar (Webkit) */
.gallery-container::-webkit-scrollbar {
    width: 8px;
}

.gallery-container::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 3px;
}

.gallery-container::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
    border: 1px solid #000;
}

/* Gallery Item Cards */
.gallery-item {
    flex-shrink: 0;
    width: 90%;
    max-width: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
   /* background: linear-gradient(180deg, rgba(74, 74, 74, 0.92), rgba(45, 45, 45, 0.92));*/
    border: 2px outset var(--border-light);
    border-radius: 4px;
    padding: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-item:hover {
    transform: scale(1.04);
    box-shadow: 0 0 12px var(--border-light);
}

.gallery-image-wrapper {
    width: 200px;
    height: 250px;
    background: #000;
    border: 2px inset var(--border-dark);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 8px;
    position: relative;
}
.gallery-image-wrapper-tall {
    width: 225px;
    background: #000;
    border: 2px inset var(--border-dark);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 8px;
    position: relative;
}

.gallery-image-wrapper::after {
    content: '📄';
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 12px;
    opacity: 0.7;
    text-shadow: 1px 1px 0 #000;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.2s ease;
}

.gallery-item:hover img {
    filter: brightness(1.2);
}

.gallery-label {
    font-family: 'Press Start 2P', monospace, sans-serif;
    font-size: 8px;
    color: var(--text-gold);
    text-align: center;
    text-shadow: 1px 1px 0 #000;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-item:active {
    transform: scale(0.98);
}

.gallery-item:focus {
    outline: 2px solid var(--text-gold);
    outline-offset: 2px;
}

/* Scroll hint */
.gallery-scroll-hint {
    text-align: center;
    font-size: 8px;
    color: var(--text-gold);
    padding: 5px 0 8px;
    flex-shrink: 0;
    text-shadow: 1px 1px 0 #000;
    animation: bounce 1.5s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(3px); }
}