/* ============================================
   选择困难辅助器 - 黑曜石与暗金主题 (Obsidian & Gold)
   ============================================ */

:root {
    --bg-primary: #0a0a0f; /* 极深邃的黑曜石底色 */
    --glass-bg: rgba(20, 20, 30, 0.4); /* 更通透的毛玻璃 */
    --glass-border: rgba(255, 255, 255, 0.08); /* 极细微的倒角边框 */
    --glass-shadow: 0 10px 40px 0 rgba(0, 0, 0, 0.5);
    --glass-highlight: inset 0 1px 0 0 rgba(255, 255, 255, 0.1);

    --glass-bg-hover: rgba(30, 30, 45, 0.5);
    
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --text-muted: #718096;

    /* 全新调布的高级暗金配色 */
    --accent-gold: #d4af37;
    --accent-amber: #b45309;
    --accent-lightgold: #fde08b;

    --gradient-primary: linear-gradient(135deg, #b45309 0%, #d4af37 50%, #fde08b 100%);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: 'Inter', 'PingFang SC', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    isolation: isolate;
    background-image: 
        radial-gradient(circle at 50% 10%, rgba(253, 224, 139, 0.13) 0%, rgba(253, 224, 139, 0.05) 16%, transparent 36%),
        radial-gradient(circle at 18% 18%, rgba(180, 83, 9, 0.16) 0%, transparent 28%),
        radial-gradient(circle at 84% 22%, rgba(56, 189, 248, 0.08) 0%, transparent 24%),
        linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px),
        linear-gradient(180deg, #0b0b11 0%, #090a10 42%, #05060a 100%);
    background-size: auto, auto, auto, 48px 48px, 48px 48px, auto;
    background-position: center top, left top, right top, center center, center center, center center;
}

/* 更立体的背景氛围光 */
body::before, body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: -2;
}

body::before {
    width: min(76vw, 960px);
    height: min(76vw, 960px);
    top: -34vw;
    left: 50%;
    transform: translateX(-50%);
    background:
        radial-gradient(circle at 50% 50%, rgba(253, 224, 139, 0.34) 0%, rgba(212, 175, 55, 0.2) 18%, rgba(212, 175, 55, 0.08) 34%, transparent 68%);
    filter: blur(26px);
    opacity: 0.85;
    animation: crownGlow 20s infinite alternate ease-in-out;
}

body::after {
    width: min(52vw, 640px);
    height: min(52vw, 640px);
    right: -12vw;
    bottom: -18vw;
    background:
        radial-gradient(circle at 50% 50%, rgba(37, 99, 235, 0.2) 0%, rgba(15, 23, 42, 0.15) 38%, transparent 72%);
    filter: blur(96px);
    opacity: 0.58;
    animation: cornerGlow 24s infinite alternate-reverse ease-in-out;
}

@keyframes crownGlow {
    0% { transform: translateX(-50%) translateY(0) scale(1); }
    100% { transform: translateX(-50%) translateY(5%) scale(1.06); }
}

@keyframes cornerGlow {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(-4%, -6%, 0) scale(1.08); }
}

/* 顶部标题区域 */
.app-header {
    text-align: center;
    padding: 40px 0 30px;
    position: relative;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
}

.logo-icon {
    font-size: 2.8rem;
    filter: drop-shadow(0 0 15px rgba(253, 224, 139, 0.3));
    animation: gentleBounce 4s infinite ease-in-out;
}

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

.logo h1 {
    font-size: 2.4rem;
    font-weight: 800;
    /* 铂金渐变 */
    background: linear-gradient(180deg, #FFFFFF 0%, #A0AEC0 100%);
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 1px;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 2px;
}

/* 模式切换按钮 */
.mode-switcher {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 40px;
    position: relative;
    z-index: 10;
}

.mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 40px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--glass-shadow), var(--glass-highlight);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    position: relative;
    overflow: hidden;
}

.mode-btn:hover {
    transform: translateY(-4px);
    background: var(--glass-bg-hover);
    border-color: rgba(255,255,255,0.2);
    color: white;
}

