/* minimal cards */
.analysis-card,
.analysis-lastspin-row .last-spin-section .spin-display {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    min-height: 110px;
    height: 100%;
    box-shadow: none;
}
/* ═══════════════════════════════════════════════════════════════════════════════ */
/* 🎨 PALETA DE CORES DA BLAZE                                                     */
/* ═══════════════════════════════════════════════════════════════════════════════ */

:root {
    --bg-primary: #151b28;
    --bg-secondary: #212838;
    --bg-tertiary: #2a3548;
    --text-primary: #ffffff;
    --text-secondary: #8b92a8;
    --border-color: #2d3748;
    --red-primary: #ef4444;
    --font-primary: 'Inter', 'Segoe UI', 'Roboto', -apple-system, sans-serif;
}

/* ═══════════════════════════════════════════════════════════════════════════════ */
/* 🚫 OCULTAR TODAS AS SCROLLBARS (mantém funcionalidade)                          */
/* ═══════════════════════════════════════════════════════════════════════════════ */

/* Firefox */
* {
    scrollbar-width: none;
    font-family: var(--font-primary);
}

/* Chrome, Edge, Safari */
*::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

/* Modal customizado para aviso de chave API */
.ai-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ai-modal-overlay.show {
    opacity: 1;
}

.ai-modal {
    position: fixed;
    width: 420px;
    background: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transform: translateY(-20px) scale(0.95);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 100000;
}

