﻿

    body {
      font-family: 'Outfit', sans-serif;
      background: var(--bg-deep);
      background-image:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(245, 185, 66, 0.12), transparent),
        linear-gradient(180deg, var(--bg-deep), var(--bg));
      color: var(--text);
      min-height: 100dvh;
      padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    }

    body.admin-active {
      padding: 0;
      overflow-x: hidden;
    }

    .login-wrap {
      max-width: 520px;
      margin: 0 auto;
    }

    .wrap {
      max-width: 520px;
      margin: 0 auto;
    }

    .brand {
      text-align: center;
      margin-bottom: 1.25rem;
    }

    .brand-tag {
      font-size: 0.72rem;
      letter-spacing: 0.18em;
      text-transform: uppercase;
      color: var(--accent-light);
      font-weight: 600;
    }

    .brand h1 {
      font-family: 'Fredoka', sans-serif;
      font-size: 1.75rem;
      margin-top: 0.25rem;
      background: linear-gradient(180deg, #fff, var(--accent-light));
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    .card {
      background: var(--surface);
      border: 1px solid var(--surface-border);
      border-radius: var(--radius);
      padding: 1.25rem;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    }

    .login-card label {
      display: block;
      font-size: 0.8rem;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.08em;
      margin-bottom: 0.5rem;
      font-weight: 600;
    }

    .login-card input {
      width: 100%;
      padding: 0.85rem 1rem;
      border-radius: 10px;
      border: 1px solid var(--surface-border);
      background: rgba(0, 0, 0, 0.25);
      color: var(--text);
      font: inherit;
      font-size: 1.1rem;
      letter-spacing: 0.15em;
      text-align: center;
    }

    .login-card input:focus {
      outline: none;
      border-color: rgba(245, 185, 66, 0.5);
      box-shadow: 0 0 0 3px rgba(245, 185, 66, 0.15);
    }

    .login-error {
      color: #fca5a5;
      font-size: 0.85rem;
      margin-top: 0.65rem;
      min-height: 1.2em;
      text-align: center;
    }

    .btn {
      font: inherit;
      font-weight: 600;
      border: none;
      border-radius: 10px;
      cursor: pointer;
      transition: filter 0.15s, transform 0.15s;
      min-height: 46px;
    }

    .btn:active:not(:disabled) { transform: scale(0.98); }
    .btn:disabled { opacity: 0.5; cursor: not-allowed; }

    .btn-primary {
      width: 100%;
      margin-top: 1rem;
      background: linear-gradient(135deg, var(--accent), #f59e0b);
      color: #1a1200;
      font-family: 'Fredoka', sans-serif;
      font-size: 1rem;
    }

    .btn-draw {
      width: 100%;
      min-height: 64px;
      font-family: 'Fredoka', sans-serif;
      font-size: 1.25rem;
      background: linear-gradient(135deg, var(--accent), #f59e0b, var(--accent-light));
      color: #1a1200;
      box-shadow: 0 4px 24px var(--accent-glow);
      margin-bottom: 0.75rem;
    }

    .btn-secondary {
      flex: 1;
      background: rgba(255, 255, 255, 0.08);
      color: var(--text);
      border: 1px solid var(--surface-border);
    }

    .btn-danger {
      flex: 1;
      background: linear-gradient(135deg, #ef4444, #dc2626);
      color: white;
    }

    .row { display: flex; gap: 0.5rem; }

    .stats {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.65rem;
      margin-bottom: 1rem;
    }

    .stat-box {
      background: rgba(0, 0, 0, 0.22);
      border: 1px solid var(--surface-border);
      border-radius: 10px;
      padding: 0.75rem;
      text-align: center;
    }

    .stat-box span {
      display: block;
      font-size: 0.68rem;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.08em;
      margin-bottom: 0.25rem;
    }

    .stat-box strong {
      font-family: 'Fredoka', sans-serif;
      font-size: 1.5rem;
      color: var(--accent-light);
    }

    .last-ball-wrap {
      display: flex;
      justify-content: center;
      margin-bottom: 1rem;
    }

    .last-ball {
      width: 100px;
      height: 100px;
      border-radius: 50%;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      font-family: 'Fredoka', sans-serif;
      font-weight: 700;
      color: white;
      position: relative;
      box-shadow:
        inset -4px -8px 14px rgba(0, 0, 0, 0.42),
        inset 4px 4px 12px rgba(255, 255, 255, 0.22),
        0 6px 20px rgba(0, 0, 0, 0.4);
    }

    .last-ball::before {
      content: '';
      position: absolute;
      top: 10%;
      left: 16%;
      width: 32%;
      height: 18%;
      background: rgba(255, 255, 255, 0.4);
      border-radius: 50%;
    }

    .last-ball.empty {
      background: radial-gradient(circle at 35% 28%, #475569, #1e293b) !important;
    }

    .last-ball .letter { font-size: 1.1rem; z-index: 1; }
    .last-ball .num { font-size: 2rem; line-height: 1; z-index: 1; }

    .last-ball.b { background: radial-gradient(circle at 35% 28%, var(--col-b-light), #1d4ed8); }
    .last-ball.i { background: radial-gradient(circle at 35% 28%, var(--col-i-light), #b91c1c); }
    .last-ball.n { background: radial-gradient(circle at 35% 28%, var(--col-n-light), #d97706); }
    .last-ball.g { background: radial-gradient(circle at 35% 28%, var(--col-g-light), #15803d); }
    .last-ball.o { background: radial-gradient(circle at 35% 28%, var(--col-o-light), #7e22ce); }

    .history-title {
      font-size: 0.75rem;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.1em;
      margin: 1rem 0 0.5rem;
      font-weight: 600;
    }

    .history-list {
      display: flex;
      flex-wrap: wrap;
      gap: 0.35rem;
      max-height: 180px;
      overflow-y: auto;
      padding: 0.5rem;
      background: rgba(0, 0, 0, 0.2);
      border-radius: 10px;
      border: 1px solid var(--surface-border);
    }

    .history-item {
      font-family: 'Fredoka', sans-serif;
      font-size: 0.78rem;
      font-weight: 600;
      padding: 0.2rem 0.55rem;
      border-radius: 99px;
      border: 1px solid transparent;
    }

    .history-item.h-b { background: rgba(59, 130, 246, 0.18); color: #93c5fd; border-color: rgba(59, 130, 246, 0.35); }
    .history-item.h-i { background: rgba(239, 68, 68, 0.18); color: #fca5a5; border-color: rgba(239, 68, 68, 0.35); }
    .history-item.h-n { background: rgba(245, 158, 11, 0.18); color: #fde68a; border-color: rgba(245, 158, 11, 0.35); }
    .history-item.h-g { background: rgba(34, 197, 94, 0.18); color: #86efac; border-color: rgba(34, 197, 94, 0.35); }
    .history-item.h-o { background: rgba(168, 85, 247, 0.18); color: #d8b4fe; border-color: rgba(168, 85, 247, 0.35); }

    .toolbar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 1rem;
      gap: 0.5rem;
    }

    .toolbar a, .toolbar button.link {
      font-size: 0.82rem;
      color: var(--accent-light);
      text-decoration: none;
      background: none;
      border: none;
      cursor: pointer;
      font: inherit;
      padding: 0.25rem 0.5rem;
    }

    .sync-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--success);
      box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
      flex-shrink: 0;
    }

    .sync-dot.off { background: #64748b; box-shadow: none; }

    .sync-status {
      display: flex;
      align-items: center;
      gap: 0.4rem;
      font-size: 0.75rem;
      color: var(--text-muted);
    }

    .hidden { display: none !important; }

    .login-wrap.hidden { display: none !important; }

    .modal-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.75);
      align-items: center;
      justify-content: center;
      padding: 1rem;
      z-index: 100;
    }

    .modal-overlay.open {
      display: flex;
    }

    .login-card form {
      position: relative;
    }

    .login-user-hidden {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }

    .hint {
      text-align: center;
      font-size: 0.78rem;
      color: var(--text-muted);
      margin-top: 1rem;
      line-height: 1.5;
    }

    .hint a { color: var(--accent-light); }

    .mode-tabs {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 0.5rem;
      margin-bottom: 1rem;
    }

    @media (max-width: 420px) {
      .mode-tab {
        font-size: 0.72rem;
        padding: 0.55rem 0.25rem;
      }
    }

    .patrocinadores-box {
      text-align: center;
      padding: 1.25rem 1rem;
      margin-bottom: 1rem;
      background: rgba(245, 185, 66, 0.08);
      border: 1px solid rgba(245, 185, 66, 0.28);
      border-radius: 14px;
    }

    .patrocinadores-box h2 {
      font-family: 'Fredoka', sans-serif;
      font-size: 1.15rem;
      color: var(--accent-light);
      margin-bottom: 0.5rem;
    }

    .patrocinadores-box p {
      color: var(--text-muted);
      font-size: 0.88rem;
      line-height: 1.5;
      margin-bottom: 0.85rem;
    }

    .patrocinadores-box a {
      color: var(--accent-light);
      font-weight: 600;
      text-decoration: none;
    }

    .patrocinadores-box a:hover {
      text-decoration: underline;
    }

    .patrocinadores-live {
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
      font-size: 0.78rem;
      font-weight: 600;
      color: #4ade80;
      margin-top: 0.25rem;
    }

    .patrocinadores-live::before {
      content: '';
      width: 0.45rem;
      height: 0.45rem;
      border-radius: 50%;
      background: #4ade80;
      box-shadow: 0 0 8px rgba(74, 222, 128, 0.7);
    }

    #gamePanel.hidden {
      display: none;
    }

    .mode-tab {
      font: inherit;
      font-weight: 600;
      font-size: 0.85rem;
      padding: 0.65rem 0.5rem;
      border-radius: 10px;
      border: 1px solid var(--surface-border);
      background: rgba(255, 255, 255, 0.04);
      color: var(--text-muted);
      cursor: pointer;
      transition: background 0.15s, color 0.15s, border-color 0.15s;
    }

    .mode-tab.active {
      background: rgba(245, 185, 66, 0.15);
      border-color: rgba(245, 185, 66, 0.45);
      color: var(--accent-light);
    }

    .giro-range {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.5rem;
      margin-bottom: 1rem;
      padding: 0.75rem;
      background: rgba(0, 0, 0, 0.2);
      border-radius: 10px;
      border: 1px solid var(--surface-border);
    }

    .giro-range label {
      display: flex;
      flex-direction: column;
      gap: 0.35rem;
      font-size: 0.72rem;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.06em;
      font-weight: 600;
    }

    .giro-range input {
      font: inherit;
      padding: 0.55rem 0.65rem;
      border-radius: 8px;
      border: 1px solid var(--surface-border);
      background: rgba(0, 0, 0, 0.25);
      color: var(--text);
      font-size: 1rem;
    }

    .giro-range .btn-range {
      grid-column: 1 / -1;
      margin-top: 0.25rem;
      background: rgba(255, 255, 255, 0.08);
      color: var(--text);
      border: 1px solid var(--surface-border);
      border-radius: 8px;
      padding: 0.55rem;
      font: inherit;
      font-weight: 600;
      cursor: pointer;
    }

    .last-ball.giro-only .letter { display: none; }
    .last-ball.giro-only .num { font-size: 2.5rem; }

    .telao-links {
      display: flex;
      gap: 0.5rem;
      flex-wrap: wrap;
    }

    .auto-draw {
      margin-bottom: 1rem;
      padding: 0.75rem;
      background: rgba(0, 0, 0, 0.2);
      border-radius: 10px;
      border: 1px solid var(--surface-border);
    }

    .auto-draw.running {
      border-color: rgba(34, 197, 94, 0.35);
      background: rgba(34, 197, 94, 0.06);
    }

    .auto-draw.paused {
      border-color: rgba(245, 185, 66, 0.35);
      background: rgba(245, 185, 66, 0.06);
    }

    .auto-draw-title {
      font-size: 0.78rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--text-muted);
      margin-bottom: 0.65rem;
    }

    .auto-draw-config {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.5rem;
      margin-bottom: 0.65rem;
    }

    .auto-draw-config label {
      display: flex;
      flex-direction: column;
      gap: 0.35rem;
      font-size: 0.72rem;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.06em;
      font-weight: 600;
    }

    .auto-draw-config input,
    .auto-draw-config select {
      font: inherit;
      padding: 0.55rem 0.65rem;
      border-radius: 8px;
      border: 1px solid var(--surface-border);
      background: rgba(0, 0, 0, 0.25);
      color: var(--text);
      font-size: 1rem;
    }

    .auto-status {
      text-align: center;
      font-size: 0.85rem;
      color: var(--text-muted);
      margin-bottom: 0.65rem;
      min-height: 1.25rem;
    }

    .auto-status.active { color: #86efac; font-weight: 600; }
    .auto-status.paused { color: var(--accent-light); font-weight: 600; }

    .auto-buttons {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.5rem;
    }

    .auto-buttons .btn-auto-start {
      grid-column: 1 / -1;
      background: linear-gradient(135deg, #16a34a, #15803d);
      color: #fff;
      border: none;
      border-radius: 10px;
      padding: 0.7rem;
      font: inherit;
      font-weight: 700;
      cursor: pointer;
    }

    .auto-buttons .btn-auto-start:disabled {
      opacity: 0.45;
      cursor: not-allowed;
    }

    .cartelas-box {
      margin-bottom: 1rem;
      padding: 0.75rem;
      background: rgba(0, 0, 0, 0.2);
      border-radius: 10px;
      border: 1px solid var(--surface-border);
    }

    .cartelas-box.hidden { display: none !important; }

    .conferencia-admin.hidden { display: none !important; }

    .conferencia-admin-table {
      width: 100%;
      border-collapse: collapse;
      margin-top: 0.5rem;
      font-size: 0.82rem;
    }

    .conferencia-admin-table th,
    .conferencia-admin-table td {
      text-align: left;
      padding: 0.4rem 0.45rem;
      border-bottom: 1px solid var(--surface-border);
    }

    .conferencia-admin-table th {
      color: var(--text-muted);
      font-weight: 600;
      font-size: 0.75rem;
      text-transform: uppercase;
    }

    .conferencia-admin-table tr.pts-close td:last-child { color: #fdba74; font-weight: 600; }
    .conferencia-admin-table tr.pts-winner td:last-child { color: #86efac; font-weight: 700; }

    .edicao-box {
      margin-bottom: 1rem;
      padding: 0.75rem;
      background: rgba(34, 197, 94, 0.08);
      border-radius: 10px;
      border: 1px solid rgba(34, 197, 94, 0.28);
    }

    .edicao-box.hidden { display: none !important; }

    .edicao-box select {
      width: 100%;
      margin-bottom: 0.55rem;
      padding: 0.55rem 0.65rem;
      border-radius: 8px;
      border: 1px solid var(--surface-border);
      background: rgba(0, 0, 0, 0.25);
      color: var(--text);
      font: inherit;
      font-size: 0.85rem;
    }

    .edicao-stats {
      display: flex;
      flex-wrap: wrap;
      gap: 0.65rem;
      font-size: 0.78rem;
      color: var(--text-muted);
      margin-top: 0.35rem;
    }

    .edicao-stats strong { color: var(--accent-light); }

    .live-box {
      margin-bottom: 1rem;
      padding: 0.75rem;
      background: rgba(0, 0, 0, 0.2);
      border-radius: 10px;
      border: 1px solid rgba(245, 185, 66, 0.22);
    }

    .live-box input[type="url"] {
      width: 100%;
      margin-bottom: 0.55rem;
      padding: 0.55rem 0.65rem;
      border-radius: 8px;
      border: 1px solid var(--surface-border);
      background: rgba(0, 0, 0, 0.25);
      color: var(--text);
      font: inherit;
      font-size: 0.85rem;
    }

    .live-actions {
      display: flex;
      gap: 0.5rem;
      flex-wrap: wrap;
    }

    .waiting-box {
      margin-bottom: 1rem;
      padding: 0.75rem;
      background: rgba(245, 185, 66, 0.08);
      border-radius: 10px;
      border: 1px solid rgba(245, 185, 66, 0.28);
    }

    .waiting-box.active {
      border-color: rgba(245, 185, 66, 0.55);
      background: rgba(245, 185, 66, 0.14);
    }

    .waiting-status {
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
      font-size: 0.78rem;
      font-weight: 700;
      color: var(--accent-light);
      margin-top: 0.55rem;
    }

    .waiting-status::before {
      content: '';
      width: 0.45rem;
      height: 0.45rem;
      border-radius: 50%;
      background: var(--accent);
      box-shadow: 0 0 8px var(--accent-glow);
    }

    .waiting-box.hidden { display: none !important; }

    .cartelas-hint {
      font-size: 0.78rem;
      color: var(--text-muted);
      line-height: 1.45;
      margin-bottom: 0.65rem;
    }

    .cartelas-row {
      display: grid;
      grid-template-columns: auto 1fr auto;
      gap: 0.5rem;
      align-items: center;
      margin-bottom: 0.65rem;
    }

    .cartelas-row input {
      font: inherit;
      padding: 0.55rem 0.65rem;
      border-radius: 8px;
      border: 1px solid var(--surface-border);
      background: rgba(0, 0, 0, 0.25);
      color: var(--text);
      font-size: 1.25rem;
      font-weight: 700;
      text-align: center;
    }

    .cartelas-row .btn {
      min-width: 44px;
      padding: 0.55rem;
      font-size: 1.25rem;
      font-weight: 700;
    }

    .cartelas-actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.5rem;
    }

    .cartelas-actions .btn-range {
      grid-column: 1 / -1;
    }

    .cartelas-actions .btn-link {
      background: none;
      border: none;
      color: var(--text-muted);
      font: inherit;
      font-size: 0.78rem;
      cursor: pointer;
      text-decoration: underline;
      padding: 0.25rem;
    }

    .sponsors-admin {
      margin-bottom: 1rem;
    }

    .sponsors-admin-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.5rem;
      margin-bottom: 0.65rem;
    }

    .sponsors-admin-head h2 {
      font-family: 'Fredoka', sans-serif;
      font-size: 1rem;
      color: var(--accent-light);
    }

    .sponsors-list {
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
      max-height: 420px;
      overflow: auto;
    }

    .sponsor-item {
      display: flex;
      align-items: center;
      gap: 0.65rem;
      padding: 0.65rem 0.75rem;
      border-radius: 10px;
      border: 1px solid var(--surface-border);
      background: rgba(0, 0, 0, 0.2);
    }

    .sponsor-thumb {
      width: 2.5rem;
      height: 2.5rem;
      border-radius: 50%;
      object-fit: cover;
      flex-shrink: 0;
      background: rgba(255, 255, 255, 0.06);
      border: 1px solid var(--surface-border);
    }

    .sponsor-thumb.empty {
      display: flex;
      align-items: center;
      justify-content: center;
      font-family: 'Fredoka', sans-serif;
      font-size: 0.95rem;
      color: var(--accent-light);
    }

    .sponsor-info {
      flex: 1;
      min-width: 0;
    }

    .sponsor-info strong {
      display: block;
      font-size: 0.9rem;
      line-height: 1.3;
    }

    .sponsor-meta {
      font-size: 0.72rem;
      color: var(--text-muted);
      margin-top: 0.15rem;
    }

    .sponsor-actions {
      display: flex;
      gap: 0.35rem;
      flex-shrink: 0;
    }

    .sponsor-actions button {
      font: inherit;
      font-size: 0.72rem;
      font-weight: 600;
      border-radius: 8px;
      border: 1px solid var(--surface-border);
      background: rgba(255, 255, 255, 0.06);
      color: var(--text);
      padding: 0.35rem 0.55rem;
      cursor: pointer;
    }

    .sponsor-actions .danger {
      color: #fca5a5;
      border-color: rgba(239, 68, 68, 0.35);
    }

    .sponsor-actions .share {
      color: var(--accent-light);
      border-color: rgba(245, 185, 66, 0.35);
    }

    .sponsor-form .field {
      margin-bottom: 0.75rem;
      text-align: left;
    }

    .sponsor-form label {
      display: block;
      font-size: 0.72rem;
      font-weight: 600;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.05em;
      margin-bottom: 0.3rem;
    }

    .sponsor-form input,
    .sponsor-form textarea,
    .sponsor-form select {
      width: 100%;
      font: inherit;
      color: var(--text);
      background: rgba(0, 0, 0, 0.25);
      border: 1px solid var(--surface-border);
      border-radius: 8px;
      padding: 0.55rem 0.65rem;
    }

    .sponsor-form textarea {
      min-height: 72px;
      resize: vertical;
    }

    .sponsor-form-msg {
      color: var(--danger);
      font-size: 0.82rem;
      margin-bottom: 0.65rem;
      min-height: 1.1rem;
    }

    .sponsors-admin.hidden { display: none !important; }

    .ganhadores-box {
      margin-bottom: 1rem;
      padding: 0.75rem;
      background: rgba(34, 197, 94, 0.08);
      border-radius: 10px;
      border: 1px solid rgba(34, 197, 94, 0.28);
    }

    .ganhadores-box.hidden { display: none !important; }

    .ganhadores-form {
      display: grid;
      gap: 0.5rem;
      margin-bottom: 0.75rem;
    }

    .ganhadores-form label {
      display: flex;
      flex-direction: column;
      gap: 0.35rem;
      font-size: 0.72rem;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.06em;
      font-weight: 600;
    }

    .ganhadores-form input {
      font: inherit;
      padding: 0.55rem 0.65rem;
      border-radius: 8px;
      border: 1px solid var(--surface-border);
      background: rgba(0, 0, 0, 0.25);
      color: var(--text);
      font-size: 0.95rem;
      text-transform: none;
      letter-spacing: normal;
    }

    .ganhadores-actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.5rem;
    }

    .ganhadores-actions .btn-range {
      grid-column: 1 / -1;
    }

    .ganhadores-list {
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
      max-height: 280px;
      overflow: auto;
    }

    .ganhador-item {
      display: flex;
      align-items: center;
      gap: 0.65rem;
      padding: 0.65rem 0.75rem;
      border-radius: 10px;
      border: 1px solid var(--surface-border);
      background: rgba(0, 0, 0, 0.2);
    }

    .ganhador-badge {
      flex-shrink: 0;
      width: 2.5rem;
      height: 2.5rem;
      border-radius: 10px;
      background: linear-gradient(145deg, rgba(34, 197, 94, 0.35), rgba(22, 163, 74, 0.5));
      border: 1px solid rgba(74, 222, 128, 0.35);
      display: flex;
      align-items: center;
      justify-content: center;
      font-family: 'Fredoka', sans-serif;
      font-size: 0.72rem;
      font-weight: 700;
      color: #ecfdf5;
      line-height: 1.1;
      text-align: center;
      padding: 0.15rem;
    }

    .ganhador-info {
      flex: 1;
      min-width: 0;
    }

    .ganhador-info strong {
      display: block;
      font-size: 0.9rem;
      line-height: 1.3;
    }

    .ganhador-meta {
      font-size: 0.72rem;
      color: var(--text-muted);
      margin-top: 0.15rem;
      line-height: 1.35;
    }

    .ganhador-actions {
      display: flex;
      gap: 0.35rem;
      flex-shrink: 0;
    }

    .ganhador-actions button {
      font: inherit;
      font-size: 0.72rem;
      font-weight: 600;
      border-radius: 8px;
      border: 1px solid var(--surface-border);
      background: rgba(255, 255, 255, 0.06);
      color: var(--text);
      padding: 0.35rem 0.55rem;
      cursor: pointer;
    }

    .ganhador-actions .danger {
      color: #fca5a5;
      border-color: rgba(239, 68, 68, 0.35);
    }

    .ganhador-form-msg {
      color: var(--danger);
      font-size: 0.82rem;
      margin-bottom: 0.65rem;
      min-height: 1.1rem;
    }

    .ganhadores-whatsapp {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.5rem;
      margin-top: 0.65rem;
    }

    .ganhadores-whatsapp .btn-range {
      font-size: 0.78rem;
      padding: 0.5rem 0.45rem;
    }

    .ganhadores-status {
      font-size: 0.78rem;
      color: var(--text-muted);
      margin-top: 0.5rem;
      min-height: 1.1rem;
      line-height: 1.35;
    }

    .ganhadores-status.ok { color: #86efac; }
    .ganhadores-status.err { color: #fca5a5; }

    #gwVendedorField.hidden,
    #gwNumeroField.hidden,
    #gwPremioField.hidden,
    #giroNumerosRef.hidden { display: none !important; }

    .giro-numeros-ref {
      margin-bottom: 0.65rem;
      padding: 0.65rem;
      border-radius: 10px;
      background: rgba(168, 85, 247, 0.1);
      border: 1px solid rgba(192, 132, 252, 0.28);
    }

    .giro-numeros-ref-title {
      font-size: 0.72rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: #e9d5ff;
      margin-bottom: 0.45rem;
    }

    .giro-numeros-ref-hint {
      font-size: 0.75rem;
      color: var(--text-muted);
      line-height: 1.4;
      margin-bottom: 0.5rem;
    }

    .giro-numeros-chips {
      display: flex;
      flex-wrap: wrap;
      gap: 0.35rem;
    }

    .giro-num-chip {
      font: inherit;
      font-size: 0.78rem;
      font-weight: 700;
      border-radius: 999px;
      border: 1px solid rgba(192, 132, 252, 0.35);
      background: rgba(0, 0, 0, 0.25);
      color: var(--text);
      padding: 0.28rem 0.55rem;
      cursor: pointer;
    }

    .giro-num-chip:hover {
      border-color: rgba(216, 180, 254, 0.65);
      background: rgba(168, 85, 247, 0.2);
    }

    .giro-num-chip.done {
      background: rgba(34, 197, 94, 0.2);
      border-color: rgba(74, 222, 128, 0.45);
      color: #bbf7d0;
    }

    .ganhadores-form textarea {
      width: 100%;
      font: inherit;
      color: var(--text);
      background: rgba(0, 0, 0, 0.25);
      border: 1px solid var(--surface-border);
      border-radius: 8px;
      padding: 0.55rem 0.65rem;
      min-height: 56px;
      resize: vertical;
    }

    /* ── Layout admin: sidebar menu + conteúdo central ── */
    .admin-shell {
      min-height: 100dvh;
    }

    .admin-layout {
      display: flex;
      flex-direction: column;
      min-height: 100dvh;
    }

    .sidebar {
      display: flex;
      flex-direction: column;
      background: rgba(10, 14, 22, 0.98);
      border-bottom: 1px solid var(--surface-border);
    }

    .sidebar-brand {
      padding: 1rem 1rem 0.75rem;
      border-bottom: 1px solid var(--surface-border);
    }

    .sidebar-brand .brand-tag {
      display: block;
      font-size: 0.65rem;
      letter-spacing: 0.16em;
      text-transform: uppercase;
      color: var(--accent-light);
      font-weight: 600;
    }

    .sidebar-brand strong {
      display: block;
      font-family: 'Fredoka', sans-serif;
      font-size: 1.2rem;
      margin-top: 0.15rem;
      background: linear-gradient(180deg, #fff, var(--accent-light));
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    .sidebar-modes {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 0.35rem;
      padding: 0.65rem 0.75rem;
      border-bottom: 1px solid var(--surface-border);
    }

    .sidebar-modes .mode-tab {
      font-size: 0.72rem;
      padding: 0.5rem 0.35rem;
      text-align: center;
    }

    .sidebar-menu {
      display: flex;
      flex-direction: column;
      gap: 0.2rem;
      padding: 0.65rem 0.5rem;
      flex: 1;
    }

    .menu-item {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      width: 100%;
      text-align: left;
      font: inherit;
      font-weight: 600;
      font-size: 0.88rem;
      padding: 0.65rem 0.75rem;
      border: none;
      border-radius: 8px;
      background: transparent;
      color: var(--text-muted);
      cursor: pointer;
      transition: background 0.15s, color 0.15s;
    }

    .menu-item:hover {
      background: rgba(255, 255, 255, 0.05);
      color: var(--text);
    }

    .menu-item.active {
      background: rgba(245, 185, 66, 0.12);
      color: var(--accent-light);
      box-shadow: inset 3px 0 0 var(--accent);
    }

    .menu-item.hidden {
      display: none !important;
    }

    .sidebar-footer {
      padding: 0.75rem;
      border-top: 1px solid var(--surface-border);
      background: rgba(0, 0, 0, 0.25);
    }

    .sidebar-footer .toolbar {
      flex-direction: column;
      align-items: stretch;
      margin-bottom: 0;
      gap: 0.65rem;
    }

    .sidebar-footer .telao-links {
      display: flex;
      flex-wrap: wrap;
      gap: 0.3rem 0.55rem;
      font-size: 0.78rem;
    }

    .main-panel {
      flex: 1;
      padding: 1rem;
      min-width: 0;
      background: var(--bg);
    }

    .main-header {
      max-width: 820px;
      margin: 0 auto 1.25rem;
      padding-bottom: 0.85rem;
      border-bottom: 1px solid var(--surface-border);
    }

    .main-header h2 {
      font-family: 'Fredoka', sans-serif;
      font-size: 1.45rem;
      color: var(--accent-light);
      font-weight: 600;
    }

    .main-header .main-hint {
      font-size: 0.85rem;
      color: var(--text-muted);
      margin-top: 0.25rem;
    }

    .content-area {
      max-width: 820px;
      margin: 0 auto;
      width: 100%;
    }

    .content-view {
      background: var(--surface);
      border: 1px solid var(--surface-border);
      border-radius: var(--radius);
      padding: 1.35rem 1.5rem;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
    }

    .content-view .edicao-box,
    .content-view .cartelas-box,
    .content-view .waiting-box,
    .content-view .live-box,
    .content-view .giro-range,
    .content-view .ganhadores-box,
    .content-view .patrocinadores-box,
    .content-view .sponsors-admin {
      margin-bottom: 0;
      padding: 0;
      background: transparent;
      border: none;
    }

    .game-panel-card {
      background: transparent;
      border: none;
      padding: 0;
      box-shadow: none;
    }

    .content-view#viewPatrocinadores {
      padding: 1.25rem;
    }

    .content-view#viewPatrocinadores .patrocinadores-box {
      margin-bottom: 1.25rem;
    }

    @media (min-width: 960px) {
      .admin-layout {
        flex-direction: row;
        align-items: stretch;
      }

      .sidebar {
        width: 240px;
        min-width: 240px;
        max-width: 240px;
        min-height: 100dvh;
        position: sticky;
        top: 0;
        align-self: flex-start;
        border-bottom: none;
        border-right: 1px solid var(--surface-border);
      }

      .sidebar-modes .mode-tab {
        font-size: 0.78rem;
        padding: 0.55rem 0.4rem;
      }

      .menu-item {
        font-size: 0.9rem;
        padding: 0.7rem 0.85rem;
      }

      .main-panel {
        padding: 1.5rem 2rem 2.5rem;
      }

      .content-view .last-ball {
        width: 118px;
        height: 118px;
      }

      .content-view .last-ball .num {
        font-size: 2.35rem;
      }

      .content-view .btn-draw {
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
      }

      .content-view .row {
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
      }

      .content-view .auto-draw {
        max-width: 460px;
        margin-left: auto;
        margin-right: auto;
      }

      .content-view .stats {
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
      }

      .history-list {
        max-height: 320px;
        overflow-y: auto;
      }

      .ganhadores-list {
        max-height: 420px;
        overflow-y: auto;
      }
    }

    .edicao-badge {
      text-align: center;
      font-size: 0.88rem;
      font-weight: 600;
      color: var(--accent-light);
      background: rgba(245, 185, 66, 0.1);
      border: 1px solid rgba(245, 185, 66, 0.35);
      border-radius: 10px;
      padding: 0.55rem 0.85rem;
      margin-bottom: 1rem;
    }

    .edicao-badge.warn {
      color: #fca5a5;
      background: rgba(239, 68, 68, 0.12);
      border-color: rgba(239, 68, 68, 0.35);
    }

    .edicao-badge.hidden {
      display: none !important;
    }

    .edicao-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 0.65rem;
      margin-top: 1rem;
    }

    .edicao-actions .btn-open-sorteio {
      flex: 1;
      min-width: 200px;
      min-height: 48px;
      font-family: 'Fredoka', sans-serif;
      background: linear-gradient(135deg, var(--accent), #f59e0b);
      color: #1a1200;
      border: none;
      border-radius: 10px;
      font-weight: 600;
      cursor: pointer;
    }

    .edicao-actions .btn-open-sorteio:disabled {
      opacity: 0.45;
      cursor: not-allowed;
    }
