/**
 * Sorteador Profissional - Estilos
 * Design: Escuro e Elegante (inspirado no apresentador-de-slides)
 * Layout: Área central + Painel lateral (como apresentador-de-slides)
 */

/* ============================================
   VARIÁVEIS E CUSTOM PROPERTIES
   ============================================ */
:root {
    /* Cores Primárias */
    --color-bg-dark: #0a0a1a;
    --color-bg-panel: rgba(30, 30, 30, 0.98);
    --color-accent: #00ff88;
    --color-accent-secondary: #00d4ff;
    --color-accent-gold: #ffd700;
    --color-danger: #ff4757;
    --color-warning: #ffa502;

    /* Gradientes */
    --gradient-accent: linear-gradient(135deg, #00ff88 0%, #00d4ff 100%);
    --gradient-gold: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    --gradient-dark: linear-gradient(180deg, #0a0a1a 0%, #1a1a2e 100%);

    /* Texto */
    --color-text-primary: #ffffff;
    --color-text-secondary: #a0a0b0;
    --color-text-muted: #6c6c7c;

    /* Bordas e Sombras */
    --border-subtle: 1px solid rgba(255, 255, 255, 0.1);
    --shadow-glow: 0 0 30px rgba(0, 255, 136, 0.3);
    --shadow-number: 0 0 80px rgba(0, 255, 136, 0.5), 0 0 150px rgba(0, 212, 255, 0.3);

    /* Tipografia */
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Transições */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ============================================
   RESET E BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================
   LAYOUT PRINCIPAL - ESTILO APRESENTADOR DE SLIDES
   ============================================ */

/* Centralização vertical do layout principal */
main.flex-grow {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 10px 0 !important;
    flex-grow: 1 !important;
    min-height: 0 !important;
}

/* Limitar altura do histórico para não causar overflow */
#history-list {
    max-height: 150px;
    overflow-y: auto;
}

/* Main app container - layout horizontal flex */
#app-container {
    display: flex;
    flex-direction: row;
    width: 100%;
    gap: 16px;
    padding: 16px;
    box-sizing: border-box;
    background: #1e1e2e;
    border-radius: 8px;
    flex: 0 0 auto !important;
    margin: 0 auto !important;
    min-height: 0;
    align-items: center;
}

/* Área de apresentação - 16:9 */
#presentation-area {
    flex: 1;
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    min-width: 0;
    aspect-ratio: 16 / 9;
    max-height: calc(100vh - 180px);
    align-self: center;
    /* Centraliza verticalmente no container */
    border: 3px solid #3a3a4a;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Camada de fundo */
#background-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-dark);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    z-index: 1;
}

/* Efeito de grid futurista no fundo */
#background-layer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 255, 136, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 136, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 2;
    pointer-events: none;
}

/* Camada de conteúdo - container para elementos arrastáveis */
#content-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    /* Removido flexbox para permitir posicionamento absoluto independente */
    padding: 20px;
}

/* ============================================
   PAINEL DE CONTROLE (SIDEBAR) - ESTILO APRESENTADOR
   ============================================ */
.side-menu {
    width: 320px;
    min-width: 320px;
    max-width: 320px;
    height: auto;
    max-height: calc(100vh - 250px);
    overflow-y: auto;
    position: relative !important;
    background: var(--color-bg-panel);
    border-radius: 8px;
    padding: 16px;
    flex-shrink: 0;
    border: 1px solid #374151;
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: var(--border-subtle);
}

.menu-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-accent);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Layout lado a lado para campos do painel */
.input-group-row {
    display: flex;
    gap: 10px;
    width: 100%;
}

.input-group.half {
    flex: 1;
    min-width: 0;
}

.input-group.half input[type="number"],
.input-group.half input[type="text"] {
    width: 100%;
    padding: 6px 8px;
    font-size: 0.9rem;
}

.input-group.half label {
    font-size: 0.8rem;
    margin-bottom: 3px;
}

/* Seção de Áudio - Layout Compacto Inline */
.audio-section-compact {
    padding: 8px 0 !important;
}

.audio-header-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.audio-header-row h4 {
    margin: 0;
    font-size: 0.95rem;
}