.mode-btn.active {
    border-color: var(--accent-gold);
    color: var(--accent-lightgold);
    background: rgba(212, 175, 55, 0.08);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2), var(--glass-highlight);
}

/* 主内容大容器毛玻璃 */
.app-container {
    max-width: 1100px;
    margin: 0 auto 40px;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

.app-container::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(circle at 50% 34%, rgba(253, 224, 139, 0.08) 0%, transparent 22%),
        radial-gradient(circle at 50% 34%, transparent 0%, transparent 28%, rgba(255,255,255,0.035) 28.2%, transparent 28.9%, transparent 38%, rgba(255,255,255,0.022) 38.2%, transparent 38.8%);
    opacity: 0.75;
}

.main-content {
    display: flex;
    gap: 24px;
    background: var(--glass-bg);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--glass-shadow), var(--glass-highlight);
}

/* 左侧栏 */
.sidebar {
    width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-card {
    background: rgba(0,0,0,0.18);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-header, .sidebar-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-header h3, .sidebar-section h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    color: #1a1a1a;
    transform: scale(1.05);
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-text:hover {
    color: var(--accent-lightgold);
}

.group-list, .history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.group-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.03);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.group-item-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.group-item:hover {
    background: rgba(255,255,255,0.06);
    color: white;
    transform: translateX(4px);
    border-color: rgba(255,255,255,0.1);
}

.group-item.active {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.15) 0%, transparent 100%);
    border-left: 3px solid var(--accent-gold);
    color: var(--accent-lightgold);
    font-weight: 500;
}

.group-item-actions {
    opacity: 0;
    transition: var(--transition);
}

.group-item:hover .group-item-actions {
    opacity: 1;
}

.group-item-actions button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
}

.group-item-actions button:hover {
    color: #ef4444;
}

.history-item {
    padding: 12px;
    background: rgba(0,0,0,0.25);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255,255,255,0.02);
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: var(--transition);
    line-height: 1.5;
}

.history-item:hover {
    background: rgba(255,255,255,0.05);
    transform: translateX(4px);
}

.history-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.history-time {
    color: #cbd5e1;
}

.history-candidates {
    color: var(--text-secondary);
    word-break: break-word;
}

.history-reuse {
    border: 1px solid rgba(212, 175, 55, 0.28);
    background: rgba(212, 175, 55, 0.08);
    color: var(--accent-lightgold);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.history-reuse:hover {
    background: rgba(212, 175, 55, 0.18);
    border-color: rgba(212, 175, 55, 0.4);
}

.history-item .history-result {
    color: var(--accent-lightgold);
    font-weight: 600;
    font-size: 0.9rem;
}

/* 中央交互区 */
.center-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.input-area {
    background: rgba(0,0,0,0.25);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid rgba(255,255,255,0.03);
}

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.btn-secondary {
    padding: 8px 16px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.15);
    box-shadow: 0 0 10px rgba(255,255,255,0.1);
}

.candidates-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.candidate-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.candidate-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--accent-lightgold);
    flex-shrink: 0;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.candidate-input {
    flex: 1;
    padding: 14px 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--radius-md);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.candidate-input:focus {
    background: rgba(255,255,255,0.08);
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15), inset 0 2px 4px rgba(0,0,0,0.3);
}

.candidate-weight {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 118px;
}

.candidate-weight label {
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 24px;
}

.weight-slider {
    appearance: none;
    width: 80px;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    outline: none;
}

.weight-slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-lightgold);
    cursor: pointer;
    box-shadow: 0 0 10px var(--accent-lightgold);
}

.candidate-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.candidate-remove:hover {
    color: #ef4444;
    transform: scale(1.2);
}

