/* ============================= */
/* 💎 PREMIUM MENU SERVICE UI    */
/* ============================= */

:root {
    --primary: #FF6B35;
    --primary-dark: #E85A2A;
    --primary-light: #FFF0EB;

    --bg-page: #F8F9FA;
    --bg-card: #FFFFFF;

    --text-main: #1A1C1E;
    --text-sub: #44474E;
    --text-muted: #74777F;

    --border: #DEE2E6;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --shadow-heavy: 0 10px 30px rgba(0, 0, 0, 0.08);

    --radius-full: 9999px;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;

    --font-main: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
}

[data-theme="dark"] {
    --bg-page: #121212;
    --bg-card: #1E1E1E;
    --text-main: #F1F1F1;
    --text-sub: #BBBBBB;
    --text-muted: #888888;
    --border: #333333;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.5;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 16px;
    transition: background-color 0.3s ease;
}

#app {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-bottom: 40px;
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.weather-badge {
    background: var(--bg-card);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.history-badge {
    background: var(--bg-card);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.history-badge span:first-child {
    color: var(--text-muted);
    margin-right: 4px;
}

.count-num {
    color: var(--primary);
}

.trash-badge {
    background: #FFF0F0 !important;
    /* Soft red for trash */
}

.trash-badge .count-num {
    color: #FA5252;
}

.theme-toggle-btn {
    background: var(--bg-card);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow);
    cursor: pointer;
    font-size: 10px;
    font-weight: 800;
}

/* Main Cards */
.main-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 50px 24px 32px;
    box-shadow: var(--shadow);
    width: 100%;
    position: relative;
    overflow: hidden;
}

.step {
    display: none;
    flex-direction: column;
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.step.active {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typography & Layouts */
.hero-section {
    text-align: center;
    margin-bottom: 48px;
}

.main-logo {
    font-size: 40px;
    line-height: 1.1;
    margin-bottom: 16px;
    font-weight: 400;
}

.main-logo strong {
    color: var(--primary);
    font-weight: 900;
}

.description {
    color: var(--text-sub);
    font-size: 16px;
    word-break: keep-all;
}

/* Buttons */
.action-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.button-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn {
    border: none;
    padding: 18px 24px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-main);
}

.btn-ghost {
    background: var(--primary-light);
    color: var(--primary);
}

.btn-large {
    width: 100%;
    padding: 20px;
}

.btn-back {
    background: transparent;
    border: 1px solid var(--border);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
}

/* Utilities */
.mt-large {
    margin-top: 30px !important;
}

.mb-large {
    margin-bottom: 40px !important;
}

.mt-medium {
    margin-top: 24px !important;
}

.mb-medium {
    margin-bottom: 24px !important;
}

/* Stats section */
.stats-section {
    margin-top: 33px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.stats-title {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
    text-align: center;
}

.trending-flex {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.trending-card {
    background: var(--bg-page);
    padding: 12px;
    border-radius: var(--radius-md);
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.step-desc {
    color: var(--text-sub);
    font-size: 14px;
    margin-bottom: 20px;
    text-align: center;
}

/* Filters */
.step-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.step-title {
    font-size: 20px;
    font-weight: 850;
}

.filter-group {
    margin-bottom: 32px;
}

.filter-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
}

.chip-group.center {
    justify-content: center;
}

.chip {
    padding: 10px 16px;
    background: var(--bg-page);
    border: 1.5px solid transparent;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chip:hover {
    border-color: var(--primary);
}

.chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Slot machine */
.slot-container {
    height: 120px;
    background: var(--bg-page);
    border-radius: var(--radius-md);
    margin: 32px 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
}

.slot-strip {
    display: flex;
    flex-direction: column;
    transition: transform 0.1s linear;
}

.slot-item {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    gap: 12px;
}

.loading-text {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* Result Screen */
.result-badge {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 11px;
    font-weight: 900;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    letter-spacing: 0.5px;
}

.result-card-inner {
    text-align: center;
    padding: 24px 0 40px;
}

.result-emoji {
    font-size: 80px;
    margin-bottom: 16px;
    display: inline-block;
    animation: bounce 1s infinite alternate cubic-bezier(0.45, 0.05, 0.55, 0.95);
}

@keyframes bounce {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-10px);
    }
}

.result-name {
    font-size: 32px;
    font-weight: 900;
    margin-bottom: 12px;
}

.result-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-bottom: 24px;
}

.tag {
    font-size: 12px;
    background: #F1F3F5;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
}

.result-comment {
    background: var(--bg-page);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    line-height: 1.6;
    font-size: 15px;
}

.result-details {
    display: flex;
    gap: 16px;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.action-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.secondary-actions {
    display: flex;
    justify-content: center;
    gap: 24px;
}

.btn-text {
    background: none;
    border: none;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    color: var(--text-muted);
}

.btn-text.text-danger {
    color: #FA5252;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

.modal-card {
    background: var(--bg-card);
    width: 100%;
    max-width: 400px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    box-shadow: var(--shadow-heavy);
    position: relative;
}

#history-list,
#excluded-list {
    overflow-y: auto;
    padding-right: 8px;
    margin-top: 12px;
}

/* Scrollbar refine */
#history-list::-webkit-scrollbar,
#excluded-list::-webkit-scrollbar {
    width: 4px;
}

#history-list::-webkit-scrollbar-thumb,
#excluded-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

/* FAB */
.share-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
}

.share-fab button {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.share-fab button:hover {
    transform: scale(1.1);
}

/* Worldcup items */
.battle-arena {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 32px;
}

.battle-item {
    background: var(--bg-page);
    padding: 40px 32px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.battle-item:hover {
    background: var(--primary-light);
    transform: translateY(-4px);
    border-color: var(--primary);
}

.bt-emoji {
    font-size: 48px;
}

.bt-name {
    font-weight: 800;
    font-size: 18px;
}

.battle-vs {
    text-align: center;
    font-weight: 900;
    color: var(--primary);
    font-size: 12px;
}

.wc-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}

.round-badge {
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 800;
}

.idx-badge {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
}

/* Roulette Specifics */
.canvas-container {
    position: relative;
    width: 320px;
    height: 320px;
    margin: 32px auto;
}

.roulette-pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 25px solid #FA5252;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

#roulette-wheel {
    border-radius: 50%;
    box-shadow: 0 0 0 8px var(--bg-page), var(--shadow-heavy);
    background: white;
}