/* 다크 모드를 기본값으로 설정 */
:root {
    --primary: #9D68FE;
    --primary-light: #B992FF;
    --accent: #FF5F7E;
    --accent-light: #FF8E9E;
    --background: #131419;
    --surface-1: #1E1F29;
    --surface-2: #2A2B36;
    --text-primary: #FFFFFF;
    --text-secondary: #CCCCCC;
    --success: #4CAF50;
    --warning: #FF9F40;
    --danger: #FF5F7E;
    --border-radius-sm: 12px;
    --border-radius-md: 18px;
    --border-radius-lg: 24px;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    --neuro-shadow: 12px 12px 24px rgba(0, 0, 0, 0.4), -12px -12px 24px rgba(40, 40, 70, 0.2);
    --neuro-inset: inset 5px 5px 10px rgba(0, 0, 0, 0.3), inset -5px -5px 10px rgba(40, 40, 70, 0.1);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 라이트 모드 색상 변수 */
body.light-mode {
    --primary: #6B38D1;
    --primary-light: #9D68FE;
    --accent: #E83A5F;
    --accent-light: #FF5F7E;
    --background: #F0F0F5;
    --surface-1: #FFFFFF;
    --surface-2: #E8E8EC;
    --text-primary: #2E2E3A;
    --text-secondary: #555566;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --neuro-shadow: 10px 10px 20px rgba(174, 174, 192, 0.4), -10px -10px 20px rgba(255, 255, 255, 0.9);
    --neuro-inset: inset 5px 5px 10px rgba(174, 174, 192, 0.4), inset -5px -5px 10px rgba(255, 255, 255, 0.9);
}

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

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 20%, rgba(140, 82, 255, 0.15) 0%, rgba(140, 82, 255, 0) 40%),
        radial-gradient(circle at 70% 60%, rgba(255, 95, 126, 0.15) 0%, rgba(255, 95, 126, 0) 40%),
        radial-gradient(circle at 90% 90%, rgba(255, 159, 64, 0.1) 0%, rgba(255, 159, 64, 0) 30%);
    z-index: -1;
}

.page-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 3rem 1.5rem;
    overflow: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
    padding: 1rem;
    position: relative;
}

@media (min-width: 992px) {
    .container {
        grid-template-columns: 1.3fr 0.7fr;
        padding: 2rem;
    }
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 3rem;
    grid-column: 1 / -1;
    position: relative;
    z-index: 1;
}

.header::before {
    content: '';
    position: absolute;
    width: 180px;
    height: 180px;
    background: var(--primary);
    filter: blur(140px);
    opacity: 0.4;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    z-index: -1;
    border-radius: 50%;
}

.header h1 {
    font-size: 3.2rem;
    line-height: 1.2;
    font-weight: 900;
    margin-bottom: 1.2rem;
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    position: relative;
    letter-spacing: -0.01em;
}

.header h1::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -8px;
    transform: translateX(-50%);
    width: 80px;
    height: 6px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--primary) 100%);
    border-radius: 3px;
}

.header p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Card Styles */
.card {
    background-color: var(--surface-1);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--neuro-shadow);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(157, 104, 254, 0.03) 0%, rgba(255, 95, 126, 0.03) 100%);
    pointer-events: none;
}

.card-title {
    font-size: 1.7rem;
    font-weight: 700;
    margin-bottom: 1.8rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    position: relative;
}

.card-title i {
    margin-right: 0.85rem;
    font-size: 1.4rem;
    color: var(--primary);
    padding: 10px;
    background-color: rgba(157, 104, 254, 0.12);
    border-radius: 12px;
    box-shadow: var(--neuro-shadow);
}

/* Participants Section */
.participants {
    margin-bottom: 2.5rem;
}

.participant-limit-info {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem;
    background-color: rgba(157, 104, 254, 0.05);
    border-radius: var(--border-radius-sm);
}

.participant-limit-info i {
    color: var(--primary);
    margin-right: 0.5rem;
}

.input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.counter-group {
    display: flex;
    align-items: center;
    background-color: var(--surface-2);
    border-radius: var(--border-radius-sm);
    padding: 0.4rem;
    overflow: hidden;
    box-shadow: var(--neuro-shadow);
}