.btn-add-candidate {
    margin-top: 12px;
    padding: 12px;
    background: transparent;
    border: 1px dashed rgba(255,255,255,0.15);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.btn-add-candidate:hover {
    border-color: var(--accent-gold);
    color: var(--accent-lightgold);
    background: rgba(212, 175, 55, 0.05);
}

/* 动画展示区 */
.animation-area {
    min-height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* 黄金背光：映衬比特币 */
.animation-area::before {
    content: '';
    position: absolute;
    width: 320px;
    height: 180px;
    background: radial-gradient(circle at 50% 50%, rgba(253, 224, 139, 0.18) 0%, rgba(253, 224, 139, 0.06) 36%, transparent 72%);
    border-radius: 999px;
    filter: blur(18px);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
}

/* 顶级奢华硬币 3D 纹理 (机械表盘与重金质感交织) */
.coin-container {
    perspective: 1400px;
    z-index: 10;
    /* 投影放在容器上，避免 filter 破坏 .coin 的 3D backface-visibility */
    filter: drop-shadow(0 22px 34px rgba(0, 0, 0, 0.55)) drop-shadow(0 8px 18px rgba(253, 224, 139, 0.12));
}

.coin {
    width: 208px;
    height: 208px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.1s;
}

.coin-face {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 34px;
    text-align: center;
    border: none;
    background: 
        radial-gradient(circle at center, rgba(0,0,0,0.55) 0%, transparent 65%),
        url('./antique_bronze_coin.png');
    background-size: 148%;
    background-position: center;
    box-shadow: 
        inset 0 0 30px 10px rgba(0,0,0,0.6),
        0 10px 22px rgba(0, 0, 0, 0.3);
}

.coin-face::before {
    display: none;
}

.coin-face::after {
    display: none;
}

.coin-face span {
    position: relative;
    z-index: 10;
    max-width: 118px;
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: 0.02em;
    color: #fde08b;
    text-shadow: 0 4px 6px rgba(0,0,0,0.9), 0 -1px 0 rgba(255,255,255,0.3);
    backface-visibility: hidden;
}

.coin-back {
    transform: rotateY(180deg);
}

@keyframes coinFlipEnhanced {
    0%   { transform: rotateY(0deg) scale(1); }
    50%  { transform: rotateY(900deg) scale(1.3); } 
    100% { transform: rotateY(1800deg) scale(1); }
}

@keyframes coinFlipToBackEnhanced {
    0%   { transform: rotateY(0deg) scale(1); }
    50%  { transform: rotateY(990deg) scale(1.3); }
    100% { transform: rotateY(1980deg) scale(1); }
}

.coin.flipping-front {
    animation: coinFlipEnhanced 2.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.coin.flipping-back {
    animation: coinFlipToBackEnhanced 2.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}


/* 轮盘样式优化 */
.wheel-wrapper {
    position: relative;
    filter: drop-shadow(0 15px 30px rgba(0,0,0,0.7));
    z-index: 10;
}

.wheel-pointer {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.5rem;
    color: #fef08a;
    z-index: 10;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.6));
}

#wheel-canvas {
    border-radius: 50%;
    box-shadow: 
        0 0 0 6px rgba(212, 175, 55, 0.3), 
        0 0 0 12px rgba(212, 175, 55, 0.1);
}

/* 底部 GO 按钮（暗金色） */
.btn-go {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
    border: none;
    border-radius: var(--radius-xl);
    background: var(--gradient-primary);
    color: #271400; /* 高级深棕字 */
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.3), inset 0 2px 0 rgba(255,255,255,0.4);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-go::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    animation: btnShine 3s infinite;
}

@keyframes btnShine {
    0% { left: -100%; }
    20% { left: 200%; }
    100% { left: 200%; }
}

.btn-go:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 40px rgba(212, 175, 55, 0.5), inset 0 2px 0 rgba(255,255,255,0.6);
}

.btn-go:active {
    transform: translateY(2px);
}

