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

body {
    font-family: 'Courier New', monospace;
    background: #F2EEE1; /* Aztec Parchment */
    color: #1A1400; /* Aztec Ink */
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    /* Retro scanline effect */
    background-image: repeating-linear-gradient(
        0deg,
        rgba(26, 20, 0, 0.03) 0px,
        rgba(242, 238, 225, 1) 1px,
        rgba(242, 238, 225, 1) 2px
    );
}

/* Screen Management */
.screen {
    display: none;
    width: 100%;
    min-height: 100vh;
    position: relative;
    padding: 2rem 0;
}

.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

/* Login Screen - Aztec Retro Theme with Renaissance Background */
#login-screen {
    background: #2BFAE9; /* Fallback color */
    background-image: url('images/retro_background.jpg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    justify-content: center;
    border: 4px solid #1A1400;
    box-shadow: inset 0 0 0 3px #D4FF28, 0 0 0 3px #1A1400, 0 0 20px rgba(212, 255, 40, 0.5);
    position: relative;
}

#login-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 30, 0.4), /* Dark blue overlay */
        rgba(46, 0, 38, 0.4), /* Aubergine overlay */
        rgba(43, 250, 233, 0.3) /* Aqua overlay */
    );
    z-index: 1;
}

.login-container {
    text-align: center;
    background: #F2EEE1; /* Parchment background */
    padding: 3rem;
    border: 4px solid #1A1400;
    box-shadow: 
        8px 8px 0px #1A1400,
        inset 0 0 0 2px #D4FF28;
    max-width: 500px;
    width: 90%;
    position: relative;
    z-index: 2; /* Ensure it's above the background overlay */
    backdrop-filter: blur(20px);
    background: rgba(242, 238, 225, 0.95); /* Semi-transparent Parchment */
}

.title-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin: 1.5rem 0;
    position: relative;
    flex-wrap: wrap;
}

.games-section {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
    position: relative;
}

.menu-buttons-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
    position: relative;
}

.game-title {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 0;
    color: #1A1400; /* Ink */
    text-shadow: 
        4px 4px 0px #D4FF28, /* Chartreuse shadow */
        8px 8px 0px #FF2DF4; /* Orchid shadow */
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    text-transform: uppercase;
    flex: 0 0 auto;
}

/* Decorative Goose Images */
.goose-decorative {
    flex: 0 0 auto;
    position: relative;
    animation: float 3s ease-in-out infinite;
}

.goose-title {
    animation-delay: 0s;
}

.goose-games {
    animation-delay: 1s;
}

.goose-footer {
    animation-delay: 2s;
}

.goose-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    filter: 
        drop-shadow(4px 4px 0px #1A1400)
        drop-shadow(2px 2px 0px #D4FF28)
        drop-shadow(0px 0px 8px rgba(212, 255, 40, 0.5));
    transition: transform 0.3s ease;
    display: block;
}

/* Handle missing or broken images */
.goose-img {
    background: transparent;
}

.goose-img[src=""],
.goose-img:not([src]) {
    display: none;
}

/* Show emoji fallback when image fails to load */
.goose-decorative {
    position: relative;
}

.goose-decorative::after {
    content: '';
    display: none;
    font-size: 4rem;
    line-height: 80px;
    text-align: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 80px;
    height: 80px;
    filter: 
        drop-shadow(4px 4px 0px #1A1400)
        drop-shadow(2px 2px 0px #D4FF28);
}

/* For browsers that support :has() selector */
@supports selector(:has(*)) {
    .goose-decorative:has(img[src=""])::after,
    .goose-decorative:has(img:not([src]))::after {
        content: '🦢';
        display: block;
    }
}

/* JavaScript will handle image errors */

.goose-img:hover {
    transform: scale(1.1) rotate(5deg);
    filter: 
        drop-shadow(4px 4px 0px #1A1400)
        drop-shadow(2px 2px 0px #D4FF28)
        drop-shadow(0px 0px 12px rgba(255, 45, 244, 0.8));
}

/* Goose images positioned outside container - relative to screen */
#main-menu {
    position: relative;
}

#main-menu .goose-games {
    position: absolute;
    right: 1rem;
    top: 45%;
    z-index: 10;
}

#main-menu .goose-games .goose-img {
    width: 90px;
    height: 90px;
}

#main-menu .goose-footer {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    z-index: 10;
}

#main-menu .goose-footer .goose-img {
    width: 85px;
    height: 85px;
}