.audio-controls-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.audio-controls-inline .toggle-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: #9ca3af;
    cursor: pointer;
    white-space: nowrap;
}

.audio-controls-inline .toggle-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
}

.sound-select {
    flex: 1;
    min-width: 100px;
    padding: 4px 6px;
    font-size: 0.8rem;
    background: #1f2937;
    color: #e5e7eb;
    border: 1px solid #374151;
    border-radius: 4px;
    cursor: pointer;
}

/* ============================================
   ELEMENTOS ARRASTÁVEIS
   ============================================ */
.draggable-element {
    cursor: move;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    user-select: none;
}

.draggable-element:hover {
    transform: scale(1.02);
}

.draggable-element.dragging {
    opacity: 0.8;
    z-index: 1000;
}

.draggable-element.selected {
    outline: 2px dashed var(--color-accent);
    outline-offset: 5px;
}

/* ============================================
   ALÇAS DE REDIMENSIONAMENTO
   ============================================ */
.resize-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    background: white;
    border: 2px solid var(--color-accent);
    border-radius: 50%;
    z-index: 30;
    visibility: hidden;
    cursor: pointer;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.draggable-element:hover .resize-handle,
.draggable-element.selected .resize-handle {
    visibility: visible;
}

.resize-handle:hover {
    transform: scale(1.3);
    background-color: var(--color-accent);
}

/* Posições dos handles nos cantos */
.handle-se {
    bottom: -7px;
    right: -7px;
    cursor: nwse-resize;
}

.handle-sw {
    bottom: -7px;
    left: -7px;
    cursor: nesw-resize;
}

.handle-ne {
    top: -7px;
    right: -7px;
    cursor: nesw-resize;
}

.handle-nw {
    top: -7px;
    left: -7px;
    cursor: nwse-resize;
}

/* Logo do Evento */
#event-logo {
    position: absolute;
    top: 12%;
    left: 50%;
    transform: translateX(-50%);
    max-width: 150px;
}

#event-logo img {
    max-width: 100%;
    height: auto;
    max-height: 45px;
    /* Reduzido 25%: 60px -> 45px */
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
}

/* Título do Evento */
#event-title {
    position: absolute;
    top: 28%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

#title-text {
    font-family: var(--font-display);
    font-size: clamp(0.75rem, 2vw, 1.1rem);
    /* Reduzido 25% */
    font-weight: 700;
    color: var(--color-text-primary);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
    white-space: nowrap;
}

/* ============================================
   NÚMERO SORTEADO (PROTAGONISTA)
   ============================================ */
#number-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transform-origin: center center;
}

#number-container {
    position: relative;
    padding: 22px 45px;
    /* Reduzido 25%: 30px 60px -> 22px 45px */
    background: rgba(0, 0, 0, 0.6);
    border: 3px solid var(--color-accent);
    border-radius: 15px;
    box-shadow: var(--shadow-number);
    overflow: hidden;
    /* Centraliza o número sempre */
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: fit-content;
    box-sizing: border-box;
}

/* Efeito de brilho interno */
#number-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(0, 255, 136, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

#drawn-number {
    font-family: var(--font-display);
    font-size: 80px;
    /* Valor fixo para permitir resize proporcional */
    font-weight: 900;
    color: var(--color-text-primary);
    text-shadow:
        0 0 20px var(--color-accent),
        0 0 40px var(--color-accent),
        0 0 80px var(--color-accent-secondary);
    line-height: 1;
    letter-spacing: 0.05em;
    position: relative;
    z-index: 2;
    white-space: nowrap;
    /* Garante que o número não quebre */
}

/* Animação de pulso quando sorteado */
#drawn-number.pulse {
    animation: numberPulse 0.5s ease-out;
}

@keyframes numberPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* Animação de glow intenso */
#drawn-number.glow-intense {
    animation: glowIntense 1s ease-in-out;
}

@keyframes glowIntense {

    0%,
    100% {
        text-shadow:
            0 0 20px var(--color-accent),
            0 0 40px var(--color-accent),
            0 0 80px var(--color-accent-secondary);
    }

    50% {
        text-shadow:
            0 0 40px var(--color-accent),
            0 0 80px var(--color-accent),
            0 0 120px var(--color-accent-secondary),
            0 0 200px var(--color-accent);
    }
}