.counter-btn {
    background-color: var(--surface-1);
    color: var(--text-primary);
    width: 48px;
    padding: 0;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--neuro-shadow);
}

.counter-btn:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-3px);
}

input {
    background-color: var(--surface-2);
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 0.95rem 1.2rem;
    font-size: 1.05rem;
    color: var(--text-primary);
    flex-grow: 1;
    transition: var(--transition);
    box-shadow: var(--neuro-inset);
}

input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(157, 104, 254, 0.3), var(--neuro-inset);
}

input::placeholder {
    color: var(--text-secondary);
}

.generate-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 0 1.5rem;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    box-shadow: var(--neuro-shadow);
}

.generate-btn:hover {
    background-color: var(--primary-light);
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.generate-btn:disabled {
    background-color: var(--surface-2);
    color: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--neuro-inset);
}

/* Participant List */
.participant-list-container {
    background-color: var(--surface-2);
    border-radius: var(--border-radius-md);
    padding: 1.2rem;
    max-height: 280px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--surface-2);
    position: relative;
    box-shadow: var(--neuro-inset);
}

.participant-list-container::-webkit-scrollbar {
    width: 8px;
    border-radius: 4px;
}

.participant-list-container::-webkit-scrollbar-track {
    background-color: var(--surface-2);
    border-radius: 4px;
}

.participant-list-container::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 10px;
    border: 2px solid var(--surface-2);
}

.participant-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.participant {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--surface-1);
    border-radius: var(--border-radius-sm);
    padding: 1rem 1.2rem;
    transition: var(--transition);
    box-shadow: var(--neuro-shadow);
    position: relative;
    overflow: hidden;
}

.participant::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: var(--primary);
    opacity: 0.8;
}

.participant:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.participant span {
    font-weight: 600;
    font-size: 1.05rem;
}

.participant-actions {
    display: flex;
    gap: 0.7rem;
}

.edit-btn, .remove-btn {
    background-color: var(--surface-2);
    color: var(--text-primary);
    border: none;
    padding: 0.6rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--neuro-shadow);
}

.edit-btn {
    color: var(--primary);
}

.remove-btn {
    color: var(--danger);
}

.edit-btn:hover, .remove-btn:hover {
    transform: translateY(-2px);
    background-color: var(--surface-1);
}

.edit-btn:hover {
    color: var(--primary-light);
}

.remove-btn:hover {
    color: var(--accent-light);
}

.no-participants {
    color: var(--text-secondary);
    text-align: center;
    padding: 2rem 1rem;
    font-size: 1.05rem;
    background-color: rgba(157, 104, 254, 0.05);
    border-radius: var(--border-radius-md);
    position: relative;
}

.no-participants::before {
    content: '\f059';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 2rem;
    color: var(--primary-light);
    opacity: 0.5;
    position: absolute;
    top: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
}

.no-participants p {
    margin-top: 2rem;
}

/* Game Area */
.game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 1rem;
}

.wheel-container {
    position: relative;
    width: 320px;
    height: 320px;
    margin: 0 auto 3rem;
    perspective: 1000px;
    max-width: 100%;
    z-index: 5; /* 기본적으로도 앞에 표시되도록 설정 */
}

#wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    transition: transform 5s cubic-bezier(0.08, 0.82, 0.17, 1);
    transform: rotate(0deg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(157, 104, 254, 0.3);
    z-index: 2;
}

.wheel-outer-ring {
    position: absolute;
    width: 110%;
    height: 110%;
    top: -5%;
    left: -5%;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        var(--primary) 0%, 
        var(--accent) 33%, 
        var(--primary) 66%, 
        var(--accent) 100%
    );
    opacity: 0.8;
    filter: blur(20px);
    animation: rotate 10s linear infinite;
    z-index: 1;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.wheel-arrow-container {
    position: absolute;
    top: -45px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    width: 50px;
    height: 80px;
    display: flex;
    justify-content: center;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.4));
}

.wheel-arrow {
    width: 0;
    height: 0;
    border-left: 25px solid transparent;
    border-right: 25px solid transparent;
    border-top: 40px solid var(--accent);
    position: relative;
    transform-origin: center bottom;
    animation: arrowPulse 1.5s ease-in-out infinite alternate;
}

