/* === CARTOON STYLE RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --yellow-bright: #FFD93D;
    --yellow-dark: #F5A623;
    --orange: #FF6B35;
    --red: #E63946;
    --blue-sky: #87CEEB;
    --blue-dark: #1D3557;
    --green: #4ECDC4;
    --white: #FFFEF7;
    --black: #1a1a2e;
    --outline: 4px solid var(--black);
}

body {
    font-family: 'Comic Neue', cursive;
    background: linear-gradient(180deg, #87CEEB 0%, #7CB87C 40%, #4A7C4A 70%, #2E5A2E 100%);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    overflow: hidden;
    position: relative;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

html {
    height: -webkit-fill-available;
}

/* === CARTOON BACKGROUND === */
.cartoon-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.cloud {
    position: absolute;
    font-size: 80px;
    opacity: 0.8;
    animation: float 20s infinite ease-in-out;
    filter: drop-shadow(2px 2px 0 rgba(0,0,0,0.1));
}

.cloud-1 { top: 10%; left: 10%; animation-delay: 0s; }
.cloud-2 { top: 25%; left: 60%; animation-delay: -7s; font-size: 60px; }
.cloud-3 { top: 5%; left: 80%; animation-delay: -14s; font-size: 100px; }

@keyframes float {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(30px) translateY(-10px); }
    50% { transform: translateX(0) translateY(5px); }
    75% { transform: translateX(-30px) translateY(-5px); }
}

/* === CONTAINER === */
.container {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* === SCREENS === */
.screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.screen.hidden {
    display: none;
}

.hidden {
    display: none !important;
}

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* === LOGO & TITLE === */
.logo-container {
    text-align: center;
}

.title {
    font-family: 'Bangers', cursive;
    font-size: clamp(2.5rem, 8vw, 5rem);
    color: var(--yellow-bright);
    text-shadow: 
        4px 4px 0 var(--orange),
        8px 8px 0 var(--red),
        -2px -2px 0 var(--black),
        2px -2px 0 var(--black),
        -2px 2px 0 var(--black),
        2px 2px 0 var(--black);
    letter-spacing: 3px;
}

.wobble {
    animation: wobble 3s infinite ease-in-out;
}

@keyframes wobble {
    0%, 100% { transform: rotate(-2deg); }
    50% { transform: rotate(2deg); }
}

.duck-mascot {
    font-size: 100px;
    animation: bounce 1s infinite;
    filter: drop-shadow(4px 4px 0 rgba(0,0,0,0.3));
    display: flex;
    gap: 5px;
    justify-content: center;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* === SPEECH BUBBLE === */
.speech-bubble {
    background: var(--white);
    border: var(--outline);
    border-radius: 30px;
    padding: 25px 35px;
    position: relative;
    max-width: 400px;
    text-align: center;
    box-shadow: 8px 8px 0 var(--black);
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    border: 15px solid transparent;
    border-top: 20px solid var(--white);
}

.speech-bubble::before {
    content: '';
    position: absolute;
    bottom: -38px;
    left: 50%;
    transform: translateX(-50%);
    border: 18px solid transparent;
    border-top: 24px solid var(--black);
    z-index: -1;
}

.speech-bubble p {
    font-size: 1.3rem;
    color: var(--black);
    line-height: 1.4;
}

.speech-bubble .small {
    font-size: 1rem;
    margin-top: 10px;
    color: #555;
}

/* === CARTOON BUTTON === */
.cartoon-btn {
    font-family: 'Bangers', cursive;
    font-size: 2rem;
    padding: 18px 45px;
    background: linear-gradient(180deg, var(--yellow-bright) 0%, var(--yellow-dark) 100%);
    border: var(--outline);
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 
        6px 6px 0 var(--black),
        inset 0 -4px 0 rgba(0,0,0,0.2);
    transition: all 0.1s ease;
    color: var(--black);
    letter-spacing: 2px;
}

.cartoon-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 
        4px 4px 0 var(--black),
        inset 0 -4px 0 rgba(0,0,0,0.2);
}

.cartoon-btn:active {
    transform: translate(4px, 4px);
    box-shadow: 
        2px 2px 0 var(--black),
        inset 0 -4px 0 rgba(0,0,0,0.2);
}

.small-btn {
    font-size: 1.2rem;
    padding: 12px 30px;
}

/* === INSTRUCTIONS === */
.instructions {
    background: rgba(255,255,255,0.9);
    border: 3px solid var(--black);
    border-radius: 15px;
    padding: 15px 25px;
    text-align: center;
}

.instructions p {
    font-size: 1rem;
    color: var(--black);
    margin: 5px 0;
}

/* === GAME SCREEN === */
#game-screen {
    position: relative;
}