/* ============================================
   HISTÓRICO VISUAL
   ============================================ */
#history-display {
    position: absolute;
    top: 80%;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 600px;
}

#history-numbers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.history-number {
    font-family: var(--font-display);
    font-size: 0.75rem;
    /* Reduzido 25%: 1rem -> 0.75rem */
    font-weight: 600;
    color: var(--color-text-secondary);
    padding: 3px 8px;
    /* Reduzido 25% */
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.history-number:last-child {
    color: var(--color-accent, #00ff88);
    background: var(--color-accent-bg, rgba(0, 255, 136, 0.2));
    border: 1px solid var(--color-accent, #00ff88);
}

/* Placeholder transparente antes do primeiro sorteio */
.history-number.placeholder {
    opacity: 0.3;
    color: var(--color-text-secondary);
    background: rgba(255, 255, 255, 0.05);
}

/* ============================================
   SEÇÕES DO MENU
   ============================================ */
.menu-section {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: var(--border-subtle);
}

.menu-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.menu-section h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-section h4 i {
    color: var(--color-accent);
    font-size: 0.85rem;
}

/* Seção do botão de sortear */
.draw-section {
    padding: 0;
    margin-bottom: 15px;
}

/* ============================================
   BOTÃO DE SORTEAR (NO PAINEL)
   ============================================ */
.draw-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 16px 24px;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;

    color: #0a0a1a;
    background: var(--gradient-accent);
    border: none;
    border-radius: 10px;
    cursor: pointer;

    box-shadow: 0 8px 30px rgba(0, 255, 136, 0.4);
    transition: all var(--transition-medium);
}

.draw-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 255, 136, 0.5);
}

.draw-button:active {
    transform: translateY(0);
}

.draw-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.draw-button i {
    font-size: 1.4rem;
}

/* ============================================
   INPUTS
   ============================================ */
.input-group {
    margin-bottom: 8px;
}

.input-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    margin-bottom: 5px;
}

.input-group input[type="text"],
.input-group input[type="number"],
.input-group select {
    width: 100%;
    padding: 6px 8px;
    font-size: 0.85rem;
    color: var(--color-text-primary);
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    transition: all var(--transition-fast);
}

/* Opções dos selects também com fundo escuro */
.input-group select option {
    background: #1a1a2e;
    color: #e5e7eb;
    padding: 8px;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(0, 255, 136, 0.1);
}

.input-group input[type="color"] {
    width: 100%;
    height: 32px;
    padding: 2px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.input-group input[type="file"] {
    width: 100%;
    padding: 6px;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
}

.input-group input[type="file"]:hover {
    border-color: var(--color-accent);
}

/* Controles de Logo */
.logo-input-group .logo-controls {
    display: flex;
    gap: 6px;
    align-items: center;
}

.logo-controls input[type="file"] {
    flex: 1;
    min-width: 0;
}

.btn-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
    padding: 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.8rem;
}

.btn-danger-icon {
    background: var(--color-danger);
    color: white;
}

.btn-danger-icon:hover {
    background: #e63946;
    transform: scale(1.1);
}

.btn-success-icon {
    background: #28a745;
    color: white;
}

.btn-success-icon:hover {
    background: #218838;
    transform: scale(1.1);
}

/* Logos extras na área de apresentação */
.extra-logo {
    position: absolute;
    max-width: 120px;
    z-index: 15;
}

.extra-logo img {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
}

/* Controles do campo de título */
.title-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.title-controls input[type="text"] {
    flex: 1;
    min-width: 0;
}

/* Container de inputs de textos extras */
.extra-inputs-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
}

.extra-text-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.extra-text-input-row input[type="text"] {
    flex: 1;
    min-width: 0;
    padding: 6px 10px;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: var(--color-text-primary);
}

.extra-text-input-row input[type="text"]:focus {
    border-color: var(--color-accent);
    outline: none;
}

