body {
    background-color: #9ad3f4;
    margin: 0;
    font-family: Arial, sans-serif;
    min-height: 100vh;
    width: 100vw;
    overflow-x: hidden;
}

/* Hauptcontainer: vertikal, alles unter dem Spielfeld, max. Breite */
#main-container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 0 2vw 24px 2vw;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

/* Titel */
#game-title {
    margin-top: 18px;
    margin-bottom: 8px;
}

/* Spielfeld */
#game {
    width: 100%;
    max-width: 420px;
    min-height: 320px;
    margin: 0 auto 18px auto;
    border-radius: 18px;
    box-shadow: 0 8px 32px #0002;
    background: rgba(255,255,255,0.7);
    position: relative;
    overflow: hidden;
}

/* Score */
#score {
    font-size: 1.3em;
    background: linear-gradient(90deg, #fff 60%, #e0eafc 100%);
    border: 2px solid #4a8fe7;
    border-radius: 16px;
    padding: 10px 0;
    text-align: center;
    font-weight: bold;
    color: #17407b;
    margin-bottom: 8px;
    margin-top: 8px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 1px 6px #0001;
    opacity: 0.95;
    pointer-events: none;
    min-width: 70px;
    transition: background 0.2s, color 0.2s, transform 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#score.celebrate {
    background: linear-gradient(90deg,#ff4081 40%,#4a8fe7 100%);
    color: #fff;
    transform: scale(1.15);
    box-shadow: 0 4px 24px #ff4081cc;
}

/* Outfit-Vorschau */
#outfit-preview-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px #4a8fe799;
    padding: 8px;
    margin-bottom: 8px;
    width: 100%;
    max-width: 120px;
    min-width: 80px;
    min-height: 80px;
}

#outfit-preview {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Pause-Button */
#pause-btn, #mobile-pause-btn {
    font-size: 1.2em;
    background: #4a8fe7;
    color: #fff;
    border-radius: 14px;
    border: none;
    padding: 12px 0;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px #4a8fe799;
    transition: background 0.2s, color 0.2s;
    width: 100%;
    max-width: 420px;
    cursor: pointer;
}

#pause-btn:active, #mobile-pause-btn:active {
    background: #1976d2;
}

/* Kleiderschrank */
#closet {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 4px 16px #0001;
    padding: 0 0 16px 0;
    width: 100%;
    max-width: 420px;
    margin: 0 auto 12px auto;
    border: 2px solid #4a8fe7;
    position: relative;
    transition: box-shadow 0.2s;
    overflow: visible;
}

.closet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 8px 18px;
    border-bottom: 1px solid #e0eafc;
}

.closet-header h3 {
    margin: 0;
    font-size: 1.2em;
    color: #1976d2;
}

#undress-all-btn {
    background: #e3f2fd;
    color: #1976d2;
    border: none;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    margin-left: 8px;
}

#undress-all-btn:active {
    background: #ffecfa;
    color: #d81b60;
}

#closet-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
    align-items: flex-start;
    max-height: 180px;
    overflow-y: auto;
    padding: 0 10px 8px 10px;
    min-height: 60px;
    margin-bottom: 0;
    scrollbar-width: thin;
    scrollbar-color: #4a8fe7 #e0eafc;
}

#closet-items::-webkit-scrollbar {
    width: 8px;
    background: #e0eafc;
}
#closet-items::-webkit-scrollbar-thumb {
    background: #4a8fe7;
    border-radius: 8px;
}

/* Kleider-Items */
.item {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    background: #f8fafc;
    box-shadow: 0 2px 8px #4a8fe722;
    border: 2px solid transparent;
    cursor: pointer;
    object-fit: contain;
    padding: 6px;
    transition: box-shadow 0.18s, border 0.18s, background 0.18s, transform 0.12s;
    display: block;
    margin: 0 auto;
    font-size: 1em;
}
.item.active {
    border: 2px solid #ff4081;
    background: #fff0fa;
}
.item-hover, .item:focus {
    box-shadow: 0 0 0 4px #4a8fe799, 0 2px 8px #4a8fe722;
    border: 2px solid #1976d2;
    background: #e3f2fd;
    outline: none;
    z-index: 2;
}

/* Scoreboard */
#scoreboard, #pause-scoreboard {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 8px #4a8fe722;
    padding: 14px 10px 18px 10px;
    width: 100%;
    max-width: 420px;
    margin: 0 auto 12px auto;
    border: 2px solid #4a8fe7;
    font-size: 1.05em;
    text-align: center;
    overflow-x: auto;
}

#scoreboard ul, #pause-scoreboard ul {
    list-style: none;
    padding: 0;
    margin: 0 0 8px 0;
    max-height: 120px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #4a8fe7 #e0eafc;
}
#scoreboard ul::-webkit-scrollbar, #pause-scoreboard ul::-webkit-scrollbar {
    width: 8px;
    background: #e0eafc;
}
#scoreboard ul::-webkit-scrollbar-thumb, #pause-scoreboard ul::-webkit-scrollbar-thumb {
    background: #4a8fe7;
    border-radius: 8px;
}

#scoreboard input, #pause-scoreboard input {
    width: 60%;
    max-width: 160px;
    margin: 8px 0;
    font-size: 1em;
    border-radius: 8px;
    border: 1.5px solid #4a8fe7;
    padding: 6px 10px;
}

