:root {
      --bg-gradient: linear-gradient(135deg, #0b0f19 0%, #111827 100%);
      --card-bg: rgba(17, 24, 39, 0.75);
      --card-border: rgba(255, 255, 255, 0.08);

      /* Theme colors (will be updated dynamically by JS) */
      --primary: #8b5cf6;
      /* Lotofácil Violet by default */
      --primary-hover: #a78bfa;
      --primary-glow: rgba(139, 92, 246, 0.2);

      --accent: #f59e0b;
      /* Amber/Gold */
      --accent-hover: #fbbf24;
      --text-main: #f3f4f6;
      --text-muted: #9ca3af;
      --bg-input: #1f2937;
      --border-input: #374151;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      font-family: 'Plus Jakarta Sans', sans-serif;
    }

    body {
      background: var(--bg-gradient);
      color: var(--text-main);
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      padding: 2rem 1.5rem;
      overflow-x: hidden;
      transition: background-color 0.3s ease;
    }

    /* Container */
    .container {
      max-width: 1400px;
      margin: 0 auto;
      width: 100%;
      max-width: 100%;
      overflow-x: hidden;
      display: flex;
      flex-direction: column;
      gap: 2rem;
    }

    /* Header */
    header {
      display: flex;
      flex-direction: column;
      gap: 0.85rem;
      padding-bottom: 1.25rem;
      border-bottom: 1px solid var(--card-border);
    }

    @media (min-width: 768px) {
      header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
      }
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      min-width: 0;
    }

    .brand-title {
      min-width: 0;
      overflow: hidden;
    }

    .brand-logo {
      width: 52px;
      height: 52px;
      background: linear-gradient(135deg, #107c41 0%, #1f9a55 100%);
      border-radius: 14px;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 8px 20px rgba(16, 124, 65, 0.3);
      transition: background 0.3s, box-shadow 0.3s;
    }

    .brand-title h1 {
      font-family: 'Outfit', sans-serif;
      font-size: 1.75rem;
      font-weight: 700;
      background: linear-gradient(to right, #ffffff, var(--primary));
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      transition: background 0.3s;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .brand-title p {
      font-size: 0.875rem;
      color: var(--text-muted);
      margin-top: 0.1rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    /* Modality Tabs Selector */
    .modality-selector {
      display: flex;
      flex-wrap: wrap;
      background: rgba(31, 41, 55, 0.6);
      padding: 0.35rem;
      border-radius: 14px;
      border: 1px solid var(--card-border);
      gap: 0.25rem;
    }

    .tab-btn {
      padding: 0.6rem 1.2rem;
      border-radius: 10px;
      border: none;
      background: transparent;
      color: var(--text-muted);
      font-weight: 700;
      font-size: 0.85rem;
      cursor: pointer;
      white-space: nowrap;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .tab-btn:hover {
      color: var(--text-main);
      background: rgba(255, 255, 255, 0.03);
    }

    .tab-btn.active {
      color: #fff;
      background: var(--primary);
      box-shadow: 0 4px 12px var(--primary-glow);
    }

    /* Main Grid Layout */
    .dashboard-grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 2rem;
      min-width: 0;
      overflow: hidden;
    }

    @media (min-width: 1024px) {
      .dashboard-grid {
        grid-template-columns: 1fr 1fr;
        overflow: visible;
      }
    }

    /* Cards */
    .card {
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      border-radius: 20px;
      padding: 2rem;
      backdrop-filter: blur(16px);
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
      transition: transform 0.3s ease, border-color 0.3s ease;
      display: flex;
      flex-direction: column;
      gap: 1.5rem;
      min-width: 0;
      overflow: hidden;
    }

    .card:hover {
      border-color: rgba(255, 255, 255, 0.12);
    }

    .card-title {
      font-family: 'Outfit', sans-serif;
      font-size: 1.3rem;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 0.75rem;
      color: #ffffff;
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
      padding-bottom: 1rem;
    }

    .card-title svg {
      width: 22px;
      height: 22px;
      color: var(--primary);
    }

    /* Drag & Drop Area */
    .dropzone {
      border: 2px dashed var(--border-input);
      border-radius: 14px;
      padding: 2.5rem 1.5rem;
      text-align: center;
      cursor: pointer;
      transition: all 0.3s ease;
      background: rgba(31, 41, 55, 0.3);
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 1rem;
    }

    .dropzone:hover,
    .dropzone.dragover {
      border-color: var(--primary);
      background: rgba(139, 92, 246, 0.04);
    }

    .dropzone svg {
      width: 44px;
      height: 44px;
      color: var(--text-muted);
      transition: color 0.3s ease, transform 0.3s ease;
    }

    .dropzone:hover svg {
      color: var(--primary);
      transform: translateY(-4px);
    }

    .dropzone p {
      font-size: 0.9rem;
      color: var(--text-muted);
    }

    .dropzone span {
      color: var(--text-main);
      font-weight: 600;
      text-decoration: underline;
    }

    /* Base Numbers Grid */
    .base-numbers-container {
      display: flex;
      flex-direction: column;
      gap: 1rem;
    }

    .section-desc {
      font-size: 0.85rem;
      color: var(--text-muted);
      line-height: 1.5;
    }

    .dezenas-wrapper {
      max-height: 250px;
      overflow-y: auto;
      padding-right: 0.5rem;
      border: 1px solid rgba(255, 255, 255, 0.05);
      border-radius: 12px;
      background: rgba(0, 0, 0, 0.15);
      padding: 1rem;
      width: 100%;
      max-width: 100%;
    }

    .dezenas-grid {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 0.5rem;
    }

    @media (min-width: 400px) {
      .dezenas-grid {
        grid-template-columns: repeat(6, 1fr);
      }
    }

    @media (min-width: 480px) {
      .dezenas-grid {
        grid-template-columns: repeat(8, 1fr);
      }
    }

    @media (min-width: 600px) {
      .dezenas-grid {
        grid-template-columns: repeat(10, 1fr);
      }
    }

    @media (min-width: 1024px) {
      .dezenas-grid {
        grid-template-columns: repeat(6, 1fr);
      }
    }

    @media (min-width: 1200px) {
      .dezenas-grid {
        grid-template-columns: repeat(8, 1fr);
      }
    }

    @media (min-width: 1350px) {
      .dezenas-grid {
        grid-template-columns: repeat(10, 1fr);
      }
    }

    .dezena-input-group {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0.2rem;
      background: rgba(31, 41, 55, 0.4);
      padding: 0.4rem 0.2rem;
      border-radius: 8px;
      border: 1px solid var(--card-border);
    }

    .dezena-label {
      font-size: 0.65rem;
      font-weight: 700;
      color: var(--text-muted);
    }

    .dezena-input {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      border: 2px solid var(--border-input);
      background: var(--bg-input);
      color: #fff;
      text-align: center;
      font-size: 0.95rem;
      font-weight: 700;
      outline: none;
      transition: all 0.2s ease;
    }

    .dezena-input:focus {
      border-color: var(--primary);
      box-shadow: 0 0 8px var(--primary-glow);
      transform: scale(1.05);
    }

    /* Actions Panel */
    .actions-panel {
      display: flex;
      flex-direction: column;
      gap: 1rem;
    }

    .btn {
      width: 100%;
      padding: 0.9rem 1.25rem;
      border-radius: 12px;
      border: none;
      font-size: 0.95rem;
      font-weight: 700;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.75rem;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      min-width: 0;
    }

    .btn-primary {
      background: linear-gradient(135deg, var(--primary) 0%, rgba(0, 0, 0, 0.2) 100%);
      color: white;
    }

    .btn-primary:hover:not(:disabled) {
      filter: brightness(1.15);
      box-shadow: 0 8px 24px var(--primary-glow);
      transform: translateY(-2px);
    }

    .btn-primary:disabled {
      background: #374151;
      color: #6b7280;
      cursor: not-allowed;
      box-shadow: none;
    }

    .btn-secondary {
      background: rgba(31, 41, 55, 0.8);
      border: 1px solid var(--border-input);
      color: var(--text-main);
    }

    .btn-secondary:hover {
      background: rgba(55, 65, 81, 0.8);
      border-color: var(--text-muted);
    }

    /* Result Checker Card */
    .checker-results {
      background: rgba(31, 41, 55, 0.2);
      border-radius: 12px;
      padding: 1rem;
      border: 1px solid rgba(255, 255, 255, 0.05);
      display: flex;
      flex-direction: column;
      gap: 0.75rem;
    }

    .checker-grid-title {
      font-size: 0.85rem;
      font-weight: 700;
      color: var(--accent);
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }

    .checker-inputs-wrapper {
      max-height: 250px;
      overflow-y: auto;
      padding-right: 0.25rem;
      width: 100%;
      max-width: 100%;
    }

    .checker-inputs {
      display: grid;
      grid-template-columns: repeat(6, 1fr);
      gap: 0.4rem;
    }

    @media (min-width: 480px) {
      .checker-inputs {
        grid-template-columns: repeat(8, 1fr);
      }
    }

    @media (min-width: 600px) {
      .checker-inputs {
        grid-template-columns: repeat(10, 1fr);
      }
    }

    @media (min-width: 1024px) {
      .checker-inputs {
        grid-template-columns: repeat(6, 1fr);
      }
    }

    @media (min-width: 1200px) {
      .checker-inputs {
        grid-template-columns: repeat(8, 1fr);
      }
    }

    @media (min-width: 1350px) {
      .checker-inputs {
        grid-template-columns: repeat(10, 1fr);
      }
    }

    .checker-input {
      width: 100%;
      aspect-ratio: 1;
      border-radius: 50%;
      border: 1px solid var(--border-input);
      background: rgba(17, 24, 39, 0.8);
      color: var(--accent);
      text-align: center;
      font-size: 0.9rem;
      font-weight: 700;
      outline: none;
      transition: all 0.2s ease;
    }

    .checker-input:focus {
      border-color: var(--accent);
      box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
    }

    /* Summary Stats Grid */
    .stats-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 0.75rem;
    }

    @media (min-width: 600px) {
      .stats-grid {
        grid-template-columns: repeat(3, 1fr);
      }
    }

    @media (min-width: 1200px) {
      .stats-grid {
        grid-template-columns: repeat(4, 1fr);
      }
    }

    .stat-box {
      background: rgba(17, 24, 39, 0.9);
      border: 1px solid var(--card-border);
      border-radius: 12px;
      padding: 0.75rem;
      text-align: center;
      min-width: 0;
      word-wrap: break-word;
    }

    .stat-val {
      font-size: 1.2rem;
      font-weight: 800;
      color: #fff;
      font-family: 'Outfit', sans-serif;
    }

    .stat-val.win {
      color: var(--primary);
    }

    .stat-lbl {
      font-size: 0.65rem;
      color: var(--text-muted);
      font-weight: 600;
      margin-top: 0.25rem;
      text-transform: uppercase;
    }

    /* Preview Table Area */
    .preview-section {
      grid-column: 1 / -1;
      display: flex;
      flex-direction: column;
      gap: 1rem;
      min-width: 0;
      overflow: hidden;
    }

    .preview-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 0.5rem;
    }

    .table-container {
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      border-radius: 16px;
      overflow-x: auto;
      max-height: 450px;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
      width: 100%;
      max-width: 100%;
    }

    table {
      width: 100%;
      min-width: max-content;
      border-collapse: collapse;
      text-align: left;
      font-size: 0.85rem;
    }

    th {
      background: rgba(31, 41, 55, 0.8);
      color: var(--text-main);
      padding: 0.75rem 0.9rem;
      font-weight: 700;
      font-size: 0.75rem;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      border-bottom: 2px solid var(--card-border);
      position: sticky;
      top: 0;
      z-index: 10;
      text-align: center;
    }

    th:first-child {
      text-align: left;
      position: sticky;
      left: 0;
      background: rgba(31, 41, 55, 1);
      z-index: 11;
    }

    td {
      padding: 0.5rem 0.75rem;
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
      color: var(--text-main);
      text-align: center;
      white-space: nowrap;
    }

    td:first-child {
      text-align: left;
      font-weight: 600;
      color: var(--text-muted);
      position: sticky;
      left: 0;
      background: #111827;
      z-index: 5;
      border-right: 1px solid var(--card-border);
    }

    tr:hover td {
      background-color: rgba(255, 255, 255, 0.02);
    }

    tr:hover td:first-child {
      background-color: #161e2e;
    }

    .num-ball {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 26px;
      height: 26px;
      border-radius: 50%;
      background: rgba(31, 41, 55, 0.6);
      border: 1px solid var(--border-input);
      font-size: 0.8rem;
      font-weight: 700;
      color: var(--text-main);
      transition: all 0.2s ease;
    }

    .num-ball.matched {
      background: var(--primary);
      border-color: var(--primary-hover);
      box-shadow: 0 0 6px var(--primary-glow);
      color: #fff;
    }

    .formula-badge {
      font-family: monospace;
      font-size: 0.65rem;
      color: var(--text-muted);
      background: rgba(255, 255, 255, 0.04);
      padding: 0.05rem 0.25rem;
      border-radius: 4px;
      display: block;
      margin-top: 0.2rem;
    }

    .badge-hits {
      padding: 0.25rem 0.5rem;
      border-radius: 6px;
      font-weight: 800;
      font-size: 0.8rem;
    }

    .badge-hits.win {
      background: rgba(16, 185, 129, 0.15);
      border: 1px solid rgba(16, 185, 129, 0.2);
      color: #34d399;
    }

    .badge-hits.loss {
      background: rgba(255, 255, 255, 0.04);
      color: var(--text-muted);
    }

    /* Modal for Guide */
    .modal-overlay {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.85);
      backdrop-filter: blur(8px);
      z-index: 1000;
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.3s ease;
      padding: 1rem;
    }

    .modal-overlay.active {
      opacity: 1;
      pointer-events: auto;
    }

    .modal {
      background: #111827;
      border: 1px solid var(--card-border);
      border-radius: 20px;
      max-width: 650px;
      width: 100%;
      padding: 2rem;
      box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
      display: flex;
      flex-direction: column;
      gap: 1.5rem;
      transform: translateY(20px);
      transition: transform 0.3s ease;
    }

    .modal-overlay.active .modal {
      transform: translateY(0);
    }

    .modal-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
      padding-bottom: 1rem;
    }

    .modal-title {
      font-family: 'Outfit', sans-serif;
      font-size: 1.25rem;
      font-weight: 700;
      color: #fff;
    }

    .btn-close {
      background: none;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      font-size: 1.5rem;
    }

    .modal-body {
      font-size: 0.9rem;
      color: var(--text-muted);
      line-height: 1.6;
      display: flex;
      flex-direction: column;
      gap: 1rem;
      max-height: 400px;
      overflow-y: auto;
    }

    .modal-body strong {
      color: #fff;
    }

    .step-list {
      display: flex;
      flex-direction: column;
      gap: 0.6rem;
      margin-left: 1rem;
    }

    .step-item {
      list-style-type: decimal;
    }

    /* Helper styles */
    .hidden {
      display: none !important;
    }

    .flex-row {
      display: flex;
      gap: 1rem;
      align-items: center;
      width: 100%;
    }

    .flex-grow {
      flex-grow: 1;
    }

    /* File loaded banner */
    .file-loaded-banner {
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: rgba(16, 185, 129, 0.08);
      border: 1px solid rgba(16, 185, 129, 0.2);
      border-radius: 12px;
      padding: 1rem;
      width: 100%;
      min-width: 0;
      gap: 0.5rem;
      overflow: hidden;
    }

    .file-details {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      min-width: 0;
      flex: 1;
      overflow: hidden;
    }

    .file-details svg {
      color: var(--primary);
      width: 26px;
      height: 26px;
    }

    .file-name {
      font-weight: 600;
      font-size: 0.9rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      min-width: 0;
    }

    .file-meta {
      font-size: 0.75rem;
      color: var(--text-muted);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      min-width: 0;
    }

    .btn-remove-file {
      background: none;
      border: none;
      color: #ef4444;
      cursor: pointer;
      padding: 0.25rem;
      border-radius: 6px;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background 0.2s;
    }

    .btn-remove-file:hover {
      background: rgba(239, 68, 68, 0.1);
    }

    .info-box {
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid var(--card-border);
      border-radius: 12px;
      padding: 1rem;
      font-size: 0.85rem;
      color: var(--text-muted);
      line-height: 1.5;
    }

    /* Duplicate inputs styling */
    .dezena-input.is-duplicate,
    .checker-input.is-duplicate {
      background: rgba(239, 68, 68, 0.25) !important;
      border-color: #ef4444 !important;
      color: #ef4444 !important;
      font-weight: bold;
      animation: pulse-border-red 1.5s infinite;
    }

    @keyframes pulse-border-red {
      0% { box-shadow: 0 0 0 0px rgba(239, 68, 68, 0.4); }
      70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
      100% { box-shadow: 0 0 0 0px rgba(239, 68, 68, 0); }
    }

    /* Login Overlay Styles */
    .login-overlay {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(11, 15, 25, 0.85);
      backdrop-filter: blur(20px);
      z-index: 9999;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 1.5rem;
      transition: opacity 0.4s ease, transform 0.4s ease;
    }

    .login-overlay.hidden {
      opacity: 0;
      pointer-events: none;
      transform: scale(0.95);
    }

    .login-card {
      background: rgba(17, 24, 39, 0.8);
      border: 1px solid var(--card-border);
      border-radius: 24px;
      padding: 2.5rem 3rem;
      max-width: 520px;
      width: 100%;
      box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 1.25rem;
      text-align: center;
    }

    .login-logo {
      width: 68px;
      height: 68px;
      background: linear-gradient(135deg, #107c41 0%, #1f9a55 100%);
      border-radius: 18px;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 10px 25px rgba(16, 124, 65, 0.4);
      margin-bottom: 0.5rem;
    }

    .login-title {
      font-family: 'Outfit', sans-serif;
      font-size: 1.5rem;
      font-weight: 700;
      color: #fff;
    }

    .login-subtitle {
      font-size: 0.875rem;
      color: var(--text-muted);
      margin-top: -0.5rem;
    }

    .login-tabs {
      display: flex;
      width: 100%;
      background: rgba(31, 41, 55, 0.6);
      padding: 0.3rem;
      border-radius: 12px;
      border: 1px solid var(--card-border);
      gap: 0.2rem;
      margin-top: 0.5rem;
      margin-bottom: 0.5rem;
    }

    .login-tab-btn {
      flex: 1;
      padding: 0.55rem;
      border-radius: 9px;
      border: none;
      background: transparent;
      color: var(--text-muted);
      font-weight: 600;
      font-size: 0.85rem;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .login-tab-btn.active {
      color: #fff;
      background: #107c41;
      box-shadow: 0 4px 10px rgba(16, 124, 65, 0.2);
    }

    .login-input-group {
      width: 100%;
      text-align: left;
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
      margin-bottom: 0.75rem;
    }

    .login-input-group label {
      font-size: 0.8rem;
      font-weight: 600;
      color: var(--text-muted);
    }

    #login-form {
      width: 100%;
    }

    .login-input-group input {
      width: 100%;
      padding: 1rem 1.15rem;
      border-radius: 10px;
      border: 1px solid var(--border-input);
      background: var(--bg-input);
      color: #fff;
      outline: none;
      font-size: 1rem;
      transition: border-color 0.2s, box-shadow 0.2s;
      box-sizing: border-box;
    }

    .login-input-group input:focus {
      border-color: #107c41;
      box-shadow: 0 0 0 2px rgba(16, 124, 65, 0.25);
    }

    .login-error-msg {
      width: 100%;
      padding: 0.75rem;
      background: rgba(239, 68, 68, 0.15);
      border: 1px solid rgba(239, 68, 68, 0.25);
      color: #fca5a5;
      border-radius: 10px;
      font-size: 0.8rem;
      text-align: left;
      line-height: 1.4;
    }

    /* Generator Virtual Grid */
    .gen-grid {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 0.35rem;
      max-height: 250px;
      overflow-y: auto;
      padding-right: 0.25rem;
    }

    @media (min-width: 480px) { .gen-grid { grid-template-columns: repeat(8, 1fr); } }
    @media (min-width: 600px) { .gen-grid { grid-template-columns: repeat(10, 1fr); } }

    .gen-btn {
      width: 100%;
      aspect-ratio: 1;
      border-radius: 6px;
      background: rgba(31, 41, 55, 0.6);
      border: 1px solid var(--border-input);
      color: var(--text-muted);
      font-size: 0.85rem;
      font-weight: 700;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.2s;
    }
    .gen-btn:hover {
      background: rgba(55, 65, 81, 0.8);
      color: #fff;
    }
    
    .gen-btn-selected {
      background: var(--primary);
      border-color: var(--primary-hover);
      color: #fff;
      box-shadow: 0 0 6px var(--primary-glow);
    }
    
    .gen-btn-fixed {
      background: #fbbf24;
      border-color: #f59e0b;
      color: #000;
      box-shadow: 0 0 6px rgba(251, 191, 36, 0.4);
    }

    /* Session ribbon: flex-wrap para não overflow */
    #user-session-ribbon {
      flex-wrap: wrap;
    }

    /* =============================================
       RESPONSIVIDADE MOBILE — Completa e Segura
       ============================================= */

    /* Tablets e celulares grandes (max 768px) */
    @media (max-width: 768px) {
      body {
        padding: 0.85rem 0.75rem;
      }

      .container {
        gap: 1.25rem;
      }

      /* Botões gerais: fonte menor para caber */
      .btn {
        font-size: 0.82rem;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
      }

      /* Botão gerar planilha: ícone menor */
      #btn-generate-excel svg {
        width: 16px !important;
        height: 16px !important;
      }

      /* Header: logo + título menores */
      .brand-logo {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        flex-shrink: 0;
      }
      .brand-logo svg {
        width: 24px !important;
        height: 24px !important;
      }
      .brand-title h1 {
        font-size: 1.15rem;
      }
      .brand-title p {
        font-size: 0.72rem;
      }

      /* Tabs: envolvem (wrap) e ficam compactas */
      .modality-selector {
        flex-wrap: wrap;
        gap: 0.2rem;
      }
      .tab-btn {
        padding: 0.45rem 0.75rem;
        font-size: 0.75rem;
        gap: 0.3rem;
        border-radius: 8px;
      }
      .tab-btn span {
        width: 7px !important;
        height: 7px !important;
      }

      /* Cards com menos padding */
      .card {
        padding: 1rem;
        gap: 1rem;
        border-radius: 14px;
      }
      .card-title {
        font-size: 1.05rem;
        padding-bottom: 0.75rem;
      }

      /* Login card */
      .login-card {
        padding: 1.5rem 1.25rem;
        gap: 1rem;
        border-radius: 18px;
      }

      /* Inputs inline: empilhar em coluna */
      .responsive-flex-row {
        flex-direction: column !important;
        gap: 0.6rem !important;
        margin-top: 0.85rem !important;
        margin-bottom: 0.85rem !important;
      }
      .responsive-flex-row > div {
        flex: 1 1 auto !important;
        width: 100% !important;
        min-width: 0 !important;
      }

      /* Botões Instruções + VIP: empilhados */
      .actions-panel .flex-row-stack-mobile {
        flex-direction: column !important;
        gap: 0.5rem !important;
      }
      .actions-panel .flex-row-stack-mobile > button {
        width: 100% !important;
        flex: none !important;
      }

      /* Dezenas grid: mais colunas em telas médias */
      .dezenas-grid {
        grid-template-columns: repeat(6, 1fr) !important;
      }
      .dezenas-wrapper {
        max-height: 200px;
        padding: 0.75rem;
      }
      .dezena-input {
        width: 30px;
        height: 30px;
        font-size: 0.82rem;
      }
      .dezena-label {
        font-size: 0.58rem;
      }

      /* Checker inputs grid */
      .checker-inputs {
        grid-template-columns: repeat(6, 1fr) !important;
      }

      /* Gen grid: 5 colunas em telas médias */
      .gen-grid {
        grid-template-columns: repeat(5, 1fr) !important;
      }

      /* Preview table: garantir scroll horizontal */
      .table-container {
        border-radius: 10px;
        max-height: 350px;
      }

      /* Modal responsivo */
      .modal {
        padding: 1.25rem;
        gap: 1rem;
        border-radius: 14px;
        max-width: 100%;
        margin: 0.5rem;
      }
      .modal-body {
        max-height: 60vh;
      }

      /* Stats grid: 2 colunas */
      .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
      }

      /* Botões do gerador: lado a lado, igual */
      .generator-actions-row {
        display: flex !important;
        flex-direction: row !important;
        gap: 0.5rem !important;
      }
      .generator-actions-row > button {
        flex: 1 !important;
      }

      /* Checker header: título + botões lado a lado sempre */
      .checker-results .checker-header-row {
        flex-wrap: wrap;
        gap: 0.5rem;
      }
    }

    /* Celulares pequenos (max 480px) */
    @media (max-width: 480px) {
      body {
        padding: 0.65rem 0.5rem;
      }

      .dashboard-grid {
        gap: 0.85rem;
      }

      /* Brand: reduzir mais */
      .brand-title h1 {
        font-size: 0.95rem;
        line-height: 1.2;
      }
      .brand-title p {
        font-size: 0.65rem;
      }

      /* Dezenas grid: 5 colunas para caber dezenas circulares */
      .dezenas-grid {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 0.35rem;
      }
      .dezena-input {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
      }

      /* Checker inputs: 5 colunas */
      .checker-inputs {
        grid-template-columns: repeat(5, 1fr) !important;
      }

      /* Gen grid: 5 colunas para todos */
      .gen-grid {
        grid-template-columns: repeat(5, 1fr) !important;
      }
      .gen-btn {
        font-size: 0.72rem;
      }

      /* Stats grid: 2 colunas */
      .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
      }

      /* Checker simulador: empilha título e botões em coluna */
      .checker-results .checker-header-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
      }
      .checker-results .checker-header-row > div:last-child {
        width: 100% !important;
        display: flex !important;
        gap: 0.4rem !important;
      }
      .checker-results .checker-header-row > div:last-child > button {
        flex: 1 !important;
        padding: 0.4rem 0.5rem !important;
        font-size: 0.8rem !important;
      }

      /* Tabs de modalidade */
      .tab-btn {
        padding: 0.38rem 0.55rem;
        font-size: 0.7rem;
      }

      /* Botão btn-reset-base */
      #btn-reset-base {
        font-size: 0.7rem !important;
        padding: 0.3rem 0.5rem !important;
        white-space: nowrap;
      }

      /* Volante: rodapé dos botões empilha */
      #gen-number-grid + div {
        flex-wrap: wrap !important;
        gap: 0.4rem !important;
      }
    }

    /* Celulares muito pequenos (max 360px) */
    @media (max-width: 360px) {
      .brand-title h1 {
        font-size: 0.85rem;
      }
      .brand-logo {
        width: 34px;
        height: 34px;
      }
      .tab-btn {
        padding: 0.3rem 0.4rem;
        font-size: 0.65rem;
      }
      .dezena-input {
        width: 22px;
        height: 22px;
        font-size: 0.68rem;
      }
    }