/* Floating animation for retro charm */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Retro scanline effect for images on hover */
.goose-img:hover {
    position: relative;
}

.goose-img:hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0) 0px,
        rgba(0, 0, 0, 0.03) 1px,
        rgba(0, 0, 0, 0) 2px
    );
    pointer-events: none;
    animation: scanline 0.1s linear infinite;
}

@keyframes scanline {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(4px);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .title-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .games-section {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .menu-buttons-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .game-title {
        font-size: 2.5rem;
    }
    
    .goose-img {
        width: 60px;
        height: 60px;
    }
    
    #main-menu .goose-games {
        position: static;
        margin: 1rem 0;
    }
    
    #main-menu .goose-games .goose-img {
        width: 70px;
        height: 70px;
    }
    
    #main-menu .goose-footer {
        position: static;
        margin: 1rem 0;
    }
    
    #main-menu .goose-footer .goose-img {
        width: 65px;
        height: 65px;
    }
}

.game-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #001F18; /* Malachite */
    font-weight: bold;
}

.discord-btn {
    background: #2E0026; /* Aztec Aubergine */
    color: #D4FF28; /* Chartreuse text */
    border: 3px solid #1A1400;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 auto;
    transition: all 0.15s ease;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 4px 4px 0px #1A1400, 
                inset 0 0 0 1px #FF2DF4;
    position: relative;
}

.discord-btn:hover {
    background: #D4FF28;
    color: #1A1400;
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px #1A1400;
}

.discord-btn:active {
    transform: translate(4px, 4px);
    box-shadow: none;
}

.login-options {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.login-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #1A1400;
    font-weight: bold;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    border-bottom: 2px solid #1A1400;
}

.login-divider span {
    padding: 0 1rem;
}

.custom-login-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.username-input {
    padding: 1rem;
    font-size: 1.1rem;
    border: 3px solid #1A1400;
    background: #F2EEE1;
    color: #1A1400;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    box-shadow: 2px 2px 0px #1A1400;
    transition: all 0.3s ease;
    text-align: center;
}

.username-input:focus {
    outline: none;
    box-shadow: 4px 4px 0px #1A1400, inset 0 0 0 2px #D4FF28;
    transform: translateY(-2px);
}

.username-input::placeholder {
    color: #1A1400;
    opacity: 0.5;
}

.custom-login-btn {
    background: #00122E;
    color: #FFD700;
    border: 3px solid #1A1400;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 4px 4px 0px #1A1400;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Courier New', monospace;
}

.custom-login-btn:hover {
    background: #002040;
    transform: translateY(-2px);
    box-shadow: 6px 6px 0px #1A1400;
}

.custom-login-btn:active {
    transform: translateY(0);
    box-shadow: 2px 2px 0px #1A1400;
}

/* Main Menu - Aztec Retro Theme */
.menu-container {
    text-align: center;
    max-width: 1200px;
    padding: 2rem;
    width: 100%;
    margin: 0 auto;
    background: #F2EEE1; /* Parchment */
    border: 4px solid #1A1400;
    box-shadow: 8px 8px 0px #1A1400;
    position: relative;
}

.user-info {
    position: fixed;
    top: 2rem;
    right: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #D4FF28; /* Chartreuse */
    color: #1A1400; /* Ink */
    padding: 1rem;
    border: 3px solid #1A1400;
    box-shadow: 4px 4px 0px #1A1400, inset 0 0 0 1px #FF2DF4;
    z-index: 1000;
    font-weight: bold;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #FFD700;
}

.user-name {
    font-weight: 700;
    color: #1A1400;
}

