@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;700;900&family=Varela+Round&display=swap');

:root {
    /* ... existing variables ... */
    /* (We don't need to re-declare root if not changing variables, but I need to make sure the import is at the top) */
    /* Actually, I will just replace the import line and the title class */
}

/* ... */

.title-kawaii {
    font-family: 'Varela Round', sans-serif;
    /* New readable font */
    font-size: 4rem;
    margin-bottom: 2rem;
    color: var(--white);
    /* Solid fill */
    font-weight: 900;
    letter-spacing: 1px;
    line-height: 1.1;
    /* High Contrast Stroke */
    -webkit-text-stroke: 4px #4a4e69;
    filter: drop-shadow(0 0 5px rgba(162, 220, 252, 0.8)) drop-shadow(0 0 15px rgba(216, 180, 254, 0.6));
    animation: bounceHover 2s infinite ease-in-out;
}

/* Difficulty Buttons Styling */
#difficulty-selection {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 300px;
}

.btn-diff {
    padding: 1rem 2rem;
    font-size: 1.5rem;
    font-weight: 700;
    border-radius: 30px;
    cursor: pointer;
    font-family: 'Varela Round', sans-serif;
    border: 3px solid var(--white);
    color: var(--white);
    transition: transform 0.1s, box-shadow 0.1s;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
}

.btn-diff:active {
    transform: translateY(2px);
}

.diff-easy {
    background: var(--sweet-green);
    box-shadow: 0 6px 0 #9ed49a;
}

.diff-medium {
    background: var(--happy-yellow);
    box-shadow: 0 6px 0 #e8de9b;
    color: #5d576b;
    /* Better contrast for yellow */
}

.diff-hard {
    background: var(--primary-pink);
    box-shadow: 0 6px 0 #e59bb1;
}

:root {
    --bg-color: #fef9ff;
    --primary-pink: #ffb7ce;
    --secondary-blue: #a2dcfc;
    --happy-yellow: #fff5ba;
    --sweet-green: #b5f2b1;
    --soft-purple: #d8b4fe;
    --text-color: #5d576b;
    --white: #ffffff;
    --error-red: #ff8b94;
    --success-gold: #ffd700;
    --card-bg: rgba(255, 255, 255, 0.7);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(255, 183, 206, 0.2) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(162, 220, 252, 0.2) 0%, transparent 20%),
        radial-gradient(circle at 50% 50%, rgba(216, 180, 254, 0.1) 0%, transparent 50%);
    color: var(--text-color);
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    touch-action: manipulation;
}

/* Header */
header {
    width: 100%;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 110;
}

.controls-top {
    display: flex;
    gap: 15px;
    align-items: center;
}

.lang-btn,
.sound-btn,
.home-btn,
.menu-btn {
    background: var(--card-bg);
    border: 2px solid var(--white);
    border-radius: 15px;
    padding: 8px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-btn:hover,
.sound-btn:hover,
.home-btn:hover,
.menu-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.lang-btn.active {
    border-color: var(--primary-pink);
    background: var(--white);
}

.lang-btn img {
    width: 35px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.sound-btn svg {
    width: 30px;
    height: 30px;
    fill: var(--text-color);
}

.menu-btn svg {
    /* Allow original colors */
    fill: none;
}

.home-btn svg {
    width: 30px;
    height: 30px;
    fill: var(--text-color);
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 600px;
    padding: 20px;
}

.game-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    max-height: 500px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 25px;
    padding: 25px;
    border-radius: 50%;
    /* Neon Kawaii Container Style */
    background: rgba(255, 255, 255, 0.4);
    /* More opaque for base */
    border: 12px solid #fff;
    /* Thicker border */
    box-shadow:
        0 15px 0 rgba(200, 200, 200, 0.5),
        /* 3D depth shadow */
        0 20px 40px rgba(0, 0, 0, 0.1),
        /* Soft shadow */
        inset 0 10px 20px rgba(255, 255, 255, 0.8);
    /* Inner highlight */
    backdrop-filter: blur(15px);
    z-index: 10;
}

.game-btn {
    border-radius: 50%;
    border: 4px solid var(--white);
    cursor: pointer;
    transition: all 0.1s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Deep "Kawaii" shadow for 3D effect */
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.1), 0 15px 20px rgba(0, 0, 0, 0.1);
    background-size: 200% 200%;
}

