/* Reset en basis stijlen */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Orbitron', monospace;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    color: #ffffff;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    scroll-behavior: auto;
}

/* Allow scrolling on mobile devices */
@media (max-width: 768px) {
    body {
        overflow: auto;
        min-height: 100vh;
        display: block;
    }
}

#gameContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Fixed width on desktop */
@media (min-width: 769px) {
    #gameContainer {
        width: 800px;
        height: 600px;
        border: 2px solid #00ff88;
        border-radius: 15px;
        box-shadow: 0 0 30px rgba(0, 255, 136, 0.3);
        position: relative;
    }
}

/* Allow scrolling on mobile devices */
@media (max-width: 768px) {
    #gameContainer {
        min-height: 100vh;
        height: auto;
        width: 100vw;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }
}

/* Scherm stijlen */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
}

/* Desktop screens - fixed dimensions */
@media (min-width: 769px) {
    .screen {
        width: 800px;
        height: 600px;
        position: absolute;
    }
    
    /* Main menu screen - dynamic height */
    .screen#startScreen {
        height: 600px;
        min-height: 600px;
        max-height: 90vh;
        overflow-y: auto;
        padding: 20px 0;
        transition: height 0.3s ease;
    }
}

/* Allow scrolling on mobile devices */
@media (max-width: 768px) {
    .screen {
        position: relative;
        min-height: 100vh;
        height: auto;
        padding: 20px 0 60px 0; /* Add extra bottom padding */
    }
}

.screen.active {
    display: flex;
}

/* Startscherm */
.title-container {
    text-align: center;
    margin-bottom: 2rem;
    animation: glow 2s ease-in-out infinite alternate;
}

.game-title {
    font-size: 4rem;
    font-weight: 900;
    color: #00ff88;
    text-shadow: 0 0 20px #00ff88, 0 0 40px #00ff88;
    margin-bottom: 0.5rem;
    letter-spacing: 0.2em;
}

.subtitle {
    font-size: 1.2rem;
    color: #88aaff;
    text-shadow: 0 0 10px #88aaff;
}

@keyframes glow {
    from {
        text-shadow: 0 0 20px #00ff88, 0 0 40px #00ff88;
    }
    to {
        text-shadow: 0 0 30px #00ff88, 0 0 60px #00ff88, 0 0 80px #00ff88;
    }
}

/* Knoppen */
.btn {
    padding: 1rem 2rem;
    font-family: 'Orbitron', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0.5rem;
    min-width: 200px;
}

