﻿

    body {
      font-family: 'Outfit', sans-serif;
      background: var(--bg-deep);
      background-image:
        radial-gradient(ellipse 90% 50% at 50% -5%, rgba(245, 185, 66, 0.14), transparent),
        radial-gradient(ellipse 50% 40% at 100% 100%, rgba(168, 85, 247, 0.08), transparent);
      color: var(--text);
      min-height: 100dvh;
      padding:
        max(0.65rem, env(safe-area-inset-top))
        max(0.65rem, env(safe-area-inset-right))
        max(0.65rem, env(safe-area-inset-bottom))
        max(0.65rem, env(safe-area-inset-left));
    }

    .wrap {
      max-width: 480px;
      margin: 0 auto;
      display: flex;
      flex-direction: column;
      min-height: calc(100dvh - 1.3rem);
    }

    .header {
      text-align: center;
      margin-bottom: 0.65rem;
      flex-shrink: 0;
    }

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

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

    .header-sub {
      font-size: 0.82rem;
      color: var(--text-muted);
      margin-top: 0.2rem;
    }

    .header-nav {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 0.4rem;
      margin-top: 0.55rem;
    }

    .header-nav a {
      font-size: 0.74rem;
      color: var(--text-muted);
      text-decoration: none;
      padding: 0.32rem 0.65rem;
      border-radius: 999px;
      border: 1px solid var(--surface-border);
      background: rgba(255,255,255,0.03);
    }

    .header-nav a:hover { color: var(--accent-light); border-color: rgba(245,185,66,0.35); }

    .viewer-count {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.4rem;
      margin-top: 0.45rem;
      padding: 0.32rem 0.7rem;
      border-radius: 999px;
      font-size: 0.76rem;
      font-weight: 700;
      color: var(--accent-light);
      background: rgba(245, 185, 66, 0.1);
      border: 1px solid rgba(245, 185, 66, 0.28);
    }

    .viewer-count-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: #22c55e;
      box-shadow: 0 0 8px rgba(34, 197, 94, 0.75);
      flex-shrink: 0;
    }

    .stats-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.5rem;
      margin-bottom: 0.65rem;
      flex-shrink: 0;
    }

    .stat-card {
      background: var(--surface);
      border: 1px solid var(--surface-border);
      border-radius: 12px;
      padding: 0.55rem 0.65rem;
      text-align: center;
    }

    .stat-card.full { grid-column: 1 / -1; }

    .stat-card.highlight {
      border-color: rgba(245, 185, 66, 0.35);
      background: rgba(245, 185, 66, 0.08);
    }

    .stat-card .label {
      font-size: 0.62rem;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--text-muted);
      font-weight: 600;
      margin-bottom: 0.15rem;
    }

    .stat-card .value {
      font-family: 'Fredoka', sans-serif;
      font-size: 1.15rem;
      font-weight: 700;
      color: var(--accent-light);
    }

    .stat-card.highlight .value { font-size: 1rem; line-height: 1.25; }
    .stat-card.highlight .value.zero { color: #86efac; }

    .stat-card.timer .value {
      font-size: 0.95rem;
      color: #86efac;
    }

    .stat-card.timer.drawing .value {
      color: #fde68a;
      animation: blink 1s ease-in-out infinite;
    }

    @keyframes blink {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.55; }
    }

    .hero {
      background: var(--surface);
      border: 1px solid var(--surface-border);
      border-radius: 16px;
      padding: 1rem;
      text-align: center;
      margin-bottom: 0.65rem;
      flex-shrink: 0;
    }

    .hero-label {
      font-size: 0.72rem;
      text-transform: uppercase;
      letter-spacing: 0.12em;
      color: var(--text-muted);
      font-weight: 600;
      margin-bottom: 0.65rem;
    }

    .ball-stage {
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;
      perspective: 700px;
      min-height: min(52vw, 220px);
    }

    .ball-glow {
      position: absolute;
      width: min(70vw, 260px);
      height: min(70vw, 260px);
      border-radius: 50%;
      background: radial-gradient(circle, rgba(245, 185, 66, 0.2), transparent 70%);
      opacity: 0;
      transition: opacity 0.3s;
    }

    .ball-glow.active { opacity: 1; }
    .ball-glow.pulse { animation: glowPulse 0.55s ease-in-out infinite; }

    @keyframes glowPulse {
      0%, 100% { opacity: 0.6; transform: scale(1); }
      50% { opacity: 1; transform: scale(1.06); }
    }

    .ball {
      position: relative;
      width: min(52vw, 210px);
      height: min(52vw, 210px);
      border-radius: 50%;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      font-family: 'Fredoka', sans-serif;
      font-weight: 700;
      color: white;
      transform-style: preserve-3d;
      box-shadow:
        inset -6px -12px 20px rgba(0, 0, 0, 0.4),
        inset 5px 5px 14px rgba(255, 255, 255, 0.22),
        0 8px 28px rgba(0, 0, 0, 0.45);
    }

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

    .ball.b {
      background: radial-gradient(circle at 28% 22%, rgba(255,255,255,0.55) 0%, transparent 32%),
                  radial-gradient(circle at 38% 32%, var(--col-b-light) 0%, var(--col-b-dark) 68%, #0c2d6e 100%);
    }
    .ball.i {
      background: radial-gradient(circle at 28% 22%, rgba(255,255,255,0.55) 0%, transparent 32%),
                  radial-gradient(circle at 38% 32%, var(--col-i-light) 0%, var(--col-i-dark) 68%, #6b1010 100%);
    }
    .ball.n {
      background: radial-gradient(circle at 28% 22%, rgba(255,255,255,0.55) 0%, transparent 32%),
                  radial-gradient(circle at 38% 32%, var(--col-n-light) 0%, var(--col-n-dark) 68%, #7c4a03 100%);
    }
    .ball.g {
      background: radial-gradient(circle at 28% 22%, rgba(255,255,255,0.55) 0%, transparent 32%),
                  radial-gradient(circle at 38% 32%, var(--col-g-light) 0%, var(--col-g-dark) 68%, #0a4d22 100%);
    }
    .ball.o {
      background: radial-gradient(circle at 28% 22%, rgba(255,255,255,0.55) 0%, transparent 32%),
                  radial-gradient(circle at 38% 32%, var(--col-o-light) 0%, var(--col-o-dark) 68%, #4a1578 100%);
    }
    .ball.giro-ball {
      background: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.5) 0%, transparent 35%),
                  radial-gradient(circle at 38% 32%, var(--accent-light) 0%, var(--accent) 45%, #b45309 100%);
    }
    .ball.empty {
      background: radial-gradient(circle at 35% 28%, #475569, #1e293b) !important;
      box-shadow: inset -6px -10px 16px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.35) !important;
    }

    .ball .letter {
      font-size: calc(min(52vw, 210px) * 0.22);
      line-height: 1;
      z-index: 1;
    }

    .ball .num {
      font-size: calc(min(52vw, 210px) * 0.42);
      line-height: 1;
      z-index: 1;
      text-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
    }

    .ball.giro-ball .num { font-size: calc(min(52vw, 210px) * 0.48); }
    .ball.empty .num { font-size: calc(min(52vw, 210px) * 0.28); color: var(--text-muted); }

    .ball.spinning { animation: ballSpin 0.42s linear infinite; }

    @keyframes ballSpin {
      0%   { transform: rotateY(0deg) rotateX(8deg); }
      25%  { transform: rotateY(90deg) rotateX(-6deg); }
      50%  { transform: rotateY(180deg) rotateX(8deg); }
      75%  { transform: rotateY(270deg) rotateX(-6deg); }
      100% { transform: rotateY(360deg) rotateX(8deg); }
    }

    .ball.pop { animation: ballPop 0.55s cubic-bezier(0.34, 1.4, 0.64, 1); }

    @keyframes ballPop {
      0% { transform: scale(0.78); opacity: 0.5; }
      55% { transform: scale(1.08); }
      100% { transform: scale(1); opacity: 1; }
    }

    .history-panel {
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
      background: var(--surface);
      border: 1px solid var(--surface-border);
      border-radius: 16px;
      padding: 0.75rem;
      overflow: hidden;
    }

    .history-panel h2 {
      font-size: 0.72rem;
      text-transform: uppercase;
      letter-spacing: 0.1em;
      color: var(--text-muted);
      margin-bottom: 0.5rem;
      flex-shrink: 0;
    }

    .history-grid {
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-content: flex-start;
      justify-content: center;
      padding: 0.15rem;
      -webkit-overflow-scrolling: touch;
    }

    .hist-ball {
      position: relative;
      width: var(--hist-ball-size);
      height: var(--hist-ball-size);
      border-radius: 50%;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      font-family: 'Fredoka', sans-serif;
      font-weight: 700;
      color: white;
      box-shadow:
        inset -3px -6px 12px rgba(0, 0, 0, 0.38),
        inset 3px 3px 8px rgba(255, 255, 255, 0.2),
        0 3px 10px rgba(0, 0, 0, 0.38);
    }

    .hist-ball::before {
      content: '';
      position: absolute;
      top: 11%;
      left: 17%;
      width: 28%;
      height: 14%;
      background: rgba(255, 255, 255, 0.4);
      border-radius: 50%;
      pointer-events: none;
    }

    .hist-ball.b {
      background: radial-gradient(circle at 28% 22%, rgba(255,255,255,0.55) 0%, transparent 32%),
                  radial-gradient(circle at 38% 32%, var(--col-b-light) 0%, var(--col-b-dark) 68%, #0c2d6e 100%);
    }
    .hist-ball.i {
      background: radial-gradient(circle at 28% 22%, rgba(255,255,255,0.55) 0%, transparent 32%),
                  radial-gradient(circle at 38% 32%, var(--col-i-light) 0%, var(--col-i-dark) 68%, #6b1010 100%);
    }
    .hist-ball.n {
      background: radial-gradient(circle at 28% 22%, rgba(255,255,255,0.55) 0%, transparent 32%),
                  radial-gradient(circle at 38% 32%, var(--col-n-light) 0%, var(--col-n-dark) 68%, #7c4a03 100%);
    }
    .hist-ball.g {
      background: radial-gradient(circle at 28% 22%, rgba(255,255,255,0.55) 0%, transparent 32%),
                  radial-gradient(circle at 38% 32%, var(--col-g-light) 0%, var(--col-g-dark) 68%, #0a4d22 100%);
    }
    .hist-ball.o {
      background: radial-gradient(circle at 28% 22%, rgba(255,255,255,0.55) 0%, transparent 32%),
                  radial-gradient(circle at 38% 32%, var(--col-o-light) 0%, var(--col-o-dark) 68%, #4a1578 100%);
    }
    .hist-ball.giro-ball {
      background: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.5) 0%, transparent 35%),
                  radial-gradient(circle at 38% 32%, var(--accent-light) 0%, var(--accent) 45%, #b45309 100%);
    }

    .hist-ball .h-letter {
      position: relative;
      z-index: 1;
      font-size: calc(var(--hist-ball-size) * 0.22);
      line-height: 1;
      opacity: 0.95;
    }

    .hist-ball .h-num {
      position: relative;
      z-index: 1;
      font-size: calc(var(--hist-ball-size) * 0.36);
      line-height: 1;
      text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    }

    .hist-ball.giro-ball .h-num {
      font-size: calc(var(--hist-ball-size) * 0.34);
    }

    .hist-ball.wide .h-num {
      font-size: calc(var(--hist-ball-size) * 0.28);
    }

    .hist-ball.latest {
      box-shadow:
        inset -3px -6px 12px rgba(0, 0, 0, 0.38),
        inset 3px 3px 8px rgba(255, 255, 255, 0.24),
        0 0 0 2px var(--accent),
        0 0 16px var(--accent-glow),
        0 4px 14px rgba(0, 0, 0, 0.42);
      transform: scale(1.06);
      z-index: 1;
    }

    .history-empty {
      color: var(--text-muted);
      font-size: 0.9rem;
      text-align: center;
      width: 100%;
      padding: 1.5rem 0;
    }

    .footer-link {
      text-align: center;
      margin-top: 0.5rem;
      flex-shrink: 0;
    }

    .footer-link a {
      font-size: 0.72rem;
      color: var(--text-muted);
      text-decoration: none;
    }

    .live-dot {
      display: inline-block;
      width: 7px;
      height: 7px;
      background: #22c55e;
      border-radius: 50%;
      margin-right: 4px;
      box-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
      animation: blink 2s infinite;
    }

    .live-panel {
      margin-bottom: 0.65rem;
      flex-shrink: 0;
    }

    .live-panel h2 {
      font-size: 0.72rem;
      text-transform: uppercase;
      letter-spacing: 0.1em;
      color: var(--text-muted);
      font-weight: 600;
      margin-bottom: 0.4rem;
      text-align: center;
    }

    .live-frame-wrap {
      position: relative;
      width: 100%;
      padding-top: 56.25%;
      border-radius: 16px;
      overflow: hidden;
      border: 2px solid rgba(245, 185, 66, 0.42);
      box-shadow:
        0 0 0 1px rgba(245, 185, 66, 0.12),
        0 12px 40px rgba(0, 0, 0, 0.45),
        0 0 48px rgba(245, 185, 66, 0.14);
      background: #000;
    }

    .live-frame-glow {
      position: absolute;
      inset: 0;
      z-index: 2;
      pointer-events: none;
      border-radius: inherit;
      box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.18);
    }

    .live-play-hint {
      position: absolute;
      inset: 0;
      z-index: 4;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 0;
      background: rgba(0, 0, 0, 0.45);
      color: #fff;
      font: inherit;
      font-family: 'Fredoka', sans-serif;
      font-size: 1rem;
      font-weight: 600;
      cursor: pointer;
      backdrop-filter: blur(2px);
    }

    .live-play-hint.hidden {
      display: none;
    }

    .live-play-hint span {
      display: inline-flex;
      align-items: center;
      gap: 0.45rem;
      padding: 0.65rem 1rem;
      border-radius: 999px;
      background: linear-gradient(135deg, rgba(245, 185, 66, 0.95), rgba(217, 119, 6, 0.95));
      color: #1a1200;
      box-shadow: 0 6px 24px rgba(245, 185, 66, 0.35);
    }

    .live-badge {
      position: absolute;
      top: 0.55rem;
      left: 0.55rem;
      z-index: 3;
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      font-size: 0.62rem;
      font-weight: 800;
      letter-spacing: 0.14em;
      text-transform: uppercase;
      color: #fff;
      background: rgba(220, 38, 38, 0.92);
      padding: 0.28rem 0.55rem;
      border-radius: 999px;
      box-shadow: 0 2px 12px rgba(220, 38, 38, 0.55);
      pointer-events: none;
    }

    .live-badge::before {
      content: '';
      width: 0.42rem;
      height: 0.42rem;
      border-radius: 50%;
      background: #fff;
      box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
      animation: livePulse 1.6s ease-in-out infinite;
    }

    @keyframes livePulse {
      0%, 100% { opacity: 1; transform: scale(1); }
      50% { opacity: 0.55; transform: scale(0.85); }
    }

    .live-frame-wrap iframe {
      position: absolute;
      z-index: 1;
      top: 0;
      left: 0;
      width: 100%;
      height: 118%;
      border: 0;
      background: #000;
    }

    .live-panel.hidden {
      display: none;
    }

    .bingo-waiting-banner {
      text-align: center;
      padding: 1rem 0.85rem;
      margin-bottom: 0.65rem;
      border-radius: 14px;
      background: linear-gradient(145deg, rgba(245, 185, 66, 0.16), rgba(245, 185, 66, 0.06));
      border: 1px solid rgba(245, 185, 66, 0.38);
      flex-shrink: 0;
    }

    .bingo-waiting-banner.hidden {
      display: none;
    }

    .winners-panel {
      margin-bottom: 0.65rem;
      padding: 0.85rem;
      border-radius: 14px;
      background: rgba(34, 197, 94, 0.08);
      border: 1px solid rgba(34, 197, 94, 0.28);
      flex-shrink: 0;
    }

    .winners-panel.hidden {
      display: none;
    }

    .winners-panel h2 {
      font-size: 0.72rem;
      text-transform: uppercase;
      letter-spacing: 0.1em;
      color: #86efac;
      margin-bottom: 0.55rem;
      font-weight: 700;
    }

    .conferencia-panel {
      margin-bottom: 0.65rem;
      padding: 0.85rem;
      border-radius: 14px;
      background: rgba(245, 185, 66, 0.08);
      border: 1px solid rgba(245, 185, 66, 0.28);
      flex-shrink: 0;
    }

    .conferencia-panel.hidden { display: none; }

    .conferencia-panel h2 {
      font-size: 0.72rem;
      text-transform: uppercase;
      letter-spacing: 0.1em;
      color: var(--accent-light);
      margin-bottom: 0.55rem;
      font-weight: 700;
    }

    .conferencia-list {
      display: flex;
      flex-direction: column;
      gap: 0.45rem;
    }

    .conferencia-item {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 0.65rem;
      padding: 0.5rem 0.55rem;
      border-radius: 10px;
      background: rgba(0, 0, 0, 0.2);
      font-size: 0.88rem;
    }

    .conferencia-item .cartela-num {
      font-weight: 700;
      color: var(--text);
      min-width: 4.5rem;
    }

    .conferencia-item .conf-status {
      text-align: right;
      color: #fde68a;
    }

    .conferencia-item.close .conf-status { color: #fdba74; font-weight: 600; }
    .conferencia-item.winner .conf-status { color: #86efac; font-weight: 700; }

    .winners-list {
      display: flex;
      flex-direction: column;
      gap: 0.45rem;
    }

    .winner-item {
      display: flex;
      align-items: center;
      gap: 0.65rem;
      padding: 0.55rem 0.65rem;
      border-radius: 10px;
      background: rgba(0, 0, 0, 0.22);
      border: 1px solid rgba(255, 255, 255, 0.06);
    }

    .winner-cartela {
      flex-shrink: 0;
      min-width: 2.5rem;
      padding: 0.35rem 0.45rem;
      border-radius: 8px;
      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);
      font-family: 'Fredoka', sans-serif;
      font-size: 0.85rem;
      font-weight: 700;
      color: #ecfdf5;
      text-align: center;
    }

    .winner-info {
      min-width: 0;
    }

    .winner-info strong {
      display: block;
      font-size: 0.92rem;
      line-height: 1.3;
      color: var(--text);
    }

    .winner-info span {
      display: block;
      font-size: 0.75rem;
      color: var(--text-muted);
      margin-top: 0.1rem;
    }

    .bingo-waiting-banner .icon {
      font-size: 2rem;
      display: block;
      margin-bottom: 0.35rem;
    }

    .bingo-waiting-banner p {
      font-family: 'Fredoka', sans-serif;
      font-size: 1.15rem;
      font-weight: 700;
      color: var(--accent-light);
      line-height: 1.25;
    }

    .bingo-waiting-banner span {
      display: block;
      margin-top: 0.3rem;
      font-size: 0.82rem;
      color: var(--text-muted);
    }