.ai-modal.show {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.ai-modal-header {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    padding: 20px;
    text-align: center;
}

.ai-modal-icon {
    font-size: 48px;
    margin-bottom: 12px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.ai-modal-header h3 {
    margin: 0;
    color: white;
    font-size: 20px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.ai-modal-body {
    padding: 28px;
    color: var(--text-secondary);
}

.ai-modal-body p {
    margin: 0 0 20px 0;
    font-size: 15px;
    line-height: 1.6;
    text-align: center;
}

.ai-modal-steps {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
}

.ai-modal-step {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-primary);
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.step-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.ai-modal-question {
    margin-top: 24px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

.ai-modal-footer {
    display: flex;
    gap: 12px;
    padding: 0 28px 28px 28px;
}

.ai-modal-btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Segoe UI', sans-serif;
}

.ai-modal-btn-cancel {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.ai-modal-btn-cancel:hover {
    background: var(--bg-primary);
    border-color: var(--border-color);
    transform: translateY(-2px);
}

.ai-modal-btn-confirm {
    background: var(--red-primary);
    color: var(--text-primary);
    border: 1px solid var(--red-primary);
}

.ai-modal-btn-confirm:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

/* Descrição da Análise IA */
.pattern-ai-description {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 16px;
    margin: 12px 0;
}

.pattern-ai-description pre {
    white-space: pre-wrap;
    font-family: var(--font-primary);
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0;
}

.pattern-info .pattern-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin: 0 3px; vertical-align: middle; box-shadow: 0 0 0 2px rgba(255,255,255,0.15); }
.pattern-info .pattern-dot.red { background: #F44336; }
.pattern-info .pattern-dot.black { background: #21222D; }
.pattern-info .pattern-dot.white { background: #fff; box-shadow: 0 0 0 2px #F44336; }

.pattern-stats { display: flex; gap: 12px; align-items: center; margin-top: 8px; color: #8da2bb; font-size: 12px; }
.pattern-stats .win-loss { font-weight: 600; color: #cdd6e8; }
.pattern-stats .pattern-len { color: #8da2bb; opacity: 0.95; }
.pattern-agg { margin-top: 6px; color: #cdd6e8; font-size: 12px; font-weight: 600; }
.pattern-agg-row { margin-top: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.pattern-agg-row.simple .agg-text { font-weight: 700; color: #cdd6e8; }
.pattern-agg-row.simple .agg-text.strong { color: #e6f0ff; }
.pattern-agg-row.simple .agg-text.loss { color: #ff6b6b; }
.agg-pill { display:none; }
.agg-sep { color: #8da2bb; }
.pattern-meta { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.badge { display:inline-block; padding: 4px 10px; border-radius: 9999px; font-weight: 700; font-size: 12px; }
.badge-green { background: rgba(43, 108, 176, 0.15); color: #cdd6e8; border: 1px solid rgba(43, 108, 176, 0.35); }
.meta-muted { color: #8da2bb; font-size: 12px; }
/* Blaze Double Analyzer - Styles */
#blaze-double-analyzer {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 300px;
    height: 600px;
    min-width: 250px;
    min-height: 400px;
    max-width: 80vw;
    max-height: 90vh;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-primary);
    z-index: 10000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 0;
    overflow: hidden;
    resize: none;
    transition: background 0.4s ease, border-color 0.4s ease;
}

/* 💎 MODO NÍVEL DIAMANTE ATIVO - Fundo 15% mais claro */
#blaze-double-analyzer.diamond-mode-active {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

#blaze-double-analyzer.collapsed {
    transform: translateX(-280px);
}

/* Resize handles */
.resize-handles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1000;
}

.resize-handle {
    position: absolute;
    background: transparent;
    pointer-events: all;
    transition: background 0.2s ease;
}

.resize-handle:hover {
    background: rgba(0, 255, 136, 0.2);
}

.resize-handle:active {
    background: rgba(0, 255, 136, 0.3);
}

.resize-n {
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    cursor: n-resize;
}

.resize-s {
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    cursor: s-resize;
}

.resize-e {
    top: 0;
    right: 0;
    bottom: 0;
    width: 8px;
    cursor: e-resize;
}

.resize-w {
    top: 0;
    left: 0;
    bottom: 0;
    width: 8px;
    cursor: w-resize;
}

.resize-ne {
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    cursor: ne-resize;
}

.resize-nw {
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    cursor: nw-resize;
}

.resize-se {
    bottom: 0;
    right: 0;
    width: 8px;
    height: 8px;
    cursor: se-resize;
}

.resize-sw {
    bottom: 0;
    left: 0;
    width: 8px;
    height: 8px;
    cursor: sw-resize;
}

.analyzer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    cursor: grab;
    user-select: none;
    transition: background 0.4s ease, border-bottom 0.4s ease;
}

/* 💎 MODO NÍVEL DIAMANTE ATIVO - Header em VERMELHO BLAZE */
#blaze-double-analyzer.diamond-mode-active .analyzer-header {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    border-bottom: 1px solid rgba(239, 68, 68, 0.3);
}

.analyzer-header:active {
    cursor: grabbing;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 16px;
}

.header-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 28px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-menu-toggle span {
    display: block;
    height: 2px;
    background: #d4d9e6;
    border-radius: 999px;
    transition: background 0.2s ease;
}

.user-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

.user-menu-toggle:hover span,
.user-menu-toggle.active span {
    background: #ffffff;
}

.user-menu-toggle.active {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.28);
}

.user-menu-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    padding: 24px;
    box-sizing: border-box;
    z-index: 12000;
    pointer-events: none;
}

.user-menu-panel.open {
    transform: translateX(0);
    pointer-events: auto;
}

.user-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.user-menu-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-menu-close {
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-menu-close:hover {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
}

.user-menu-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

.user-info-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.user-info-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.user-info-value {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
    word-break: break-word;
}

.user-info-value.alert {
    color: #ff003f;
}

.user-menu-footer {
    padding-top: 16px;
}

.user-menu-logout {
    width: 100%;
    padding: 12px 18px;
    border-radius: 8px;
    border: 1px solid #ff003f;
    background: #ff003f;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.user-menu-logout:hover {
    background: #e6003a;
    transform: translateY(-1px);
}

.analyzer-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Toggle de modo IA */
.ai-mode-toggle {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: normal;
    color: #888;
}

.ai-mode-toggle.active {
    min-height: 80px !important;
    max-height: 80px !important;
    height: auto !important;
    overflow: hidden !important;
    gap: 0 !important;
}

.ai-mode-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}


.analyzer-content {
    padding: 15px;
    padding-bottom: 60px;
    height: calc(100% - 80px);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.status-section {
    margin-bottom: 12px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #4CAF50;
    animation: pulse 2s infinite;
}

.status-dot.high {
    background: #4CAF50;
    border-left-color: #4CAF50;
}

.status-dot.medium {
    background: #FF9800;
    border-left-color: #FF9800;
}

.status-dot.low {
    background: #F44336;
    border-left-color: #F44336;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.status-text {
    font-weight: 500;
    font-size: 14px;
}

.analysis-lastspin-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
}

.analysis-lastspin-row .analysis-section,
.analysis-lastspin-row .last-spin-section {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}
.analysis-lastspin-row .analysis-section .analysis-card,
.analysis-lastspin-row .last-spin-section .spin-display {
    flex: 1;
  height: 100%;
  box-sizing: border-box;
}

/* remove extra panel styling */

.analysis-lastspin-row .analysis-section .confidence-meter {
    margin-bottom: 6px;
}

.analysis-lastspin-row .last-spin-section .spin-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
}

.analysis-lastspin-row .last-spin-section .spin-display.center {
    justify-content: center;
}

.last-spin-section,
.analysis-section,
.pattern-section,
.stats-section {
    margin-bottom: 15px;
}

.last-spin-section h4,
.analysis-section h4,
.pattern-section h4,
.stats-section h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: #e0e0e0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 4px;
}

.spin-display {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}
.spin-display.center { justify-content: center; }
.spin-meta { display:flex; flex-direction:column; gap:4px; align-items:center; }
.spin-time { font-size: 13px; color: #cdd6e8; font-weight:600; }

.highlight-panel {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}
.highlight-panel h4 {
    margin: 0 0 6px 0;
    font-size: 13px;
    font-weight: 600;
    color: #e0e0e0;
}

.spin-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    position: relative;
    box-sizing: border-box;
    border: none;
    font-size: 16px;
    font-weight: bold;
    background: #252736;
    color: #fff;
}
.spin-number::after {
  content: '';
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #fff;
  opacity: 0.90;
  z-index: 1;
}
.spin-number.red { background: #F44336; color: #fff; border-color: #fff; }
.spin-number.black { background: #21222D; color: #fff; border-color: #fff; }
.spin-number.white { background: #fff; color: #F44336; border: none; }
.spin-number.white::after { border-color: #F44336; opacity: 0.95; }

.spin-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #cdd6e8;
}
.spin-time {
    font-size: 13px;
    font-weight: 600;
    color: #cdd6e8;
}

.spin-color {
    display: none;
}

.confidence-meter {
    margin-bottom: 6px;
}

.confidence-bar {
    width: 100%;
    height: 6px;
    background: rgba(5, 10, 20, 0.45);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #F44336 0%, #FF9800 50%, #4CAF50 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0%;
}

.confidence-text {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #e0e0e0;
}

/* ✅ WRAPPER PARA CÍRCULO + INDICADOR LADO A LADO */
.suggestion-box {
    padding: 0;
    margin-top: 4px;
    background: transparent;
    border: none;
}

.suggestion-color-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    min-height: 40px;
}
.suggestion-color-wrapper.has-stage {
    gap: 10px;
}

.suggestion-color {
    font-size: 16px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}
.suggestion-color-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    font-weight: bold;
    background: #252736;
    color: #fff;
}
.suggestion-color-box.red { background: #F44336; color: #fff; }
.suggestion-color-box.black { background: #21222D; color: #fff; }
.suggestion-color-box.white { background: #fff; color: #F44336; }
.suggestion-color-box.neutral {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}
.suggestion-color-box.neutral.loading .spinner {
    width: 18px;
    height: 18px;
}
.suggestion-color-box.neutral.waiting .hourglass-icon {
    font-size: 18px;
    display: inline-block;
}

.suggestion-stage {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.15s ease;
    min-width: 0;
    max-width: 0;
    text-align: center;
    overflow: hidden;
}
.suggestion-stage.visible {
    opacity: 1;
    max-width: 50px;
}

/* ✅ WRAPPER DO INDICADOR DE GALE */
/* ═══════════════════════════════════════════════════════════════
   ✨ INDICADOR DE GALE ATIVO (BOLINHA PISCANDO)
   ═══════════════════════════════════════════════════════════════ */

.gale-active-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin-bottom: 0;
    position: relative;
    padding-left: 0;
    height: auto;
    justify-content: center;
    min-height: calc(70px * var(--icon-scale, 1));
    padding-top: calc(12px * var(--icon-scale, 1));
    padding-bottom: calc(12px * var(--icon-scale, 1));
}

/* Bolinha piscando */
.gale-pulse-circle {
    position: relative;
    width: calc(18px * var(--icon-scale, 1));
    height: calc(18px * var(--icon-scale, 1));
    min-width: calc(18px * var(--icon-scale, 1));
    border-radius: 50%;
    background: #F44336;
    box-shadow: 
        0 0 0 0 rgba(244, 67, 54, 0.7),
        0 0 4px rgba(244, 67, 54, 0.6),
        inset 0 0 2px rgba(255, 255, 255, 0.3);
    animation: gale-pulse-dot 1.5s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    font-weight: 700;
    overflow: hidden;
    font-size: calc(10px * var(--font-scale, 1));
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

/* Círculo interno branco (proporcional) */
.gale-pulse-circle::before {
    content: '';
    display: block;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: calc(14px * var(--icon-scale, 1));
    height: calc(14px * var(--icon-scale, 1));
    border-radius: 50%;
    border: 1px solid #fff;
    opacity: 0.3;
    z-index: 1;
}

/* Segundo anel de pulsação (mais lento) */
.gale-pulse-circle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(14px * var(--icon-scale, 1));
    height: calc(14px * var(--icon-scale, 1));
    border-radius: 50%;
    border: 1px solid rgba(244, 67, 54, 0.6);
    animation: gale-pulse-ring 1.5s ease-out infinite 0.5s;
    z-index: 0;
}

@keyframes gale-pulse-dot {
    0%, 100% {
        transform: scale(1);
        box-shadow: 
            0 0 0 0 rgba(244, 67, 54, 0.7),
            0 0 4px rgba(244, 67, 54, 0.6),
            inset 0 0 2px rgba(255, 255, 255, 0.3);
    }
    50% {
        transform: scale(1.10);
        box-shadow: 
            0 0 0 3px rgba(244, 67, 54, 0),
            0 0 6px rgba(244, 67, 54, 0.8),
            inset 0 0 3px rgba(255, 255, 255, 0.5);
    }
}

@keyframes gale-pulse-ring {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

.pattern-info {
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.3;
    color: #e0e0e0;
    max-height: 300px;
    overflow-y: auto;
}

.pattern-info::-webkit-scrollbar {
    width: 6px;
}

.pattern-info::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.pattern-info::-webkit-scrollbar-thumb {
    background: #2a3750;
    border-radius: 3px;
}

.pattern-info::-webkit-scrollbar-thumb:hover {
    background: #3a4a60;
}

.pattern-header {
    font-size: 11px;
    font-weight: 600;
    color: #4CAF50;
    margin-bottom: 8px;
    text-align: center;
}

/* Novo estilo para exibição amigável do padrão */
.pattern-summary {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px;
    border-left: 3px solid #2b6cb0; /* cor padrão da extensão */
}

.pattern-title {
    font-size: 18px;
    font-weight: 700;
    color: #e6f0ff; /* texto claro padrão */
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.pattern-title::before { content: none; }

.pattern-description {
    font-size: 15px;
    color: #ffffff;
    margin-bottom: 15px;
    line-height: 1.5;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.pattern-stats {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
}

.occurrence-count {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2) 0%, rgba(76, 175, 80, 0.1) 100%);
    color: #4CAF50;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    display: inline-block;
    border: 1px solid rgba(76, 175, 80, 0.3);
    box-shadow: 
        0 2px 8px rgba(76, 175, 80, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.pattern-times {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.times-title {
    font-size: 12px;
    color: #FFC107;
    margin-bottom: 6px;
    font-weight: bold;
}

.time-item {
    font-size: 11px;
    color: #ffffff;
    margin-bottom: 3px;
    padding-left: 10px;
}

.analysis-contributions {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.contrib-title {
    font-size: 12px;
    color: #FF9800;
    margin-bottom: 6px;
    font-weight: bold;
}

.contrib-item {
    font-size: 11px;
    color: #ffffff;
    margin-bottom: 3px;
    padding-left: 10px;
}

.pattern-error {
    color: #f44336;
    font-size: 12px;
    text-align: center;
    padding: 10px;
    background: rgba(244, 67, 54, 0.1);
    border-radius: 5px;
}

/* Estilos para exibição de ocorrências completas */
.pattern-occurrences {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.occurrences-title {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.occurrences-title::before { content: none; }

.occurrence-item {
    margin-bottom: 12px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border-left: 3px solid #2b6cb0;
}

.occurrence-header {
    font-size: 11px;
    color: #cdd6e8;
    margin-bottom: 6px;
    font-weight: bold;
}

.occurrence-sequence {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.pattern-spin {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.pattern-quadrado.trigger-highlight {
	position: relative;
	box-shadow: 0 0 0 3px #FFC107; /* anel amarelo para diferenciar trigger */
	border-color: #FFC107 !important;
}

/* Alerta de cor de disparo inválida */
.pattern-quadrado.trigger-highlight.invalid-trigger {
	box-shadow: 0 0 0 3px #FF5252; /* anel vermelho para trigger inválido */
	border-color: #FF5252 !important;
	animation: pulse-invalid 1.5s ease-in-out infinite;
}

@keyframes pulse-invalid {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.6; }
}

.invalid-trigger-icon {
	display: inline-block;
	margin-left: 6px;
	font-size: 14px;
	cursor: help;
	animation: shake 0.5s ease-in-out;
}

@keyframes shake {
	0%, 100% { transform: translateX(0); }
	25% { transform: translateX(-4px); }
	75% { transform: translateX(4px); }
}

/* Destaque da cor de disparo (trigger) */
.occurrence-trigger {
	margin: 6px 0 2px 0;
	font-size: 12px;
}
.trigger-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 9999px;
	border: 2px solid #4CAF50; /* anel verde para diferenciar da sequência */
	background: rgba(76, 175, 80, 0.1);
	color: #4CAF50;
	font-weight: 600;
}
.trigger-badge.red { box-shadow: 0 0 0 2px rgba(244,67,54,0.3) inset; }
.trigger-badge.black { box-shadow: 0 0 0 2px rgba(33,34,45,0.4) inset; }
.trigger-badge.white { box-shadow: 0 0 0 2px rgba(255,255,255,0.6) inset; color: #F44336; border-color: #F44336; }

/* Pattern Bank Section */
.pattern-bank-section {
    margin: 10px 0;
    padding: 12px;
    border: 1px solid rgba(0,0,0,0.3);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(20,24,36,0.7), rgba(20,24,36,0.5));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}

.pattern-bank-section h4 {
    margin: 0 0 10px 0;
    font-weight: 600;
    color: #e4ecff;
    font-size: 13px;
}

.bank-progress {
    display: none;
    margin-bottom: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(79, 195, 247, 0.45);
    background: rgba(79, 195, 247, 0.12);
    color: #dcede9;
    font-size: 12px;
    font-weight: 500;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
    transition: opacity 0.3s ease;
}

.bank-progress-text {
    display: block;
}

.bank-progress--info {
    border-color: rgba(79, 195, 247, 0.45);
    background: rgba(79, 195, 247, 0.12);
    color: #cfe8ff;
}

.bank-progress--success {
    border-color: rgba(76, 175, 80, 0.5);
    background: rgba(76, 175, 80, 0.12);
    color: #dffbe4;
}

.bank-progress--error {
    border-color: rgba(244, 67, 54, 0.5);
    background: rgba(244, 67, 54, 0.12);
    color: #ffd7d4;
}

.bank-stats {
    margin-bottom: 8px;
}

.bank-loading {
    text-align: center;
    color: #8da2bb;
    font-size: 11px;
    padding: 6px 0;
}

.bank-capacity {
    margin-bottom: 10px;
}

.capacity-bar {
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.capacity-fill {
    height: 100%;
    background: linear-gradient(90deg, #2b6cb0 0%, #4299e1 100%);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.capacity-text {
    font-size: 11px;
    color: #8da2bb;
    text-align: center;
    font-weight: 500;
}

.capacity-text span {
    color: #cdd6e8;
    font-weight: 600;
}

.bank-confidence {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.conf-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    padding: 4px 6px;
    border-radius: 4px;
    background: rgba(255,255,255,0.03);
}

.conf-dot {
    font-size: 12px;
    line-height: 1;
}

.conf-item.conf-high .conf-dot {
    color: #4CAF50;
}

.conf-item.conf-medium .conf-dot {
    color: #FFC107;
}

.conf-item.conf-low .conf-dot {
    color: #F44336;
}

.conf-label {
    color: #8da2bb;
    flex: 1;
}

.conf-value {
    color: #cdd6e8;
    font-weight: 600;
    min-width: 30px;
    text-align: right;
}

.bank-buttons {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.refresh-bank-btn {
    flex: 1;
    padding: 8px;
    border-radius: 6px;
    background: rgba(43,108,176,0.2);
    color: #cdd6e8;
    border: 1px solid rgba(43,108,176,0.3);
    cursor: pointer;
    font-weight: 600;
    font-size: 11px;
    transition: all 0.2s ease;
}

.refresh-bank-btn:hover {
    background: rgba(43,108,176,0.3);
    border-color: rgba(43,108,176,0.5);
}

.refresh-bank-btn:active {
    transform: scale(0.98);
}

.refresh-bank-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.reset-bank-btn {
    flex: 1;
    padding: 8px;
    border-radius: 6px;
    background: rgba(220,53,69,0.2);
    color: #ff8a95;
    border: 1px solid rgba(220,53,69,0.3);
    cursor: pointer;
    font-weight: 600;
    font-size: 11px;
    transition: all 0.2s ease;
}

.reset-bank-btn:hover {
    background: rgba(220,53,69,0.3);
    border-color: rgba(220,53,69,0.5);
}

.reset-bank-btn:active {
    transform: scale(0.98);
}

.reset-bank-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.upload-data-btn {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(255,100,50,0.2);
    color: #ffaa88;
    border: 1px solid rgba(255,100,50,0.3);
    cursor: pointer;
    font-weight: 600;
    font-size: 11px;
    transition: all 0.2s ease;
    width: 100%;
}

.upload-data-btn:hover {
    background: rgba(255,100,50,0.3);
    border-color: rgba(255,100,50,0.5);
    transform: translateY(-1px);
}

.upload-data-btn:active {
    transform: scale(0.98);
}

.upload-data-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Observer Section */
.observer-section {
    margin: 10px 0;
    padding: 12px;
    border: 1px solid rgba(0,0,0,0.3);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(36,24,46,0.7), rgba(36,24,46,0.5));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}

.observer-section h4 {
    margin: 0 0 10px 0;
    font-weight: 600;
    color: #f3e4ff;
    font-size: 13px;
}

.observer-stats {
    margin-bottom: 8px;
}

.observer-loading {
    text-align: center;
    color: #8da2bb;
    font-size: 11px;
    padding: 6px 0;
}

.observer-calibration {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    margin-bottom: 10px;
    background: rgba(147,51,234,0.1);
    border-radius: 6px;
    border: 1px solid rgba(147,51,234,0.2);
}

.calibration-label {
    font-size: 11px;
    color: #c4b5fd;
    font-weight: 600;
}

.calibration-value {
    font-size: 13px;
    color: #f3e4ff;
    font-weight: 700;
}

.observer-accuracy {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.accuracy-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    padding: 4px 6px;
    border-radius: 4px;
    background: rgba(255,255,255,0.03);
}

.accuracy-label {
    color: #8da2bb;
}

.accuracy-value {
    color: #cdd6e8;
    font-weight: 600;
}

.observer-by-confidence {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.obs-conf-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    padding: 6px 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.03);
}

.obs-conf-label {
    color: #c4b5fd;
    font-weight: 600;
}

.obs-conf-stat {
    color: #cdd6e8;
    font-family: 'Consolas', monospace;
    font-size: 10px;
}

.refresh-observer-btn {
    width: 100%;
    padding: 8px;
    border-radius: 6px;
    background: rgba(147,51,234,0.2);
    color: #cdd6e8;
    border: 1px solid rgba(147,51,234,0.3);
    cursor: pointer;
    font-weight: 600;
    font-size: 11px;
    transition: all 0.2s ease;
}

.refresh-observer-btn:hover {
    background: rgba(147,51,234,0.3);
    border-color: rgba(147,51,234,0.5);
}

.refresh-observer-btn:active {
    transform: scale(0.98);
}

/* Settings panel */
.settings-section { margin-top: 10px; padding: 10px; border: 1px solid rgba(0,0,0,0.3); border-radius: 10px; background: linear-gradient(180deg, rgba(20,24,36,0.7), rgba(20,24,36,0.5)); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05); }
.settings-section h4 { margin: 0 0 8px 0; font-weight: 600; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; align-items: center; }
.setting-item { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; }
.setting-item.setting-row { grid-column: 1 / span 2; }
  .setting-label { font-size: 11px; line-height: 1.2; opacity: 0.9; white-space: normal; }
  .settings-section input[type="number"] { width: 64px; min-width: 56px; padding: 4px 6px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.18); background: #0f1320; color: #e4ecff; font-weight: 500; text-align: center; box-sizing: border-box; }
  .settings-section input[type="text"] { width: 100%; padding: 6px 8px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.18); background: #0f1320; color: #e4ecff; font-weight: 500; box-sizing: border-box; font-size: 12px; }
  .settings-section input[type="number"]:focus, .settings-section input[type="text"]:focus { outline: none; border-color: #2b6cb0; box-shadow: 0 0 0 2px rgba(43,108,176,0.25); }
.cfg-save-btn { margin-top: 10px; width: 100%; padding: 10px; border-radius: 8px; background: #ef4444; color: #fff; border: none; cursor: pointer; font-weight: 600; }
.cfg-save-btn:hover { background: #dc2626; }
.checkbox-label { font-size: 12px; display: flex; align-items: center; gap: 6px; }

/* Responsividade da caixa de configurações */
@media (max-width: 480px) {
	.settings-grid { grid-template-columns: 1fr; }
	.setting-item.setting-row { grid-column: 1; }
}

/* Ajuste baseado na largura da sidebar: quando estreita, usa 1 coluna */
#blaze-double-analyzer[style*="width: 2"] .settings-grid,
#blaze-double-analyzer[style*="width: 3"] .settings-grid,
#blaze-double-analyzer[style*="width: 4"] .settings-grid {
	grid-template-columns: 1fr;
}

.pattern-quadrado {
    width: 24px;
    height: 24px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    color: white;
    border: none;
    margin-bottom: 2px;
}

.pattern-quadrado.red {
    background: #F44336;
}

.pattern-quadrado.black {
    background: #21222D;
}

.pattern-quadrado.white {
    background: #fff;
    color: #F44336;
    border-color: #F44336;
}

.pattern-occurrence {
    margin-bottom: 12px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    border-left: 2px solid #4CAF50;
}

.occurrence-header {
    font-size: 10px;
    color: #cdd6e8;
    margin-bottom: 6px;
    font-weight: 500;
}

.pattern-sequence {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
}

.pattern-spin {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pattern-quadrado {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 5px;
    position: relative;
    box-sizing: border-box;
    border: none;
    font-size: 14px;
    font-weight: bold;
    background: #252736;
    color: #fff;
}

.pattern-quadrado.red {
    background: #F44336;
    color: #fff;
    border-color: #fff;
}

.pattern-quadrado.black {
    background: #21222D;
    color: #fff;
    border-color: #fff;
}

.pattern-quadrado.white {
    background: #fff;
    color: #F44336;
    border: none;
}

.pattern-quadrado span {
    position: relative;
    z-index: 2;
    font-weight: 700;
    color: inherit;
    font-family: inherit;
}

.pattern-quadrado svg {
    display: block;
    z-index: 2;
    pointer-events: none;
}

.pattern-quadrado::after {
    content: '';
    display: block;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #fff;
    opacity: 0.90;
    z-index: 1;
}

.pattern-quadrado.white::after {
    border-color: #F44336;
    opacity: 0.95;
}

.stats-grid {
    display: grid;
    gap: 6px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.stat-label {
    font-size: 11px;
    color: #b0b0b0;
}

.stat-value {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
}

/* Dynamic sizing based on sidebar dimensions */
#blaze-double-analyzer {
    --base-size: 1;
    --icon-scale: 1;
    --font-scale: 1;
    --spacing-scale: 1;
}

/* Large sidebar (wider than 600px) */
#blaze-double-analyzer[style*="width: 6"] .analyzer-content,
#blaze-double-analyzer[style*="width: 7"] .analyzer-content,
#blaze-double-analyzer[style*="width: 8"] .analyzer-content,
#blaze-double-analyzer[style*="width: 9"] .analyzer-content {
    --icon-scale: 1.5;
    --font-scale: 1.2;
    --spacing-scale: 1.3;
}

/* Extra large sidebar (wider than 1000px) */
#blaze-double-analyzer[style*="width: 1"] .analyzer-content {
    --icon-scale: 2;
    --font-scale: 1.4;
    --spacing-scale: 1.6;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    #blaze-double-analyzer {
        width: 280px;
    }
}

@media (max-width: 768px) {
    #blaze-double-analyzer {
        width: 100%;
        height: 100vh;
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        transform: none !important;
        margin: 0;
        border-radius: 0;
        max-width: 100%;
        max-height: 100vh;
    }
    
    /* ✅ Garantir espaço para a última entrada */
    .analyzer-content {
        height: calc(100vh - 80px) !important;
        overflow-y: auto !important;
        overflow-x: hidden;
        padding-bottom: 60px !important;
    }
    
    /* ✅ Header fixo no topo */
    .analyzer-header {
        position: sticky;
        top: 0;
        z-index: 100;
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    }
}

/* Scrollbar styling */
#blaze-double-analyzer::-webkit-scrollbar {
    width: 6px;
}

#blaze-double-analyzer::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

#blaze-double-analyzer::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

#blaze-double-analyzer::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Spin history blaze style */
.spin-history-bar {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-top: 10px;
}
.spin-history-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 16px;
    border: 2px solid #999;
    margin-right: 2px;
    margin-bottom: 2px;
}
.spin-history-item.red {
    background: #F44336;
    color: #fff;
    border-color: #b71c1c;
}
.spin-history-item.black {
    background: #222;
    color: #fff;
    border-color: #444;
}
.spin-history-item.white {
    background: #fff;
    color: #222;
    border-color: #bbb;
}

.spin-history-label {
  color: #8da2bb;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  margin-left: 0;
  padding-top: 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.spin-count-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: #6b7a92;
}

.displaying-count {
  padding: 2px 6px;
  background: rgba(43, 108, 176, 0.2);
  border-radius: 4px;
  color: #8da2bb;
  font-weight: 500;
}

.more-indicator {
  padding: 2px 6px;
  background: rgba(76, 175, 80, 0.2);
  border-radius: 4px;
  color: #81c784;
  font-weight: 500;
  cursor: help;
}

.clear-history-btn { display: none; }

.clear-history-menu {
  position: relative;
  display: inline-block;
}

.clear-history-link {
  color: #8da2bb;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 2px 4px;
  background: none;
  border: none;
}
.clear-history-link:hover {
  color: #cdd6e8;
}

.clear-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: #1a1d29;
  border: 1px solid #2a3750;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  min-width: 140px;
  padding: 4px 0;
}

.clear-option {
  color: #cdd6e8;
  font-size: 11px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.clear-option:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.no-history {
  color: #8da2bb;
  font-size: 12px;
  text-align: center;
  padding: 20px;
  font-style: italic;
}

.spin-history-bar-blaze {
    display: flex !important;
    gap: 0;
    overflow-x: auto;
    overflow-y: auto;
    width: 100%;
    padding: 8px 0;
    flex-wrap: wrap;
    max-height: 300px;
    align-content: flex-start;
    visibility: visible !important;
    opacity: 1 !important;
}
.spin-history-item-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  margin-right: 4px;
  margin-bottom: 4px;
}
.spin-history-bar-blaze::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.spin-history-bar-blaze::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
.spin-history-bar-blaze::-webkit-scrollbar-thumb {
    background: #2a3750;
    border-radius: 4px;
}
.spin-history-bar-blaze::-webkit-scrollbar-thumb:hover {
    background: #3a4a60;
}
.spin-history-quadrado {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(36px * var(--icon-scale, 1));
  height: calc(36px * var(--icon-scale, 1));
  border-radius: calc(6px * var(--icon-scale, 1));
  position: relative;
  box-sizing: border-box;
  border: none;
  font-size: calc(16px * var(--font-scale, 1));
  font-weight: bold;
  background: #252736;
  color: #fff;
  z-index: 0;
}
.spin-history-time {
  font-size: calc(10px * var(--font-scale, 1));
  color: #cdd6e8;
  margin-top: calc(2px * var(--spacing-scale, 1));
}
.spin-history-quadrado.red {
    background: #F44336;
    color: #fff;
    border-color: #fff;
}
.spin-history-quadrado.black {
    background: #21222D;
    color: #fff;
    border-color: #fff;
}
.spin-history-quadrado.white {
    background: #fff;
    color: #F44336;
    border: none;
}
.spin-history-quadrado span {
    position: relative;
    z-index: 2;
    font-weight: 700;
    color: inherit;
    font-family: inherit;
}
.spin-history-quadrado svg {
    display: block;
    z-index: 2;
    pointer-events: none;
}
.spin-history-quadrado::after {
  content: '';
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #fff;
  opacity: 0.90;
  z-index: 1;
}
.spin-history-quadrado.white::after {
    border-color: #F44336;
    opacity: 0.95;
}
.spin-history-bar-blaze .spin-history-quadrado:last-child {
    margin-right: 0;
}

#spin-history-bar-ext {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    height: auto !important;
}

/* Botão Carregar Mais Histórico */
.load-more-history-btn {
    display: inline-block;
    background: transparent;
    color: #00d4ff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin: 10px auto 15px auto;
    text-decoration: underline;
}

.load-more-history-btn:hover {
    color: #00ff88;
    text-decoration: none;
    background: rgba(0, 212, 255, 0.05);
}

.load-more-history-btn:active {
    transform: scale(0.98);
}

.analysis-feedback {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  min-height: 60px !important;
}

.data-collection {
  background: rgba(255, 193, 7, 0.1) !important;
  border: 1px solid rgba(255, 193, 7, 0.3) !important;
  min-height: 60px !important;
}

.data-collection .analysis-icon {
  font-size: 20px;
  margin-bottom: 5px;
}

.data-collection .analysis-text {
  font-size: 12px;
  color: #FFC107;
  font-weight: bold;
  margin-bottom: 5px;
}

.data-collection .analysis-dots {
  display: flex;
  justify-content: center;
  gap: 2px;
}

.data-collection .dot {
  color: #FFC107;
  font-size: 16px;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* Spinner simples */
.suggestion-color.loading-spinner {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  height: 60px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  min-height: 60px !important;
}

.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Estilos modernos para exibição de padrão igual ao histórico de giros */
.pattern-spin {
    display: inline-block;
    margin: 2px;
    text-align: center;
    position: relative;
}

.pattern-quadrado {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 11px;
    color: white;
    margin: 0 auto 2px auto;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.pattern-quadrado.red { background: #F44336; }

.pattern-quadrado.black { background: #21222D; }

.pattern-quadrado.white { background: #fff; color: #F44336; }

.pattern-time {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    margin-top: 1px;
    font-weight: 400;
}

.occurrence-sequence {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
    padding: 4px 8px;
}

.pattern-sep {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: #cdd6e8;
    padding: 0 4px;
}

.occurrence-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px;
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.occurrence-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.occurrence-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
}

.occurrence-header {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 6px;
    margin-left: 8px;
    font-weight: 500;
}

/* Estilos para entradas clicáveis */
.clickable-entry {
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    padding: 2px;
}

.clickable-entry:hover {
    background: rgba(76, 175, 80, 0.1);
    transform: scale(1.02);
}

.clickable-entry:active {
    transform: scale(0.98);
}

/* Modal moderno para mostrar padrão da entrada – alinhado 100% à extensão */
.pattern-modal {
    position: absolute;           /* Relativo ao #blaze-double-analyzer */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    z-index: 20000;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
}

.pattern-modal-content {
    position: absolute;
    box-sizing: border-box;
    background: #1a1f2e;
    border-radius: 0;
    border: 1px solid #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
}

@media (max-width: 768px) {
    /* Empurra o conteúdo para baixo da barra do navegador no mobile,
       mas continua ocupando 100% da extensão */
    .pattern-modal-content {
        top: calc(8px + env(safe-area-inset-top, 0px));
        bottom: 0;
        height: auto;
    }
}

.pattern-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #252b3d;
    border-bottom: 1px solid #333;
    position: relative;
}

.pattern-modal-header h3 {
    margin: 0;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pattern-modal-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #ccc;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    white-space: nowrap;
}

.pattern-modal-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
}

.pattern-modal-close:active {
    transform: scale(0.96);
}

.pattern-modal-body {
    padding: 16px;
    flex: 1; /* ocupa o espaço abaixo do header */
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #444 transparent;
}

.pattern-modal-body::-webkit-scrollbar {
    width: 6px;
}

.pattern-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.pattern-modal-body::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

.pattern-modal-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.entry-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0;
    border: 1px solid #333;
    position: relative;
    overflow: hidden;
}

@media (min-width: 480px) {
    .entry-info {
        display: grid;
        grid-template-columns: 1fr auto;
    }
}

.entry-color-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.entry-label {
    font-weight: 600;
    color: #fff;
    font-size: 12px;
    text-shadow: none;
}

.entry-color-display {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.entry-color-display::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 1;
}

.entry-color-display.red {
    background: linear-gradient(135deg, #ff4444, #cc0000);
    border-color: #ff6666;
}

.entry-color-display.black {
    background: linear-gradient(135deg, #333333, #000000);
    border-color: #555555;
}

.entry-color-display.white {
    background: linear-gradient(135deg, #ffffff, #f0f0f0);
    color: #333333;
    border-color: #cccccc;
}

.entry-color-display.white::before {
    border-color: #333333;
}

.entry-color-name {
    font-weight: 600;
    color: #fff;
    font-size: 13px;
    text-shadow: none;
}

.entry-confidence {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0;
    border: 1px solid #333;
}

@media (min-width: 480px) {
    .entry-confidence {
        flex-direction: column;
        gap: 4px;
    }
}

.entry-confidence-value {
    font-weight: 600;
    color: #fff;
    font-size: 13px;
    text-shadow: none;
}

.pattern-details {
    margin-top: 12px;
}

/* Estilos para modal de padrão não disponível */
.no-pattern-info {
    text-align: center;
    padding: 20px;
}

.no-pattern-info p {
    color: #888;
    margin-bottom: 20px;
    font-size: 14px;
}

.entry-summary {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.entry-summary-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
}

.summary-label {
    font-weight: bold;
    color: #4CAF50;
    min-width: 70px;
    font-size: 14px;
}

.summary-value {
    color: #fff;
    font-weight: 500;
    font-size: 14px;
}

.win-text {
    color: #4CAF50 !important;
    font-weight: bold;
}

.loss-text {
    color: #f44336 !important;
    font-weight: bold;
}

.analysis-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.analysis-icon {
  font-size: 18px;
  animation: pulse 2s infinite;
  margin: 0;
  padding: 0;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.analysis-text {
  font-size: 10px;
  color: #cdd6e8;
  font-weight: 500;
  margin: 0;
  padding: 0;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
}

.analysis-dots {
  display: flex;
  gap: 2px;
  justify-content: center;
  align-items: center;
  margin: 0;
  padding: 0;
}

.analysis-dots .dot {
  width: 3px;
  height: 3px;
  background: #cdd6e8;
  border-radius: 50%;
  animation: dotPulse 1.5s infinite;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
}

.analysis-dots .dot:nth-child(2) {
  animation-delay: 0.2s;
}

.analysis-dots .dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dotPulse {
  0%, 60%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  30% {
    opacity: 1;
    transform: scale(1.2);
  }
}

@keyframes pulse {
  0% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
  100% { opacity: 0.7; transform: scale(1); }
}

.entries-section {
  margin-top: 12px;
}

.entries-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0 10px 10px 10px;
}
.entries-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  gap: 12px;
}
.entries-hit {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.entries-hit .total-entries {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.clear-entries-btn {
  border: none;
  background: transparent;
  color: #6ec8ff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.clear-entries-btn:hover {
  color: #9fe0ff;
}

.entries-tabs-bar {
  display: flex;
  gap: 6px;
  padding: 10px 0 6px 0;
}

.entries-tab {
  flex: 1;
  border: none;
  background: rgba(15, 23, 42, 0.6);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.entries-tab:hover {
  background: rgba(32, 45, 68, 0.9);
}

.entries-tab.active {
  background: #10182a;
  color: #ffffff;
}

.entries-tab[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.35;
}

.entries-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.entries-view[hidden] {
  display: none !important;
}

.bets-container {
  background: var(--bg-tertiary, #141e30);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px;
  max-height: 220px;
  overflow-y: auto;
}

.bets-table-wrapper {
  max-height: 220px;
  overflow-y: auto;
}

.bets-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.bets-table thead th {
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  padding: 6px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
}

.bets-table tbody td {
  padding: 8px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #e3e8ff;
  vertical-align: middle;
  text-align: left;
}

.bets-table tbody tr:last-child td {
  border-bottom: none;
}

.bet-color-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  font-size: 0;
}

.bet-color-pill.red {
  background: #f44336;
}

.bet-color-pill.black {
  background: #21222d;
}

.bet-color-pill.white {
  background: #ffffff;
}

.bet-color-pill.neutral {
  background: rgba(255, 255, 255, 0.08);
  color: #cdd6e8;
}

.bet-result-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 13px;
  padding: 0;
}

.bet-result-pill.red {
  background: #f44336;
  color: #fff;
}

.bet-result-pill.black {
  background: #21222d;
  color: #e9efff;
}

.bet-result-pill.white {
  background: #ffffff;
  color: #f44336;
}

.bet-result-pill.neutral {
  background: rgba(255, 255, 255, 0.08);
  color: #cdd6e8;
}

.bet-result-pill.pending {
  background: rgba(0, 212, 255, 0.1);
  color: #00d4ff;
}

.pending-indicator {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(0, 212, 255, 0.3);
  border-top-color: #00ffa3;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.bet-profit {
  font-weight: 700;
  font-size: 11px;
}

.bet-profit.positive {
  color: #4caf50;
}

.bet-profit.negative {
  color: #ef5350;
}

.bet-profit.neutral {
  color: #cdd6e8;
}

.bets-empty {
  text-align: center;
  padding: 20px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.bet-status-win td {
  color: #b2ffcc;
}

.bet-status-loss td {
  color: #ffb3b3;
}

.bet-status-cancelled td {
  color: rgba(255, 255, 255, 0.55);
  font-style: italic;
}

.bet-status-pending td {
  color: #cdd6e8;
}

.win-score {
  color: #2ecc71;
  font-weight: 600;
}

.loss-score {
  color: #e74c3c;
  font-weight: 600;
}

.percentage {
  color: #cdd6e8;
  font-weight: 500;
}
.entries-list { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 4px; 
    max-height: 200px; 
    overflow-y: auto; 
    overflow-x: hidden;
    align-content: flex-start; 
    width: 100%;
    padding: 4px 0;
}

.entries-list::-webkit-scrollbar {
    width: 6px;
}

.entries-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.entries-list::-webkit-scrollbar-thumb {
    background: #2a3750;
    border-radius: 3px;
}

.entries-list::-webkit-scrollbar-thumb:hover {
    background: #3a4a60;
}
.entry-item-wrap { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.entry-item { display: inline-flex; align-items: center; gap: 2px; }
.entry-time { 
    font-size: calc(9px * var(--font-scale, 1)); 
    color: #cdd6e8; 
    text-align: center; 
}
.entry-box { 
    position:relative; 
    width: calc(36px * var(--icon-scale, 1)); 
    height: calc(36px * var(--icon-scale, 1)); 
    border-radius: calc(6px * var(--icon-scale, 1)); 
    display:flex; 
    align-items:center; 
    justify-content:center; 
    border:none; 
    font-weight:700; 
    overflow:hidden; 
    font-size: calc(16px * var(--font-scale, 1));
}
.entry-box::after {
  content: '';
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: calc(28px * var(--icon-scale, 1));
  height: calc(28px * var(--icon-scale, 1));
  border-radius: 50%;
  border: 2px solid #fff;
  opacity: 0.9;
  z-index: 1;
}
.entry-box.red { background:#F44336; color:#fff; border-color:#fff; }
.entry-box.black { background:#21222D; color:#fff; border-color:#fff; }
.entry-box.white { background:#fff; color:#F44336; border:none; }
.entry-box.white::after { border-color:#F44336; }
.entry-result-bar { 
    width: calc(4px * var(--icon-scale, 1)); 
    height: calc(36px * var(--icon-scale, 1)); 
    border-radius: calc(2px * var(--icon-scale, 1)); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: calc(10px * var(--font-scale, 1)); 
    font-weight: bold; 
    color: #fff; 
}
.entry-result-bar.win { background: #2ecc71; }
.entry-result-bar.loss { background: #e74c3c; }

/* ✅ Estágio do Martingale (abaixo da porcentagem) */
.entry-stage {
    font-size: calc(9px * var(--font-scale, 1));
    font-weight: 600;
    text-align: center;
    padding: 1px 4px;
    border-radius: 3px;
    margin: 2px 0;
    line-height: 1.2;
}
.entry-stage.win { 
    color: #2ecc71; 
    background: rgba(46, 204, 113, 0.1);
}
.entry-stage.loss { 
    color: #e74c3c; 
    background: rgba(231, 76, 60, 0.1);
}
.entry-conf { position:absolute; left:2px; top:2px; font-size:8px; color:#cdd6e8; background:rgba(0,0,0,0.35); padding:1px 3px; border-radius:3px; }
.entry-conf-top { font-size:10px; color:#cdd6e8; font-weight:700; margin-bottom:2px; }
.entry-info { display:flex; flex-direction:column; font-size:11px; color:#cdd6e8; }
.entry-line strong { color:#fff; }

/* ═══════════════════════════════════════════════════════════════════════════════ */
/* 🎨 HEADER DA EXTENSÃO (CENTRALIZADO)                                            */
/* ═══════════════════════════════════════════════════════════════════════════════ */

.analyzer-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.header-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    letter-spacing: 0.5px;
}

/* Badge do título (PREMIUM / IA) */
.title-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a1a1a;
    letter-spacing: 0.5px;
    vertical-align: middle;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.title-badge.badge-ia {
    background: linear-gradient(135deg, #00d4ff 0%, #0099ff 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 212, 255, 0.4);
}

.ai-mode-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ai-mode-toggle:hover {
    background: var(--bg-secondary);
    transform: translateY(-1px);
}

.ai-mode-toggle.active {
    background: rgba(239, 68, 68, 0.15);
    border: none;
    border-radius: 4px;
    min-height: 80px !important;
    max-height: 80px !important;
    height: auto !important;
    overflow: hidden !important;
    padding: 6px 12px !important;
    gap: 0 !important;
}

.mode-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    font-family: var(--font-primary);
    letter-spacing: 0.3px;
    min-height: 20px !important;
    max-height: 20px !important;
    height: 20px !important;
    line-height: 20px !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    margin: 0 !important;
    padding: 0 !important;
}

.ai-mode-toggle.active .mode-name {
    color: var(--text-primary);
}

.mode-api-container {
    position: relative !important;
    margin-top: 8px !important;
    margin-bottom: 0 !important;
    min-height: 50px !important;
    max-height: 50px !important;
    height: 50px !important;
    min-width: 100% !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    display: block !important;
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
    flex-basis: 50px !important;
}

.mode-api-header-simple {
    display: block !important;
    text-align: center !important;
    padding-bottom: 4px !important;
    padding-top: 0 !important;
    margin-bottom: 4px !important;
    margin-top: 0 !important;
    border-bottom: 1px solid rgba(0, 255, 136, 0.2) !important;
    max-height: 18px !important;
    height: 18px !important;
    overflow: hidden !important;
}

.mode-api-title-simple {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: rgba(0, 255, 136, 0.95) !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    display: inline-block !important;
    line-height: 14px !important;
}

.mode-api-status {
    display: block !important;
    font-size: 10px !important;
    font-weight: 500 !important;
    color: rgba(255, 255, 255, 0.9) !important;
    line-height: 1.2 !important;
    text-align: center !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    max-height: 14px !important;
    height: 14px !important;
    padding: 0 !important;
    margin: 0 !important;
}
.mode-api-status .diamond-status-tag {
    color: #00d4ff !important;
    font-weight: 600 !important;
}
.mode-api-status .typing-caret {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: #00d4ff;
    margin-left: 2px;
    animation: diamondTypingCaret 1s steps(2, start) infinite;
    vertical-align: baseline;
}
.mode-api-status[data-typing="true"] {
    white-space: nowrap !important;
}
@keyframes diamondTypingCaret {
    50% {
        opacity: 0;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════ */
/* 🔒 BOTÃO DE MOSTRAR/OCULTAR SENHA (PROFISSIONAL)                                */
/* ═══════════════════════════════════════════════════════════════════════════════ */

.toggle-visibility-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: #8da2bb;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 44px;
    height: 100%;
}

.toggle-visibility-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    color: #cdd6e8;
}

.toggle-visibility-btn:active {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(0.95);
}

.toggle-visibility-btn svg {
    display: block;
    transition: opacity 0.2s ease;
}

/* ═══════════════════════════════════════════════════════════════════════════════ */
/* 📱 RESPONSIVIDADE PARA MOBILE                                                   */
/* ═══════════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════════════ */
/* 🖥️ TELAS GRANDES (> 1024px) - Desktop/Monitores                                */
/* ═══════════════════════════════════════════════════════════════════════════════ */
@media only screen and (min-width: 1025px) {
    #blaze-double-analyzer {
        width: clamp(400px, 25vw, 500px);
        min-width: 300px;
        max-width: 1200px;
        max-height: 95vh !important;
    }
    
    .settings-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px 18px !important;
    }
    
    .analyzer-body {
        padding: 16px !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════ */
/* 📱 TABLETS (768px - 1024px) - 2 COLUNAS                                         */
/* ═══════════════════════════════════════════════════════════════════════════════ */
@media only screen and (min-width: 768px) and (max-width: 1024px) {
    #blaze-double-analyzer {
        width: clamp(400px, 60vw, 500px);
        min-width: 300px;
        max-width: 90vw;
        max-height: 90vh !important;
    }
    
    .settings-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px 16px !important;
    }
    
    .setting-item {
        font-size: clamp(12px, 1.5vw, 14px) !important;
    }
    
    .btn-hot-pattern,
    .btn-view-patterns,
    .btn-add-custom-pattern {
        font-size: clamp(11px, 1.5vw, 13px) !important;
        padding: clamp(8px, 1.5vh, 12px) clamp(10px, 2vw, 14px) !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════ */
/* 📱 MOBILE (até 768px) - FULLSCREEN                                              */
/* ═══════════════════════════════════════════════════════════════════════════════ */

/* Detecção de mobile através de media queries */
@media only screen and (max-width: 768px) {
    
    /* ✅ BOX-SIZING GLOBAL PARA MOBILE */
    #blaze-double-analyzer * {
        box-sizing: border-box !important;
    }
    
    /* ✅ SIDEBAR FULLSCREEN NO MOBILE */
    #blaze-double-analyzer {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        min-width: 100% !important;
        min-height: 100% !important;
        border-radius: 0 !important;
        border: none !important;
        margin: 0 !important;
        padding: 0 !important;
        transform: none !important;
        overflow: hidden !important;
        /* ✅ Respeitar área segura do iOS (notch e barra de navegação) */
        padding-top: env(safe-area-inset-top) !important;
        padding-bottom: env(safe-area-inset-bottom) !important;
    }
    
    /* ✅ DESABILITAR RESIZE NO MOBILE */
    .resize-handles {
        display: none !important;
    }
    
    /* ✅ DESABILITAR DRAG NO MOBILE */
    .analyzer-header {
        cursor: default !important;
        -webkit-user-select: none;
        user-select: none;
        touch-action: none;
    }
    
    /* ✅ AJUSTAR HEADER NO MOBILE - MANTER LAYOUT HORIZONTAL IGUAL DESKTOP */
    .analyzer-header {
        padding: 12px 10px !important;
        min-height: auto !important;
        flex-direction: row !important; /* ✅ HORIZONTAL como no desktop */
        gap: 8px !important;
        /* ✅ Adicionar padding extra no topo para não ficar escondido atrás da barra do navegador */
        padding-top: max(12px, env(safe-area-inset-top, 0px)) !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 1000 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
    
    /* 💎 MODO DIAMANTE NO MOBILE - Header VERMELHO */
    #blaze-double-analyzer.diamond-mode-active .analyzer-header {
        background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%) !important;
    }
    
    /* ✅ HEADER-CONTENT: Layout vertical no mobile (nome em cima, botão embaixo) */
    .header-content {
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
        justify-content: center !important;
        align-items: stretch !important;
        gap: 8px !important;
        box-sizing: border-box !important;
        flex: 1 !important;
    }
    
    /* ✅ HEADER-MAIN: Nome + Badge + Menu (tudo na mesma linha horizontal) */
    .header-main {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 8px !important;
        width: 100% !important;
    }
    
    /* ✅ TÍTULO NO MOBILE - SEM QUEBRA DE LINHA */
    .analyzer-header h3 {
        font-size: 16px !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
    }
    
    /* ✅ BADGE NO MOBILE - COMPACTO E SEM QUEBRA */
    .title-badge {
        font-size: 8px !important;
        padding: 2px 6px !important;
        margin-left: 4px !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }
    
    /* ✅ USER MENU TOGGLE: Visível no mobile, alinhado à direita */
    .user-menu-toggle {
        display: flex !important;
        flex-shrink: 0 !important;
        margin-left: auto !important;
        width: 32px !important;
        height: 24px !important;
        padding: 4px 6px !important;
        gap: 3px !important;
    }
    
    .user-menu-toggle span {
        height: 2px !important;
    }
    
    /* ✅ AI MODE TOGGLE: Segunda linha no mobile (largura total) */
    .ai-mode-toggle {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 8px 12px !important;
        box-sizing: border-box !important;
        font-size: 13px !important;
    }
    
    /* ✅ AJUSTAR BOTÕES DO HEADER */
    .header-buttons {
        gap: 8px !important;
    }
    
    .header-btn {
        padding: 8px 12px !important;
        font-size: 13px !important;
        min-width: auto !important;
    }
    
    /* ✅ AJUSTAR CONTEÚDO DA SIDEBAR */
    .analyzer-body {
        padding: 8px !important;
        padding-bottom: 60px !important;
        /* ✅ Ajustar altura considerando safe-area e header */
        height: calc(100vh - 50px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;
        max-height: calc(100vh - 50px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* ✅ AJUSTAR SEÇÕES */
    .analysis-section,
    .status-section,
    .config-section,
    .history-section,
    .pattern-search-section,
    .signals-section {
        margin-bottom: 16px !important;
        padding: 12px 8px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: visible !important;
    }
    
    .analysis-lastspin-row {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }
    
    .analysis-lastspin-row .analysis-section,
    .analysis-lastspin-row .last-spin-section {
        margin-bottom: 0 !important;
        min-width: 0 !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    .analysis-lastspin-row .analysis-section .analysis-card,
    .analysis-lastspin-row .last-spin-section .spin-display {
        padding: 8px !important;
        min-height: 105px !important;
        flex: 1 !important;
    }
    
    .analysis-lastspin-row .last-spin-section .spin-display {
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
    }
    
    .highlight-panel {
        padding: 10px !important;
        border-radius: 10px !important;
    }
    
    .section-title {
        font-size: 14px !important;
        margin-bottom: 10px !important;
    }
    
    /* ✅ FONT-SIZES RESPONSIVOS COM CLAMP */
    html {
        font-size: clamp(14px, 2vw, 16px) !important;
    }
    
    .section-title {
        font-size: clamp(13px, 2.5vw, 16px) !important;
    }
    
    .setting-label {
        font-size: clamp(12px, 2vw, 14px) !important;
    }
    
    /* ✅ AJUSTAR GRID DE CONFIGURAÇÕES - 1 COLUNA NO MOBILE */
    .settings-grid {
        grid-template-columns: 1fr !important;
        gap: clamp(8px, 2vh, 12px) !important;
    }
    
    .settings-section {
        padding: 12px 8px !important;
        margin: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .setting-item {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: visible !important;
    }
    
    .setting-label {
        font-size: 13px !important;
        flex: 1 !important;
        min-width: 0 !important;
    }
    
    /* ✅ AJUSTAR INPUTS E SELECTS */
    input[type="text"],
    input[type="number"],
    input[type="password"],
    select,
    textarea {
        font-size: 16px !important; /* Previne zoom no iOS */
        padding: 10px 8px !important;
        min-height: 44px !important; /* Área de toque mínima */
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* ✅ INPUTS NUMÉRICOS PEQUENOS */
    .settings-section input[type="number"] {
        width: 80px !important;
        max-width: 80px !important;
        flex-shrink: 0 !important;
    }
    
    /* ✅ AJUSTAR CAMPOS COM BOTÃO DE VISIBILIDADE */
    .setting-row > div {
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
        display: flex !important;
        gap: 4px !important;
    }
    
    .setting-row input[type="password"],
    .setting-row input[type="text"] {
        flex: 1 !important;
        min-width: 0 !important;
    }
    
    .toggle-visibility-btn {
        min-width: 48px !important;
        max-width: 48px !important;
        padding: 0 10px !important;
        flex-shrink: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 44px !important;
    }
    
    .toggle-visibility-btn svg {
        width: 20px !important;
        height: 20px !important;
    }
    
    /* ✅ AJUSTAR TOGGLE DIAMANTE - REMOVER DUPLICAÇÃO (já definido acima) */
    .ai-mode-toggle .mode-name {
        font-size: 13px !important;
        min-height: 20px !important;
        max-height: 20px !important;
        height: 20px !important;
        overflow: hidden !important;
    }
    
    /* ✅ AJUSTAR BOTÕES DE PADRÕES */
    .btn-hot-pattern,
    .btn-view-patterns,
    .btn-add-custom-pattern {
        width: 100% !important;
        max-width: 100% !important;
        min-width: auto !important;
        box-sizing: border-box !important;
        padding: 10px 12px !important;
        font-size: 12px !important;
    }
    
    #customPatternsContainer {
        width: 100% !important;
        padding: 0 8px !important;
        box-sizing: border-box !important;
    }
    
    #customPatternsContainer > div {
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    /* ✅ AJUSTAR BOTÕES */
    button,
    .btn,
    .action-btn,
    .save-config-btn,
    .reset-btn,
    .clear-patterns-btn,
    .search-patterns-btn,
    .cfg-save-btn {
        min-height: 44px !important; /* Área de toque mínima */
        padding: 12px 16px !important;
        font-size: 14px !important;
        cursor: pointer !important;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* ✅ AJUSTAR SLIDERS */
    input[type="range"] {
        min-height: 44px !important;
    }
    
    /* ✅ AJUSTAR CHECKBOX E RADIO */
    input[type="checkbox"],
    input[type="radio"] {
        min-width: 24px !important;
        min-height: 24px !important;
        cursor: pointer !important;
    }
    
    /* ✅ AJUSTAR LABELS */
    label {
        font-size: 14px !important;
        line-height: 1.5 !important;
        cursor: pointer !important;
    }
    
    /* ✅ AJUSTAR HISTÓRICO DE GIROS */
    .history-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)) !important;
        gap: 8px !important;
        max-height: 300px !important;
    }
    
    .spin-item {
        width: 50px !important;
        height: 50px !important;
        font-size: 16px !important;
        touch-action: manipulation;
    }
    
    /* ✅ AJUSTAR ENTRADAS DE SINAL */
    .entries-list {
        max-height: 250px !important;
        gap: 8px !important;
        padding: 8px 4px !important;
    }
    
    .entry-box {
        width: calc(42px * var(--icon-scale, 1)) !important;
        height: calc(42px * var(--icon-scale, 1)) !important;
        font-size: calc(18px * var(--font-scale, 1)) !important;
    }
    
    .entry-time,
    .entry-stage {
        font-size: calc(11px * var(--font-scale, 1)) !important;
    }
    
    /* ✅ AJUSTAR MODAL */
    .ai-modal {
        width: 95% !important;
        max-width: 400px !important;
        margin: 0 10px !important;
    }
    
    .ai-modal-body {
        padding: 20px !important;
    }
    
    .ai-modal-btn {
        padding: 14px 20px !important;
        font-size: 15px !important;
        min-height: 48px !important;
    }
    
    /* ✅ AJUSTAR SCROLLBAR MOBILE */
    ::-webkit-scrollbar {
        width: 6px !important;
        height: 6px !important;
    }
    
    ::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.3) !important;
    }
    
    /* ✅ AJUSTAR CONFIGURAÇÕES */
    .config-group {
        margin-bottom: 16px !important;
    }
    
    .config-label {
        font-size: 13px !important;
        margin-bottom: 8px !important;
    }
    
    /* ✅ AJUSTAR PATTERN SEARCH */
    .pattern-item {
        padding: 12px !important;
        margin-bottom: 12px !important;
    }
    
    .pattern-info {
        font-size: 13px !important;
    }
    
    .pattern-stats {
        font-size: 11px !important;
        gap: 8px !important;
    }
    
    /* ✅ MELHORAR TOQUE/CLIQUE */
    * {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
        -webkit-touch-callout: none;
    }
    
    button,
    a,
    input,
    select,
    textarea,
    label {
        -webkit-tap-highlight-color: rgba(0, 212, 255, 0.2);
    }
    
    /* ✅ PREVENIR ZOOM INDESEJADO */
    input:focus,
    select:focus,
    textarea:focus {
        font-size: 16px !important;
    }
    
    /* ✅ TOGGLE AI MODE NO MOBILE */
    .ai-mode-toggle {
        font-size: 13px !important;
        padding: 6px 10px !important;
    }
    
    .ai-mode-toggle.active {
        min-height: 80px !important;
        max-height: 80px !important;
        height: auto !important;
        overflow: hidden !important;
        gap: 0 !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════ */
/* 📱 RESPONSIVIDADE PARA TABLETS (768px - 1024px)                                 */
/* ═══════════════════════════════════════════════════════════════════════════════ */

@media only screen and (min-width: 769px) and (max-width: 1024px) {
    #blaze-double-analyzer {
        width: 350px;
        min-width: 300px;
        max-width: 600px;
        height: 650px;
        min-height: 400px;
        max-height: 95vh;
    }
    
    .analyzer-body {
        padding: 14px !important;
    }
    
    input,
    select,
    button {
        font-size: 15px !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════ */
/* 📱 ORIENTAÇÃO LANDSCAPE EM MOBILE                                                */
/* ═══════════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════════════ */
/* 📱 TELAS PEQUENAS (< 375px) - iPhones antigos, Android pequenos                */
/* ═══════════════════════════════════════════════════════════════════════════════ */
@media only screen and (max-width: 374px) {
    .analyzer-header {
        padding: 10px 6px !important;
        min-height: 45px !important;
    }
    
    .analyzer-header h3 {
        font-size: 14px !important;
    }
    
    .title-badge {
        font-size: 7px !important;
        padding: 1px 4px !important;
        margin-left: 3px !important;
    }
    
    .ai-mode-toggle {
        font-size: 10px !important;
        padding: 6px 8px !important;
    }
    
    .ai-mode-toggle.active {
        min-height: 80px !important;
        max-height: 80px !important;
        height: auto !important;
        overflow: hidden !important;
        gap: 0 !important;
    }
    
    .btn-hot-pattern,
    .btn-view-patterns,
    .btn-add-custom-pattern {
        font-size: 11px !important;
        padding: 8px 10px !important;
    }
    
    .settings-section input[type="number"] {
        width: 70px !important;
        max-width: 70px !important;
        font-size: 14px !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════ */
/* 📱 TELAS ULTRA-ALTAS (Aspect Ratio > 19:9) - Celulares modernos altos          */
/* ═══════════════════════════════════════════════════════════════════════════════ */
@media only screen and (max-width: 768px) and (min-aspect-ratio: 19/9) {
    .analyzer-body {
        padding-bottom: 80px !important;
    }
    
    .analysis-section,
    .config-section {
        margin-bottom: 20px !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════ */
/* 📱 MOBILE LANDSCAPE (< 768px em landscape) - Otimizar espaço vertical          */
/* ═══════════════════════════════════════════════════════════════════════════════ */
@media only screen and (max-width: 768px) and (orientation: landscape) {
    .analyzer-header {
        padding: 6px 8px !important;
        min-height: 40px !important;
    }
    
    .analyzer-header h3 {
        font-size: 14px !important;
    }
    
    .title-badge {
        font-size: 7px !important;
        padding: 1px 4px !important;
        margin-left: 3px !important;
    }
    
    .ai-mode-toggle {
        padding: 4px 8px !important;
        font-size: 10px !important;
    }
    
    .ai-mode-toggle.active {
        min-height: 80px !important;
        max-height: 80px !important;
        height: auto !important;
        overflow: hidden !important;
        gap: 0 !important;
    }
    
    .analyzer-body {
        height: calc(100vh - 40px) !important;
        padding: 6px !important;
    }
    
    .analysis-section,
    .status-section,
    .config-section {
        margin-bottom: 10px !important;
        padding: 8px 6px !important;
    }
    
    .settings-grid {
        gap: 8px !important;
    }
    
    .btn-hot-pattern,
    .btn-view-patterns,
    .btn-add-custom-pattern {
        padding: 8px 10px !important;
        font-size: 11px !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════ */
/* 📱 TABLETS LANDSCAPE (768px - 1024px em landscape) - 2 colunas otimizado       */
/* ═══════════════════════════════════════════════════════════════════════════════ */
@media only screen and (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    #blaze-double-analyzer {
        width: 600px;
        min-width: 400px;
        max-width: 45vw;
    }
    
    .settings-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px 20px !important;
    }
    
    .analyzer-body {
        padding: 12px 16px !important;
    }
}
/* ═══════════════════════════════════════════════════════════════════════════════ */
/* 🎯 MODAL DE PADRÕES CUSTOMIZADOS (NÍVEL DIAMANTE)                               */
/* ═══════════════════════════════════════════════════════════════════════════════ */

/* Modal overlay */
.custom-pattern-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
}

.custom-pattern-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
}

/* Modal content - MINIMALISTA E COMPACTO */
.custom-pattern-modal-content {
    position: fixed;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    max-width: 420px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.2s ease-out;
    z-index: 1000000;
    /* Fallback: centralizar caso JS não execute */
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal header - COMPACTO */
.custom-pattern-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.custom-pattern-modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: bold;
    font-family: var(--font-primary);
}

.custom-pattern-modal-close {
    background: transparent;
    border: none;
    color: #888;
    width: 24px;
    height: 24px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.custom-pattern-modal-close:hover {
    color: #ff6666;
}

/* Modal body - COMPACTO */
.custom-pattern-modal-body {
    padding: 16px;
}

.custom-pattern-modal-body .diamond-level-title {
    font-size: 11px;
    font-weight: 600;
    color: #00d4ff;
    margin-bottom: 4px;
    display: block;
}

.custom-pattern-modal-body .diamond-level-note {
    font-size: 10px;
    font-weight: 400;
    color: #c8d6e9;
    line-height: 1.35;
    margin: 4px 0;
}

.custom-pattern-modal-body .diamond-level-subnote {
    font-size: 10px;
    font-weight: 400;
    color: #c8d6e9;
}

.custom-pattern-field {
    margin-bottom: 16px;
}

.custom-pattern-label {
    display: block;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: normal;
    margin-bottom: 8px;
    font-family: var(--font-primary);
}

.custom-pattern-input {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-primary);
    transition: all 0.2s;
}

.custom-pattern-input:focus {
    outline: none;
    border-color: var(--border-color);
}

/* Sequência de cores - MINIMALISTA */
.custom-pattern-sequence {
    min-height: 50px;
    padding: 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.custom-pattern-sequence:empty::before {
    content: 'Clique em "Adicionar Cor"';
    color: #555;
    font-size: 11px;
    font-style: italic;
}

/* Item de cor na sequência - APENAS CÍRCULO PEQUENO */
.sequence-color-item {
    position: relative;
    display: inline-block;
    cursor: pointer;
    transition: all 0.2s;
}

.sequence-color-item::after {
    content: '✕';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

.sequence-color-item:hover::after {
    opacity: 1;
}

.sequence-color-item:hover {
    opacity: 0.7;
}

/* Círculo pequeno de cor */
.spin-color-circle-small {
    display: block;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.spin-color-circle-small.red {
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
    border-color: #ff0000;
}

.spin-color-circle-small.black {
    background: linear-gradient(135deg, #2a2a2a 0%, #0a0a0a 100%);
    border-color: #444;
}

.spin-color-circle-small.white {
    background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 100%);
    border-color: #ccc;
}

/* Botão adicionar cor - SIMPLES */
.btn-add-color {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-primary);
}

.btn-add-color:hover {
    background: var(--bg-secondary);
}

/* Color picker popup - SIMPLES */
.color-picker-popup {
    display: flex;
    gap: 8px;
    padding: 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-top: 8px;
}

/* Seleção de cor anterior - CONTRASTE FORTE */
.custom-pattern-before-colors {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.color-radio-label {
    cursor: pointer;
}

.color-radio {
    display: none;
}

/* NÃO SELECIONADO - MUITO APAGADO */
.color-radio-btn {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.2s;
    border: 1px solid #222;
    background: #0a0f14;
    color: #555;
    opacity: 0.5;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

/* SELECIONADO - DESTAQUE FORTE */
.color-radio:checked + .color-radio-btn {
    border: 2px solid #00aa66;
    background: #1a2e22;
    color: #fff;
    opacity: 1;
    font-weight: bold;
}

.color-radio-btn:hover {
    opacity: 0.7;
}

/* Modal footer - COMPACTO */
.custom-pattern-modal-footer {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.btn-save-pattern,
.btn-cancel-pattern {
    flex: 1;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-primary);
}

.btn-save-pattern {
    background: var(--red-primary);
    border: 1px solid var(--red-primary);
    color: var(--text-primary);
}

.btn-save-pattern:hover {
    background: #dc2626;
}

.btn-cancel-pattern {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-cancel-pattern:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════════════════════════ */
/* 🎯 TOAST NOTIFICATION                                                            */
/* ═══════════════════════════════════════════════════════════════════════════════ */

.custom-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #00aa66;
    color: #fff;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    z-index: 999999999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: all 0.3s ease;
}

.custom-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ═══════════════════════════════════════════════════════════════════════════════ */
/* 🎯 BOTÕES DE MODELOS CUSTOMIZADOS                                               */
/* ═══════════════════════════════════════════════════════════════════════════════ */

.btn-view-patterns {
    padding: 8px 14px;
    background: #1a2e3e;
    border: 1px solid #ef4444;
    border-radius: 6px;
    color: #ef4444;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.btn-view-patterns:hover {
    background: #ef4444;
    color: #ffffff;
}

.btn-add-custom-pattern {
    padding: 8px 14px;
    background: #ef4444;
    border: 1px solid #dc2626;
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.btn-add-custom-pattern:hover {
    background: #dc2626;
}

.btn-hot-pattern {
    padding: 8px 14px;
    background: #1a2e3e;
    border: 1px solid #ef4444;
    border-radius: 6px;
    color: #ef4444;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    position: relative;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-hot-pattern:hover {
    background: #ef4444;
    color: #ffffff;
}

.btn-hot-pattern.active {
    background: #1a2e3e;
    color: #ef4444;
    border: 1px solid #ef4444;
    box-shadow: none;
}

@keyframes pulse-hot {
    0%, 100% {
        box-shadow: 0 0 15px rgba(255, 107, 53, 0.5);
    }
    50% {
        box-shadow: 0 0 25px rgba(255, 107, 53, 0.8);
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════ */
/* 🎯 MODAL DE VISUALIZAÇÃO DE PADRÕES                                             */
/* ═══════════════════════════════════════════════════════════════════════════════ */

.view-pattern-item {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    background: #0a0f14;
    border: 1px solid #333;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.3s;
}

.view-pattern-item:hover {
    background: #101520;
    border-color: #00d4ff;
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.2);
    transform: translateX(2px);
}

.view-pattern-name {
    color: rgba(255, 255, 255, 0.95);
    font-size: 13px;
    font-weight: bold;
    padding-right: 30px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.view-pattern-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.view-pattern-sequence {
    display: inline-flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
}

.view-pattern-before {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #888;
    font-size: 10px;
    white-space: nowrap;
}

.view-pattern-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: #ff6666;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: all 0.2s;
    opacity: 0.6;
}

.view-pattern-remove:hover {
    opacity: 1;
    transform: scale(1.2);
}

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

.custom-pattern-item {
    background: #0a0f14;
    border: 1px solid #00d4ff33;
    border-radius: 8px;
    padding: 12px;
    transition: all 0.2s;
}

.custom-pattern-item:hover {
    border-color: #00d4ff;
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.2);
}

.pattern-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.pattern-item-name {
    color: #00ff88;
    font-size: 13px;
    font-weight: bold;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.btn-remove-pattern {
    padding: 6px 10px;
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid #ff0000;
    border-radius: 4px;
    color: #ff6666;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.btn-remove-pattern:hover {
    background: rgba(255, 0, 0, 0.4);
    transform: scale(1.05);
}

.pattern-item-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pattern-item-sequence {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #ccc;
}

.pattern-list-color {
    font-size: 16px;
}

.pattern-item-before {
    color: #888;
    font-size: 11px;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.no-custom-patterns {
    padding: 20px;
    text-align: center;
    background: #0a0f14;
    border: 1px dashed #00d4ff33;
    border-radius: 8px;
}

/* Mobile responsiveness for modal */
@media only screen and (max-width: 768px) {
    .custom-pattern-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .custom-pattern-before-colors {
        flex-direction: column;
    }
    
    .custom-pattern-modal-footer {
        flex-direction: column;
    }
    
    .btn-save-pattern,
    .btn-cancel-pattern {
        width: 100%;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════ */
/* 🎨 QUADRADINHOS DE COR (ESTILO DO HISTÓRICO DE GIROS)                          */
/* ═══════════════════════════════════════════════════════════════════════════════ */

.spin-color-circle {
    display: inline-block;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
}

.spin-color-circle.red {
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
    border-color: #ff0000;
}

.spin-color-circle.black {
    background: linear-gradient(135deg, #2a2a2a 0%, #0a0a0a 100%);
    border-color: #444;
}

.spin-color-circle.white {
    background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 100%);
    border-color: #ccc;
}

/* Cor anterior - círculos com "ou" */
.color-circle {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    vertical-align: middle;
}

.color-circle.red {
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
    border-color: #ff0000;
}

.color-circle.black {
    background: linear-gradient(135deg, #2a2a2a 0%, #0a0a0a 100%);
    border-color: #444;
}

.color-circle.white {
    background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 100%);
    border-color: #ccc;
}

.or-text {
    display: inline-block;
    margin: 0 4px;
    color: #666;
    font-size: 10px;
    vertical-align: middle;
}

.or-text-small {
    display: inline;
    margin: 0 3px;
    color: #666;
    font-size: 9px;
}

.arrow-separator {
    display: inline;
    margin: 0 4px;
    color: #666;
    font-size: 12px;
}

/* Color picker popup - botões visuais MINIMALISTA */
.color-choice-visual {
    background: transparent;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 4px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-choice-visual:hover {
    border-color: #555;
    transform: scale(1.05);
}

.color-choice-visual .spin-color-circle {
    width: 26px;
    height: 26px;
}

/* Botões de opção de cor anterior - MINIMALISTA */
.color-radio-btn.red-white,
.color-radio-btn.black-white {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Mobile responsiveness */
@media only screen and (max-width: 768px) {
    .custom-pattern-modal-content {
        max-width: 95%;
    }
    
    .spin-color-circle,
    .spin-color-circle-small {
        width: 22px;
        height: 22px;
    }
    
    .color-circle {
        width: 20px;
        height: 20px;
    }
    
    .color-choice-visual .spin-color-circle {
        width: 24px;
        height: 24px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════ */
/* ⚙️ MODAL - CONFIGURAÇÃO DOS NÍVEIS DIAMANTE                                      */
/* ═══════════════════════════════════════════════════════════════════════════════ */
#diamondLevelsModal .custom-pattern-modal-content {
    width: calc(100% - 32px);
    max-width: 420px;
    margin: 0 auto;
    background: #182534;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-sizing: border-box;
}

#diamondLevelsModal .custom-pattern-modal-header {
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

#diamondLevelsModal .custom-pattern-modal-header h3 {
    flex: 1;
    text-align: left;
}

#diamondLevelsModal .custom-pattern-modal-close {
    width: auto;
    height: auto;
    font-size: 13px;
    color: #9fb3c9;
    border: 1px solid rgba(159, 179, 201, 0.35);
    border-radius: 6px;
    padding: 6px 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

#diamondLevelsModal .custom-pattern-modal-close:hover {
    color: #ffffff;
    border-color: rgba(239, 68, 68, 0.55);
    background: rgba(239, 68, 68, 0.25);
}

#diamondLevelsModal .custom-pattern-modal-body {
    max-height: 360px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0;
    margin: 0 -4px;
    padding-right: 4px;
}

#diamondLevelsModal .custom-pattern-modal-footer {
    padding: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

#diamondLevelsModal .custom-pattern-modal-footer button:last-child {
    margin-left: auto;
}

.diamond-level-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.diamond-level-field label {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
}

#diamondLevelsModal input[type='number'] {
    background: #0f1f2a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 10px 12px;
    height: 44px;
    color: #ffffff;
    font-size: 13px;
    transition: border 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

#diamondLevelsModal input[type='number']:focus {
    border-color: rgba(255, 0, 63, 0.45);
    box-shadow: 0 0 0 2px rgba(255, 0, 63, 0.18);
    outline: none;
}

.diamond-level-double {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.diamond-level-double div {
    flex: 1;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.diamond-level-double span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
}

#diamondLevelsModal button.btn-hot-pattern,
#diamondLevelsModal .btn-secondary {
    min-width: 120px;
}

#diamondLevelsModal .btn-hot-pattern {
    border-radius: 8px;
}

@media (max-width: 460px) {
    #diamondLevelsModal .custom-pattern-modal-content {
        padding: 20px;
    }

    .diamond-level-double div {
        min-width: 100%;
    }
}

#customPatternsContainer .hot-pattern-actions {
    width: 100%;
    display: flex;
    gap: 12px;
}

#customPatternsContainer .hot-pattern-actions button {
    flex: 1;
    min-width: 0;
}

.btn-diamond-levels {
    border-color: rgba(239, 68, 68, 0.6);
    background: linear-gradient(135deg, #1a2e3e 0%, #122238 100%);
    color: #ffffff;
}

.btn-diamond-levels:hover {
    background: linear-gradient(135deg, #ef4444 0%, #d13434 100%);
    color: #ffffff;
}

@media (max-width: 420px) {
    #customPatternsContainer .hot-pattern-actions {
        flex-direction: column;
    }
}
#diamondLevelsModal .custom-pattern-modal-content {
    width: calc(100% - 32px);
    max-width: 420px;
    margin: 0 auto;
    background: #182534;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

#diamondLevelsModal .custom-pattern-modal-header {
    border: none;
    padding: 0;
}

#diamondLevelsModal .custom-pattern-modal-body {
    max-height: 360px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-right: 4px;
}

#diamondLevelsModal .custom-pattern-modal-footer {
    padding: 0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.diamond-level-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.diamond-level-field label {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
}

#diamondLevelsModal input[type='number'] {
    background: #0f1f2a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 10px 12px;
    color: #ffffff;
    font-size: 13px;
    transition: border 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
}

#diamondLevelsModal input[type='number']:focus {
    border-color: rgba(255, 0, 63, 0.45);
    box-shadow: 0 0 0 2px rgba(255, 0, 63, 0.18);
    outline: none;
}

.diamond-level-double {
    display: flex;
    gap: 12px;
}

.diamond-level-double div {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.diamond-level-double span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
}

#diamondLevelsModal button.btn-hot-pattern,
#diamondLevelsModal .btn-secondary {
    min-width: 120px;
}

#diamondLevelsModal .btn-hot-pattern {
    border-radius: 8px;
}

@media (max-width: 460px) {
    #diamondLevelsModal .custom-pattern-modal-content {
        padding: 20px;
    }
}

#customPatternsContainer .hot-pattern-actions {
    width: 100%;
    display: flex;
    gap: 12px;
}

#customPatternsContainer .hot-pattern-actions button {
    flex: 1;
    min-width: 0;
}

.btn-diamond-levels {
    border-color: rgba(239, 68, 68, 0.6);
    background: linear-gradient(135deg, #1a2e3e 0%, #122238 100%);
    color: #ffffff;
}

.btn-diamond-levels:hover {
    background: linear-gradient(135deg, #ef4444 0%, #d13434 100%);
    color: #ffffff;
}

@media (max-width: 420px) {
    #customPatternsContainer .hot-pattern-actions {
        flex-direction: column;
    }
}