/* Glossy highlight for detail/plastic look */
.game-btn::after {
    content: '';
    position: absolute;
    top: 15%;
    left: 15%;
    width: 35%;
    height: 25%;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

.game-btn:active,
.game-btn.active {
    transform: scale(0.95) translateY(4px);
    /* Remove depth shadow, replace with neon glow */
    z-index: 10;
}

.game-btn.disabled {
    pointer-events: none;
    /* Optional: make it look "off" or just disabled */
}

/* Colors for buttons - Normal (Pastel) & Active (Neon Glow) */
.btn-pink {
    background-color: var(--primary-pink);
    box-shadow: 0 8px 0 #e59bb1;
}

.btn-pink:active,
.btn-pink.active {
    background-color: #ff6beb;
    /* Neon Pink */
    box-shadow: 0 0 40px #ff6beb, inset 0 0 20px #ffffff;
    border-color: #ffebf5;
}

.btn-blue {
    background-color: var(--secondary-blue);
    box-shadow: 0 8px 0 #8dc3e3;
}

.btn-blue:active,
.btn-blue.active {
    background-color: #00d2ff;
    /* Neon Blue */
    box-shadow: 0 0 40px #00d2ff, inset 0 0 20px #ffffff;
    border-color: #e0faff;
}

.btn-yellow {
    background-color: var(--happy-yellow);
    box-shadow: 0 8px 0 #e8de9b;
}

.btn-yellow:active,
.btn-yellow.active {
    background-color: #ffff00;
    /* Neon Yellow */
    box-shadow: 0 0 40px #ffff00, inset 0 0 20px #ffffff;
    border-color: #ffffe0;
}

.btn-green {
    background-color: var(--sweet-green);
    box-shadow: 0 8px 0 #9ed49a;
}

.btn-green:active,
.btn-green.active {
    background-color: #39ff14;
    /* Neon Green */
    box-shadow: 0 0 40px #39ff14, inset 0 0 20px #ffffff;
    border-color: #eaffea;
}

/* Kawaii Face on buttons */
.kawaii-face {
    width: 60%;
    height: auto;
    opacity: 0.8;
    pointer-events: none;
}

/* Central Info */
.center-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 130px;
    height: 130px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Center styling matching buttons */
    box-shadow:
        0 8px 0 rgba(0, 0, 0, 0.1),
        0 15px 20px rgba(0, 0, 0, 0.1);
    border: 8px solid var(--white);
    /* White border to blend with base */
    z-index: 20;
    /* Neon glow for center */
    filter: drop-shadow(0 0 10px rgba(216, 180, 254, 0.5));
}

#level-display {
    font-size: 2rem;
    font-weight: 800;
    color: var(--soft-purple);
    text-shadow: 2px 2px 0px rgba(216, 180, 254, 0.2);
}

#label-level {
    font-size: 1rem;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 800;
    margin-bottom: 5px;
}

/* UI Overlays */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Glassmorphism background */
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    padding: 2rem;
    text-align: center;
}

.hidden {
    display: none !important;
}

/* Old definition removed */