/* Textos extras na área de apresentação */
.extra-text {
    position: absolute;
    z-index: 15;
    font-family: var(--font-display);
    font-size: 24px;
    color: var(--color-text-primary);
    text-shadow: 0 0 10px var(--color-accent);
    white-space: nowrap;
    cursor: move;
    padding: 8px 12px;
    /* Visual limpo, sem borda */
    background: transparent;
    border: none;
    /* Dimensões mínimas para resize */
    min-width: 50px;
    min-height: 30px;
}

.extra-text:hover {
    /* Sutil indicador de seleção */
    text-shadow: 0 0 20px var(--color-accent), 0 0 40px var(--color-accent);
}

/* Seções Colapsáveis */
.collapsible-section {
    margin-bottom: 10px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.collapsible-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--color-text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.collapsible-header:hover {
    background: rgba(255, 255, 255, 0.08);
}

.collapsible-header span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.collapsible-header span i {
    color: var(--color-accent);
    font-size: 0.9rem;
}

.collapsible-header .chevron-icon {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
    color: var(--color-text-secondary);
}

.collapsible-header.active .chevron-icon {
    transform: rotate(180deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 12px;
}

.collapsible-content.open {
    max-height: 450px;
    padding: 12px;
}

/* Seletor de Fonte */
.font-selector-group {
    margin-top: 10px;
}

.font-select {
    width: 100%;
    padding: 8px 10px;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: var(--color-text-primary);
    cursor: pointer;
}

.font-select option {
    background: #1a1a2e;
    color: white;
    padding: 8px;
}

.audio-controls-compact {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.audio-controls-compact .toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.audio-controls-compact .sound-select {
    width: 100%;
}

/* Range com valor */
.range-with-value {
    display: flex;
    align-items: center;
    gap: 10px;
}

.range-with-value input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
}

.range-with-value input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--color-accent);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
}

/* ============================================
   ANIMAÇÕES DE SORTEIO
   ============================================ */

/* Animação Jackpot - spin com blur */
#drawn-number.jackpot-spin {
    animation: jackpotSpin 0.1s ease-in-out infinite;
    filter: blur(1px);
}

@keyframes jackpotSpin {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-2px);
    }
}

/* Animação Count - pulse suave */
#drawn-number.counting {
    animation: countPulse 0.1s ease-in-out infinite;
}

@keyframes countPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

#duration-value {
    font-size: 0.8rem;
    color: var(--color-accent);
    font-weight: 600;
    min-width: 25px;
}

/* Input group row */
.input-group-row {
    display: flex;
    gap: 10px;
}

.input-group.half {
    flex: 1;
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--color-accent);
    cursor: pointer;
}

.checkbox-group label {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    cursor: pointer;
}

/* Histórico no Painel */
.history-list {
    max-height: 120px;
    overflow-y: auto;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    margin-bottom: 10px;
}

.history-empty {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-align: center;
    padding: 8px;
    margin: 0;
}

.history-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 8px;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.history-item:last-child {
    border-bottom: none;
}

.history-item .number {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--color-accent);
}

.history-item .time {
    color: var(--color-text-muted);
    font-size: 0.75rem;
}

/* ============================================
   BOTÕES
   ============================================ */
.btn-primary,
.btn-secondary,
.btn-success,
.btn-warning,
.btn-danger,
.btn-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-sm {
    padding: 6px 10px;
    font-size: 0.75rem;
}

.btn-full {
    width: 100%;
}

.btn-primary {
    background: var(--color-accent);
    color: #0a0a1a;
}

.btn-primary:hover {
    background: #00e07a;
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-warning {
    background: var(--color-warning);
    color: #0a0a1a;
}

.btn-warning:hover {
    background: #e09400;
}

.btn-danger {
    background: var(--color-danger);
    color: white;
}

.btn-danger:hover {
    background: #e63946;
}

.btn-info {
    background: var(--color-accent-secondary);
    color: #0a0a1a;
}

.btn-info:hover {
    background: #00bfe0;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.button-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mt-10 {
    margin-top: 10px;
}

.actions-section {
    padding-top: 15px;
}

/* ============================================
   CONTROLES FULLSCREEN
   ============================================ */
.fullscreen-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    gap: 12px;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 40px;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-medium);
}

.fullscreen-controls.show {
    opacity: 1;
    visibility: visible;
}

