/* sorteo.css - Estilos visuales del Sorteador en Vivo • El Fogón de Amílcar */
:root {
    --bg-dark: #0b0907;
    --bg-card: #15100c;
    --bg-card-hover: #1e1711;
    --border: rgba(212, 175, 55, 0.22);
    --border-glow: rgba(234, 88, 12, 0.4);
    --gold: #d4af37;
    --gold-light: #fef08a;
    --gold-dark: #a17f1a;
    --fire: #ea580c;
    --fire-light: #fb923c;
    --fire-glow: #f97316;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --text-gold: #fde047;
    --green: #22c55e;
    --red: #ef4444;
    --radius: 14px;
    --font-title: 'Playfair Display', Georgia, serif;
    --font-ui: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

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

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(234, 88, 12, 0.15) 0%, transparent 60%),
        radial-gradient(circle at 20% 90%, rgba(212, 175, 55, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(180, 83, 9, 0.1) 0%, transparent 50%);
    color: var(--text);
    font-family: var(--font-ui);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Brasas flotantes de fondo */
.ember-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.65;
}

/* Encabezado Superior */
.fogon-header {
    position: relative;
    z-index: 10;
    background: rgba(15, 11, 8, 0.88);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.brand-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    height: 52px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(234, 88, 12, 0.4));
}

.brand-title-wrap {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-family: var(--font-title);
    font-size: 1.35rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.brand-title span {
    color: var(--gold);
}

.brand-sub {
    font-size: 0.72rem;
    color: var(--fire-light);
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* Indicadores de Estado */
.stats-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
}

.stat-pill i {
    color: var(--gold);
}

.stat-pill strong {
    font-size: 1.05rem;
    font-family: var(--font-mono);
    color: #fff;
}

.badge-live-status {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.badge-live-status.offline {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.badge-live-status.live {
    background: rgba(234, 88, 12, 0.25);
    color: #fb923c;
    border: 1px solid var(--fire);
    box-shadow: 0 0 12px rgba(234, 88, 12, 0.4);
    animation: pulseGlow 2s infinite;
}

.badge-live-status.sim {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
    border: 1px solid #a855f7;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-hdr {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 8px 13px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-hdr:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--gold);
    color: var(--gold-light);
    transform: translateY(-1px);
}

/* Barra de Configuración de la Transmisión */
.setup-bar {
    position: relative;
    z-index: 10;
    background: rgba(20, 15, 11, 0.95);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.setup-inputs {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 320px;
}

.input-box {
    position: relative;
    display: flex;
    align-items: center;
}

.input-box i {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.input-box input {
    background: #0d0906;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    padding: 9px 12px 9px 36px;
    color: #fff;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}

.input-box input:focus {
    border-color: var(--fire);
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.25);
}

.input-url {
    flex: 2;
    min-width: 220px;
}

.input-kw {
    width: 140px;
}

.quick-tags {
    display: flex;
    gap: 6px;
}

.btn-tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
    padding: 4px 9px;
    border-radius: 6px;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-tag:hover, .btn-tag.active {
    background: rgba(234, 88, 12, 0.25);
    border-color: var(--fire);
    color: #fff;
}

/* Botones de Control de la Ronda */
.round-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-round {
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 800;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-start-reg {
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #fff;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.35);
}

.btn-start-reg:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(22, 163, 74, 0.5);
}

.btn-close-reg {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
}

.btn-close-reg:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.5);
}

.timer-badge {
    background: rgba(234, 88, 12, 0.2);
    border: 1px solid var(--fire);
    color: var(--gold-light);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 800;
    padding: 7px 14px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Espacio Principal */
.fogon-main {
    position: relative;
    z-index: 1;
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 390px;
    gap: 20px;
    padding: 20px 24px;
}

@media (max-width: 1024px) {
    .fogon-main {
        grid-template-columns: 1fr;
    }
}

/* Área de la Ruleta */
.wheel-stage-container {
    background: radial-gradient(circle at 50% 50%, #1e150f 0%, #100c08 80%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), inset 0 0 60px rgba(234, 88, 12, 0.08);
    overflow: hidden;
}

.prize-callout {
    text-align: center;
    margin-bottom: 18px;
}

.prize-badge {
    display: inline-block;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid var(--gold);
    color: var(--gold);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 6px;
}

.prize-name-live {
    font-family: var(--font-title);
    font-size: 1.6rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.prize-chances-count {
    color: var(--fire-light);
    font-weight: 700;
    font-size: 0.95rem;
    margin-top: 2px;
}

/* Envoltorio del Canvas de la Ruleta */
.wheel-canvas-wrap {
    position: relative;
    width: 480px;
    height: 480px;
    max-width: 90vw;
    max-height: 90vw;
    margin: 10px auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#wheelCanvas {
    width: 100%;
    height: 100%;
    display: block;
    filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.8));
    border-radius: 50%;
}

/* Puntero Dorado Criollo */
.wheel-pointer {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 46px;
    z-index: 10;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.9));
    pointer-events: none;
    transition: transform 0.08s ease;
}

.wheel-pointer.kick {
    transform: translateX(-50%) rotate(-12deg) scale(1.1);
}

/* Botón Gigante de Giro */
.wheel-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: 100%;
    max-width: 420px;
}

.btn-spin-huge {
    width: 100%;
    padding: 16px 28px;
    background: linear-gradient(135deg, #ea580c 0%, #d4af37 50%, #b45309 100%);
    background-size: 200% 200%;
    color: #000;
    border: none;
    border-radius: 14px;
    font-size: 1.25rem;
    font-weight: 900;
    font-family: var(--font-title);
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(234, 88, 12, 0.4), 0 0 20px rgba(212, 175, 55, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.2s;
    animation: gradientGlow 4s infinite alternate;
}

.btn-spin-huge:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 15px 40px rgba(234, 88, 12, 0.6), 0 0 30px rgba(212, 175, 55, 0.5);
}

.btn-spin-huge:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.wheel-sub-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.mode-selector {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 2px;
}

.mode-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    cursor: pointer;
}

.mode-btn.active {
    background: rgba(212, 175, 55, 0.25);
    color: var(--gold-light);
    font-weight: 700;
}

/* Columna Lateral del Chat en Vivo */
.chat-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 170px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.chat-header {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-title {
    font-size: 0.88rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
}

.chat-title i {
    color: #ef4444;
}

.chat-filter-input {
    background: #0a0705;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.76rem;
    color: #fff;
    width: 130px;
}

.chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 9px 12px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    transition: background 0.15s;
}

.chat-item.qualified {
    border-left: 3px solid var(--gold);
    background: rgba(212, 175, 55, 0.06);
}

.chat-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    background: #2a2018;
    flex-shrink: 0;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.chat-body {
    flex: 1;
    min-width: 0;
}

.chat-author-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3px;
}

