:root {
    --bg-color-1: #0f172a;
    --bg-color-2: #1e293b;
    --accent-gold: #fbbf24;
    --water-blue: #38bdf8;
    --bowl-white: #f8fafc;
    --text-color: #e2e8f0;
    --font-main: 'Noto Serif KR', serif;
    --font-hand: 'Gowun Batang', serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: radial-gradient(circle at 50% -20%, #1e293b 0%, #020617 100%);
    color: var(--text-color);
    font-family: var(--font-main);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(1px 1px at 10% 10%, rgba(255, 255, 255, 0.8) 1px, transparent 0),
        radial-gradient(1px 1px at 20% 40%, rgba(255, 255, 255, 0.6) 1px, transparent 0),
        radial-gradient(2px 2px at 60% 30%, rgba(255, 255, 255, 0.9) 1px, transparent 0),
        radial-gradient(1px 1px at 80% 80%, rgba(255, 255, 255, 0.5) 1px, transparent 0);
    background-size: 50% 50%;
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
    animation: twinkle 10s infinite alternate;
}

@keyframes twinkle {
    0% {
        opacity: 0.2;
        transform: translateY(0);
    }

    100% {
        opacity: 0.4;
        transform: translateY(-10px);
    }
}

.container {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 600px;
}

.header {
    text-align: center;
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeInDown 2s ease-out forwards;
    padding: 0 1rem;
}

h1 {
    font-family: var(--font-hand);
    font-size: clamp(2.5rem, 8vw, 3.5rem);
    /* Responsive font size */
    font-weight: 700;
    letter-spacing: -0.05em;
    margin-bottom: 0.5rem;
    background: linear-gradient(to bottom, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.subtitle {
    font-size: clamp(0.9rem, 4vw, 1.1rem);
    color: #94a3b8;
    font-weight: 300;
}

/* The Bowl */
.bowl-container {
    position: relative;
    width: 60vmin;
    /* Responsive to viewport size */
    height: 60vmin;
    max-width: 350px;
    max-height: 350px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    margin-bottom: 10vmin;
    animation: float 6s ease-in-out infinite;
    -webkit-tap-highlight-color: transparent;
    /* Remove mobile tap highlight */
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

.bowl {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 30%, #ffffff, #e2e8f0 40%, #cbd5e1 100%);
    border-radius: 50%;
    position: relative;
    box-shadow:
        inset 0 0 20px rgba(0, 0, 0, 0.1),
        inset 10px 10px 30px rgba(255, 255, 255, 0.9),
        0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s;
}

.bowl:active {
    transform: scale(0.98);
}

.water {
    width: 90%;
    height: 90%;
    /* Deeper, more realistic water gradient */
    background: radial-gradient(circle at 50% 50%, #06b6d4, #0891b2 40%, #0f172a 95%);
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    /* Meniscus and depth shadows */
    box-shadow:
        inset 0 0 40px rgba(0, 0, 0, 0.9),
        /* Deep interaction shadow */
        inset 0 4px 10px rgba(255, 255, 255, 0.2),
        /* Top surface light */
        0 0 0 2px rgba(255, 255, 255, 0.1);
    /* Faint meniscus ring */

    /* Subtle independent water movement */
    animation: slosh 8s ease-in-out infinite reverse;
}

@keyframes slosh {

    0%,
    100% {
        transform: translate(0, 0) scale(1.0);
    }

    25% {
        transform: translate(2px, 2px) scale(1.005);
    }

    50% {
        transform: translate(0, 1px) scale(1.0);
    }

    75% {
        transform: translate(-2px, 0) scale(1.005);
    }
}

#ripple-canvas {
    width: 100%;
    height: 100%;
    display: block;
    mix-blend-mode: overlay;
    /* Better blending for realism */
    opacity: 0.8;
}

.reflection {
    position: absolute;
    top: 15%;
    left: 15%;
    width: 50%;
    height: 40%;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(15px);
    pointer-events: none;
    transform: rotate(-15deg);
}

.shadow {
    position: absolute;
    bottom: -15%;
    width: 70%;
    height: 15%;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    filter: blur(20px);
    animation: shadowScale 6s ease-in-out infinite;
}

/* Interactions */
.interaction-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px;
    z-index: 20;
}

.input-group {
    display: flex;
    gap: 10px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s ease-out 1s forwards;
    width: 100%;
    max-width: 400px;
}

input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.8rem 1.2rem;
    border-radius: 50px;
    color: white;
    font-family: var(--font-main);
    font-size: 16px;
    /* Prevents iOS zoom on focus */
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-appearance: none;
}

input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

button {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: var(--font-hand);
    font-size: 1.1rem;
    white-space: nowrap;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

button:hover,
button:active {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
}

.message-display {
    margin-top: 1rem;
    font-family: var(--font-hand);
    font-size: 1.2rem;
    color: #fff;
    text-shadow: 0 0 10px var(--water-blue);
    height: 1.5rem;
    opacity: 0;
    transition: opacity 0.5s;
    text-align: center;
    width: 100%;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-height: 700px) {
    .header {
        margin-bottom: 2rem;
    }

    .bowl-container {
        margin-bottom: 2rem;
    }
}