#scoreboard button, #pause-scoreboard button {
    background: #4a8fe7;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 1em;
    cursor: pointer;
    margin-left: 6px;
    margin-top: 8px;
    transition: background 0.2s, color 0.2s;
}
#scoreboard button:active, #pause-scoreboard button:active {
    background: #1976d2;
}

/* Pause-Overlay */
#pause-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 999;
    background: rgba(0,0,0,0.4);
    justify-content: center;
    align-items: center;
    font-size: 40px;
    color: #fff;
    font-family: Comic Sans MS, Comic Sans, cursive;
    flex-direction: column;
}
#pause-overlay .pause-content {
    background: #fff;
    color: #222;
    padding: 30px 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 4px 24px #0004;
    font-size: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}
#pause-overlay button {
    font-size: 22px;
    margin-top: 20px;
    background: #4a8fe7;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 24px;
    cursor: pointer;
    transition: background 0.2s;
}
#pause-overlay button:active {
    background: #1976d2;
}

/* Mobile Optimierung */
@media (max-width: 700px), (max-height: 500px) {
    #main-container {
        max-width: 100vw !important;
        padding: 0 1vw 16vw 1vw;
    }
    #game {
        max-width: 100vw !important;
        min-width: 0 !important;
        border-radius: 0 !important;
    }
    #score, #outfit-preview-container, #pause-btn, #mobile-pause-btn, #closet, #scoreboard {
        max-width: 100vw !important;
        min-width: 0 !important;
    }
    #closet {
        border-radius: 18px 18px 0 0 !important;
        box-shadow: 0 -4px 16px #0002 !important;
        margin-bottom: 16px !important;
    }
    #closet-items {
        max-height: 28vh;
        min-height: 60px;
    }
    #scoreboard, #pause-scoreboard {
        font-size: 1em !important;
        padding: 10px 2vw 16px 2vw !important;
    }
    #scoreboard ul, #pause-scoreboard ul {
        max-height: 80px;
    }
    #pause-overlay .pause-content {
        padding: 18px 4vw;
        font-size: 18px;
    }
}

/* Scrollbar immer sichtbar auf Mobile */
@media (pointer: coarse) {
    #closet-items, #scoreboard ul, #pause-scoreboard ul {
        scrollbar-width: auto;
    }
}

/* Touch-Optimierung für Buttons */
button, input[type="text"] {
    min-height: 44px;
    min-width: 44px;
    font-size: 1.1em;
    border-radius: 8px;
    border: 1.5px solid #4a8fe7;
    padding: 7px 10px;
    margin: 4px 0;
}
button:active {
    background: #e0eaff;
}

/* Pinguin- und Plattformgrößen für Mobil anpassen */
@media (max-width: 600px) {
    .platform {
        width: 60px;
        height: 8px;
    }
    .platform img {
        width: 28px;
        height: 28px;
        left: 16px;
        top: -28px;
    }
}

/* Animationen (wie gehabt) */
.pinguin {
    position: absolute;
    bottom: 0;
    width: 50px;
    height: 50px;
}
.pinguin img {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    bottom: 0;
}
.clothing {
    z-index: 10;
}
.platform {
    position: absolute;
    width: 80px;
    height: 10px;
    background: linear-gradient(90deg, #4a8fe7 60%, #aeeaff 100%);
    border-radius: 5px;
    box-shadow: 0 2px 8px #4a8fe766, 0 0 12px #fff4 inset;
    border: 1.5px solid #fff;
    transition: box-shadow 0.2s;
}
.platform img {
    position: absolute;
    top: -40px;
    left: 20px;
    width: 40px;
    height: 40px;
}
@keyframes pinguin-jump {
    0% { transform: translateY(0) scale(1); filter: drop-shadow(0 0 0 #ff4081); }
    30% { transform: translateY(-30px) scale(1.1,0.9); filter: drop-shadow(0 0 16px #ff4081cc);}
    60% { transform: translateY(-10px) scale(0.95,1.05); filter: drop-shadow(0 0 8px #ff4081aa);}
    100% { transform: translateY(0) scale(1); filter: drop-shadow(0 0 0 #ff4081);}
}
@keyframes clothing-pop {
    0% { transform: scale(0.2) rotate(-30deg); opacity: 0; filter: brightness(2);}
    60% { transform: scale(1.2) rotate(15deg); opacity: 1; filter: brightness(1.2);}
    100% { transform: scale(1) rotate(0deg); filter: brightness(1);}
}
@keyframes clothing-glow {
    0% { box-shadow: 0 0 0 0 #ff4081; }
    70% { box-shadow: 0 0 24px 12px #ff4081aa; }
    100% { box-shadow: 0 0 0 0 #ff4081; }
}
.clothing {
    animation: clothing-glow 0.7s;
}
@keyframes clothing-spin {
    0% { transform: scale(0.2) rotate(-180deg); opacity: 0; }
    60% { transform: scale(1.2) rotate(20deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg);}
}
@keyframes platform-wobble {
    0% { transform: rotate(0deg);}
    20% { transform: rotate(-8deg);}
    40% { transform: rotate(8deg);}
    60% { transform: rotate(-4deg);}
    80% { transform: rotate(4deg);}
    100% { transform: rotate(0deg);}
}
@keyframes score-bounce {
    0% { transform: scale(1); color: #333;}
    40% { transform: scale(1.5); color: #ff4081;}
    100% { transform: scale(1); color: #333;}
}
.confetti {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 999;
    animation: confetti-fall 1s linear forwards;
}
@keyframes confetti-fall {
    0% { opacity: 1; }
    100% { transform: translateY(120px) rotate(360deg); opacity: 0; }
}