@keyframes arrowPulse {
    0% {
        transform: scaleY(0.9);
    }
    100% {
        transform: scaleY(1.1);
    }
}

.wheel-arrow::after {
    content: '';
    position: absolute;
    left: -12.5px;
    top: -40px;
    border-left: 12.5px solid transparent;
    border-right: 12.5px solid transparent;
    border-top: 25px solid var(--text-primary);
}

/* Empty wheel state */
.empty-wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: 
        radial-gradient(circle at 30% 30%, var(--surface-2) 0%, transparent 70%),
        radial-gradient(circle at 70% 70%, rgba(157, 104, 254, 0.1) 0%, transparent 70%),
        var(--surface-1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 2rem;
    text-align: center;
    box-shadow: inset 10px 10px 20px rgba(0, 0, 0, 0.2), inset -10px -10px 20px rgba(40, 40, 70, 0.1);
}

.empty-wheel i {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
    opacity: 0.7;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.empty-wheel p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 200px;
    line-height: 1.5;
}

/* Game Controls */
.game-controls {
    display: flex;
    gap: 1.2rem;
    margin-top: 1.5rem;
}

.btn-primary, .btn-secondary {
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 0.95rem 1.8rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    box-shadow: var(--neuro-shadow);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background-color: var(--primary-light);
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background-color: var(--surface-2);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--surface-2);
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

/* Results */
.results-card {
    display: flex;
    flex-direction: column;
    position: relative;
}

.results-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 95, 126, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
    z-index: 0;
    border-radius: var(--border-radius-lg);
}

.results-glow.show {
    opacity: 1;
}

.results {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 2rem 0;
    padding: 2rem;
    background-color: var(--surface-2);
    border-radius: var(--border-radius-md);
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease-out;
    position: relative;
    z-index: 1;
    box-shadow: var(--neuro-shadow);
    line-height: 1.6;
}

.results.show {
    opacity: 1;
    transform: translateY(0);
}

.results .highlight {
    color: var(--accent);
    font-weight: 900;
    position: relative;
    display: inline-block;
    padding: 0 5px;
    z-index: 1;
}

.results .highlight::before {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    width: 100%;
    height: 8px;
    background-color: rgba(255, 95, 126, 0.3);
    z-index: -1;
    border-radius: 4px;
}

/* Tasks */
.tasks {
    margin-top: 2rem;
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease-out 0.3s;
    position: relative;
    z-index: 1;
}

.tasks.show {
    opacity: 1;
    transform: translateY(0);
    display: block;
}

.tasks-title {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    color: var(--primary);
    font-size: 1.3rem;
    font-weight: 700;
}

.tasks-title i {
    margin-right: 0.8rem;
    background-color: rgba(157, 104, 254, 0.12);
    padding: 8px;
    border-radius: 10px;
    box-shadow: var(--neuro-shadow);
}

.task-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.task {
    background: linear-gradient(135deg, var(--surface-1) 0%, var(--surface-2) 100%);
    padding: 1.2rem;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 1.05rem;
    transition: var(--transition);
    position: relative;
    box-shadow: var(--neuro-shadow);
    overflow: hidden;
    z-index: 1;
}

.task::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: var(--primary);
}

.task:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.task:hover::after {
    transform: translateX(0);
}

