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

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: hidden;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    max-width: 1200px;
    max-height: 95vh;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    overflow: hidden;
}

h1 {
    grid-column: 1 / -1;
    text-align: center;
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 2.5em;
}

h2 {
    color: #3a7f8c;
    margin-bottom: 15px;
    font-size: 1.5em;
}

h3 {
    color: #5a6c7d;
    margin-bottom: 10px;
    margin-top: 15px;
    font-size: 1.2em;
}

/* 메뉴 입력 섹션 */
.menu-input-section {
    display: flex;
    flex-direction: column;
}

/* 그룹 탭 */
.group-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.group-tab {
    padding: 10px 20px;
    background: #f8f9fa;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.group-tab:hover {
    background: #e8f4f8;
    border-color: #3a7f8c;
}

.group-tab.active {
    background: #3a7f8c;
    color: white;
    border-color: #3a7f8c;
}

.group-tab-name {
    font-weight: bold;
}

.group-tab-delete {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: inherit;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.group-tab-delete:hover {
    background: rgba(255, 255, 255, 0.5);
}

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

#menuInput,
#groupInput {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

#menuInput:focus,
#groupInput:focus {
    outline: none;
    border-color: #3a7f8c;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-add {
    background: #52a681;
    color: white;
}

.btn-add:hover {
    background: #479972;
    transform: translateY(-2px);
}

.btn-spin {
    background: #3a7f8c;
    color: white;
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
    margin-top: 20px;
}

.btn-spin:hover {
    background: #2f6b76;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(58, 127, 140, 0.3);
}

.btn-spin:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* 메뉴 리스트 */
.menu-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 8px;
    overflow-y: auto;
    max-height: 400px;
}

.menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #52a681;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s;
}

.menu-item:hover {
    transform: translateX(5px);
}

.menu-item span {
    font-size: 16px;
    color: #333;
}

.btn-delete {
    background: #c94b4b;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-delete:hover {
    background: #b13a3a;
}

/* 돌림판 섹션 */
.wheel-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.wheel-container {
    position: relative;
    width: 500px;
    height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#wheelCanvas {
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transition: transform 0.1s;
}

.wheel-pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 40px;
    color: #e07a5f;
    z-index: 10;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.2));
}

/* 결과 표시 */
.result {
    margin-bottom: 30px;
    padding: 20px;
    background: #3a7f8c;
    border-radius: 10px;
    color: white;
    font-size: 1.5em;
    font-weight: bold;
    text-align: center;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(58, 127, 140, 0.2);
    opacity: 0;
    transition: opacity 0.5s;
}

.result.show {
    opacity: 1;
}

/* 반응형 디자인 */
@media (max-width: 1024px) {
    .container {
        grid-template-columns: 1fr;
    }

    .wheel-container {
        width: 400px;
        height: 400px;
    }

    #wheelCanvas {
        width: 400px;
        height: 400px;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.8em;
    }

    .wheel-container {
        width: 300px;
        height: 300px;
    }

    #wheelCanvas {
        width: 300px;
        height: 300px;
    }
}