.logout-btn {
    background: #ff4444;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Orbitron', monospace;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: #cc3333;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.game-card {
    background: #00122E; /* Dark blue */
    padding: 2rem;
    border: 4px solid #1A1400;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 6px 6px 0px #1A1400;
    position: relative;
    overflow: hidden;
}

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

.game-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0px #1A1400, inset 0 0 0 2px #D4FF28;
}

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

.game-card:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px #1A1400;
}

.game-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    filter: drop-shadow(2px 2px 0px #FF2DF4);
}

.game-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #D4FF28; /* Chartreuse */
    text-shadow: 2px 2px 0px #1A1400; /* Ink shadow */
    font-weight: bold;
    text-transform: uppercase;
}

.game-card p {
    color: #F2EEE1; /* Parchment - light text */
    margin-bottom: 1rem;
    font-weight: 500;
}

.score-display {
    font-weight: 700;
    color: #1A1400; /* Dark brown */
    background: #FF2DF4; /* Orchid background */
    padding: 0.3rem 0.6rem;
    border: 2px solid #1A1400;
    box-shadow: 2px 2px 0px #1A1400;
    display: inline-block;
}

.menu-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.menu-btn {
    background: #00122E; /* Lapis */
    color: #D4FF28; /* Chartreuse text */
    border: 3px solid #1A1400;
    padding: 1rem 2rem;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.15s ease;
    box-shadow: 4px 4px 0px #1A1400;
}

.menu-btn:hover {
    background: #D4FF28;
    color: #1A1400;
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px #1A1400;
}

.menu-btn:active {
    transform: translate(4px, 4px);
    box-shadow: none;
}

.admin-btn {
    background: #2E0700; /* Oxblood */
    color: #FF1A1A; /* Vermillion text */
}

.admin-btn:hover {
    background: #FF1A1A;
    color: #2E0700;
}

/* Game Screen */
#game-screen {
    flex-direction: column;
    padding: 2rem;
    justify-content: flex-start;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 1000px;
}

.back-btn {
    background: #666;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Orbitron', monospace;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #555;
}

.game-title-display {
    text-align: center;
}

.game-title-display h2 {
    font-size: 2rem;
    color: #1A1400;
    margin-bottom: 0.5rem;
}

#game-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 0;
}

/* Flappy Goose Game */
#flappy-canvas {
    border: 2px solid #FFD700;
    border-radius: 10px;
    background: #87CEEB;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

/* Sliding Puzzle Game */
.mole-container {
    text-align: center;
    padding: 2rem;
    max-width: 100%;
    overflow-x: hidden;
}

.mole-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.mole-hole {
    width: 150px;
    height: 150px;
    background: #8B4513; /* Brown - dirt color */
    border: 4px solid #1A1400;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: all 0.1s ease;
    box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.5);
    touch-action: manipulation; /* Prevent double-tap zoom on mobile */
}

/* Mobile optimization for mole holes */
@media (max-width: 768px) {
    .mole-grid {
        gap: 0.5rem;
        max-width: 100%;
        padding: 0 1rem;
    }
    
    .mole-hole {
        width: calc((100vw - 4rem) / 3 - 0.5rem);
        height: calc((100vw - 4rem) / 3 - 0.5rem);
        min-width: 80px;
        min-height: 80px;
        max-width: 150px;
        max-height: 150px;
    }
    
    #whac-timer {
        font-size: 1.2rem !important;
    }
}

@media (max-width: 480px) {
    .mole-container {
        padding: 1rem;
    }
    
    .mole-grid {
        gap: 0.3rem;
    }
    
    .mole-hole {
        width: calc((100vw - 3rem) / 3 - 0.3rem);
        height: calc((100vw - 3rem) / 3 - 0.3rem);
        min-width: 70px;
        min-height: 70px;
    }
    
    #whac-timer {
        font-size: 1rem !important;
    }
}

.mole-hole:active {
    transform: scale(0.95);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.7);
}

