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

body {
    font-family: 'M PLUS Rounded 1c', 'Varela Round', 'Quicksand', 'Hiragino Maru Gothic ProN', Arial, sans-serif;
    /* Magical night sky background */
    background: radial-gradient(circle at top, #3b006a, #110022 80%);
    color: #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    touch-action: manipulation;
}

#game-container {
    margin-top: 60px;
    width: 100%;
    max-width: 600px;
    height: 100vh;
    max-height: 900px;
    /* Glassmorphism dark magic card */
    background-color: rgba(20, 10, 40, 0.7);
    backdrop-filter: blur(10px);
    position: relative;
    box-shadow: 0 0 40px rgba(138, 43, 226, 0.4), inset 0 0 20px rgba(138, 43, 226, 0.2);
    border: 1px solid rgba(255,255,255,0.1);
    overflow: hidden;
}

@media (min-height: 700px) and (min-width: 600px) {
    #game-container {
        border-radius: 30px;
        border: 2px solid rgba(255, 255, 255, 0.2);
        height: 90vh;
    }
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 80%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.screen.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 10;
}

h1 {
    font-size: 38px;
    color: #ffd32a;
    margin-bottom: 15px;
    /* Magical neon glow */
    text-shadow: 0 0 10px #ff9ff3, 0 0 20px #f368e0, 2px 2px 0px #833471;
    letter-spacing: 2px;
}

.description {
    margin: 20px 0;
    font-size: 18px;
    line-height: 1.6;
    color: #d1d8e0;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
}

.primary-btn {
    background: linear-gradient(to bottom, #a55eea, #8854d0);
    color: white;
    border: 2px solid #fd79a8;
    border-radius: 40px;
    padding: 15px 50px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(253, 121, 168, 0.5), 0 5px 0 #5f27cd;
    transition: all 0.1s;
    margin-top: 20px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.primary-btn:active {
    transform: translateY(5px);
    box-shadow: 0 0 5px rgba(253, 121, 168, 0.5), 0 0px 0 #5f27cd;
}

.primary-btn:hover {
    background: linear-gradient(to bottom, #d980fa, #9980fa);
    box-shadow: 0 0 25px rgba(253, 121, 168, 0.8), 0 5px 0 #5f27cd;
}

/* Game Screen */
.header {
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    font-size: 20px;
    font-weight: bold;
    z-index: 5;
    color: #f5f6fa;
    text-shadow: 0 0 5px #00a8ff;
    background: none;
}

#message-display {
    color: #ff9ff3;
    text-shadow: 0 0 10px #f368e0, 0 0 20px #833471;
    font-size: 26px;
    font-weight: bold;
    margin-bottom: 20px;
    z-index: 10;
    text-align: center;
    width: 100%;
}

#cups-area {
    position: relative;
    width: 100%;
    height: 300px;
    margin-top: 50px;
}

/* Magical floating platform */
#cups-area::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 5%;
    width: 90%;
    height: 40px;
    background: radial-gradient(ellipse, rgba(138, 43, 226, 0.6) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
    box-shadow: 0 0 20px rgba(155, 89, 182, 0.5);
}

.cup-wrapper {
    position: absolute;
    width: 90px;
    height: 120px;
    transform: translateX(-50%);
    cursor: pointer;
    transition: left 0.5s ease-in-out, top 0.5s ease-in-out;
}

.cup {
    width: 100%;
    height: 100%;
    /* Mystical dark crystal look */
    background: linear-gradient(to bottom, #4834d4, #30336b);
    border-radius: 20px 20px 5px 5px;
    border: 2px solid #7ed6df;
    position: relative;
    transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 2;
    box-shadow: inset 0 0 15px rgba(126, 214, 223, 0.5), 0 10px 15px rgba(0,0,0,0.5);
}

.cup::before {
    content: '✦';
    color: #f9ca24;
    font-size: 24px;
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    text-shadow: 0 0 10px #f6e58d;
}

.character {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 70px;
    object-fit: contain;
    z-index: 1;
    opacity: 0;
    /* Magical glow on character */
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8));
}

.cup-wrapper.revealed .cup {
    transform: translateY(-85px);
}
.cup-wrapper.has-character .character {
    opacity: 1;
}

.cup-wrapper.disabled {
    pointer-events: none;
}

/* Result / Clear Screen */
#result-title {
    font-size: 40px;
    margin-bottom: 10px;
    text-shadow: 0 0 15px currentColor;
}

.congratulations {
    color: #feca57;
    font-size: 38px;
    animation: magicFloat 2s ease-in-out infinite alternate;
    text-shadow: 0 0 20px #ff9f43, 0 0 30px #f368e0;
}

@keyframes magicFloat {
    from { transform: translateY(0) scale(1); }
    to { transform: translateY(-15px) scale(1.05); }
}

.bonus-box {
    background-color: rgba(138, 43, 226, 0.3);
    border: 2px solid #c8d6e5;
    border-radius: 15px;
    padding: 25px;
    margin: 30px 0;
    color: #fff;
    font-weight: bold;
    box-shadow: 0 0 15px rgba(255,255,255,0.2);
}

#mypage-btn {
    background: linear-gradient(to bottom, #f368e0, #ff9ff3);
    border-color: #fff;
    box-shadow: 0 0 15px rgba(243, 104, 224, 0.6), 0 5px 0 #833471;
}
#mypage-btn:hover {
    background: linear-gradient(to bottom, #ff9ff3, #feca57);
}