.fullscreen-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.fullscreen-btn.btn-draw-fs {
    background: var(--gradient-accent);
    color: #0a0a1a;
    border: none;
}

.fullscreen-btn.btn-draw-fs:hover {
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.4);
}

/* ============================================
   ESTADOS FULLSCREEN
   ============================================ */

/* Quando presentation-area está em fullscreen */
#presentation-area:fullscreen,
#presentation-area:-webkit-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    aspect-ratio: auto !important;
    border: none !important;
    border-radius: 0 !important;
    background: #000 !important;
}

#presentation-area:fullscreen #background-layer,
#presentation-area:-webkit-full-screen #background-layer {
    width: 100%;
    height: 100%;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
}

/* REMOVIDO: Regras de escala manual em fullscreen
   Agora usamos transform:scale() no content-layer que escala tudo automaticamente */
/*
#presentation-area:fullscreen #content-layer,
#presentation-area:-webkit-full-screen #content-layer {
    width: 100%;
    height: 100%;
}
*/

#presentation-area:fullscreen .fullscreen-controls,
#presentation-area:-webkit-full-screen .fullscreen-controls {
    opacity: 0;
}

#presentation-area:fullscreen:hover .fullscreen-controls,
#presentation-area:-webkit-full-screen:hover .fullscreen-controls {
    opacity: 1;
    visibility: visible;
}

/* REMOVIDO: Regras de escala manual de elementos em fullscreen
   O transform:scale() no content-layer cuida de tudo automaticamente
#presentation-area:fullscreen #event-logo img,
#presentation-area:-webkit-full-screen #event-logo img {
    max-height: 80px;
}

#presentation-area:fullscreen #title-text,
#presentation-area:-webkit-full-screen #title-text {
    font-size: clamp(1.2rem, 3vw, 2rem);
}

#presentation-area:fullscreen #drawn-number,
#presentation-area:-webkit-full-screen #drawn-number {
    font-size: clamp(5rem, 15vw, 12rem);
}

#presentation-area:fullscreen #number-container,
#presentation-area:-webkit-full-screen #number-container {
    padding: 40px 80px;
}

#presentation-area:fullscreen .history-number,
#presentation-area:-webkit-full-screen .history-number {
    font-size: 1.2rem;
    padding: 6px 14px;
}
*/

/* Fallback body.is-fullscreen class */
body.is-fullscreen header,
body.is-fullscreen aside,
body.is-fullscreen footer,
body.is-fullscreen .side-menu {
    display: none !important;
}

body.is-fullscreen #app-container {
    padding: 0;
    background: #000;
    border-radius: 0;
}

body.is-fullscreen #presentation-area {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    aspect-ratio: auto;
    border: none;
    border-radius: 0;
}

/* ============================================
   UTILITÁRIOS
   ============================================ */
.hidden {
    display: none !important;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */
@media (max-width: 1024px) {
    #app-container {
        flex-direction: column;
    }

    .side-menu {
        width: 100%;
        max-width: 100%;
        min-width: auto;
        max-height: none;
    }

    #presentation-area {
        width: 100%;
        max-height: 50vh;
    }
}

@media (max-width: 768px) {
    #drawn-number {
        font-size: clamp(3rem, 18vw, 6rem);
    }

    #number-container {
        padding: 20px 40px;
    }

    #title-text {
        font-size: 1rem;
        letter-spacing: 0.1em;
    }

    .draw-button {
        padding: 12px 20px;
        font-size: 1rem;
    }
}

/* ============================================
   ANIMAÇÕES DE ROLAGEM
   ============================================ */
@keyframes slotRoll {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-100%);
    }
}

.slot-rolling {
    animation: slotRoll 0.1s linear infinite;
}

/* Efeito de blur durante rolagem */
.rolling-blur {
    filter: blur(2px);
    transition: filter 0.1s ease;
}

.rolling-blur.clear {
    filter: blur(0);
}

/* ============================================
   MODO FLAT - Remove efeitos visuais
   ============================================ */

/* Container do número em modo flat */
#presentation-area.flat-mode #number-container {
    background: transparent;
    border-color: var(--flat-element-color, #ffffff);
    box-shadow: none;
}