.btn-primary {
    background: linear-gradient(45deg, #00ff88, #00cc6a);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.8);
}

.btn-secondary {
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
    color: #fff;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.5);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(255, 107, 107, 0.8);
}

/* Leaderboard tabs */
.leaderboard-tabs {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
}

.tab-btn {
    padding: 0.8rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
}

.tab-btn.active {
    background: linear-gradient(45deg, #00ff88, #00cc6a);
    border-color: #00ff88;
    color: #000;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
}

.tab-btn:hover {
    transform: translateY(-1px);
}

/* Leaderboard container */
.leaderboard-container {
    width: 90%;
    max-width: 600px;
    max-height: 400px;
    overflow: hidden;
    border-radius: 15px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

/* Better mobile leaderboard */
@media (max-width: 768px) {
    .leaderboard-container {
        width: 95%;
        max-height: 60vh; /* Use viewport height instead of fixed pixels */
        margin: 1rem 0;
        padding-bottom: 2rem; /* Add extra padding at bottom */
    }
    
    .leaderboard-list {
        max-height: 50vh; /* Allow more space for the list */
        padding-bottom: 1rem; /* Extra padding for last items */
    }
}

/* Desktop leaderboard - dynamic height */
@media (min-width: 769px) {
    .leaderboard-container {
        max-height: 400px;
        height: 350px;
        margin: 1rem 0;
        transition: max-height 0.3s ease, height 0.3s ease;
        overflow: hidden;
    }
    
    .leaderboard-list {
        max-height: 350px;
        transition: max-height 0.3s ease;
        overflow-y: auto;
        padding-bottom: 10px;
    }
}

.leaderboard {
    display: none;
    padding: 1rem;
}

.leaderboard.active {
    display: block;
}

.leaderboard h3 {
    text-align: center;
    color: #00ff88;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.leaderboard-list {
    max-height: 300px;
    overflow-y: auto;
}

.leaderboard-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    margin: 0.2rem 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    border-left: 4px solid #00ff88;
}

.leaderboard-entry:nth-child(1) {
    border-left-color: #ffd700;
    background: rgba(255, 215, 0, 0.2);
}

.leaderboard-entry:nth-child(2) {
    border-left-color: #c0c0c0;
    background: rgba(192, 192, 192, 0.2);
}

.leaderboard-entry:nth-child(3) {
    border-left-color: #cd7f32;
    background: rgba(205, 127, 50, 0.2);
}

.rank {
    font-weight: 700;
    color: #00ff88;
    min-width: 30px;
}

.player-name {
    flex: 1;
    margin: 0 1rem;
    font-weight: 500;
}

.score {
    font-weight: 700;
    color: #ff6b6b;
}

.loading {
    text-align: center;
    color: #88aaff;
    padding: 2rem;
}

/* Game Canvas */
#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* Desktop game canvas - fixed dimensions */
@media (min-width: 769px) {
    #gameCanvas {
        width: 800px;
        height: 600px;
    }
}

/* Mobile game canvas */
@media (max-width: 768px) {
    #gameCanvas {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        z-index: 1;
    }
}

/* Game UI */
.game-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.score-display {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 15px;
    border-radius: 10px;
    border: 2px solid #00ff88;
    font-size: 1.2rem;
    font-weight: 700;
    color: #00ff88;
    text-shadow: 0 0 10px #00ff88;
}

.lives-display {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 5px;
}