.game-header {
    margin-bottom: 15px;
}

.score-display {
    background: linear-gradient(180deg, var(--yellow-bright) 0%, var(--yellow-dark) 100%);
    border: var(--outline);
    border-radius: 50px;
    padding: 10px 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 4px 4px 0 var(--black);
}

.coin-icon {
    font-size: 2rem;
    animation: spin 2s infinite linear;
}

/* Consistent Gold Coin - works on all devices */
.gold-coin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #FFE066 0%, #FFD700 50%, #B8860B 100%);
    border-radius: 50%;
    border: 3px solid #B8860B;
    font-family: 'Bangers', cursive;
    font-size: 1.2rem;
    color: #8B6914;
    text-shadow: 1px 1px 0 rgba(255,255,255,0.5);
    box-shadow: 
        inset 2px 2px 4px rgba(255,255,255,0.5),
        inset -2px -2px 4px rgba(0,0,0,0.2),
        2px 2px 4px rgba(0,0,0,0.3);
}

.inline-coin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #FFE066 0%, #FFD700 50%, #B8860B 100%);
    border-radius: 50%;
    border: 2px solid #B8860B;
    font-family: 'Bangers', cursive;
    font-size: 0.8rem;
    color: #8B6914;
    margin-right: 5px;
    vertical-align: middle;
}

.gold-coin-confetti {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #FFE066 0%, #FFD700 50%, #B8860B 100%);
    border-radius: 50%;
    border: 2px solid #B8860B;
    font-family: 'Bangers', cursive;
    font-size: 1rem;
    color: #8B6914;
}

@keyframes spin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

#score {
    font-family: 'Bangers', cursive;
    font-size: 2.5rem;
    color: var(--black);
}

.score-goal {
    font-family: 'Bangers', cursive;
    font-size: 1.5rem;
    color: var(--red);
}

#canvas-container {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 2/3;
    position: relative;
}

#game-canvas {
    width: 100%;
    height: 100%;
    border: 4px solid var(--black);
    border-radius: 15px;
    box-shadow: 8px 8px 0 var(--black);
    background: linear-gradient(180deg, #87CEEB 0%, #7CB87C 60%, #4A7C4A 100%);
    cursor: pointer;
    touch-action: none;
    display: block;
}

/* === GAME OVER OVERLAY === */
#game-over-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    padding: 40px;
    border-radius: 30px;
    border: 4px solid var(--yellow-bright);
    text-align: center;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translate(-50%, -50%) rotate(0); }
    25% { transform: translate(-50%, -50%) rotate(-5deg); }
    75% { transform: translate(-50%, -50%) rotate(5deg); }
}

.game-over-title {
    font-family: 'Bangers', cursive;
    font-size: 3rem;
    color: var(--red);
    text-shadow: 3px 3px 0 var(--black);
    margin-bottom: 15px;
}

#game-over-overlay p {
    color: var(--white);
    font-size: 1.3rem;
    margin-bottom: 20px;
}

#final-score {
    font-family: 'Bangers', cursive;
    font-size: 2rem;
    color: var(--yellow-bright);
}

