/* ── Colorful Kids Theme ── */

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

@keyframes wiggle {

    0%,
    100% {
        transform: rotate(-2deg);
    }

    50% {
        transform: rotate(2deg);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% center;
    }

    100% {
        background-position: 200% center;
    }
}

@keyframes pulse-soft {

    0%,
    100% {
        box-shadow: 0 8px 32px rgba(255, 107, 157, 0.2), 0 0 0 0 rgba(255, 200, 100, 0);
    }

    50% {
        box-shadow: 0 8px 40px rgba(255, 107, 157, 0.35), 0 0 0 8px rgba(255, 200, 100, 0.08);
    }
}

@keyframes tagIn {
    from {
        opacity: 0;
        transform: scale(0.7) rotate(-5deg);
    }

    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes bgMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

* {
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #FFF5E4 0%, #FFE3F1 25%, #E8F5FF 50%, #F0FFE8 75%, #FFF5E4 100%);
    background-size: 400% 400%;
    animation: bgMove 15s ease infinite;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: 'Jua', 'Outfit', sans-serif;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-tap-highlight-color: transparent;
}

/* 배경 장식 */
.bg-deco {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 15% 20%, rgba(255, 182, 193, 0.25) 0%, transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(135, 206, 250, 0.25) 0%, transparent 40%),
        radial-gradient(circle at 50% 10%, rgba(255, 255, 150, 0.2) 0%, transparent 30%),
        radial-gradient(circle at 20% 80%, rgba(152, 251, 152, 0.2) 0%, transparent 35%);
    pointer-events: none;
    z-index: 0;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    padding: 20px 12px;
    width: 100%;
    max-width: 600px;
}

.title {
    color: transparent;
    background: linear-gradient(90deg, #FF6B9D, #FFB347, #87CEEB, #98FB98, #DDA0DD, #FF6B9D);
    background-size: 300% auto;
    -webkit-background-clip: text;
    background-clip: text;
    font-size: clamp(26px, 7vw, 44px);
    font-weight: 900;
    letter-spacing: 2px;
    margin-bottom: 12px;
    animation: shimmer 4s linear infinite;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
    text-align: center;
}

/* ── 라벨 입력 패널 ── */
.label-panel {
    background: rgba(255, 255, 255, 0.75);
    border: 2.5px solid rgba(255, 182, 193, 0.5);
    border-radius: 20px;
    padding: 14px 16px;
    margin-bottom: 16px;
    width: 92%;
    max-width: 400px;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(255, 107, 157, 0.1);
}

.label-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.label-panel-title {
    color: #E8446D;
    font-size: 17px;
    font-weight: 700;
}

.label-count {
    color: #c0a0a8;
    font-size: 13px;
}

.label-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.label-input-row input {
    flex: 1;
    padding: 10px 14px;
    border: 2.5px solid rgba(255, 182, 193, 0.4);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    color: #555;
    font-family: 'Jua', sans-serif;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.label-input-row input:focus {
    border-color: #FF6B9D;
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.15);
}

.label-input-row input::placeholder {
    color: #ccc;
}

#add-label-btn {
    width: 42px;
    height: 42px;
    border: 2.5px solid rgba(255, 107, 157, 0.4);
    border-radius: 12px;
    background: linear-gradient(135deg, #FF6B9D, #FFB347);
    color: #fff;
    font-size: 22px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#add-label-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.3);
}

#add-label-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.label-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 120px;
    overflow-y: auto;
}

.label-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: linear-gradient(135deg, rgba(255, 182, 193, 0.3), rgba(135, 206, 250, 0.3));
    border: 1.5px solid rgba(255, 107, 157, 0.25);
    border-radius: 20px;
    color: #E8446D;
    font-size: 14px;
    font-weight: 600;
    animation: tagIn 0.25s ease-out;
}

.label-tag .remove-btn {
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 100, 100, 0.2);
    color: #e05050;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.label-tag .remove-btn:hover {
    background: rgba(255, 100, 100, 0.45);
}

.label-empty-msg {
    color: #ccc;
    font-size: 13px;
    padding: 8px 0;
    text-align: center;
    width: 100%;
}

/* ── 룰렛 ── */
.roulette-wrapper {
    position: relative;
    width: 92vw;
    max-width: 520px;
    aspect-ratio: 1;
    margin-bottom: 24px;
    animation: pulse-soft 3s ease-in-out infinite;
    border-radius: 50%;
}

#wheel {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.08));
}

.pointer {
    position: absolute;
    top: -14px;
    left: 50%;
    z-index: 10;
}

/* ── 스핀 버튼 ── */
#spin-button {
    position: relative;
    padding: 16px 48px;
    font-size: clamp(20px, 5vw, 26px);
    font-family: 'Jua', sans-serif;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #FF6B9D 0%, #FFB347 50%, #87CEEB 100%);
    color: #fff;
    border: 3px solid rgba(255, 255, 255, 0.6);
    border-radius: 50px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 6px 24px rgba(255, 107, 157, 0.3);
    animation: float 2.5s ease-in-out infinite;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    width: auto;
    max-width: 90%;
}

#spin-button:hover {
    transform: translateY(-4px) scale(1.06);
    box-shadow: 0 10px 36px rgba(255, 107, 157, 0.45);
}

#spin-button:active {
    transform: translateY(1px) scale(0.97);
}

#spin-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    animation: none;
    transform: none;
}

.btn-text {
    position: relative;
    z-index: 2;
}

/* ── 결과 표시 ── */
#result-display {
    margin-top: 20px;
    font-size: clamp(22px, 6vw, 34px);
    font-weight: 700;
    color: #E8446D;
    text-shadow: 0 2px 8px rgba(255, 107, 157, 0.25);
    min-height: 40px;
    letter-spacing: 2px;
    text-align: center;
    padding: 0 8px;
}

/* ── 모바일 반응형 ── */
@media (max-width: 480px) {
    body {
        align-items: flex-start;
    }

    .game-container {
        padding: 12px 8px;
    }

    .label-panel {
        padding: 12px 12px;
        border-radius: 16px;
    }

    .label-input-row input {
        padding: 8px 10px;
        font-size: 14px;
    }

    #add-label-btn {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    .label-tag {
        padding: 4px 10px;
        font-size: 13px;
    }

    .pointer {
        width: 36px;
        height: 48px;
        top: -10px;
    }

    #spin-button {
        padding: 14px 36px;
    }

    .roulette-wrapper {
        margin-bottom: 18px;
    }
}

@media (max-width: 360px) {
    .label-panel {
        width: 96%;
        padding: 10px 10px;
    }

    .roulette-wrapper {
        width: 96vw;
    }

    .pointer {
        width: 30px;
        height: 40px;
        top: -8px;
    }
}