.mole-hole.has-mole {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><text y="50" x="50" font-size="80" text-anchor="middle" dominant-baseline="middle">🐹</text></svg>');
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.mole-hole.has-mole-custom {
    /* Custom images will be set via inline styles - no default background */
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.mole-hole.has-bomb {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><text y="50" x="50" font-size="80" text-anchor="middle" dominant-baseline="middle">💣</text></svg>');
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.mole-hole.has-bomb-custom {
    /* Custom images will be set via inline styles - no default background */
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

@keyframes molePopOut {
    0% {
        transform: translate(-50%, -150%) scale(0.5);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes bombPopOut {
    0% {
        transform: translate(-50%, -150%) scale(0.5);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.puzzle-container {
    text-align: center;
}

.puzzle-layout {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 2rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

#puzzle-grid {
    display: grid;
    grid-template-columns: repeat(3, 100px);
    grid-template-rows: repeat(3, 100px);
    gap: 5px;
    width: fit-content;
}

.puzzle-reference {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.puzzle-reference h4 {
    color: #FFD700;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

#reference-image {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #FFD700;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.puzzle-piece {
    width: 100px;
    height: 100px;
    background-size: cover;
    background-position: center;
    border: 2px solid #FFD700;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.puzzle-piece:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.puzzle-piece.empty {
    background: rgba(0, 0, 0, 0.3);
    border: 2px dashed #FFD700;
}

.puzzle-controls {
    margin-top: 2rem;
}

.puzzle-controls button {
    background: #667eea;
    color: white;
    border: none;
    padding: 1rem 2rem;
    margin: 0 1rem;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    transition: all 0.3s ease;
}

.puzzle-controls button:hover {
    background: #4752C4;
    transform: translateY(-2px);
}

/* Quiz Game */
.quiz-container {
    max-width: 800px;
    text-align: center;
}

#quiz-question {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

#quiz-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.quiz-option {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.quiz-option:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #FFD700;
}

.quiz-option.selected {
    background: rgba(255, 215, 0, 0.2);
    border-color: #FFD700;
}

.quiz-progress {
    margin-top: 2rem;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
}

#progress-fill {
    height: 100%;
    background: linear-gradient(45deg, #00ff88, #00cc66);
    width: 0%;
    transition: width 0.3s ease;
}

#question-counter {
    font-weight: 700;
    color: #FFD700;
}

/* Leaderboard */
.leaderboard-container {
    max-width: 800px;
    width: 100%;
    padding: 2rem;
}

.leaderboard-container h2 {
    text-align: center;
    font-size: 2.5rem;
    color: #1A1400;
    margin-bottom: 2rem;
}

#leaderboard-list {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 2rem;
    backdrop-filter: blur(10px);
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    transition: all 0.3s ease;
}

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

.leaderboard-item.rank-1 {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #000;
}

.leaderboard-item.rank-2 {
    background: linear-gradient(45deg, #C0C0C0, #A0A0A0);
    color: #000;
}

.leaderboard-item.rank-3 {
    background: linear-gradient(45deg, #CD7F32, #B8860B);
    color: #000;
}

/* All ranks from 3rd position onwards get the same color */
.leaderboard-item:not(.rank-1):not(.rank-2) {
    background: linear-gradient(45deg, #CD7F32, #B8860B);
    color: #000;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.player-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #FFD700;
}

.player-name {
    font-weight: 700;
}

.player-score {
    font-weight: 700;
    font-size: 1.2rem;
    color: #1A1400;
}

.player-score-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.share-btn {
    background: #00122E;
    color: #FFD700;
    border: 2px solid #1A1400;
    border-radius: 5px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    box-shadow: 2px 2px 0px #1A1400;
}

.share-btn:hover {
    background: #002040;
    transform: translateY(-2px);
    box-shadow: 4px 4px 0px #1A1400;
}

.share-btn:active {
    transform: translateY(0);
    box-shadow: 1px 1px 0px #1A1400;
}

.share-btn svg {
    width: 20px;
    height: 20px;
}

/* Admin Panel */
.admin-container {
    max-width: 1000px;
    width: 100%;
    padding: 2rem;
}

.admin-container h2 {
    text-align: center;
    font-size: 2.5rem;
    color: #1A1400;
    margin-bottom: 2rem;
}

.admin-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.tab-btn {
    background: #00122E;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: #FFD700;
    color: #000;
}

.tab-btn:hover {
    background: #002040;
}

.tab-content {
    display: none;
    background: #00122E;
    padding: 2rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    color: #FFD700;
}

.tab-content.active {
    display: block;
}

.asset-section {
    margin-bottom: 1.5rem;
}

.asset-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: #FFD700;
}

.tab-content p,
.tab-content h3,
.tab-content h4,
.images-grid .image-item p,
.image-item p,
.question-item p,
.question-item h4 {
    color: #FFD700;
}

.asset-section input[type="color"] {
    width: 100px;
    height: 40px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.save-btn, .upload-btn, .add-btn {
    background: #00ff88;
    color: #000;
    border: none;
    padding: 1rem 2rem;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.save-btn:hover, .upload-btn:hover, .add-btn:hover {
    background: #00cc66;
    transform: translateY(-2px);
}

.question-form {
    margin-bottom: 2rem;
}

.question-form input, .question-form select {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-family: 'Orbitron', monospace;
}

.question-form input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.options-input {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.option-input {
    margin-bottom: 0.5rem !important;
}

.image-upload {
    margin-bottom: 2rem;
}

.image-upload input[type="file"] {
    margin-bottom: 1rem;
}

#puzzle-images-list, #questions-list {
    margin-top: 2rem;
}

.image-item, .question-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.image-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.images-grid .image-item {
    flex-direction: column;
    text-align: center;
    padding: 0.5rem;
    justify-content: center;
}

.images-grid .image-item img {
    width: 100px;
    height: 100px;
    margin-bottom: 0.5rem;
    border: 2px solid #FFD700;
}

.images-grid .image-item p {
    font-size: 0.9rem;
    margin: 0.25rem 0;
}

.images-grid .image-item button {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
}

.delete-btn {
    background: #ff4444;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Orbitron', monospace;
}

.delete-btn:hover {
    background: #cc3333;
}

/* Custom Popup Modal */
.popup-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.popup-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease-out;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.popup-header {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.popup-header h3 {
    color: #FFD700;
    font-size: 1.8rem;
    margin: 0;
    font-weight: bold;
}

.popup-close {
    background: none;
    border: none;
    color: #FFD700;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.popup-close:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: scale(1.1);
}

.popup-body {
    padding: 2rem;
    text-align: center;
}

.popup-body p {
    color: white;
    font-size: 1.2rem;
    margin: 0 0 1rem 0;
    line-height: 1.5;
}

.popup-score {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 10px;
    margin: 1rem 0;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.popup-score span:first-child {
    color: #FFD700;
    font-weight: bold;
    font-size: 1.1rem;
}

.popup-score span:last-child {
    color: white;
    font-size: 1.3rem;
    font-weight: bold;
}

.popup-footer {
    padding: 1.5rem 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.popup-btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.popup-btn-primary {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #000;
}

.popup-btn-primary:hover {
    background: linear-gradient(45deg, #FFA500, #FFD700);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

.popup-btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.popup-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .game-title {
        font-size: 2rem;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
        margin: 2rem 0;
    }
    
    .user-info {
        position: static;
        justify-content: center;
        margin-bottom: 2rem;
        margin-top: 2rem;
    }
    
    .menu-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    #quiz-options {
        grid-template-columns: 1fr;
    }
    
    .options-input {
        grid-template-columns: 1fr;
    }
    
    .admin-tabs {
        flex-direction: column;
    }
    
    .menu-container {
        padding: 1rem;
    }
    
    .login-container {
        padding: 2rem;
        margin: 1rem;
    }
    
    #game-container {
        padding: 1rem 0;
    }
    
    .puzzle-layout {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .puzzle-reference {
        order: -1;
        margin-bottom: 1rem;
    }
    
    #reference-image {
        width: 150px;
        height: 150px;
    }
    
    #puzzle-grid {
        grid-template-columns: repeat(3, 80px);
        grid-template-rows: repeat(3, 80px);
    }
    
    .puzzle-piece {
        width: 80px;
        height: 80px;
    }
    
    #flappy-canvas {
        max-width: 100%;
        height: auto;
    }
    
    .popup-content {
        width: 95%;
        margin: 1rem;
    }
    
    .popup-header {
        padding: 1rem 1.5rem;
    }
    
    .popup-header h3 {
        font-size: 1.5rem;
    }
    
    .popup-body {
        padding: 1.5rem;
    }
    
    .popup-body p {
        font-size: 1.1rem;
    }
    
    .popup-footer {
        padding: 1rem 1.5rem;
        flex-direction: column;
    }
    
    .popup-btn {
        width: 100%;
        margin: 0.25rem 0;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 1.5rem;
    }
    
    .game-subtitle {
        font-size: 1rem;
    }
    
    .login-container {
        padding: 1.5rem;
    }
    
    .game-card {
        padding: 1.5rem;
    }
    
    .menu-container {
        padding: 0.5rem;
    }
}

/* Retro CRT Scanline Effect */
@keyframes scanlines {
    0% { background-position: 0 0; }
    100% { background-position: 0 2px; }
}

/* Add subtle CRT flicker to screens */
.screen {
    position: relative;
}

.screen::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.03),
        rgba(0, 0, 0, 0.03) 1px,
        transparent 1px,
        transparent 2px
    );
    animation: scanlines 0.1s linear infinite;
    z-index: 10000;
}

/* Pixel-art style for retro look */
button, .game-card, .discord-btn, .menu-btn {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* Credits Footer */
.credits-footer {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    text-align: center;
    padding: 0.75rem 1rem;
    z-index: 100;
    background: rgba(242, 238, 225, 0.9); /* Semi-transparent parchment */
    border-top: 2px solid #1A1400;
    border-bottom: 2px solid #1A1400;
}

.credits-footer p {
    margin: 0;
    font-size: 0.9rem;
    color: #1A1400;
    font-weight: 600;
}

.credits-footer a {
    color: #00122E; /* Dark blue color */
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s ease;
}

.credits-footer a:hover {
    color: #D4FF28; /* Yellow on hover */
    text-decoration: underline;
}

/* Footer positioning for login screen */
#login-screen .credits-footer {
    position: absolute;
    bottom: 1rem;
    background: rgba(242, 238, 225, 0.95);
    border: 2px solid #1A1400;
    box-shadow: 4px 4px 0px #1A1400;
}

/* Footer positioning for main menu */
#main-menu .credits-footer {
    position: absolute;
    bottom: 1rem;
    background: rgba(242, 238, 225, 0.9);
    border: 2px solid #1A1400;
    box-shadow: 4px 4px 0px #1A1400;
}

/* Music Controls */
.music-controls {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    z-index: 1000;
    text-align: center;
}

.music-controls-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.music-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #00122E;
    color: #FFD700;
    border: 3px solid #1A1400;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 4px 4px 0px #1A1400;
    padding: 0;
}

.music-btn:hover {
    background: #002040;
    transform: scale(1.1);
    box-shadow: 6px 6px 0px #1A1400;
}

.music-btn:active {
    transform: scale(0.95);
    box-shadow: 2px 2px 0px #1A1400;
}

.music-label {
    font-size: 0.9rem;
    color: #1A1400;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.music-attribution {
    font-size: 0.65rem;
    color: #1A1400;
    text-align: center;
    line-height: 1.3;
    max-width: 200px;
}

.music-attribution a {
    color: #00122E;
    text-decoration: none;
    transition: color 0.3s ease;
}

.music-attribution a:hover {
    color: #D4FF28;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .music-controls {
        bottom: 0.5rem;
        left: 0.5rem;
    }
    
    .music-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .music-label {
        font-size: 0.8rem;
    }
    
    .music-attribution {
        font-size: 0.55rem;
        max-width: 150px;
    }
}
