﻿    :root {
      --blue: #063d8f;
      --blue-2: #0b63ce;
      --blue-3: #e8f1ff;
      --red: #d7193f;
      --red-2: #fff0f3;
      --green: #087c47;
      --green-2: #e8f8ef;
      --gold: #d8a72d;
      --gold-2: #fff4ce;
      --ink: #102033;
      --muted: #66758c;
      --line: #dfe7f1;
      --paper: #ffffff;
      --soft: #f5f8fc;
      --radius: 18px;
      --radius-sm: 12px;
      --shadow: 0 22px 70px rgba(4, 20, 49, 0.16);
      --shadow-soft: 0 12px 28px rgba(10, 36, 78, 0.1);
    }

    * { box-sizing: border-box; }
    html { scroll-behavior: smooth; }

    body {
      margin: 0;
      min-height: 100vh;
      overflow-x: hidden;
      color: var(--ink);
      font-family: Inter, Arial, sans-serif;
      background: #edf3f8;
    }

    button, input, select, textarea { font: inherit; }
    button { cursor: pointer; }
    h1, h2, h3, p { margin-top: 0; }

    .skip-link {
      position: fixed;
      top: 12px;
      left: 12px;
      z-index: 100;
      transform: translateY(-150%);
      border-radius: 999px;
      color: #fff;
      background: var(--blue);
      padding: 10px 14px;
      font-weight: 800;
      text-decoration: none;
    }

    .skip-link:focus { transform: translateY(0); }

    .stadium-bg {
      position: fixed;
      inset: 0;
      z-index: -2;
      overflow: hidden;
      background:
        radial-gradient(circle at 50% -12%, rgba(255, 255, 255, 0.68), transparent 25%),
        linear-gradient(135deg, #052b69 0%, #0a57bd 32%, #087c47 68%, #c8173a 100%);
    }

    .stadium-bg::before {
      content: "";
      position: absolute;
      inset: auto 0 0;
      height: 48vh;
      background:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.13) 0 1px, transparent 1px 86px),
        linear-gradient(180deg, rgba(12, 117, 62, 0), rgba(12, 117, 62, 0.38));
      clip-path: polygon(0 30%, 100% 0, 100% 100%, 0 100%);
    }

    .stadium-bg::after {
      content: "";
      position: absolute;
      inset: 0;
      background:
        linear-gradient(to bottom, rgba(5, 15, 35, 0.06), rgba(237, 243, 248, 0.96) 62%),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 34px);
    }

    .hero {
      min-height: 430px;
      color: #fff;
      padding: 22px clamp(16px, 4vw, 56px) 78px;
    }

    .topbar, .hero-content, .app-shell {
      width: min(1240px, 100%);
      margin: 0 auto;
    }

    .topbar {
      position: relative;
      z-index: 2;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 18px;
    }

    .brand {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      color: #fff;
      font-size: 1.08rem;
      font-weight: 900;
      text-decoration: none;
      white-space: nowrap;
    }

    .session-pill {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      border: 1px solid rgba(255, 255, 255, 0.22);
      border-radius: 999px;
      color: #fff;
      background: rgba(255, 255, 255, 0.12);
      padding: 7px 10px;
      font-size: 0.82rem;
      font-weight: 900;
    }

    .session-pill button {
      border: 0;
      border-radius: 999px;
      color: var(--blue);
      background: #fff;
      padding: 5px 8px;
      font-weight: 900;
    }

    .brand-mark {
      display: grid;
      place-items: center;
      width: 42px;
      height: 42px;
      border: 1px solid rgba(255, 255, 255, 0.32);
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.14);
      box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.16);
    }

    .nav-actions {
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-end;
      gap: 7px;
      padding: 6px;
      border: 1px solid rgba(255, 255, 255, 0.15);
      border-radius: 999px;
      background: rgba(4, 15, 38, 0.18);
      backdrop-filter: blur(14px);
    }

    .nav-link {
      min-height: 38px;
      border: 0;
      border-radius: 999px;
      color: #fff;
      background: transparent;
      padding: 8px 12px;
      font-weight: 800;
      transition: 0.2s ease;
    }

    .nav-link:hover, .nav-link.active {
      color: var(--blue);
      background: #fff;
    }

    .hero-content {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 360px;
      align-items: center;
      gap: 28px;
      padding-top: 70px;
    }

    .eyebrow {
      margin: 0 0 8px;
      color: var(--gold);
      font-size: 0.74rem;
      font-weight: 900;
      letter-spacing: 0;
      text-transform: uppercase;
    }

    h1 {
      max-width: 820px;
      margin-bottom: 14px;
      font-size: clamp(2.45rem, 6vw, 5.3rem);
      line-height: 0.98;
      letter-spacing: 0;
      text-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
    }

    .hero-subtitle {
      max-width: 720px;
      margin-bottom: 0;
      color: rgba(255, 255, 255, 0.88);
      font-size: 1.12rem;
      line-height: 1.55;
    }

    .hero-chips, .panel-stats {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 18px;
    }

    .hero-chips span, .mini-pill {
      border: 1px solid rgba(255, 255, 255, 0.18);
      border-radius: 999px;
      color: rgba(255, 255, 255, 0.94);
      background: rgba(255, 255, 255, 0.12);
      padding: 8px 11px;
      font-size: 0.85rem;
      font-weight: 800;
    }

    .hero-panel, .metric-card, .side-panel, .content-panel, .modal-card {
      border: 1px solid rgba(226, 232, 240, 0.88);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
    }

    .hero-panel {
      display: grid;
      gap: 12px;
      padding: 18px;
      border-color: rgba(255, 255, 255, 0.25);
      background: linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.1));
      backdrop-filter: blur(16px);
    }

    .panel-label {
      color: rgba(255, 255, 255, 0.8);
      font-weight: 800;
    }

    select, input, textarea {
      width: 100%;
      min-height: 42px;
      border: 1px solid var(--line);
      border-radius: 10px;
      color: var(--ink);
      background: #fff;
      padding: 10px 12px;
      outline: none;
      transition: 0.2s ease;
    }

    textarea { resize: vertical; }

    select:focus, input:focus, textarea:focus {
      border-color: var(--blue-2);
      box-shadow: 0 0 0 3px rgba(11, 99, 206, 0.14);
    }

    button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
      outline: 3px solid rgba(216, 167, 45, 0.85);
      outline-offset: 3px;
    }

    .score-pill {
      justify-self: start;
      border-radius: 999px;
      color: #141b2d;
      background: linear-gradient(135deg, #ffe39a, var(--gold));
      padding: 8px 12px;
      font-weight: 900;
    }

    .app-shell {
      margin-top: -70px;
      padding: 0 clamp(14px, 3vw, 28px) 50px;
    }

    .dashboard-grid {
      display: grid;
      grid-template-columns: repeat(6, minmax(0, 1fr));
      gap: 14px;
    }

    .metric-card {
      position: relative;
      overflow: hidden;
      min-height: 126px;
      padding: 18px;
      background: rgba(255, 255, 255, 0.95);
      animation: liftIn 0.38s ease both;
    }

    .metric-card::after {
      content: "";
      position: absolute;
      right: -30px;
      bottom: -42px;
      width: 110px;
      height: 110px;
      border-radius: 50%;
      background: rgba(11, 99, 206, 0.08);
    }

    .metric-card.wide { grid-column: span 2; }
    .metric-card.leader { background: linear-gradient(145deg, #fff, #fff8df); }
    .metric-card.leader::after { background: rgba(216, 167, 45, 0.18); }

    .metric-card p {
      margin: 10px 0 7px;
      color: var(--muted);
      font-size: 0.9rem;
      font-weight: 800;
    }

    .metric-card strong {
      display: block;
      overflow-wrap: anywhere;
      font-size: 1.36rem;
      line-height: 1.15;
    }

    .metric-icon {
      display: inline-grid;
      place-items: center;
      width: 34px;
      height: 34px;
      border-radius: 10px;
      color: #fff;
      background: var(--blue);
      font-size: 0.72rem;
      font-weight: 900;
      line-height: 1;
      text-align: center;
      white-space: nowrap;
    }

    .workspace {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 18px;
      margin-top: 18px;
      justify-items: center;
    }

    body:not(.admin-mode) .admin-only {
      display: none !important;
    }

    body:not(.admin-mode) #admin,
    body:not(.admin-mode) .nav-link[data-section="admin"] {
      display: none !important;
    }

    button,
    a,
    input,
    select,
    textarea {
      touch-action: manipulation;
    }

    .side-panel, .content-panel {
      background: rgba(255, 255, 255, 0.96);
      backdrop-filter: blur(18px);
      box-shadow: var(--shadow-soft);
    }

    .side-panel {
      align-self: start;
      position: sticky;
      top: 14px;
      padding: 18px;
    }

    .content-panel {
      width: 100%;
      max-width: 1180px;
      min-height: 720px;
      padding: clamp(16px, 2vw, 24px);
    }

    .section-heading {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 18px;
    }

    .section-heading h2, .admin-banner h2 {
      margin: 0;
      font-size: clamp(1.45rem, 3vw, 2.1rem);
    }

    .section-heading.compact { margin-bottom: 14px; }
    .section-heading.compact strong {
      border-radius: 999px;
      color: #fff;
      background: var(--blue);
      padding: 4px 10px;
    }

    label {
      display: grid;
      gap: 6px;
      color: #304257;
      font-size: 0.86rem;
      font-weight: 800;
    }

    .stack-form, .modal-form, .first-phase-form { display: grid; gap: 12px; }

    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      min-height: 42px;
      border: 0;
      border-radius: 10px;
      padding: 10px 14px;
      font-weight: 900;
      text-decoration: none;
      transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    }

    .btn:hover {
      transform: translateY(-1px);
      box-shadow: 0 10px 22px rgba(10, 36, 78, 0.15);
    }

    .btn:disabled, button:disabled {
      cursor: not-allowed;
      opacity: 0.52;
      transform: none !important;
      box-shadow: none !important;
    }

    .btn.primary { color: #fff; background: linear-gradient(135deg, var(--blue-2), var(--blue)); }
    .btn.secondary { color: var(--blue); background: #eaf2ff; }
    .btn.gold { color: #172033; background: linear-gradient(135deg, #ffe39a, var(--gold)); }
    .btn.whatsapp { color: #fff; background: #138c4a; }
    .btn.danger { color: #fff; background: #c9263d; }
    .btn.ghost { color: var(--ink); background: #f3f6fa; }
    .btn.small { min-height: 34px; padding: 7px 10px; font-size: 0.82rem; }
    .btn.full { width: 100%; }

    .button-row { display: flex; flex-wrap: wrap; gap: 8px; }
    .search-wrap { margin: 14px 0; }

    .table-wrap {
      width: 100%;
      overflow-x: auto;
      overscroll-behavior-inline: contain;
      -webkit-overflow-scrolling: touch;
    }

    .participants-list, .games-list, .admin-games, .prediction-grid, .group-tables, .knockout-grid, .admin-predictions-list {
      display: grid;
      gap: 12px;
    }

    .games-list {
      grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    }

    .participant-item, .game-card, .prediction-card, .admin-game, .rules-grid article, .group-table-card, .knockout-card, .admin-card {
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #fff;
      box-shadow: var(--shadow-soft);
    }

    .participant-item {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: 10px;
      padding: 12px;
    }

    .participant-item.current {
      border-color: rgba(216, 167, 45, 0.8);
      background: linear-gradient(135deg, #fff, #fff8df);
    }

    .participant-item strong, .game-teams strong { overflow-wrap: anywhere; }
    .participant-item span {
      display: block;
      margin-top: 3px;
      color: var(--muted);
      font-size: 0.8rem;
    }

    .participant-item small {
      display: block;
      margin-top: 6px;
      color: var(--blue);
      font-size: 0.74rem;
      font-weight: 900;
    }

    .participant-actions { display: flex; flex-direction: column; gap: 6px; }

    .filters {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, auto)) minmax(160px, 1fr) minmax(160px, 1fr) auto;
      align-items: center;
      gap: 9px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      padding: 12px;
      margin-bottom: 16px;
      background: #f8fbff;
    }

    .filters select, .filters input {
      width: 100%;
      min-width: 160px;
    }

    .filter-btn, .phase-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 42px;
      border: 1px solid var(--line);
      border-radius: 999px;
      color: var(--ink);
      background: #fff;
      padding: 9px 12px;
      font-weight: 900;
      white-space: nowrap;
    }

    .phase-btn {
      color: var(--blue);
      background: #eef6ff;
    }

    .filter-btn.active, .filter-btn:hover, .phase-btn.active, .phase-btn:hover {
      color: #fff;
      background: var(--green);
      border-color: var(--green);
    }

    .filter-btn.clear {
      border-radius: 10px;
      color: var(--blue);
      background: #edf4ff;
    }

    .content-section {
      display: none;
      scroll-margin-top: 20px;
      animation: fadeIn 0.24s ease;
    }

    .content-section.active { display: block; }

    .game-card {
      position: relative;
      overflow: hidden;
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 14px;
      padding: 16px;
      transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    }

    .game-card::before {
      content: "";
      position: absolute;
      inset: 0 auto 0 0;
      width: 5px;
      background: linear-gradient(180deg, var(--blue-2), var(--green));
    }

    .game-card:hover {
      transform: translateY(-2px);
      box-shadow: 0 18px 45px rgba(10, 36, 78, 0.16);
    }

    .game-card.today {
      border-color: rgba(216, 167, 45, 0.75);
      box-shadow: 0 0 0 3px rgba(216, 167, 45, 0.12);
    }

    .game-meta, .prediction-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 7px;
      margin-bottom: 12px;
    }

    .badge {
      display: inline-flex;
      align-items: center;
      border-radius: 999px;
      padding: 5px 9px;
      font-size: 0.76rem;
      font-weight: 900;
      letter-spacing: 0.01em;
    }

    .badge.open { color: #07512a; background: #dff7e9; }
    .badge.live { color: #7a2509; background: #ffeadb; }
    .badge.done { color: #173a67; background: #e4efff; }
    .badge.locked { color: #7d2435; background: var(--red-2); }
    .badge.today-badge { color: #5c4100; background: #fff1bc; }

    .badge.open::before, .badge.live::before, .badge.done::before, .badge.locked::before {
      content: "";
      width: 7px;
      height: 7px;
      margin-right: 6px;
      border-radius: 50%;
      background: currentColor;
    }

    .badge.live::before { animation: pulse 1.1s ease-in-out infinite; }

    .game-teams {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
      align-items: center;
      gap: 12px;
    }

    .team {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
    }

    .team.away { justify-content: flex-end; text-align: right; }

    .flag {
      display: grid;
      flex: 0 0 auto;
      place-items: center;
      width: 42px;
      height: 30px;
      border-radius: 7px;
      color: #fff;
      background: #e7edf5;
      font-size: 1.15rem;
      font-weight: 900;
      line-height: 1;
      text-align: center;
      overflow: hidden;
      box-shadow: 0 3px 10px rgba(10, 36, 78, 0.14);
    }

    .flag img, .rank-avatar img, .inline-flag img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center;
    }

    .flag img, .rank-avatar img {
      border-radius: inherit;
    }

    .inline-flag {
      display: inline-grid;
      place-items: center;
      width: 1.75em;
      height: 1.2em;
      min-width: 1.75em;
      margin-right: 0.3em;
      font-size: 1.05em;
      line-height: 1;
      vertical-align: -0.08em;
      overflow: hidden;
      border-radius: 4px;
      background: #e7edf5;
      box-shadow: 0 1px 4px rgba(10, 36, 78, 0.13);
    }

    .scoreline {
      min-width: 76px;
      border-radius: 12px;
      color: #fff;
      background: #0e2038;
      padding: 9px 12px;
      text-align: center;
      font-size: 1.1rem;
      font-weight: 900;
      box-shadow: inset 0 -10px 28px rgba(255, 255, 255, 0.07);
    }

    .game-actions {
      display: flex;
      flex-direction: row;
      flex-wrap: wrap;
      justify-content: flex-start;
      gap: 8px;
    }

    .inline-pick {
      display: grid;
      gap: 10px;
      border-top: 1px solid var(--line);
      margin-top: 12px;
      padding-top: 12px;
    }

    .inline-pick-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
      gap: 8px;
      align-items: center;
    }

    .inline-pick .score-stepper {
      grid-template-columns: 30px minmax(44px, 1fr) 30px;
    }

    .inline-pick .score-stepper button {
      width: 30px;
      height: 34px;
    }

    .inline-pick input {
      min-height: 38px;
      text-align: center;
      font-weight: 900;
    }

    .inline-pick-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      justify-content: flex-end;
    }

    .muted, .empty { color: var(--muted); }
    .muted { line-height: 1.45; }

    .empty {
      border: 1px dashed #cbd5e1;
      border-radius: var(--radius);
      padding: 18px;
      text-align: center;
      background: #f8fafc;
    }

    .prediction-grid { grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); }
    .prediction-card { padding: 16px; }

    .prediction-score {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin: 14px 0;
      font-size: 1.25rem;
      font-weight: 900;
    }

    .prediction-card.exact { border-color: rgba(216, 167, 45, 0.85); background: #fffaf0; }
    .prediction-card.result { border-color: rgba(18, 161, 80, 0.55); background: #f2fff7; }
    .prediction-card.partial { border-color: rgba(11, 99, 206, 0.35); background: #f5f9ff; }
    .prediction-card.wrong { border-color: rgba(215, 25, 63, 0.3); }

    .participant-picks-toolbar {
      display: grid;
      grid-template-columns: minmax(220px, 300px) repeat(3, minmax(160px, 1fr));
      align-items: end;
      gap: 14px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      padding: 14px;
      margin-bottom: 16px;
      background: #f8fbff;
    }

    .picks-command-bar {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 12px;
      align-items: center;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      padding: 12px;
      margin-bottom: 14px;
      background: #fff;
      box-shadow: var(--shadow-soft);
    }

    .progress-panel {
      display: grid;
      gap: 8px;
    }

    .progress-label {
      display: flex;
      justify-content: space-between;
      gap: 10px;
      color: var(--muted);
      font-size: 0.86rem;
      font-weight: 900;
    }

    .completion-bar {
      height: 10px;
      overflow: hidden;
      border-radius: 999px;
      background: #e8edf5;
    }

    .completion-bar span {
      display: block;
      height: 100%;
      border-radius: inherit;
      background: linear-gradient(90deg, var(--green), var(--gold));
      transition: width 0.25s ease;
    }

    .first-phase-summary {
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-end;
      gap: 8px;
    }

    .first-phase-summary span {
      border-radius: 999px;
      color: var(--blue);
      background: #eaf2ff;
      padding: 8px 11px;
      font-size: 0.84rem;
      font-weight: 900;
    }

    .first-phase-games { display: grid; gap: 12px; }
    .first-phase-group {
      margin: 14px 0 2px;
      color: var(--blue);
      font-size: 1rem;
    }

    .first-phase-game {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
      align-items: center;
      gap: 14px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      padding: 14px;
      background: #fff;
      box-shadow: var(--shadow-soft);
    }

    .first-phase-game.locked { background: #f8fafc; }
    .first-phase-game-info strong { display: block; overflow-wrap: anywhere; font-size: 1rem; }

    .first-phase-score {
      display: grid;
      grid-template-columns: 1fr auto 1fr;
      align-items: center;
      gap: 8px;
    }

    .first-phase-score input {
      min-width: 0;
      text-align: center;
      font-weight: 900;
    }

    .first-phase-score span { color: var(--muted); font-weight: 900; }

    .score-stepper {
      display: grid;
      grid-template-columns: 34px 1fr 34px;
      gap: 6px;
      align-items: center;
    }

    .score-stepper button {
      width: 34px;
      height: 38px;
      border: 1px solid var(--line);
      border-radius: 10px;
      color: var(--blue);
      background: #eef5ff;
      font-weight: 900;
    }

    .quick-scores {
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-end;
      gap: 6px;
      margin-top: 10px;
    }

    .quick-score {
      border: 1px solid var(--line);
      border-radius: 999px;
      color: var(--ink);
      background: #fff;
      padding: 6px 9px;
      font-size: 0.78rem;
      font-weight: 900;
    }

    .quick-score:hover {
      color: #fff;
      background: var(--blue);
    }

    .first-phase-actions {
      position: sticky;
      bottom: 0;
      display: flex;
      justify-content: flex-end;
      border-top: 1px solid var(--line);
      padding-top: 12px;
      background: rgba(255, 255, 255, 0.92);
      backdrop-filter: blur(10px);
    }

    .table-toolbar {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #f8fbff;
      padding: 12px;
      margin-bottom: 12px;
    }

    .table-toolbar input {
      max-width: 320px;
      min-width: 210px;
    }

    .table-summary {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .table-summary span {
      border-radius: 999px;
      color: var(--blue);
      background: #eaf2ff;
      padding: 8px 11px;
      font-size: 0.84rem;
      font-weight: 900;
    }

    .table-wrap, .group-table-card, .admin-card {
      overflow-x: auto;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #fff;
    }

    table {
      width: 100%;
      min-width: 760px;
      border-collapse: collapse;
    }

    th, td {
      border-bottom: 1px solid var(--line);
      padding: 13px 12px;
      text-align: left;
      white-space: nowrap;
    }

    th {
      position: sticky;
      top: 0;
      z-index: 1;
      color: #516074;
      background: #f7f9fc;
      font-size: 0.78rem;
      text-transform: uppercase;
    }

    td:first-child, th:first-child {
      position: sticky;
      left: 0;
      z-index: 2;
      background: inherit;
    }

    th:first-child {
      z-index: 3;
      background: #f7f9fc;
    }

    tbody tr { transition: background 0.2s ease; }
    tbody tr:hover { background: #f7fbff; }
    .rank-1 { background: linear-gradient(90deg, rgba(216, 167, 45, 0.22), transparent); }
    .rank-2 { background: linear-gradient(90deg, rgba(186, 194, 204, 0.22), transparent); }
    .rank-3 { background: linear-gradient(90deg, rgba(201, 130, 66, 0.2), transparent); }
    .current-user-row { outline: 2px solid rgba(11, 99, 206, 0.25); outline-offset: -2px; }

    .rank-name {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 170px;
    }

    .rank-avatar {
      display: grid;
      place-items: center;
      width: 34px;
      height: 24px;
      border-radius: 6px;
      color: #fff;
      background: #e7edf5;
      font-size: 0.78rem;
      font-weight: 900;
      line-height: 1;
      overflow: hidden;
    }

    .points-cell {
      color: var(--blue);
      font-size: 1.05rem;
    }

    .progress {
      width: 110px;
      height: 8px;
      overflow: hidden;
      border-radius: 999px;
      background: #e8edf5;
    }

    .progress span {
      display: block;
      height: 100%;
      border-radius: inherit;
      background: linear-gradient(90deg, var(--green), var(--gold));
    }

    .group-tables { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
    .group-table-card { padding: 0; }
    .group-table-card h3 {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin: 0;
      padding: 14px;
      color: var(--blue);
      background: linear-gradient(135deg, #f8fbff, #fff);
    }

    .group-table-card h3 small {
      color: var(--muted);
      font-size: 0.78rem;
      font-weight: 800;
    }

    .group-table-card table { min-width: 640px; }
    .group-table-card tr.qualified { background: linear-gradient(90deg, rgba(18, 161, 80, 0.12), transparent); }
    .group-table-card tr.qualified td:first-child::after {
      content: " classifica";
      margin-left: 6px;
      color: var(--green);
      font-size: 0.72rem;
      font-weight: 900;
      text-transform: uppercase;
    }

    .knockout-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
    .knockout-card { padding: 16px; }
    .knockout-card h3 { margin-bottom: 12px; color: var(--blue); }
    .knockout-match {
      display: grid;
      gap: 8px;
      border-top: 1px solid var(--line);
      padding: 12px 0;
    }

    .rules-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 14px;
    }

    .rules-grid article { padding: 18px; }
    .rules-grid span {
      display: grid;
      place-items: center;
      width: 34px;
      height: 34px;
      border-radius: 50%;
      color: #fff;
      background: var(--blue);
      font-weight: 900;
    }

    .rules-grid h3 { margin: 14px 0 8px; }
    .rules-grid p { color: var(--muted); margin-bottom: 0; line-height: 1.5; }

    .admin-banner {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      border-radius: var(--radius);
      padding: 18px;
      margin-bottom: 18px;
      color: #fff;
      background: linear-gradient(135deg, #082750, #0b7d3b);
      box-shadow: var(--shadow-soft);
    }

    .admin-grid {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 16px;
    }

    .admin-dashboard {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
      gap: 12px;
    }

    .admin-lock-controls {
      display: grid;
      gap: 12px;
    }

    .admin-stat {
      display: grid;
      gap: 6px;
      border: 1px solid var(--line);
      border-radius: var(--radius-sm);
      padding: 14px;
      background: #f8fbff;
    }

    .admin-stat.wide {
      grid-column: span 2;
    }

    .admin-stat span {
      color: var(--muted);
      font-size: 0.76rem;
      font-weight: 900;
      text-transform: uppercase;
    }

    .admin-stat strong {
      overflow-wrap: anywhere;
      color: var(--ink);
      font-size: 1.28rem;
      line-height: 1.15;
    }

    .admin-stat small {
      color: var(--blue);
      font-weight: 800;
    }

    .admin-form {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      padding: 16px;
      background: #f8fbff;
    }

    .admin-form .btn { align-self: end; }
    .admin-game {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 12px;
      align-items: center;
      padding: 14px;
    }

    .admin-card { padding: 16px; }
    .admin-card h3 { margin-bottom: 12px; }

    .modal {
      position: fixed;
      inset: 0;
      z-index: 30;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 18px;
      background: rgba(4, 18, 35, 0.62);
    }

    .modal.open { display: flex; }

    .modal-card {
      position: relative;
      width: min(560px, 100%);
      max-height: 92vh;
      overflow-y: auto;
      padding: 22px;
      background: #fff;
      animation: modalIn 0.22s ease;
    }

    .modal-close {
      position: absolute;
      top: 12px;
      right: 12px;
      width: 34px;
      height: 34px;
      border: 0;
      border-radius: 50%;
      color: var(--ink);
      background: #eef3f8;
      font-size: 1.3rem;
    }

    .score-inputs {
      display: grid;
      grid-template-columns: 1fr auto 1fr;
      align-items: end;
      gap: 10px;
    }

    .team-inputs { grid-template-columns: 1fr 1fr; }
    .score-inputs > span { padding-bottom: 11px; font-size: 1.2rem; font-weight: 900; }

    .prediction-helper {
      display: grid;
      gap: 12px;
      border: 1px solid var(--line);
      border-radius: var(--radius-sm);
      background: #f8fbff;
      padding: 12px;
    }

    .selected-game-card {
      display: grid;
      gap: 10px;
      border: 1px solid var(--line);
      border-radius: var(--radius-sm);
      background: #fff;
      padding: 12px;
    }

    .selected-game-card strong {
      display: block;
      font-size: 1.05rem;
    }

    .prediction-scoreboard {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
      gap: 10px;
      align-items: center;
    }

    .prediction-team {
      display: grid;
      gap: 8px;
      min-width: 0;
    }

    .prediction-team-name {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      overflow-wrap: anywhere;
      font-size: 0.9rem;
      font-weight: 900;
      text-align: center;
    }

    .prediction-team-name .inline-flag {
      margin-right: 0;
    }

    .prediction-scoreboard .score-stepper {
      grid-template-columns: 38px minmax(54px, 1fr) 38px;
    }

    .prediction-scoreboard input {
      min-height: 52px;
      text-align: center;
      font-size: 1.35rem;
      font-weight: 900;
    }

    .prediction-vs {
      align-self: end;
      padding-bottom: 14px;
      color: var(--muted);
      font-weight: 900;
    }

    .saved-receipt {
      border-radius: var(--radius-sm);
      color: var(--green);
      background: var(--green-2);
      padding: 10px 12px;
      font-size: 0.86rem;
      font-weight: 900;
    }

    .game-picker-list {
      display: grid;
      gap: 8px;
      max-height: 240px;
      overflow-y: auto;
      padding-right: 4px;
    }

    .game-picker-item {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 8px;
      align-items: center;
      border: 1px solid var(--line);
      border-radius: var(--radius-sm);
      background: #fff;
      padding: 10px;
      text-align: left;
    }

    .game-picker-item.active {
      border-color: rgba(11, 99, 206, 0.5);
      background: #f2f7ff;
    }

    .game-picker-item small {
      color: var(--muted);
      font-weight: 800;
    }

    .toast {
      position: fixed;
      right: 18px;
      bottom: 18px;
      z-index: 50;
      min-width: 240px;
      max-width: 360px;
      transform: translateY(18px);
      opacity: 0;
      border: 1px solid rgba(255, 255, 255, 0.16);
      border-left: 6px solid var(--gold);
      border-radius: var(--radius);
      color: #fff;
      background: #102033;
      padding: 13px 15px;
      box-shadow: var(--shadow);
      pointer-events: none;
      transition: 0.24s ease;
    }

    .toast.show { transform: translateY(0); opacity: 1; }
    .toast.error { background: #b71e36; }

    .login-screen {
      position: fixed;
      inset: 78px 20px auto auto;
      z-index: 80;
      display: none;
      width: min(440px, calc(100vw - 28px));
      max-height: calc(100vh - 96px);
      overflow-y: auto;
      padding: 0;
      background: transparent;
    }

    .login-screen.open { display: block; }

    .login-card {
      position: relative;
      width: 100%;
      border: 1px solid rgba(255, 255, 255, 0.18);
      border-radius: var(--radius);
      color: #fff;
      background: linear-gradient(145deg, rgba(6, 42, 92, 0.96), rgba(6, 114, 68, 0.96));
      padding: 24px;
      box-shadow: var(--shadow);
      backdrop-filter: blur(18px);
    }

    .login-card h2 {
      margin-bottom: 8px;
      font-size: clamp(1.65rem, 5vw, 2.35rem);
    }

    .login-card p {
      color: rgba(255, 255, 255, 0.82);
      line-height: 1.5;
    }

    .login-tabs {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      margin: 18px 0;
    }

    .login-tab {
      border: 1px solid rgba(255, 255, 255, 0.18);
      border-radius: 999px;
      color: #fff;
      background: rgba(255, 255, 255, 0.1);
      padding: 10px 12px;
      font-weight: 900;
    }

    .login-tab.active {
      color: var(--blue);
      background: #fff;
    }

    .login-panel { display: none; gap: 12px; }
    .login-panel.active { display: grid; }
    .login-panel label { color: rgba(255, 255, 255, 0.92); }
    .login-help { font-size: 0.84rem; }

    .login-card .modal-close {
      color: #fff;
      background: rgba(255, 255, 255, 0.16);
    }

    .app-footer {
      display: flex;
      justify-content: center;
      gap: 10px;
      flex-wrap: wrap;
      padding: 0 18px 30px;
      color: #dbe8ff;
      font-size: 0.86rem;
      font-weight: 700;
      text-align: center;
    }

    .app-footer span:first-child { color: #fff1bc; }

    @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
    @keyframes liftIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
    @keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
    @keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(1.35); } }

    @media (max-width: 1080px) {
      .dashboard-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
      .workspace { grid-template-columns: 1fr; }
      .side-panel { position: static; }
      .admin-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }

    @media (max-width: 760px) {
      .hero {
        min-height: 0;
        padding: 14px 12px 58px;
      }
      .topbar {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
      }
      .brand {
        white-space: normal;
        font-size: 0.98rem;
      }
      .brand-mark {
        width: 36px;
        height: 36px;
      }
      .session-pill {
        justify-content: space-between;
        width: 100%;
      }
      .nav-actions {
        width: calc(100vw - 24px);
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        border-radius: 14px;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
      }
      .nav-actions::-webkit-scrollbar { display: none; }
      .nav-link {
        flex: 0 0 auto;
        min-height: 42px;
        scroll-snap-align: start;
      }
      .hero-content {
        grid-template-columns: 1fr;
        gap: 18px;
        padding-top: 30px;
      }
      h1 {
        font-size: clamp(2.15rem, 12vw, 3.5rem);
        line-height: 1.02;
      }
      .hero-subtitle { font-size: 0.98rem; }
      .hero-chips { margin-top: 14px; }
      .app-shell {
        margin-top: -36px;
        padding: 0 10px 30px;
      }
      .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
      }
      .rules-grid { grid-template-columns: 1fr; }
      .metric-card {
        min-height: 108px;
        padding: 13px;
      }
      .metric-card strong { font-size: 1.08rem; }
      .metric-card.wide { grid-column: auto; }
      .games-list { grid-template-columns: 1fr; }
      .content-panel {
        min-height: 0;
        padding: 12px;
        border-radius: 14px;
      }
      select, input, textarea { font-size: 16px; }
      .section-heading, .admin-banner, .game-card, .admin-game {
        align-items: stretch;
        flex-direction: column;
        grid-template-columns: 1fr;
      }
      .section-heading { gap: 10px; margin-bottom: 14px; }
      .section-heading > .btn, .admin-banner .btn { width: 100%; }
      .filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        padding: 9px;
        border-radius: 14px;
      }
      .filters select, .filters input, .filter-btn.clear {
        grid-column: 1 / -1;
        min-width: 0;
      }
      .filters .filter-btn, .filters .phase-btn {
        width: 100%;
      }
      .participant-item, .participant-actions, .participant-picks-toolbar, .first-phase-game, .admin-form {
        grid-template-columns: 1fr;
      }
      .participant-picks-toolbar {
        gap: 10px;
        padding: 10px;
        border-radius: 14px;
      }
      .picks-command-bar {
        grid-template-columns: 1fr;
        padding: 10px;
      }
      .button-row > .btn,
      .participant-actions > .btn,
      .game-actions > .btn {
        flex: 1 1 140px;
      }
      .participant-actions, .game-actions { flex-direction: row; flex-wrap: wrap; }
      .first-phase-summary, .first-phase-actions { justify-content: stretch; }
      .first-phase-summary span, .first-phase-actions .btn { width: 100%; }
      .first-phase-actions {
        bottom: 0;
        margin-inline: -12px;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
      }
      .quick-scores { justify-content: stretch; }
      .quick-score { flex: 1 1 30%; }
      .game-card { padding: 13px; }
      .game-teams {
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        gap: 7px;
        text-align: center;
      }
      .team {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        font-size: 0.86rem;
      }
      .team.away {
        flex-direction: column-reverse;
        justify-content: center;
        text-align: center;
      }
      .flag { width: 36px; height: 25px; }
      .scoreline { width: auto; min-width: 58px; padding-inline: 8px; }
      .inline-pick-row {
        grid-template-columns: 1fr auto 1fr;
      }
      .inline-pick-row > .btn {
        grid-column: 1 / -1;
        width: 100%;
      }
      .first-phase-game { padding: 11px; }
      .first-phase-score {
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        gap: 5px;
      }
      .score-stepper {
        grid-template-columns: 32px minmax(38px, 1fr) 32px;
        gap: 4px;
      }
      .score-stepper button {
        width: 32px;
        min-height: 42px;
      }
      .first-phase-score input { padding-inline: 4px; }
      .score-inputs, .team-inputs { grid-template-columns: 1fr; }
      .score-inputs > span { display: none; }
      .table-wrap, .group-table-card, .admin-card { border-radius: var(--radius-sm); }
      .table-toolbar input { max-width: none; width: 100%; }
      .admin-dashboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .admin-stat.wide { grid-column: 1 / -1; }
      .admin-card { padding: 12px; }
      .modal {
        align-items: flex-end;
        padding: 0;
      }
      .modal-card {
        width: 100%;
        max-height: 94dvh;
        border-radius: 18px 18px 0 0;
        padding: 18px 12px calc(18px + env(safe-area-inset-bottom));
      }
      .prediction-scoreboard {
        gap: 5px;
      }
      .prediction-scoreboard .score-stepper {
        grid-template-columns: 34px minmax(42px, 1fr) 34px;
        gap: 4px;
      }
      .prediction-scoreboard input {
        min-height: 48px;
        padding-inline: 4px;
        font-size: 1.15rem;
      }
      .game-picker-list { max-height: 190px; }
      .toast {
        right: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom));
        left: 10px;
        max-width: none;
      }

      table.responsive-table {
        min-width: 0;
        border-collapse: separate;
        border-spacing: 0 10px;
      }

      table.responsive-table thead {
        display: none;
      }

      table.responsive-table tr {
        display: grid;
        gap: 6px;
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
        background: #fff;
        padding: 10px;
      }

      table.responsive-table td {
        display: flex;
        justify-content: space-between;
        gap: 14px;
        border: 0;
        padding: 4px 0;
        white-space: normal;
      }

      table.responsive-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-weight: 900;
      }

      table.responsive-table td:first-child,
      table.responsive-table th:first-child {
        position: static;
      }
    }

    @media (max-width: 420px) {
      .dashboard-grid { grid-template-columns: 1fr 1fr; }
      .metric-card.wide, .metric-card.leader { grid-column: 1 / -1; }
      .filters { grid-template-columns: 1fr 1fr; }
      .filters .filter-btn, .filters .phase-btn {
        min-height: 40px;
        padding-inline: 7px;
        font-size: 0.78rem;
      }
      .progress-label {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
      }
      .first-phase-score, .prediction-scoreboard {
        grid-template-columns: 1fr;
      }
      .first-phase-score > span, .prediction-vs {
        padding: 0;
        text-align: center;
      }
      .prediction-team-name { justify-content: flex-start; text-align: left; }
      .quick-score { flex-basis: 42%; min-height: 38px; }
      .admin-dashboard { grid-template-columns: 1fr; }
      .admin-stat.wide { grid-column: auto; }
      .game-picker-item { grid-template-columns: 1fr; }
      .game-picker-item > small { justify-self: start; }
    }
