/* ═══════════════════════════════════════════
   RANDOM PICKER — Specific styles only
   Shared components (qt-*) come from tools-shared.css
   ═══════════════════════════════════════════ */

/* ─── Presets bar (Quick Start) ─── */
.picker-presets {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border);
    animation: pickerFadeIn 0.3s ease;
}

.picker-presets__label {
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
}

.picker-presets__btn {
    font-size: var(--font-size-sm) !important;
    padding: 6px 14px !important;
    border-radius: var(--radius-full) !important;
    transition: transform var(--transition-fast), background var(--transition-fast);
}

.picker-presets__btn:hover {
    transform: scale(1.05);
    background: var(--accent-bg);
}

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

@media (max-width: 640px) {
    .picker-presets { justify-content: center; }
}

/* ─── Input hint ─── */
.picker-hint {
    display: block;
    margin-top: var(--space-1);
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    font-style: italic;
}

/* ─── Eliminated chip badge (✗) ─── */
.qt-chip__badge {
    font-size: 12px;
    color: var(--error);
    font-weight: 700;
}

/* ─── Pulse on Draw button when ready ─── */
.picker-pulse:not(:disabled) {
    animation: pickerPulse 2s ease infinite;
}

.picker-pulse:disabled {
    animation: none;
}

@keyframes pickerPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.3); }
    50%      { box-shadow: 0 0 0 8px rgba(139, 92, 246, 0); }
}

/* ─── Animation zone — Premium Slot Machine ─── */
.picker-anim {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-8) 0;
    gap: var(--space-4);
}

.picker-anim__label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.picker-anim--active .picker-anim__label {
    opacity: 1;
    animation: pickerLabelPulse 1s ease infinite;
}

.picker-anim--reveal .picker-anim__label {
    opacity: 1;
    animation: none;
    color: #F59E0B;
}

/* ─── The slot card ─── */
.picker-anim__card {
    position: relative;
    width: 100%;
    max-width: 400px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xl);
    padding: 3px; /* border width for gradient */
    background: var(--border);
    transition: background 0.3s ease;
}

/* Animated gradient border during spin */
.picker-anim--active .picker-anim__card {
    background: conic-gradient(
        from var(--picker-border-angle, 0deg),
        #8B5CF6, #06B6D4, #F59E0B, #EC4899, #8B5CF6
    );
    animation: pickerBorderSpin 2s linear infinite;
}

/* Gold border on reveal */
.picker-anim--reveal .picker-anim__card {
    background: linear-gradient(135deg, #F59E0B, #FBBF24, #F59E0B);
    animation: none;
}

@property --picker-border-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes pickerBorderSpin {
    to { --picker-border-angle: 360deg; }
}

/* Inner card surface */
.picker-anim__inner {
    width: 100%;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6) var(--space-5);
    background: var(--bg-primary);
    border-radius: calc(var(--radius-xl) - 3px);
    position: relative;
    overflow: hidden;
}

/* Glow behind text during spin */
.picker-anim--active .picker-anim__inner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

/* Glow burst on reveal */
.picker-anim--reveal .picker-anim__inner::after {
    content: '';
    position: absolute;
    inset: -50%;
    background: radial-gradient(circle at center, rgba(245, 158, 11, 0.15) 0%, transparent 50%);
    pointer-events: none;
    animation: pickerGlowBurst 0.8s ease-out forwards;
}

/* Scan line during spin */
.picker-anim--active .picker-anim__inner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    animation: pickerScanLine 0.8s ease infinite;
    z-index: 2;
}

/* ─── The name text ─── */
.picker-anim__slot {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 800;
    color: var(--text-primary);
    text-align: center;
    word-break: break-word;
    line-height: 1.2;
    position: relative;
    z-index: 1;
}

/* Spinning state — vertical slide illusion */
.picker-anim__slot--spinning {
    opacity: 0.4;
    filter: blur(2px);
    transform: translateY(2px);
    transition: none;
}

/* Reveal state — dramatic entrance */
.picker-anim__slot--reveal {
    opacity: 1;
    filter: blur(0);
    color: var(--accent);
    transform: translateY(0);
    animation: pickerNameReveal 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.picker-anim--reveal .picker-anim__slot--reveal {
    color: #F59E0B;
    text-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

/* ─── Sparkles around the card on reveal ─── */
.picker-sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #F59E0B;
    pointer-events: none;
    animation: pickerSparkleFly 0.8s ease-out forwards;
}

/* ─── Keyframes ─── */
@keyframes pickerLabelPulse {
    0%, 100% { opacity: 0.6; }
    50%      { opacity: 1; }
}

@keyframes pickerScanLine {
    0%   { top: 0; opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

@keyframes pickerGlowBurst {
    0%   { opacity: 0; transform: scale(0.5); }
    50%  { opacity: 1; }
    100% { opacity: 0; transform: scale(1.5); }
}

@keyframes pickerNameReveal {
    0%   { transform: scale(2) translateY(10px); opacity: 0; filter: blur(8px); }
    50%  { transform: scale(0.95) translateY(-2px); filter: blur(0); }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes pickerSparkleFly {
    0%   { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--sx), var(--sy)) scale(0); opacity: 0; }
}

/* ─── Fallback for browsers without @property ─── */
@supports not (background: conic-gradient(from 0deg, red, blue)) {
    .picker-anim--active .picker-anim__card {
        background: var(--accent);
        animation: pickerBorderPulse 1s ease infinite;
    }
}

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

/* ─── Mobile adjustments ─── */
@media (max-width: 480px) {
    .picker-anim__card { max-width: 100%; }
    .picker-anim__inner { min-height: 100px; padding: var(--space-5) var(--space-4); }
}

/* ─── History (elimination mode) ─── */
.picker-history {
    margin-top: var(--space-6);
    padding: var(--space-4);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.picker-history h3 {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-3);
}

.picker-history ol {
    padding-left: var(--space-5);
    margin: 0;
}

.picker-history li {
    padding: var(--space-1) 0;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
}

.picker-history li:last-child {
    border-bottom: none;
}