@keyframes bounceHover {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Removed old pulseTitle to avoid conflicts */

.kawaii-icon-container {
    width: 150px;
    height: 150px;
    margin-bottom: 2rem;
    filter: drop-shadow(0 10px 15px rgba(216, 180, 254, 0.3));
    animation: float 3s ease-in-out infinite;
}

.main-icon {
    width: 100%;
    height: 100%;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.overlay::before,
.overlay::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    filter: blur(50px);
    z-index: -1;
    opacity: 0.5;
}

.overlay::before {
    background: var(--primary-pink);
    top: 10%;
    left: 10%;
    animation: float 6s ease-in-out infinite;
}

.overlay::after {
    background: var(--secondary-blue);
    bottom: 10%;
    right: 10%;
    animation: float 8s ease-in-out infinite reverse;
}

.btn-main {
    padding: 1.5rem 4rem;
    font-size: 2rem;
    font-weight: 800;
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    position: relative;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;

    /* New Gradient Blue/Purple Style */
    background: linear-gradient(135deg, #a2dcfc 0%, #d8b4fe 100%);
    color: #fff;
    border: 5px solid #fff;
    /* Deep blue shadow */
    box-shadow:
        0 8px 0 #7caed6,
        0 15px 20px rgba(0, 0, 0, 0.15);
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
}

.btn-main::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(255, 255, 255, 0.4), transparent);
    opacity: 0.5;
}

.btn-main:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow:
        0 12px 0 #7caed6,
        0 20px 30px rgba(162, 220, 252, 0.6);
}

.btn-main:active {
    transform: translateY(4px);
    box-shadow:
        0 0 0 #7caed6,
        inset 0 4px 10px rgba(0, 0, 0, 0.1);
}

.message-text {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.game-over-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.btn-kawaii-home {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid var(--white);
    background: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow:
        0 8px 0 rgba(0, 0, 0, 0.1),
        0 10px 15px rgba(0, 0, 0, 0.1);
}

.btn-kawaii-home svg {
    width: 70%;
    height: 70%;
    filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.1));
}

.btn-kawaii-home:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow:
        0 8px 0 rgba(0, 0, 0, 0.1),
        0 15px 25px rgba(0, 0, 0, 0.15);
}

.btn-kawaii-home:active {
    transform: translateY(4px);
    box-shadow:
        0 0 0 rgba(0, 0, 0, 0.1),
        inset 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.animate-pulse {
    animation: pulse 0.5s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

.animate-shake {
    animation: shake 0.4s ease-in-out;
}

/* Responsive */
@media (max-width: 450px) {
    .title-kawaii {
        font-size: 2.2rem;
    }

    .game-container {
        max-height: 350px;
        padding: 10px;
        gap: 10px;
    }

    .center-circle {
        width: 90px;
        height: 90px;
    }

    #level-display {
        font-size: 1.2rem;
    }

    .kawaii-face {
        width: 70%;
    }
}

/* Floating Background Shapes */
.floating-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.shape {
    position: absolute;
    opacity: 0.4;
    filter: blur(2px);
    animation: floatBg 20s infinite linear;
}

.shape:nth-child(1) {
    top: 10%;
    left: 10%;
    width: 60px;
    height: 60px;
    background: var(--primary-pink);
    border-radius: 50%;
    animation-duration: 25s;
}

.shape:nth-child(2) {
    top: 70%;
    left: 80%;
    width: 80px;
    height: 80px;
    background: var(--secondary-blue);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation-duration: 30s;
    animation-delay: -5s;
}

.shape:nth-child(3) {
    top: 40%;
    left: 20%;
    width: 50px;
    height: 50px;
    background: var(--happy-yellow);
    border-radius: 50%;
    animation-duration: 22s;
    animation-delay: -2s;
}

.shape:nth-child(4) {
    top: 80%;
    left: 15%;
    width: 70px;
    height: 70px;
    background: var(--sweet-green);
    border-radius: 40%;
    animation-duration: 28s;
    animation-delay: -8s;
}

.shape:nth-child(5) {
    top: 20%;
    left: 90%;
    width: 40px;
    height: 40px;
    background: var(--soft-purple);
    border-radius: 50%;
    animation-duration: 35s;
}

@keyframes floatBg {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(30px, -50px) rotate(120deg);
    }

    66% {
        transform: translate(-20px, 20px) rotate(240deg);
    }

    100% {
        transform: translate(0, 0) rotate(360deg);
    }
}