/* === VICTORY SCREEN === */
.victory-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.victory-title {
    font-family: 'Bangers', cursive;
    font-size: clamp(2rem, 6vw, 4rem);
    color: var(--yellow-bright);
    text-shadow: 
        4px 4px 0 var(--orange),
        -2px -2px 0 var(--black),
        2px -2px 0 var(--black),
        -2px 2px 0 var(--black),
        2px 2px 0 var(--black);
}

.bounce {
    animation: bigBounce 0.6s infinite;
}

@keyframes bigBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.duck-winner {
    font-size: 80px;
    animation: victory-dance 0.5s infinite alternate;
    display: flex;
    gap: 10px;
}

@keyframes victory-dance {
    0% { transform: rotate(-10deg) scale(1); }
    100% { transform: rotate(10deg) scale(1.1); }
}

.victory-bubble {
    margin-bottom: 10px;
}

/* === CONTACT CARD === */
.contact-card {
    background: var(--white);
    border: 5px solid var(--black);
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 10px 10px 0 var(--black);
    max-width: 400px;
    animation: cardReveal 1s ease;
}

@keyframes cardReveal {
    0% { 
        transform: rotateY(90deg) scale(0.5);
        opacity: 0;
    }
    100% { 
        transform: rotateY(0) scale(1);
        opacity: 1;
    }
}

.contact-header {
    background: linear-gradient(135deg, var(--green) 0%, var(--blue-sky) 100%);
    padding: 15px;
    text-align: center;
    border-bottom: 4px solid var(--black);
}

.stamp {
    font-family: 'Bangers', cursive;
    font-size: 1.8rem;
    color: var(--red);
    background: var(--white);
    padding: 5px 20px;
    border: 3px solid var(--red);
    border-radius: 10px;
    transform: rotate(-5deg);
    display: inline-block;
}

.contact-info {
    padding: 25px;
}

.contact-info h2 {
    font-family: 'Bangers', cursive;
    font-size: 1.8rem;
    color: var(--blue-dark);
    margin-bottom: 20px;
    text-align: center;
}

.contact-line {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 2px dashed #ddd;
}

.contact-line:last-child {
    border-bottom: none;
}

.contact-icon {
    font-size: 1.5rem;
}

.contact-label {
    font-weight: 700;
    color: #666;
    min-width: 50px;
}

.contact-value {
    font-family: 'Bangers', cursive;
    font-size: 1.4rem;
    color: var(--black);
    letter-spacing: 1px;
}

.contact-value.phone {
    color: var(--green);
    text-decoration: none;
    transition: color 0.2s;
}

.contact-value.phone:hover {
    color: var(--orange);
}

/* === CONFETTI === */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.confetti {
    position: absolute;
    font-size: 40px;
    animation: confetti-fall 3s infinite;
}

.confetti:nth-child(1) { left: 5%; animation-delay: 0s; }
.confetti:nth-child(2) { left: 15%; animation-delay: 0.3s; }
.confetti:nth-child(3) { left: 30%; animation-delay: 0.6s; }
.confetti:nth-child(4) { left: 45%; animation-delay: 0.9s; }
.confetti:nth-child(5) { left: 60%; animation-delay: 1.2s; }
.confetti:nth-child(6) { left: 75%; animation-delay: 1.5s; }
.confetti:nth-child(7) { left: 85%; animation-delay: 1.8s; }
.confetti:nth-child(8) { left: 95%; animation-delay: 2.1s; }

@keyframes confetti-fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* === FLYING COINS ANIMATION === */
.flying-coins {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.flying-coin {
    position: absolute;
    font-size: 50px;
    animation: fly-to-pakhuis 2s ease-out forwards;
    filter: drop-shadow(0 0 10px gold);
}

.flying-coin:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; }
.flying-coin:nth-child(2) { left: 80%; top: 30%; animation-delay: 0.2s; }
.flying-coin:nth-child(3) { left: 20%; top: 70%; animation-delay: 0.4s; }
.flying-coin:nth-child(4) { left: 70%; top: 60%; animation-delay: 0.6s; }
.flying-coin:nth-child(5) { left: 50%; top: 10%; animation-delay: 0.8s; }