.btn-go:disabled {
    cursor: wait;
    opacity: 0.82;
    transform: none;
    box-shadow: 0 10px 24px rgba(212, 175, 55, 0.2), inset 0 2px 0 rgba(255,255,255,0.25);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-7px); }
    40% { transform: translateX(7px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

/* 结果揭晓弹出 */
.result-area {
    text-align: center;
    padding: 30px;
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(24px);
    box-shadow: 0 0 50px rgba(212, 175, 55, 0.3), inset 0 0 20px rgba(255,255,255,0.1);
}

.result-label {
    font-size: 1rem;
    color: #cbd5e1;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.result-text {
    font-size: 2.8rem;
    font-weight: 900;
    background: linear-gradient(to right, #fde08b 0%, #d4af37 100%);
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

@keyframes resultPop {
    0% {
        opacity: 0;
        transform: translateY(18px) scale(0.94);
    }
    70% {
        opacity: 1;
        transform: translateY(-4px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 弹窗样式调整 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal {
    background: rgba(15, 15, 20, 0.95);
    border: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
    border-radius: var(--radius-xl);
    padding: 30px;
    width: 90%;
    max-width: 440px;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.modal h3 {
    color: var(--accent-lightgold);
    font-size: 1.2rem;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal-message {
    color: var(--text-secondary);
    line-height: 1.6;
}

.modal-footer {
    margin-top: 22px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-close {
    flex-shrink: 0;
}

.modal-input {
    width: 100%;
    padding: 16px;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-lg);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.modal-input:focus {
    border-color: var(--accent-gold);
    background: rgba(255,255,255,0.05);
}

.btn-primary {
    background: var(--accent-gold);
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius-md);
    color: #1a1a1a;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}
.btn-primary:hover {
    background: var(--accent-lightgold);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

/* Confetti */
#confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100;
}
.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confettiFall var(--fall-duration, 3s) linear forwards;
}
@keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
    100% { transform: translateY(100vh) rotate(var(--rotation, 720deg)) scale(0.3); opacity: 0; }
}

/* 响应式调整 */
@media (max-width: 960px) {
    .main-content {
        flex-direction: column;
    }

    .center-area {
        order: 1;
    }

    .sidebar {
        width: 100%;
        order: 2;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .input-header {
        flex-wrap: wrap;
        gap: 12px;
        align-items: flex-start;
    }

    .btn-go {
        position: sticky;
        bottom: 12px;
        z-index: 20;
        max-width: none;
    }
}

@media (max-width: 700px) {
    body::before {
        width: 112vw;
        height: 112vw;
        top: -30vw;
        opacity: 0.72;
    }

    body::after {
        width: 82vw;
        height: 82vw;
        right: -24vw;
        bottom: -28vw;
        opacity: 0.45;
    }

    .app-container::before {
        opacity: 0.5;
    }

    .app-container {
        padding: 0 14px 96px;
    }

    .app-header {
        padding: 28px 0 24px;
    }

    .logo {
        gap: 12px;
    }

    .logo h1 {
        font-size: 2rem;
    }

    .subtitle {
        letter-spacing: 1px;
    }

    .mode-switcher {
        gap: 12px;
        margin-bottom: 24px;
    }

    .mode-btn {
        flex: 1;
        padding: 16px 18px;
    }

    .main-content {
        padding: 16px;
        gap: 16px;
    }

    .sidebar {
        grid-template-columns: 1fr;
    }

    .sidebar-card,
    .input-area,
    .result-area {
        padding: 18px;
    }

    .candidate-item {
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
    }

    .candidate-input {
        min-width: 0;
        width: calc(100% - 44px);
    }

    .candidate-weight {
        width: 100%;
        padding-left: 44px;
    }

    .candidate-remove {
        margin-left: auto;
    }

    .animation-area {
        min-height: 260px;
    }

    .coin {
        width: 170px;
        height: 170px;
    }

    .coin-face {
        padding: 24px;
    }

    .coin-face span {
        max-width: 92px;
        font-size: 1.35rem;
    }

    #wheel-canvas {
        width: min(78vw, 300px);
        height: min(78vw, 300px);
    }

    .result-text {
        font-size: 2rem;
    }

    .modal {
        padding: 22px;
    }

    .modal-footer {
        flex-direction: column-reverse;
    }

    .modal-footer .btn-secondary,
    .modal-footer .btn-primary {
        width: 100%;
    }
}