.chat-author {
    font-weight: 700;
    font-size: 0.8rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-badges {
    display: flex;
    gap: 4px;
}

.chat-badge-tag {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

.badge-tag-qual {
    background: rgba(212, 175, 55, 0.2);
    color: var(--gold-light);
}

.badge-tag-mod {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

.chat-text {
    font-size: 0.8rem;
    color: #cbd5e1;
    line-height: 1.35;
    word-break: break-word;
}

/* Modal de Ganador Espectacular */
.winner-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 3, 2, 0.88);
    backdrop-filter: blur(12px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.winner-modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.winner-card {
    background: radial-gradient(circle at 50% 30%, #2a1b12 0%, #120d09 90%);
    border: 2px solid var(--gold);
    box-shadow: 0 0 60px rgba(234, 88, 12, 0.5), 0 25px 50px rgba(0, 0, 0, 0.9);
    border-radius: 24px;
    width: 100%;
    max-width: 580px;
    padding: 36px 30px;
    text-align: center;
    position: relative;
    animation: scalePop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.winner-crown {
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.8rem;
    filter: drop-shadow(0 4px 12px rgba(234, 88, 12, 0.8));
    animation: bounceCrown 1.5s infinite alternate;
}

.winner-avatar-wrap {
    width: 110px;
    height: 110px;
    margin: 10px auto 16px;
    position: relative;
}

.winner-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--gold);
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.6);
}

.winner-badge-title {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 800;
    color: var(--fire-light);
    margin-bottom: 4px;
}

.winner-name {
    font-family: var(--font-title);
    font-size: 2rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.winner-quote {
    background: rgba(0, 0, 0, 0.4);
    border: 1px dashed rgba(212, 175, 55, 0.35);
    border-radius: 12px;
    padding: 12px 16px;
    font-style: italic;
    font-size: 0.95rem;
    color: var(--gold-light);
    margin-bottom: 20px;
    line-height: 1.4;
}

.winner-prize-awarded {
    background: linear-gradient(135deg, rgba(234, 88, 12, 0.2), rgba(212, 175, 55, 0.15));
    border: 1px solid var(--gold);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 22px;
}

.winner-prize-awarded strong {
    color: #fff;
    font-size: 1.15rem;
    display: block;
}

/* Acciones del Ganador */
.winner-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-assign-tickets {
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #fff;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 8px 20px rgba(22, 163, 74, 0.4);
    transition: all 0.2s;
}

.btn-assign-tickets:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(22, 163, 74, 0.6);
}

.tickets-result-box {
    background: rgba(22, 163, 74, 0.15);
    border: 1px solid #22c55e;
    color: #86efac;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.88rem;
    margin-top: 6px;
    display: none;
}

.secondary-actions {
    display: flex;
    gap: 10px;
}

.btn-sec {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 10px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-sec:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
}

.btn-sec.respin {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-sec.respin:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
}

/* Modo OBS Studio Overlay */
body.obs-mode {
    background: transparent !important;
    overflow: hidden;
}

body.obs-mode .ember-canvas,
body.obs-mode .fogon-header,
body.obs-mode .setup-bar,
body.obs-mode .chat-panel,
body.obs-mode .wheel-actions,
body.obs-mode .wheel-sub-controls {
    display: none !important;
}

body.obs-mode .fogon-main {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

body.obs-mode .wheel-stage-container {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

/* Animaciones */
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 8px rgba(234, 88, 12, 0.3); }
    50% { box-shadow: 0 0 20px rgba(234, 88, 12, 0.7); }
}

@keyframes gradientGlow {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scalePop {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes bounceCrown {
    0% { transform: translateX(-50%) translateY(0); }
    100% { transform: translateX(-50%) translateY(-6px); }
}