@keyframes fly-to-pakhuis {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.5) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: scale(0) rotate(360deg) translateY(200px);
        opacity: 0;
    }
}

/* === GELDPAKHUIS === */
.geldpakhuis {
    background: linear-gradient(180deg, #8B4513 0%, #654321 100%);
    border: 5px solid var(--black);
    border-radius: 20px;
    padding: 0;
    margin: 15px 0;
    box-shadow: 10px 10px 0 var(--black);
    overflow: hidden;
    animation: pakhuis-appear 1s ease-out 0.5s both;
    max-width: 500px;
    width: 95%;
}

@keyframes pakhuis-appear {
    0% {
        transform: translateY(100px) scale(0.5);
        opacity: 0;
    }
    60% {
        transform: translateY(-20px) scale(1.05);
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.pakhuis-roof {
    background: linear-gradient(180deg, #B22222 0%, #8B0000 100%);
    padding: 15px 20px;
    text-align: center;
    border-bottom: 4px solid var(--black);
    position: relative;
}

.pakhuis-roof::before,
.pakhuis-roof::after {
    content: '';
    position: absolute;
    top: 0;
    width: 0;
    height: 0;
    border-bottom: 60px solid #8B0000;
}

.roof-sign {
    font-family: 'Bangers', cursive;
    font-size: 1.5rem;
    color: var(--yellow-bright);
    text-shadow: 2px 2px 0 var(--black);
    letter-spacing: 2px;
}

.pakhuis-body {
    display: flex;
    justify-content: space-around;
    padding: 20px 10px;
    gap: 10px;
    background: linear-gradient(180deg, #654321 0%, #4a3016 100%);
}

/* === VAULT DOORS (DIENSTEN) === */
.vault {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    animation: vault-pop 0.5s ease-out backwards;
}

.vault-1 { animation-delay: 1s; }
.vault-2 { animation-delay: 1.3s; }
.vault-3 { animation-delay: 1.6s; }

@keyframes vault-pop {
    0% {
        transform: scale(0) rotateY(90deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotateY(0deg);
        opacity: 1;
    }
}

.vault-door {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #C0C0C0 0%, #808080 50%, #A9A9A9 100%);
    border: 4px solid #404040;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        inset 3px 3px 0 rgba(255,255,255,0.3),
        inset -3px -3px 0 rgba(0,0,0,0.3),
        4px 4px 0 var(--black);
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s;
}

.vault-door:hover {
    transform: scale(1.1);
    box-shadow: 
        inset 3px 3px 0 rgba(255,255,255,0.3),
        inset -3px -3px 0 rgba(0,0,0,0.3),
        6px 6px 0 var(--black);
}

.vault-door::before {
    content: '';
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #FFD700;
    border-radius: 50%;
    border: 2px solid #B8860B;
}

.vault-icon {
    font-size: 28px;
    filter: drop-shadow(1px 1px 0 rgba(0,0,0,0.5));
}

.vault-label {
    font-family: 'Bangers', cursive;
    font-size: 0.85rem;
    color: var(--yellow-bright);
    text-align: center;
    text-shadow: 1px 1px 0 var(--black);
    max-width: 90px;
    line-height: 1.2;
}

/* === COIN COUNTER === */
.coin-counter {
    background: linear-gradient(180deg, #FFD700 0%, #B8860B 100%);
    padding: 12px 20px;
    text-align: center;
    border-top: 4px solid var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    animation: coin-flash 1s ease-in-out 2s infinite;
}

@keyframes coin-flash {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

.coin-pile {
    font-size: 1.5rem;
    animation: pile-bounce 0.5s ease-in-out infinite alternate;
}

@keyframes pile-bounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-5px); }
}

.coin-total {
    font-family: 'Bangers', cursive;
    font-size: 1.3rem;
    color: var(--black);
    text-shadow: 1px 1px 0 rgba(255,255,255,0.5);
}

/* === VISIBLE BUTTON FIX === */
.visible-btn {
    margin-top: 20px;
    margin-bottom: 30px;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* === VICTORY SCREEN COMPACT === */
#victory-screen {
    padding: 20px;
}

.victory-content {
    gap: 15px;
}

/* === RESPONSIVE === */

/* Tablet */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .title {
        font-size: 2.5rem;
    }
    
    #canvas-container {
        max-width: 350px;
    }
    
    #game-canvas {
        border-width: 4px;
        border-radius: 12px;
        box-shadow: 6px 6px 0 var(--black);
    }
}

/* Mobile */
@media (max-width: 480px) {
    .title {
        font-size: 1.8rem;
        letter-spacing: 1px;
    }
    
    .duck-mascot {
        font-size: 60px;
    }
    
    .speech-bubble {
        padding: 12px 15px;
        margin: 0 10px;
        border-radius: 20px;
    }
    
    .speech-bubble p {
        font-size: 0.95rem;
    }
    
    .speech-bubble .small {
        font-size: 0.85rem;
    }
    
    .cartoon-btn {
        font-size: 1.2rem;
        padding: 12px 25px;
        border-radius: 15px;
    }
    
    .instructions {
        padding: 10px 15px;
    }
    
    .instructions p {
        font-size: 0.85rem;
    }
    
    #canvas-container {
        max-width: 100%;
        margin: 0 5px;
    }
    
    #game-canvas {
        border-width: 3px;
        border-radius: 10px;
        box-shadow: 4px 4px 0 var(--black);
    }
    
    .score-display {
        padding: 8px 20px;
        border-radius: 40px;
    }
    
    #score {
        font-size: 2rem;
    }
    
    .score-goal {
        font-size: 1.2rem;
    }
    
    .coin-icon {
        font-size: 1.5rem;
    }
    
    .game-header {
        margin-bottom: 10px;
    }
    
    /* Victory screen mobile */
    .victory-title {
        font-size: 1.5rem;
    }
    
    .duck-winner {
        font-size: 50px;
    }
    
    .victory-bubble {
        margin: 0 10px;
    }
    
    .victory-bubble p {
        font-size: 0.9rem;
    }
    
    .contact-card {
        margin: 0 10px;
        border-width: 3px;
        box-shadow: 6px 6px 0 var(--black);
    }
    
    .contact-info {
        padding: 15px;
    }
    
    .contact-info h2 {
        font-size: 1.3rem;
    }
    
    .contact-value {
        font-size: 1.1rem;
    }
    
    .stamp {
        font-size: 1.3rem;
    }
    
    .small-btn {
        font-size: 1rem;
        padding: 10px 20px;
    }
    
    /* Game over mobile */
    #game-over-overlay {
        padding: 25px;
        border-radius: 20px;
        width: 85%;
        max-width: 300px;
    }
    
    .game-over-title {
        font-size: 2rem;
    }
    
    #game-over-overlay p {
        font-size: 1rem;
    }
}

/* Very small phones */
@media (max-width: 360px) {
    .title {
        font-size: 1.5rem;
    }
    
    .duck-mascot {
        font-size: 50px;
    }
    
    .cartoon-btn {
        font-size: 1rem;
        padding: 10px 20px;
    }
    
    .victory-title {
        font-size: 1.3rem;
    }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .container {
        padding: 5px;
    }
    
    #canvas-container {
        max-height: 80vh;
        max-width: none;
        width: auto;
        aspect-ratio: 2/3;
    }
    
    .game-header {
        margin-bottom: 5px;
    }
    
    .score-display {
        padding: 5px 15px;
    }
    
    #score {
        font-size: 1.5rem;
    }
}

