/**
 * The Spin The Wheel — Page Module: multi-wheel.css
 */

/* ==========================================================================
   Multi-Wheel Spinner & Simultaneous Rotation Styles
   ========================================================================== */
.multi-wheel-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.multi-wheel-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 0.85rem 1.25rem;
}

.multi-mode-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.multi-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 0.45rem 0.95rem;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.multi-mode-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-accent);
}

.multi-mode-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}

.multi-preset-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.multi-preset-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.multi-preset-chip:hover {
    color: var(--text-primary);
    border-color: var(--border-accent);
    background: rgba(255, 255, 255, 0.04);
}

.multi-preset-chip.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary);
    color: #a5b4fc;
}

/* Multi-Wheel Canvas Grid */
.multi-wheel-stage-grid {
    display: grid;
    gap: 1.25rem;
    width: 100%;
}

.multi-wheel-stage-grid.mode-3 {
    grid-template-columns: repeat(3, 1fr);
}

.multi-wheel-stage-grid.mode-2 {
    grid-template-columns: repeat(2, 1fr);
}

.wheel-card-column {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    box-shadow: var(--shadow-soft);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wheel-card-column:hover {
    border-color: var(--border-accent);
}

.wheel-card-column.locked {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.04);
}

.wheel-card-column.locked::after {
    content: '🔒 LOCKED';
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 0.675rem;
    font-weight: 800;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.wheel-col-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.wheel-col-title-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wheel-col-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.wheel-col-badge.badge-w1 { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.wheel-col-badge.badge-w2 { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.wheel-col-badge.badge-w3 { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }

.wheel-col-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.wheel-col-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-wheel-lock {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 0.25rem 0.55rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-wheel-lock:hover {
    color: #f59e0b;
    border-color: #f59e0b;
}

.btn-wheel-lock.active {
    background: #f59e0b;
    color: #0b0f17;
    border-color: #f59e0b;
}

/* Canvas Area in Card */
.wheel-col-canvas-wrap {
    position: relative;
    width: 100%;
    max-width: 320px;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.5rem 0 1rem;
}

.wheel-col-canvas-wrap canvas {
    width: 100% !important;
    height: 100% !important;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.wheel-col-pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 30px;
    background: #ffffff;
    clip-path: polygon(50% 100%, 0 0, 100% 0);
    z-index: 5;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.btn-spin-single {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: #ffffff;
    color: #0b0f17;
    border: 4px solid var(--bg-card);
    font-weight: 800;
    font-size: 0.75rem;
    cursor: pointer;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.btn-spin-single:hover:not(:disabled) {
    transform: translate(-50%, -50%) scale(1.08);
    background: #f8fafc;
}

.wheel-col-winner-preview {
    width: 100%;
    min-height: 48px;
    background: var(--bg-surface);
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.2s ease;
}

.wheel-col-winner-preview.has-winner {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid var(--border-accent);
}

.winner-preview-label {
    font-size: 0.675rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.04em;
}

.winner-preview-val {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Master Action Center */
.multi-master-actions {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-glow);
    text-align: center;
}

.btn-spin-all-master {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 800;
    padding: 1rem 3rem;
    border-radius: var(--radius-pill);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 25px rgba(99, 102, 241, 0.45);
    transition: all 0.2s ease;
    letter-spacing: 0.02em;
    min-height: 56px;
}

.btn-spin-all-master:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 30px rgba(99, 102, 241, 0.6);
}

.btn-spin-all-master:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.cascade-hint-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.785rem;
    color: var(--text-secondary);
    background: var(--bg-surface);
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-subtle);
}

.cascade-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
}

.master-sub-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Unified Combo Story Card */
.combo-story-card {
    background: linear-gradient(145deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.06) 100%);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-xl);
    padding: 1.5rem 1.75rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.combo-story-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.combo-story-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--primary);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
}

.combo-story-text {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.4;
    color: var(--text-primary);
}

.combo-story-text .highlight-who {
    color: #60a5fa;
    text-decoration: underline;
    text-decoration-color: rgba(96, 165, 250, 0.5);
}

.combo-story-text .highlight-action {
    color: #fbbf24;
    text-decoration: underline;
    text-decoration-color: rgba(251, 191, 36, 0.5);
}

.combo-story-text .highlight-consequence {
    color: #f87171;
    text-decoration: underline;
    text-decoration-color: rgba(248, 113, 113, 0.5);
}

.combo-story-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

/* Multi-Wheel Configuration Accordion / Tabs */
.multi-config-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    width: 100%;
}

.config-tabs-nav {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
    overflow-x: auto;
}

.config-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.config-tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.config-tab-btn.active {
    background: var(--bg-surface);
    color: var(--primary);
    border: 1px solid var(--border-accent);
}

.config-panel {
    display: none;
}

.config-panel.active {
    display: block;
}

.config-textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    padding: 0.85rem;
    resize: vertical;
    min-height: 130px;
    line-height: 1.5;
    outline: none;
    box-sizing: border-box;
}

.config-textarea:focus {
    border-color: var(--border-focus);
}

/* Responsive Breakpoints */
@media (max-width: 992px) {
    .multi-wheel-stage-grid.mode-3 {
        grid-template-columns: 1fr;
    }
    .multi-wheel-stage-grid.mode-2 {
        grid-template-columns: 1fr;
    }
    .wheel-card-column {
        padding: 1rem;
    }
    .wheel-col-canvas-wrap {
        max-width: 260px;
    }
}

@media (max-width: 768px) {
    .btn-spin-all-master {
        font-size: 1.05rem;
        padding: 0.85rem 2rem;
        width: 100%;
    }
    .combo-story-text {
        font-size: 1.15rem;
    }
    .multi-wheel-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .multi-mode-selector {
        justify-content: center;
    }
}

/* Tool Sub-Buttons */
.tool-sub-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    min-height: 38px;
    box-sizing: border-box;
}

.tool-sub-btn:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover, rgba(255, 255, 255, 0.08));
    border-color: var(--border-accent);
}

.tool-sub-btn.secondary {
    background: transparent;
    border-color: var(--border-subtle);
}

.tool-sub-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .master-sub-actions,
    .combo-story-actions {
        flex-wrap: wrap;
        width: 100%;
        gap: 0.5rem;
    }
    .tool-sub-btn {
        min-height: 44px;
        padding: 0.55rem 0.95rem;
        font-size: 0.85rem;
    }
}