.task::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(157, 104, 254, 0.1) 0%, rgba(255, 95, 126, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.task:hover::after {
    opacity: 1;
}

/* Loading Animation */
.loader {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(30, 31, 41, 0.7);
    z-index: 50;
    border-radius: var(--border-radius-lg);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    pointer-events: none; /* 휠과 상호작용 가능하도록 */
}

.loader.show {
    display: flex;
}

.spinner {
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.spinner::before,
.spinner::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.spinner::before {
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(157, 104, 254, 0.6) 0%,
        rgba(255, 95, 126, 0.6) 100%
    );
    filter: blur(10px);
}

.spinner::after {
    width: 80%;
    height: 80%;
    background: linear-gradient(
        -45deg,
        rgba(255, 95, 126, 0.8) 0%,
        rgba(157, 104, 254, 0.8) 100%
    );
    box-shadow: 0 0 20px rgba(157, 104, 254, 0.6);
    animation-delay: -0.5s;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(0.8);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

.spinner-text {
    position: absolute;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    white-space: nowrap;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    animation: textFlicker 2s linear infinite;
    z-index: 10;
}

@keyframes textFlicker {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.loading-message {
    margin-top: 2rem;
    font-size: 1.2rem;
    text-align: center;
    color: var(--text-primary);
    transform: translateY(-200px);
    position: relative;
    z-index: 60;
    font-weight: bold;
}

/* Animation Effect for Cards */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.8s ease-out forwards;
}

.card:nth-child(2) {
    animation-delay: 0.3s;
}

.card:nth-child(3) {
    animation-delay: 0.6s;
}

/* Confetti Effect */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    overflow: hidden;
    display: none;
}

.confetti {
    position: absolute;
    opacity: 0.8;
    animation: fall 5s linear infinite;
    z-index: 100;
}

@keyframes fall {
    0% {
        top: -20px;
        transform: translateX(0) rotate(0deg) scale(1);
    }
    25% {
        transform: translateX(100px) rotate(180deg) scale(1.1);
    }
    50% {
        transform: translateX(50px) rotate(360deg) scale(1);
    }
    75% {
        transform: translateX(-50px) rotate(540deg) scale(0.9);
    }
    100% {
        top: 100vh;
        transform: translateX(-100px) rotate(720deg) scale(1);
    }
}

/* Tooltips */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background-color: var(--surface-1);
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: normal;
    white-space: nowrap;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
    pointer-events: none;
}

[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--surface-1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
}