.heart {
    font-size: 2rem;
    filter: drop-shadow(0 0 5px #ff6b6b);
    transition: all 0.3s ease;
}

.heart.lost {
    opacity: 0.3;
    transform: scale(0.8);
}

.powerup-indicator {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 10px;
    border-radius: 10px;
    border: 2px solid #ffd700;
    display: none;
    align-items: center;
    gap: 10px;
}

.powerup-indicator.active {
    display: flex;
}

.powerup-icon {
    width: 30px;
    height: 30px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.powerup-timer {
    color: #ffd700;
    font-weight: 700;
    font-size: 1rem;
}

/* How to Play Scherm */
.how-to-play-content {
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    padding: 2rem;
    border-radius: 15px;
    border: 2px solid #00ff88;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.how-to-play-content h2 {
    color: #00ff88;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 20px #00ff88;
}

.instructions {
    margin-bottom: 2rem;
}

.instructions p {
    font-size: 1.2rem;
    color: #88aaff;
    margin-bottom: 1rem;
}

.bottle-types {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.bottle-type {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.bottle-demo {
    width: 35px;
    height: 55px;
    position: relative;
    flex-shrink: 0;
    clip-path: polygon(0% 0%, 100% 0%, 70% 100%, 30% 100%);
    border-radius: 0 0 6px 6px; /* Subtle rounded bottom corners */
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.2); /* Glass effect */
}

.good-bottle {
    background: linear-gradient(to bottom, #00ff88, #00cc6a);
}

.dangerous-bottle {
    background: linear-gradient(to bottom, #ff6b6b, #ff4444);
}

.powerup-bottle {
    background: linear-gradient(to bottom, #ffd700, #ffb347);
}

.bottle-demo::after {
    content: '';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 8px;
    background: inherit;
    border-radius: 1px;
    box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.3); /* Glass effect */
}

.bottle-demo::before {
    content: '';
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 4px;
    background: #ffffff;
    border-radius: 2px;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.3); /* Glass rim effect */
}

/* Liquid level indicator (60% fill) */
.bottle-demo .liquid-level {
    position: absolute;
    bottom: 24px; /* 60% from bottom */
    left: 10px;
    right: 10px;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 1px;
}

.bottle-info {
    text-align: left;
    flex: 1;
}

.bottle-info h3 {
    color: #00ff88;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.bottle-info p {
    color: #ffffff;
    font-size: 1rem;
    margin: 0;
}

.powerups-info {
    margin-bottom: 2rem;
}

.powerups-info h3 {
    color: #ffd700;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px #ffd700;
}

.powerup-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.powerup-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 215, 0, 0.1);
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.powerup-icon {
    font-size: 1.5rem;
    width: 30px;
    text-align: center;
}

.powerup-item span:last-child {
    color: #ffffff;
    font-size: 1rem;
}

/* Game Over Scherm */
.game-over-content {
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    padding: 2rem;
    border-radius: 15px;
    border: 2px solid #ff6b6b;
    max-width: 500px;
    width: 90%;
}

.game-over-content h2 {
    color: #ff6b6b;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px #ff6b6b;
}

.final-score {
    font-size: 1.5rem;
    color: #00ff88;
    margin-bottom: 2rem;
    font-weight: 700;
}

.name-input-container {
    margin-bottom: 2rem;
}

.name-input-container label {
    display: block;
    margin-bottom: 0.5rem;
    color: #88aaff;
    font-weight: 700;
}

.name-input-container input {
    width: 100%;
    padding: 0.8rem;
    font-family: 'Orbitron', monospace;
    font-size: 1rem;
    border: 2px solid #00ff88;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    margin-bottom: 1rem;
    text-align: center;
}

.name-input-container input:focus {
    outline: none;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
}

.share-container {
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.share-container h4 {
    color: #00ff88;
    margin-bottom: 1rem;
}

.share-url {
    display: flex;
    gap: 0.5rem;
}

.share-url input {
    flex: 1;
    padding: 0.5rem;
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    border: 1px solid #88aaff;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
}

/* Responsive design */
@media (max-width: 768px) {
    .game-title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
        min-width: 150px;
    }
    
    .leaderboard-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .tab-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .score-display {
        font-size: 1rem;
        padding: 8px 12px;
    }
    
    .heart {
        font-size: 1.5rem;
    }
    
    .game-over-content h2 {
        font-size: 2rem;
    }
    
    .final-score {
        font-size: 1.2rem;
    }
    
    /* How to Play mobile styles */
    .how-to-play-content {
        max-width: 95%;
        padding: 1.5rem;
    }
    
    .how-to-play-content h2 {
        font-size: 2rem;
    }
    
    .bottle-type {
        flex-direction: column;
        text-align: center;
        gap: 0.8rem;
    }
    
    .bottle-info {
        text-align: center;
    }
    
    .bottle-demo {
        width: 35px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 2rem;
    }
    
    .btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
        min-width: 120px;
    }
    
    .leaderboard-container {
        width: 95%;
        margin-bottom: 2rem; /* Add extra margin at bottom */
    }
    
    .score-display {
        top: 10px;
        left: 10px;
        font-size: 0.9rem;
        padding: 6px 10px;
    }
    
    .lives-display {
        top: 10px;
        right: 10px;
    }
    
    .heart {
        font-size: 1.3rem;
    }
}

/* Scrollbar styling */
.leaderboard-list::-webkit-scrollbar,
.screen#startScreen::-webkit-scrollbar {
    width: 8px;
}

.leaderboard-list::-webkit-scrollbar-track,
.screen#startScreen::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.leaderboard-list::-webkit-scrollbar-thumb,
.screen#startScreen::-webkit-scrollbar-thumb {
    background: #00ff88;
    border-radius: 4px;
}

.leaderboard-list::-webkit-scrollbar-thumb:hover,
.screen#startScreen::-webkit-scrollbar-thumb:hover {
    background: #00cc6a;
}

