/* 전역 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
    background: linear-gradient(135deg, #FEE500 0%, #FFD700 100%);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 헤더 */
.header {
    text-align: center;
    padding: 20px 0;
    color: #3C1E1E;
}

.title {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1rem;
    opacity: 0.8;
}

/* 게임 영역 */
.game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}

/* 룰렛 컨테이너 */
.roulette-container {
    position: relative;
    width: 90vw;
    max-width: 400px;
    aspect-ratio: 1;
    margin: 0 auto;
}

#roulette-canvas {
    width: 100%;
    height: 100%;
    cursor: grab;
    touch-action: none;
}

#roulette-canvas:active {
    cursor: grabbing;
}

/* 포인터 */
.pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 3rem;
    color: #FF6B6B;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 10;
    pointer-events: none;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(5px); }
}

/* 안내 메시지 */
.instruction {
    margin-top: 20px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 25px;
    color: #3C1E1E;
    font-size: 1rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}

/* 입력 섹션 */
.input-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px 20px 0 0;
    padding: 20px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
}

.participants-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    min-height: 40px;
}

.participant-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #FF9A9E 0%, #FAD0C4 100%);
    border-radius: 20px;
    color: #3C1E1E;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.participant-tag .character-emoji {
    font-size: 1.2rem;
}

.participant-tag .remove-btn {
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.participant-tag .remove-btn:hover {
    background: #FF6B6B;
    color: white;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.name-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #FFD700;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
}

.name-input:focus {
    border-color: #FFA500;
    box-shadow: 0 0 0 3px rgba(255, 165, 0, 0.2);
}

.add-button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.add-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.add-button:active {
    transform: translateY(0);
}

.clear-button {
    width: 100%;
    padding: 10px;
    background: rgba(60, 30, 30, 0.1);
    color: #3C1E1E;
    border: none;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.clear-button:hover {
    background: rgba(60, 30, 30, 0.2);
}

/* 결과 모달 */
.result-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s;
}

.result-modal.show {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.result-content {
    background: white;
    padding: 40px;
    border-radius: 30px;
    text-align: center;
    max-width: 90%;
    animation: scaleIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.result-character {
    font-size: 6rem;
    margin-bottom: 20px;
    animation: celebration 1s ease-in-out infinite;
}

@keyframes celebration {
    0%, 100% { transform: rotate(-10deg) scale(1); }
    50% { transform: rotate(10deg) scale(1.1); }
}

.result-title {
    font-size: 2rem;
    color: #FF6B6B;
    margin-bottom: 10px;
}

.result-name {
    font-size: 1.5rem;
    color: #3C1E1E;
    font-weight: bold;
    margin-bottom: 30px;
}

.close-button {
    padding: 12px 40px;
    background: linear-gradient(135deg, #FEE500 0%, #FFD700 100%);
    color: #3C1E1E;
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.close-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* 반응형 디자인 */
@media (max-width: 480px) {
    .title {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .result-character {
        font-size: 4rem;
    }

    .result-title {
        font-size: 1.5rem;
    }

    .result-name {
        font-size: 1.2rem;
    }
}

/* 스피닝 애니메이션 */
.spinning {
    pointer-events: none;
}