[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Responsive Design */
@media (max-width: 992px) {
    .header h1 {
        font-size: 2.8rem;
    }
    
    .card {
        padding: 2rem;
    }

    .page-wrapper {
        padding: 2rem 1rem;
    }
    
    .container {
        gap: 3rem;
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 2.4rem;
    }

    .wheel-container {
        width: 85vw;
        height: 85vw;
        max-width: 280px;
        max-height: 280px;
    }

    .task-list {
        grid-template-columns: 1fr 1fr;
    }
    
    .container {
        gap: 2.5rem;
    }
    
    .card {
        padding: 2rem 1.5rem;
    }
    
    .participant-list-container {
        max-height: 220px;
    }
}

@media (max-width: 576px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .page-wrapper {
        padding: 1rem 0.5rem;
    }
    
    .container {
        padding: 0.5rem;
    }
    
    .wheel-container {
        width: 80vw; /* Viewport-based sizing */
        height: 80vw; /* Keep it square */
        max-width: 240px;
        max-height: 240px;
        margin-bottom: 2rem;
    }
    
    .wheel-arrow-container {
        top: -35px;
    }
    
    .wheel-arrow {
        border-left: 20px solid transparent;
        border-right: 20px solid transparent;
        border-top: 30px solid var(--accent);
    }
    
    .wheel-arrow::after {
        left: -10px;
        top: -30px;
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
        border-top: 20px solid var(--text-primary);
    }

    .input-group {
        flex-direction: column;
        gap: 0.7rem;
    }
    
    .task-list {
        grid-template-columns: 1fr;
    }
    
    .card-title {
        font-size: 1.4rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .results {
        font-size: 1.2rem;
        padding: 1.5rem;
    }
    
    .participant span {
        font-size: 1rem;
    }
    
    .game-controls {
        flex-direction: column;
        gap: 0.8rem;
        width: 100%;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
    }
}

/* Dark Mode Toggle */
.theme-toggle {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    background-color: var(--surface-1);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1000;
    transition: var(--transition);
    box-shadow: var(--neuro-shadow);
}

.theme-toggle:hover {
    transform: rotate(45deg);
    background-color: var(--primary);
}

.theme-toggle i {
    font-size: 1.3rem;
    color: var(--text-primary);
}

@media (max-width: 576px) {
    .theme-toggle i, .help-btn i {
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .theme-toggle, .help-btn {
        width: 40px;
        height: 40px;
    }
    
    .theme-toggle {
        top: 1rem;
        right: 1rem;
    }
    
    .help-btn {
        bottom: 1rem;
        right: 1rem;
    }
}

/* Page Entry Animation */
@keyframes pageEntry {
    0% {
        opacity: 0;
        transform: scale(0.96);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Help Button */
.help-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background-color: var(--surface-1);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1000;
    transition: var(--transition);
    box-shadow: var(--neuro-shadow);
}

.help-btn:hover {
    background-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.help-btn i {
    font-size: 1.3rem;
    color: var(--text-primary);
}

/* 가상 키보드가 나타날 때 레이아웃 조정 */
@media screen and (max-height: 500px) {
    .wheel-container {
        width: 60vw;
        height: 60vw;
        max-width: 200px;
        max-height: 200px;
        margin-bottom: 1rem;
    }
    
    .participant-list-container {
        max-height: 150px;
    }
}

/* 모달 관련 스타일 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: var(--surface-1);
    border-radius: var(--border-radius-lg);
    width: 95%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--neuro-shadow);
    animation: modalFadeIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--surface-2);
}

.modal-header h3 {
    display: flex;
    align-items: center;
    margin: 0;
    color: var(--text-primary);
}

.modal-header h3 i {
    margin-right: 0.85rem;
    color: var(--primary);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--accent);
    transform: rotate(90deg);
}

.modal-body {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    border-top: 1px solid var(--surface-2);
}

/* 벌칙 편집 관련 스타일 */
.task-editor-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.task-input {
    flex-grow: 1;
    background-color: var(--surface-2);
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 0.95rem 1.2rem;
    font-size: 1.05rem;
    color: var(--text-primary);
    box-shadow: var(--neuro-inset);
}

.task-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(157, 104, 254, 0.3), var(--neuro-inset);
}

.editable-task-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.editable-task {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--surface-2);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    transition: var(--transition);
    box-shadow: var(--neuro-shadow);
}

.editable-task:hover {
    transform: translateY(-3px);
}

.editable-task-text {
    font-weight: 500;
    flex-grow: 1;
    margin-right: 1rem;
}

.editable-task-actions {
    display: flex;
    gap: 0.5rem;
}

.edit-task-btn, .remove-task-btn {
    background-color: var(--surface-1);
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--neuro-shadow);
}

.edit-task-btn {
    color: var(--primary);
}

.remove-task-btn {
    color: var(--accent);
}

.edit-task-btn:hover, .remove-task-btn:hover {
    transform: translateY(-2px);
}

/* 룰렛 모드 토글 버튼 */
.roulette-mode-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1rem 0;
    padding: 0.8rem;
    background-color: var(--surface-2);
    border-radius: var(--border-radius-md);
    box-shadow: var(--neuro-inset);
}

.roulette-mode-toggle span {
    margin-right: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.toggle-buttons {
    display: flex;
    background-color: var(--surface-1);
    border-radius: var(--border-radius-sm);
    padding: 0.4rem;
    box-shadow: var(--neuro-shadow);
}

.toggle-btn {
    background: none;
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 0.7rem 1.2rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.toggle-btn.active {
    background-color: var(--primary);
    color: white;
    box-shadow: var(--neuro-shadow);
}

.toggle-btn:not(.active):hover {
    background-color: rgba(157, 104, 254, 0.1);
    color: var(--text-primary);
}

/* 버튼 그룹 */
.btn-group {
    display: flex;
    gap: 0.7rem;
}

@media (max-width: 576px) {
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .task-editor-controls {
        flex-direction: column;
    }
}



.help-content {
    display: none;
    position: fixed;
    bottom: 5rem;
    right: 1.5rem;
    background-color: var(--surface-1);
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    width: 300px;
    box-shadow: var(--neuro-shadow);
    z-index: 999;
    transition: all 0.3s ease;
    transform: translateY(20px);
    opacity: 0;
}

.help-content.show {
    display: block;
    transform: translateY(0);
    opacity: 1;
}

.help-content h3 {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    color: var(--primary);
}

.help-content h3 i {
    margin-right: 0.5rem;
}

.help-content p {
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.help-content ul {
    list-style-type: none;
    padding-left: 0.5rem;
}

.help-content li {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    position: relative;
    padding-left: 1.2rem;
    color: var(--text-secondary);
}

.help-content li::before {
    content: '•';
    color: var(--primary);
    position: absolute;
    left: 0;
    font-weight: bold;
}

.close-help {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.close-help:hover {
    color: var(--accent);
    transform: none;
}

/* Initial page load animation */
.page-wrapper {
    animation: pageEntry 0.8s ease-out forwards;
}