﻿    :root {
      --bg: #0d0b1e;
      --surface: #161329;
      --surface2: #1f1a38;
      --accent: #f7c948;
      --accent2: #ff6b6b;
      --accent3: #4ecdc4;
      --accent4: #a78bfa;
      --text: #f0eaff;
      --text-dim: #8880a8;
      --border: #2e2856;
      --green: #22c55e;
      --radius: 16px;
      --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      -webkit-tap-highlight-color: transparent;
    }

    html,
    body {
      min-height: 100vh;
      background: var(--bg);
      color: var(--text);
      font-family: 'Nunito', sans-serif;
      overflow-x: hidden;
    }

    body::before {
      content: '';
      position: fixed;
      inset: 0;
      background: radial-gradient(ellipse at 20% 20%, rgba(167, 139, 250, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 80%, rgba(78, 205, 196, 0.10) 0%, transparent 60%);
      pointer-events: none;
      z-index: 0;
    }

   
    .screen {
      display: none;
      min-height: 100vh;
      position: relative;
      z-index: 1;
    }

    .screen.active {
      display: flex;
      flex-direction: column;
    }

    
    .app-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 14px 16px;
      background: rgba(22, 19, 41, 0.95);
      border-bottom: 1px solid var(--border);
      position: sticky;
      top: 0;
      z-index: 100;
      backdrop-filter: blur(12px);
    }

    .app-header h1 {
      font-family: 'Baloo 2', cursive;
      font-size: 1.5rem;
      font-weight: 800;
      background: linear-gradient(135deg, var(--accent), #ff9f43);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      letter-spacing: -0.5px;
    }

    .header-right {
      display: flex;
      gap: 8px;
      align-items: center;
    }

    .icon-btn {
      width: 38px;
      height: 38px;
      border-radius: 10px;
      background: var(--surface2);
      border: 1px solid var(--border);
      color: var(--text);
      font-size: 1.1rem;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.2s;
    }

    .icon-btn:active {
      transform: scale(0.93);
    }

    .points-badge {
      background: linear-gradient(135deg, var(--accent), #ff9f43);
      color: #000;
      font-weight: 800;
      font-size: 0.85rem;
      padding: 6px 12px;
      border-radius: 20px;
    }

    
    #screen-welcome {
      align-items: center;
      justify-content: center;
      padding: 32px 20px;
      gap: 32px;
    }

    .welcome-logo {
      text-align: center;
    }

    .welcome-logo .emoji-big {
      font-size: 5rem;
      display: block;
      margin-bottom: 8px;
      animation: float 3s ease-in-out infinite;
    }

    @keyframes float {

      0%,
      100% {
        transform: translateY(0);
      }

      50% {
        transform: translateY(-12px);
      }
    }

    .welcome-logo h1 {
      font-family: 'Baloo 2', cursive;
      font-size: 3rem;
      font-weight: 800;
      background: linear-gradient(135deg, var(--accent), #ff9f43, var(--accent2));
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }

    .welcome-logo p {
      color: var(--text-dim);
      font-size: 1rem;
      margin-top: 4px;
    }

    .welcome-form {
      width: 100%;
      max-width: 380px;
      display: flex;
      flex-direction: column;
      gap: 14px;
    }

    .form-group {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .form-group label {
      font-weight: 700;
      font-size: 0.9rem;
      color: var(--text-dim);
      letter-spacing: 0.5px;
      text-transform: uppercase;
    }

    .form-input {
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 14px 16px;
      color: var(--text);
      font-family: 'Nunito', sans-serif;
      font-size: 1rem;
      font-weight: 600;
      width: 100%;
      outline: none;
      transition: border-color 0.2s;
    }

    .form-input:focus {
      border-color: var(--accent4);
    }

    .form-input::placeholder {
      color: var(--text-dim);
    }

    .room-toggle {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }

    .toggle-btn {
      padding: 12px;
      border-radius: 12px;
      border: 2px solid var(--border);
      background: var(--surface2);
      color: var(--text-dim);
      font-family: 'Nunito', sans-serif;
      font-size: 0.95rem;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s;
      text-align: center;
    }

    .toggle-btn.selected {
      border-color: var(--accent4);
      background: rgba(167, 139, 250, 0.15);
      color: var(--accent4);
    }

    
    .btn {
      padding: 15px 24px;
      border-radius: 14px;
      font-family: 'Nunito', sans-serif;
      font-size: 1rem;
      font-weight: 800;
      cursor: pointer;
      border: none;
      transition: all 0.2s;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      text-align: center;
    }

    .btn:active {
      transform: scale(0.96);
    }

    .btn-primary {
      background: linear-gradient(135deg, var(--accent), #ff9f43);
      color: #000;
      box-shadow: 0 4px 20px rgba(247, 201, 72, 0.35);
    }

    .btn-secondary {
      background: var(--surface2);
      border: 2px solid var(--border);
      color: var(--text);
    }

    .btn-danger {
      background: linear-gradient(135deg, var(--accent2), #c0392b);
      color: #fff;
    }

    .btn-success {
      background: linear-gradient(135deg, #22c55e, #16a34a);
      color: #fff;
    }

    .btn-purple {
      background: linear-gradient(135deg, var(--accent4), #7c3aed);
      color: #fff;
    }

    .btn-teal {
      background: linear-gradient(135deg, var(--accent3), #0d9488);
      color: #fff;
    }

    .btn:disabled {
      opacity: 0.4;
      pointer-events: none;
    }

    .btn-full {
      width: 100%;
    }

    
    #screen-cards {
      padding: 0;
    }

    .cards-header {
      padding: 16px;
    }

    .cards-header h2 {
      font-size: 1.2rem;
      font-weight: 800;
    }

    .cards-header p {
      color: var(--text-dim);
      font-size: 0.9rem;
      margin-top: 2px;
    }

    .color-picker-row {
      display: flex;
      gap: 8px;
      padding: 7px 16px 16px;
      overflow-x: auto;
      scrollbar-width: none;
    }

    .color-picker-row::-webkit-scrollbar {
      display: none;
    }

    .color-swatch {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      border: 3px solid transparent;
      cursor: pointer;
      flex-shrink: 0;
      transition: all 0.2s;
    }

    .color-swatch.selected {
      border-color: #fff;
      transform: scale(1.15);
    }

    .cards-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
      padding: 0 16px 16px;
    }

    .card-thumb {
      background: var(--surface);
      border: 2px solid var(--border);
      border-radius: 12px;
      padding: 10px 8px;
      cursor: pointer;
      transition: all 0.2s;
      position: relative;
    }

    .card-thumb:active {
      transform: scale(0.96);
    }

    .card-thumb.selected {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(247, 201, 72, 0.3);
    }

    .card-thumb.taken {
      opacity: 0.45;
      pointer-events: none;
    }

    .card-thumb .card-num {
      font-size: 0.75rem;
      font-weight: 800;
      color: var(--text-dim);
      margin-bottom: 6px;
    }

    .card-mini {
      display: grid;
      grid-template-columns: repeat(9, 1fr);
      gap: 1px;
    }

    .card-mini-cell {
      height: 6px;
      border-radius: 1px;
    }

    .taken-badge {
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      background: rgba(13, 11, 30, 0.7);
      border-radius: 10px;
      font-size: 0.7rem;
      font-weight: 800;
      color: var(--accent2);
    }

    
    .popup-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.75);
      display: flex;
      align-items: flex-end;
      justify-content: center;
      z-index: 200;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.3s;
    }

    .popup-overlay.open {
      opacity: 1;
      pointer-events: all;
    }

    .popup-sheet {
      background: var(--surface);
      border-radius: 24px 24px 0 0;
      width: 100%;
      max-width: 480px;
      padding: 24px 20px 40px;
      transform: translateY(100%);
      transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
      max-height: 90vh;
      overflow-y: auto;
    }

    .popup-overlay.open .popup-sheet {
      transform: translateY(0);
    }

    .popup-handle {
      width: 40px;
      height: 4px;
      background: var(--border);
      border-radius: 2px;
      margin: 0 auto 20px;
    }

    .popup-sheet h2 {
      font-size: 1.4rem;
      font-weight: 800;
      margin-bottom: 20px;
    }

    /* ─── GAME SCREEN ─── */
    #screen-game {
      padding-bottom: 20px;
    }

    /* Number display */
    .drawn-section {
      background: var(--surface);
      border-bottom: 1px solid var(--border);
      padding: 16px;
      display: flex;
      gap: 16px;
      align-items: stretch;
    }

    .current-number-box {
      background: linear-gradient(135deg, #1f1a38, #2e2856);
      border: 2px solid var(--accent);
      border-radius: 16px;
      min-width: 90px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 12px;
      flex-shrink: 0;
    }

    .current-number-box .label {
      font-size: 0.65rem;
      font-weight: 800;
      letter-spacing: 1px;
      color: var(--accent);
      text-transform: uppercase;
    }

    .current-number-big {
      font-family: 'Baloo 2', cursive;
      font-size: 3.5rem;
      font-weight: 800;
      color: var(--accent);
      line-height: 1;
      transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .current-number-big.pop {
      animation: numPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    @keyframes numPop {
      0% {
        transform: scale(0.4);
        opacity: 0;
      }

      100% {
        transform: scale(1);
        opacity: 1;
      }
    }

    .prev-numbers-scroll {
      flex: 1;
      overflow-x: auto;
      scrollbar-width: none;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .prev-numbers-scroll::-webkit-scrollbar {
      display: none;
    }

    .drawn-right-col {
      flex: 1;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      min-width: 0;
    }

    
    .speed-slider-wrap {
      display: flex;
      align-items: center;
      gap: 7px;
      padding: 0 2px;
    }

    .speed-icon {
      font-size: 1rem;
      line-height: 1;
      flex-shrink: 0;
      user-select: none;
    }

    .speed-label {
      font-size: 0.72rem;
      font-weight: 800;
      color: #f7c948;
      min-width: 32px;
      text-align: right;
      flex-shrink: 0;
    }

    .speed-slider {
      flex: 1;
      -webkit-appearance: none;
      appearance: none;
      height: 6px;
      border-radius: 3px;
      background: linear-gradient(to right, #f7c948 25%, #2e2856 25%);
      outline: none;
      cursor: pointer;
      min-width: 0;
    }

    .speed-slider::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      width: 22px;
      height: 22px;
      border-radius: 50%;
      background: #f7c948;
      cursor: pointer;
      box-shadow: 0 2px 10px rgba(247,201,72,0.45);
      border: 2px solid rgba(255,255,255,0.25);
      transition: box-shadow 0.15s;
    }

    .speed-slider::-webkit-slider-thumb:active {
      box-shadow: 0 0 0 6px rgba(247,201,72,0.2);
    }

    .speed-slider::-moz-range-thumb {
      width: 22px;
      height: 22px;
      border-radius: 50%;
      background: #f7c948;
      cursor: pointer;
      box-shadow: 0 2px 10px rgba(247,201,72,0.45);
      border: 2px solid rgba(255,255,255,0.25);
    }

    .prev-num-chip {
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: 8px;
      min-width: 34px;
      height: 34px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.85rem;
      font-weight: 800;
      flex-shrink: 0;
      color: var(--text-dim);
    }

    .prev-num-chip.on-card {
      background: rgba(247, 201, 72, 0.15);
      border-color: var(--accent);
      color: var(--accent);
    }

    /* tombala card */
    .card-section {
      padding: 16px;
    }

    .card-section h3 {
      font-size: 0.8rem;
      font-weight: 800;
      color: var(--text-dim);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 10px;
    }

    .tombala-card {
      border-radius: 14px;
      overflow: hidden;
      border: 2px solid var(--border);
      box-shadow: var(--shadow);
    }

    .card-row {
      display: grid;
      grid-template-columns: repeat(9, 1fr);
    }

    .card-cell {
      aspect-ratio: 0.85;
      display: flex;
      align-items: center;
      justify-content: center;
 
      font-size: clamp(0.72rem, 2.8vw, 1.15rem);
      font-weight: 900;
      color: #fff;
      position: relative;
      transition: transform 0.15s, box-shadow 0.15s;
      cursor: default;
      border: 1px solid rgba(0, 0, 0, 0.2);
      overflow: hidden;
      letter-spacing: -0.3px;
      line-height: 1;
      /* prevent text from ever growing outside its box */
      word-break: keep-all;
      white-space: nowrap;
    }

    
    @media (max-width: 480px) {
      .card-cell {
        font-size: clamp(0.78rem, 7.4vw, 1rem);
      }
    }

    
    @media (min-width: 768px) {
      .card-cell {
        font-size: clamp(0.85rem, 1.8vw, 1.3rem);
      }
    }

    
    .card-cell.empty {
      background: var(--cell-color, #2e2856);
      box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.06),
        inset 0 -2px 0 rgba(0, 0, 0, 0.35);
    }

    
    .card-cell.numbered {
      background: linear-gradient(160deg, #272044 0%, #1a1535 60%, #120e28 100%);
      color: var(--text);
      cursor: pointer;
      box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.10),
        inset 0 -2px 0 rgba(0, 0, 0, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.4);
      text-shadow: 0 1px 0 rgba(0, 0, 0, 0.8), 0 -1px 0 rgba(255, 255, 255, 0.07);
    }

    .card-cell.numbered:active {
      transform: scale(0.88);
      box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
    }

    
    .card-cell.marked {
      background: var(--cell-color-mark, #f7c948) !important;
      color: #000 !important;
      box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.35),
        inset 0 -2px 0 rgba(0, 0, 0, 0.25),
        0 2px 6px rgba(0, 0, 0, 0.4) !important;
      text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) !important;
    }

    .card-cell.marked::after {
      content: '✓';
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.15em;
      font-weight: 900;
      animation: markAnim 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .card-cell.marked span {
      opacity: 0;
    }

    @keyframes markAnim {
      0% {
        transform: scale(0) rotate(-20deg);
      }

      100% {
        transform: scale(1) rotate(0deg);
      }
    }

    .card-cell.not-drawn {
      background: linear-gradient(160deg, #1a1535 0%, #120e28 100%) !important;
      color: #9a96af !important;
      cursor: not-allowed;
      box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.03), inset 0 -2px 0 rgba(0, 0, 0, 0.4) !important;
      text-shadow: none !important;
    }

    
    .card-row.row-complete .card-cell.numbered {
      box-shadow: inset 0 0 0 2px var(--accent), inset 0 2px 0 rgba(255, 255, 255, 0.1) !important;
    }

    
    .win-btn {
      padding: 12px 8px;
      border-radius: 12px;
      font-family: 'Nunito', sans-serif;
      font-size: 0.8rem;
      font-weight: 800;
      cursor: pointer;
      border: 2px solid transparent;
      transition: all 0.2s;
      text-align: center;
      line-height: 1.2;
    }

    .win-btn:active:not(:disabled) {
      transform: scale(0.95);
    }

    .win-btn-cinko1 {
      background: rgba(78, 205, 196, 0.15);
      border-color: var(--accent3);
      color: var(--accent3);
    }

    .win-btn-cinko2 {
      background: rgba(167, 139, 250, 0.15);
      border-color: var(--accent4);
      color: var(--accent4);
    }

    .win-btn-tombala {
      background: rgba(247, 201, 72, 0.15);
      border-color: var(--accent);
      color: var(--accent);
    }

    .win-btn:disabled {
      opacity: 0.35;
      pointer-events: none;
    }

    .win-btn.claimed {
      opacity: 0.5;
      pointer-events: none;
    }

    /* PTT Button */
    .ptt-section {
      padding: 16px;
    }

    .ptt-btn {
      width: 100%;
      padding: 18px;
      border-radius: 14px;
      background: var(--surface2);
      border: 2px solid var(--border);
      color: var(--text-dim);
      font-family: 'Nunito', sans-serif;
      font-size: 1rem;
      font-weight: 800;
      cursor: pointer;
      transition: all 0.2s;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      user-select: none;
      -webkit-user-select: none;
    }

    .ptt-btn.talking {
      background: rgba(255, 107, 107, 0.15);
      border-color: var(--accent2);
      color: var(--accent2);
      box-shadow: 0 0 20px rgba(255, 107, 107, 0.25);
    }

    .ptt-icon {
      font-size: 1.3rem;
    }

    .ptt-ring {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background: var(--accent2);
      animation: pttPulse 1s infinite;
      display: none;
    }

    .ptt-btn.talking .ptt-ring {
      display: block;
    }

    @keyframes pttPulse {

      0%,
      100% {
        transform: scale(1);
        opacity: 1;
      }

      50% {
        transform: scale(1.5);
        opacity: 0.5;
      }
    }

    .ptt-btn.locked,
    .ptt-btn:disabled {
      opacity: 0.4;
      cursor: not-allowed;
      filter: grayscale(0.5);
    }

    
    .host-section {
      padding: 16px;
      background: rgba(247, 201, 72, 0.05);
      border-top: 1px solid rgba(247, 201, 72, 0.15);
      margin-top: 8px;
    }

    .host-section h4 {
      font-size: 0.75rem;
      font-weight: 800;
      color: var(--accent);
      text-transform: uppercase;
      letter-spacing: 1px;
      margin-bottom: 10px;
    }

    .host-btns {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }

    .btn-invite {
      width: 100%;
      margin-top: 10px;
      background: transparent;
      border: 1px solid rgba(247, 201, 72, 0.25);
      color: var(--accent);
      font-size: 1rem;
      font-weight: 700;
      letter-spacing: 0.3px;
      opacity: 0.85;
      transition: opacity 0.2s, border-color 0.2s;
    }
    .btn-invite:hover { opacity: 1; border-color: rgba(247, 201, 72, 0.6); }

    
    .players-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.85rem;
    }

    .players-table th {
      padding: 8px 6px;
      text-align: left;
      font-size: 0.7rem;
      color: var(--text-dim);
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      border-bottom: 1px solid var(--border);
    }

    .players-table td {
      padding: 10px 6px;
      border-bottom: 1px solid rgba(46, 40, 86, 0.5);
      font-weight: 600;
    }

    .win-icon {
      font-size: 1rem;
    }

    
    .win-buttons-wrap {
      position: relative;
      padding: 0 16px;
    }

    .win-buttons {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 8px;
    }

    .win-block-overlay {
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: space-around;
      background: rgba(255, 50, 50, 0.1);
      border-radius: 12px;
      pointer-events: none;
      z-index: 10;
      padding: 0 8px;
    }

    .block-x {
      font-size: 2.2rem;
      font-weight: 900;
      color: #ff4444;
      text-shadow: 0 0 12px rgba(255, 68, 68, 0.8);
      animation: blockPulse 0.9s ease-in-out infinite alternate;
    }

    @keyframes blockPulse {
      from {
        transform: scale(0.88);
        opacity: 0.6;
      }

      to {
        transform: scale(1.12);
        opacity: 1;
      }
    }

    .block-banner {
      background: rgba(255, 68, 68, 0.1);
      border: 1px solid rgba(255, 68, 68, 0.3);
      border-radius: 8px;
      padding: 8px 12px;
      margin-top: 8px;
      text-align: center;
      font-size: 0.83rem;
      font-weight: 700;
      color: #ff9999;
    }

    
    .tombala-card.golden-card {
      position: relative;
      border: 3px solid #f7c948 !important;
      box-shadow:
        0 0 0 1px rgba(247, 201, 72, 0.2),
        0 0 28px rgba(247, 201, 72, 0.5),
        0 0 70px rgba(255, 215, 0, 0.25),
        inset 0 0 30px rgba(247, 201, 72, 0.04) !important;
      animation: goldenShimmer 3s ease-in-out infinite;
      overflow: visible !important;
    }

    .tombala-card.golden-card::before {
      content: '';
      position: absolute;
      inset: -4px;
      border-radius: 16px;
      background: linear-gradient(135deg, #f7c948 0%, #fff7c0 25%, #d4a017 50%, #fff7c0 75%, #f7c948 100%);
      background-size: 300% 300%;
      animation: goldenBorderAnim 4s linear infinite;
      z-index: -1;
      opacity: 0.7;
      filter: blur(3px);
    }

    @keyframes goldenShimmer {

      0%,
      100% {
        box-shadow: 0 0 28px rgba(247, 201, 72, 0.5), 0 0 70px rgba(255, 215, 0, 0.25);
      }

      50% {
        box-shadow: 0 0 50px rgba(247, 201, 72, 0.8), 0 0 110px rgba(255, 215, 0, 0.45);
      }
    }

    @keyframes goldenBorderAnim {
      0% {
        background-position: 0% 0%;
      }

      100% {
        background-position: 300% 300%;
      }
    }

    .tombala-card.golden-card .card-cell.empty {
      background: linear-gradient(145deg, rgba(255, 185, 0, 0.22), rgba(160, 110, 0, 0.25)) !important;
      border-color: rgba(247, 201, 72, 0.18) !important;
    }

    .tombala-card.golden-card .card-cell.numbered {
      background: linear-gradient(160deg, #1c1500 0%, #231c00 60%, #150f00 100%) !important;
      border-color: rgba(247, 201, 72, 0.18) !important;
      color: #ffe980 !important;
      box-shadow:
        inset 0 2px 0 rgba(255, 215, 0, 0.15),
        inset 0 -2px 0 rgba(0, 0, 0, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.4) !important;
      text-shadow: 0 1px 0 rgba(0, 0, 0, 0.8), 0 0 8px rgba(255, 215, 0, 0.3) !important;
    }

    .tombala-card.golden-card .card-cell.marked {
      background: linear-gradient(135deg, #f7c948, #ffe566, #ffd700) !important;
      color: #000 !important;
      box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.5) !important;
    }

    .tombala-card.golden-card .card-cell.marked::after {
      color: #000 !important;
    }

    .tombala-card.golden-card .card-cell.not-drawn {
      background: #100d00 !important;
      color: #897b20 !important;
    }

    .tombala-card.golden-card .card-row.row-complete .card-cell.numbered {
      box-shadow: inset 0 0 0 2px #ffd700 !important;
    }

    .golden-badge {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      background: linear-gradient(135deg, rgba(247, 201, 72, 0.25), rgba(255, 215, 0, 0.1));
      border: 1px solid var(--accent);
      border-radius: 20px;
      padding: 5px 14px;
      font-size: 0.8rem;
      font-weight: 800;
      color: var(--accent);
      margin-bottom: 8px;
      animation: goldenPulse 2s ease-in-out infinite;
    }

    @keyframes goldenPulse {

      0%,
      100% {
        box-shadow: 0 0 0 0 rgba(247, 201, 72, 0.5);
      }

      50% {
        box-shadow: 0 0 0 8px rgba(247, 201, 72, 0);
      }
    }

    
    .change-card-section {
      padding: 8px 16px 4px;
      display: none;
    }

    .btn-change-card-style {
      background: rgba(167, 139, 250, 0.12);
      border: 2px dashed var(--accent4);
      color: var(--accent4);
      font-family: 'Nunito', sans-serif;
      font-size: 0.9rem;
      font-weight: 800;
      width: 100%;
      padding: 13px;
      border-radius: 12px;
      cursor: pointer;
      transition: all 0.2s;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
    }

    .btn-change-card-style:active {
      transform: scale(0.97);
    }

    .change-card-note {
      text-align: center;
      font-size: 0.78rem;
      font-weight: 600;
      color: var(--text-dim);
      margin-top: 6px;
      letter-spacing: 0.2px;
    }

    
    .change-cards-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
      max-height: 55vh;
      overflow-y: auto;
      padding: 4px;
    }

    
    .special-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.92);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 600;
      backdrop-filter: blur(10px);
    }

    .special-card {
      background: linear-gradient(145deg, #0d0b1e, #1a1535);
      border: 2px solid rgba(255, 200, 0, 0.35);
      border-radius: 24px;
      padding: 32px 22px;
      width: 90%;
      max-width: 360px;
      text-align: center;
      position: relative;
      overflow: hidden;
      box-shadow: 0 0 60px rgba(255, 180, 0, 0.3), 0 0 120px rgba(255, 80, 80, 0.12);
      animation: specialEntrance 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    @keyframes specialEntrance {
      0% {
        transform: scale(0.3) rotate(-8deg);
        opacity: 0;
      }

      100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
      }
    }

    .special-card::before {
      content: '';
      position: absolute;
      inset: 0;
      background: radial-gradient(ellipse at 50% 0%, rgba(255, 200, 0, 0.1) 0%, transparent 65%);
      pointer-events: none;
    }

    .special-glow-ring {
      position: absolute;
      inset: -3px;
      border-radius: 26px;
      background: linear-gradient(135deg, #f7c948 0%, #ff6b6b 33%, #a78bfa 66%, #4ecdc4 100%);
      background-size: 400%;
      animation: gradientSpin 2.5s linear infinite;
      opacity: 0.55;
      z-index: -1;
      filter: blur(8px);
    }

    @keyframes gradientSpin {
      0% {
        background-position: 0% 50%;
      }

      50% {
        background-position: 100% 50%;
      }

      100% {
        background-position: 0% 50%;
      }
    }

    .special-icon {
      font-size: 3.5rem;
      animation: iconZap 0.45s ease-in-out infinite alternate;
      display: block;
      margin-bottom: 8px;
    }

    @keyframes iconZap {
      from {
        transform: scale(1) rotate(-5deg);
        filter: brightness(1);
      }

      to {
        transform: scale(1.15) rotate(5deg);
        filter: brightness(1.5) drop-shadow(0 0 8px #f7c948);
      }
    }

    .special-title {
      font-family: 'Baloo 2', cursive;
      font-size: 2rem;
      font-weight: 800;
      background: linear-gradient(135deg, #f7c948, #ff6b6b);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      margin-bottom: 6px;
    }

    .special-sub {
      font-size: 0.88rem;
      color: var(--text-dim);
      margin-bottom: 18px;
    }

    .special-timer-wrap {
      position: relative;
      width: 80px;
      height: 80px;
      margin: 0 auto 18px;
    }

    .special-timer-svg {
      width: 80px;
      height: 80px;
      transform: rotate(-90deg);
    }

    .timer-track {
      fill: none;
      stroke: rgba(255, 255, 255, 0.08);
      stroke-width: 5;
    }

    .timer-fill {
      fill: none;
      stroke: #f7c948;
      stroke-width: 5;
      stroke-linecap: round;
      stroke-dasharray: 163;
      stroke-dashoffset: 0;
      transition: stroke-dashoffset 1s linear, stroke 0.5s;
    }

    .special-countdown {
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.6rem;
      font-weight: 900;
      color: var(--accent);
    }

    .special-players-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
      max-height: 180px;
      overflow-y: auto;
      margin-bottom: 16px;
    }

    .special-player-row {
      background: var(--surface2);
      border: 2px solid var(--border);
      border-radius: 10px;
      padding: 10px 14px;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 10px;
      font-weight: 700;
      font-size: 0.9rem;
      transition: all 0.2s;
      text-align: left;
    }

    .special-player-row:active {
      transform: scale(0.97);
    }

    .special-player-row.selected {
      border-color: var(--accent2);
      background: rgba(255, 107, 107, 0.12);
      color: var(--accent2);
    }

    .special-player-avatar {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--accent4), var(--accent2));
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.85rem;
      font-weight: 800;
      color: #fff;
      flex-shrink: 0;
    }

    
    .confetti-container {
      position: fixed;
      inset: 0;
      pointer-events: none;
      z-index: 1000;
      overflow: hidden;
    }

    .confetti-piece {
      position: absolute;
      border-radius: 50%;
      animation: confettiFall linear forwards;
    }

    @keyframes confettiFall {
      0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 1;
      }

      80% {
        opacity: 0.9;
      }

      100% {
        transform: translate(var(--dx, 0px), 110vh) rotate(var(--rot, 720deg)) scale(0.3);
        opacity: 0;
      }
    }

    
    .win-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.85);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 500;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.3s;
    }

    .win-overlay.show {
      opacity: 1;
      pointer-events: all;
    }

    .win-card {
      background: var(--surface);
      border-radius: 24px;
      padding: 40px 32px;
      text-align: center;
      max-width: 320px;
      width: 90%;
      border: 2px solid var(--accent);
      box-shadow: 0 0 60px rgba(247, 201, 72, 0.3);
      animation: winPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    @keyframes winPop {
      0% {
        transform: scale(0.5) rotate(-5deg);
        opacity: 0;
      }

      100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
      }
    }

    .win-emoji {
      font-size: 4rem;
      display: block;
      margin-bottom: 12px;
    }

    .win-card h2 {
      font-family: 'Baloo 2', cursive;
      font-size: 1.8rem;
      font-weight: 800;
    }

    .win-card p {
      color: var(--text-dim);
      margin-top: 8px;
      margin-bottom: 24px;
    }

    
    .game-status {
      padding: 10px 16px;
      background: rgba(22, 19, 41, 0.9);
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 0.82rem;
    }

    .status-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--green);
      display: inline-block;
      margin-right: 6px;
      animation: pulse 2s infinite;
    }

    @keyframes pulse {

      0%,
      100% {
        opacity: 1
      }

      50% {
        opacity: 0.4
      }
    }

    
    .sep {
      height: 1px;
      background: var(--border);
      margin: 0 16px;
    }

    .mt16 {
      margin-top: 16px;
    }

    .section-title {
      padding: 16px 16px 8px;
      font-size: 0.75rem;
      font-weight: 800;
      color: var(--text-dim);
      text-transform: uppercase;
      letter-spacing: 1px;
    }

    
    .waiting-overlay {
      position: absolute;
      inset: 0;
      background: rgba(13, 11, 30, 0.88);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      z-index: 50;
      gap: 16px;
      border-radius: 14px;
    }

    .waiting-overlay h3 {
      font-size: 1.1rem;
      font-weight: 800;
      color: var(--text-dim);
    }

    
    .game-scroll {
      flex: 1;
      overflow-y: auto;
    }

    .badge {
      display: inline-flex;
      align-items: center;
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 3px 10px;
      font-size: 0.78rem;
      font-weight: 700;
      color: var(--text-dim);
      gap: 4px;
    }

    .badge.green {
      border-color: var(--green);
      color: var(--green);
      background: rgba(34, 197, 94, 0.1);
    }

    .badge.yellow {
      border-color: var(--accent);
      color: var(--accent);
      background: rgba(247, 201, 72, 0.1);
    }

    
    .solo-scoreboard {
      margin: 0 16px 16px;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 14px;
      overflow: hidden;
    }

    .solo-scoreboard-title {
      padding: 10px 14px;
      font-size: 0.78rem;
      font-weight: 800;
      color: var(--text-dim);
      text-transform: uppercase;
      letter-spacing: 0.8px;
      border-bottom: 1px solid var(--border);
      background: var(--surface2);
    }

    .solo-scoreboard-body {
      max-height: 180px;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
    }

    .solo-opp-row {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 7px 14px;
      border-bottom: 1px solid rgba(46, 40, 86, 0.4);
      font-size: 0.82rem;
      transition: background 0.3s;
    }

    .solo-opp-row:last-child {
      border-bottom: none;
    }

    .solo-opp-row.just-won {
      background: rgba(247, 201, 72, 0.07);
    }

    .solo-opp-name {
      flex: 1;
      font-weight: 700;
      color: var(--text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .solo-opp-badges {
      display: flex;
      gap: 4px;
      flex-shrink: 0;
    }

    .solo-opp-icon {
      font-size: 0.9rem;
      opacity: 0.35;
      transition: opacity 0.3s, transform 0.3s;
    }

    .solo-opp-icon.won {
      opacity: 1;
      transform: scale(1.2);
    }

    
    .solo-toast {
      position: fixed;
      top: 68px;
      left: 50%;
      transform: translateX(-50%) translateY(-20px);
      z-index: 800;
      background: var(--surface);
      border: 1.5px solid var(--accent);
      border-radius: 40px;
      padding: 10px 20px;
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 0.88rem;
      font-weight: 700;
      color: var(--text);
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(247, 201, 72, 0.15);
      white-space: nowrap;
      max-width: 90vw;
      overflow: hidden;
      text-overflow: ellipsis;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.3s, transform 0.3s;
    }

    .solo-toast.show {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }

    .solo-toast-icon {
      font-size: 1.1rem;
      flex-shrink: 0;
    }

    .solo-info-card {
      background: linear-gradient(135deg, rgba(78, 205, 196, 0.08), rgba(167, 139, 250, 0.08));
      border: 1px solid var(--accent3);
      border-radius: 14px;
      padding: 14px 16px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .solo-info-row {
      display: flex;
      align-items: center;
      gap: 10px;
      font-size: 0.88rem;
      font-weight: 600;
      color: var(--text-dim);
    }

    .solo-info-row span {
      color: var(--text);
    }

    .solo-controls-row {
      padding: 14px 16px 0;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .solo-play-wrap {}

    .solo-play-btn {
      width: 100%;
      padding: 16px;
      font-size: 1.05rem;
      font-weight: 900;
      background: linear-gradient(135deg, var(--accent3), #0d9488);
      color: #fff;
      border-radius: 14px;
      border: none;
      cursor: pointer;
      transition: all 0.2s;
      box-shadow: 0 4px 20px rgba(78, 205, 196, 0.3);
    }

    .solo-play-btn.playing {
      background: linear-gradient(135deg, #f59e0b, #d97706);
      box-shadow: 0 4px 20px rgba(245, 158, 11, 0.35);
    }

    .solo-play-btn.finished {
      background: linear-gradient(135deg, #7c3aed, #5b21b6);
      box-shadow: 0 4px 20px rgba(124, 58, 237, 0.3);
    }

    .solo-play-btn:active {
      transform: scale(0.97);
    }

    .solo-change-wrap {
      display: none;
      /* shown after first game starts */
    }

    .solo-change-wrap.visible {
      display: block;
    }

    .solo-win-row {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 8px;
      padding: 10px 16px 16px;
    }

    .solo-win-badge {
      padding: 12px 6px;
      border-radius: 12px;
      font-family: 'Nunito', sans-serif;
      font-size: 0.78rem;
      font-weight: 800;
      text-align: center;
      line-height: 1.2;
      border: 2px solid transparent;
      transition: all 0.3s;
      background: var(--surface2);
      color: var(--text-dim);
      border-color: var(--border);
    }

    
    .solo-win-badge:nth-child(1) {
      background: rgba(78, 205, 196, 0.12);
      border-color: var(--accent3);
      color: var(--accent3);
    }

    
    .solo-win-badge:nth-child(2) {
      background: rgba(167, 139, 250, 0.12);
      border-color: var(--accent4);
      color: var(--accent4);
    }

    
    .solo-win-badge:nth-child(3) {
      background: rgba(247, 201, 72, 0.12);
      border-color: var(--accent);
      color: var(--accent);
    }

    
    .solo-win-badge.achieved {
      opacity: 1;
      box-shadow: 0 0 12px rgba(247, 201, 72, 0.3);
    }

    .solo-win-badge.tombala-achieved {
      opacity: 1;
      border-color: var(--green);
      color: var(--green);
      background: rgba(34, 197, 94, 0.12);
      box-shadow: 0 0 12px rgba(34, 197, 94, 0.3);
    }

    
    .solo-win-badge:not(.achieved):not(.tombala-achieved) {
      opacity: 0.45;
    }

    .video-overlay {
      position: fixed;
      inset: 0;
      width: 100%;
      height: 100%;
      background: #000;
      display: none;
      justify-content: center;
      align-items: center;
      z-index: 99999;
    }

    .video-overlay video {
      width: 100%;
      height: 100%;
      object-fit: cover;
      
    }