/* Remove brilho interno do container */
#presentation-area.flat-mode #number-container::before {
    display: none;
}

/* Número sorteado em modo flat */
#presentation-area.flat-mode #drawn-number {
    text-shadow: none;
    color: var(--flat-element-color, #ffffff);
}

/* Título do evento em modo flat */
#presentation-area.flat-mode #title-text {
    text-shadow: none;
    color: var(--flat-element-color, #ffffff);
}

/* Histórico em modo flat */
#presentation-area.flat-mode #history-numbers {
    background: transparent;
    border-color: var(--flat-element-color, #ffffff);
    border-width: 1px;
    border-style: solid;
}

#presentation-area.flat-mode .history-number {
    background: transparent;
    color: var(--flat-element-color, #ffffff);
    border: 1px solid var(--flat-element-color, #ffffff);
}

#presentation-area.flat-mode .history-number:last-child {
    background: var(--flat-element-color, #ffffff);
    color: var(--color-bg-dark, #0a0a1a);
}

/* Remove grid futurista do fundo no modo flat */
#presentation-area.flat-mode #background-layer::before {
    display: none;
}

/* ============================================
   CONTROLES DE TEMA NO PAINEL
   ============================================ */

/* Grupo de tema inline */
.theme-controls-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.theme-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-row .input-group {
    flex: 1;
    margin-bottom: 0;
}

.theme-row .checkbox-group {
    margin-bottom: 0;
    white-space: nowrap;
}

/* Cor picker menor para ficar na mesma linha */
.theme-row input[type="color"] {
    width: 40px;
    height: 32px;
    padding: 2px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Grupo de cor flat (oculto por padrão) */
.flat-color-group {
    display: none;
    animation: fadeIn 0.3s ease;
}

.flat-color-group.show {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ============================================
   LAYOUT COMPACTO - COR FUNDO + IMAGEM FUNDO
   ============================================ */

/* Primeira linha: Cor Fundo + Imagem Fundo */
.bg-controls-row {
    display: flex;
    gap: 12px;
    align-items: stretch;
    margin-bottom: 12px;
}

/* Grupo de Cor de Fundo */
.bg-controls-row .input-group.compact {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.bg-controls-row .input-group.compact label {
    font-size: 0.75rem;
    white-space: nowrap;
    margin-bottom: 4px;
    color: var(--color-text-secondary);
}

.bg-controls-row .input-group.compact input[type="color"] {
    width: 60px;
    height: 28px;
    padding: 2px;
    border-radius: 4px;
    cursor: pointer;
}

/* Grupo de Imagem Fundo */
.bg-image-group {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.bg-image-group>label {
    font-size: 0.75rem;
    white-space: nowrap;
    margin-bottom: 4px;
    color: var(--color-text-secondary);
}

.bg-image-controls {
    display: flex;
    gap: 6px;
    align-items: center;
}

.btn-load-image {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    font-size: 0.75rem;
    background: rgba(0, 255, 136, 0.15);
    color: var(--color-accent);
    border: 1px solid var(--color-accent);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    height: 28px;
}

.btn-load-image:hover {
    background: rgba(0, 255, 136, 0.3);
}

.btn-load-image i {
    font-size: 0.7rem;
}

.bg-image-controls .btn-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
    font-size: 0.75rem;
}

/* Estilos para tema-controls-group: Cor Tema + Modo Flat na mesma linha */
.theme-controls-group {
    margin-top: 4px;
}

.theme-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 10px;
}

.theme-row .input-group {
    flex: 0 0 auto;
    margin-bottom: 0;
}

.theme-row .input-group label {
    font-size: 0.75rem;
    margin-bottom: 4px;
}

.theme-row .input-group input[type="color"] {
    width: 60px;
    height: 28px;
    padding: 2px;
    border-radius: 4px;
    cursor: pointer;
}

.theme-row .checkbox-group {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 4px;
}

.theme-row .checkbox-group label {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

/* ============================================
   WRAPPER VERTICAL: PRESENTATION + ATALHOS
   ============================================ */
.presentation-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    align-items: stretch;
}

.presentation-wrapper #presentation-area {
    flex: 0 0 auto;
    width: 100%;
}

/* ============================================
   TEXTO DE ATALHOS DE TECLADO
   ============================================ */
.keyboard-shortcuts-hint {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.keyboard-shortcuts-hint:hover {
    opacity: 1;
}

.keyboard-shortcuts-hint span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.keyboard-shortcuts-hint .separator {
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.6rem;
}

.keyboard-shortcuts-hint kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 2px 6px;
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ============================================
   RESPONSIVIDADE MOBILE
   ============================================ */

/* Tablets e telas menores (até 1024px) */
@media (max-width: 1024px) {
    #app-container {
        flex-direction: column;
        gap: 12px;
        padding: 12px;
    }

    .side-menu {
        width: 100%;
        max-width: 100%;
        min-width: auto;
        max-height: none;
        order: 2;
    }

    .presentation-wrapper {
        width: 100%;
        order: 1;
    }

    #presentation-area {
        max-height: 50vh;
    }
}

/* Smartphones (até 768px) */
@media (max-width: 768px) {
    #app-container {
        padding: 8px;
        gap: 10px;
        border-radius: 0;
    }

    .side-menu {
        padding: 12px;
        border-radius: 8px;
    }

    #presentation-area {
        max-height: 40vh;
        border-radius: 8px;
        border-width: 2px;
    }

    /* Ajusta elementos internos da área de apresentação */
    #content-layer {
        padding: 10px;
    }

    /* Logo menor em mobile */
    #event-logo img {
        max-height: 30px !important;
    }

    /* Título menor */
    #title-text {
        font-size: clamp(0.5rem, 3vw, 0.8rem) !important;
    }

    /* Número sorteado menor */
    #drawn-number {
        font-size: 40px !important;
    }

    #number-container {
        padding: 12px 24px !important;
        border-width: 2px;
    }

    /* Histórico visual mais compacto */
    #history-display {
        width: 95%;
    }

    #history-numbers {
        gap: 4px;
        padding: 6px;
    }

    .history-number {
        font-size: 0.6rem;
        padding: 2px 5px;
    }

    /* Botão de sortear */
    .draw-button {
        padding: 12px 16px;
        font-size: 1rem;
    }

    /* Inputs mais compactos */
    .input-group-row {
        flex-direction: column;
        gap: 8px;
    }

    .input-group.half {
        flex: none;
        width: 100%;
    }

    /* Esconde atalhos de teclado em mobile (não aplicáveis) */
    .keyboard-shortcuts-hint {
        display: none;
    }

    /* Seções do menu mais compactas */
    .menu-section {
        margin-bottom: 10px;
        padding-bottom: 8px;
    }

    .menu-section h4 {
        font-size: 0.85rem;
    }

    /* Histórico no painel */
    #history-list {
        max-height: 100px;
    }

    .history-item {
        padding: 6px 10px;
    }

    /* Botões de ação */
    .button-group {
        flex-direction: column;
        gap: 8px;
    }

    .button-group .btn-sm {
        width: 100%;
    }

    .button-group-vertical {
        gap: 8px;
    }
}

/* Smartphones pequenos (até 480px) */
@media (max-width: 480px) {
    #presentation-area {
        max-height: 35vh;
        aspect-ratio: 4 / 3;
    }

    /* Elementos ainda menores */
    #event-logo img {
        max-height: 25px !important;
    }

    #title-text {
        font-size: 0.5rem !important;
        letter-spacing: 0.1em;
    }

    #drawn-number {
        font-size: 32px !important;
    }

    #number-container {
        padding: 8px 16px !important;
    }

    /* Histórico visual mínimo */
    #history-display {
        top: 85%;
    }

    .history-number {
        font-size: 0.5rem;
        padding: 2px 4px;
    }

    /* Botão de sortear mais compacto */
    .draw-button {
        padding: 10px 12px;
        font-size: 0.9rem;
        gap: 8px;
    }

    .draw-button i {
        font-size: 1.1rem;
    }

    /* Seções colapsáveis */
    .collapsible-header {
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    .collapsible-content {
        padding: 8px;
    }

    /* Controles de áudio em coluna */
    .audio-controls-compact {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .sound-select {
        width: 100%;
    }
}