@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Oswald:wght@500;600;700&display=swap');
  :root{
    --bg:#F3F1FA;
    --bg-glow-1:rgba(124,92,255,0.14);
    --bg-glow-2:rgba(255,122,61,0.12);
    --panel:#FFFFFF;
    --panel-2:#F6F4FC;
    --text:#1A1433;
    --muted:#6A6389;
    --border:rgba(26,20,51,0.11);
    --border-strong:rgba(26,20,51,0.22);
    --gold:#F5A524;
    --gold-dark:#B8740A;
    --ember:#FF6A3D;
    --accent:#7C5CFF;
    --accent-soft:rgba(124,92,255,0.12);
    --red:#E5484D;
    --teal:#12A594;
    --grad-hot:linear-gradient(135deg, #FFB43A 0%, #FF6A3D 100%);
    --grad-brand:linear-gradient(135deg, #7C5CFF 0%, #FF6A3D 100%);
    --shadow: 0 1px 2px rgba(26,20,51,0.06), 0 8px 24px rgba(26,20,51,0.08);
    --shadow-lift: 0 2px 4px rgba(26,20,51,0.08), 0 14px 32px rgba(26,20,51,0.14);
    --radius: 16px;
  }
  @media (prefers-color-scheme: dark){
    :root:not([data-theme="light"]){
      --bg:#0D0A1C;
      --bg-glow-1:rgba(124,92,255,0.22);
      --bg-glow-2:rgba(255,106,61,0.14);
      --panel:#17122E;
      --panel-2:#211A40;
      --text:#F3F0FF;
      --muted:#A59DC9;
      --border:rgba(243,240,255,0.10);
      --border-strong:rgba(243,240,255,0.24);
      --accent:#9B82FF;
      --accent-soft:rgba(155,130,255,0.16);
      --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 10px 30px rgba(0,0,0,0.35);
      --shadow-lift: 0 2px 4px rgba(0,0,0,0.35), 0 16px 36px rgba(0,0,0,0.5);
    }
  }
  :root[data-theme="dark"]{
    --bg:#0D0A1C;
    --bg-glow-1:rgba(124,92,255,0.22);
    --bg-glow-2:rgba(255,106,61,0.14);
    --panel:#17122E;
    --panel-2:#211A40;
    --text:#F3F0FF;
    --muted:#A59DC9;
    --border:rgba(243,240,255,0.10);
    --border-strong:rgba(243,240,255,0.24);
    --accent:#9B82FF;
    --accent-soft:rgba(155,130,255,0.16);
    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 10px 30px rgba(0,0,0,0.35);
    --shadow-lift: 0 2px 4px rgba(0,0,0,0.35), 0 16px 36px rgba(0,0,0,0.5);
  }
  *{box-sizing:border-box;}
  html,body{margin:0;padding:0;}
  body{
    background:
      radial-gradient(900px 500px at 8% -10%, var(--bg-glow-1), transparent 70%),
      radial-gradient(800px 480px at 105% 0%, var(--bg-glow-2), transparent 70%),
      var(--bg);
    background-attachment:fixed;
    color:var(--text);
    font-family:'Inter',system-ui,-apple-system,'Segoe UI',sans-serif;
    min-height:100vh;
    transition:background .3s ease,color .3s ease;
  }
  h1,h2,h3,.display{
    font-family:'Oswald',system-ui,sans-serif;
    font-weight:600;
    letter-spacing:0.3px;
    margin:0;
  }
  button{ font-family:inherit; }
  input:focus-visible, button:focus-visible, [tabindex]:focus-visible{
    outline:3px solid var(--accent);
    outline-offset:2px;
  }
  .stage{
    max-width:1180px;
    margin:0 auto;
    padding:20px 20px 60px;
  }
  .topbar{
    display:flex;
    align-items:center;
    gap:16px;
    padding:8px 4px 22px;
    flex-wrap:wrap;
  }
  .brand{
    display:flex;
    align-items:center;
    gap:10px;
    font-family:'Oswald',sans-serif;
    font-size:1.35rem;
    font-weight:700;
    white-space:nowrap;
  }
  .brand-mark{
    font-size:1.1rem;
    width:40px; height:40px; border-radius:12px;
    display:flex; align-items:center; justify-content:center;
    background:var(--grad-brand); color:#fff;
    box-shadow:0 6px 16px rgba(124,92,255,0.35);
  }
  .brand > span:last-child{
    letter-spacing:0.5px; text-transform:uppercase;
  }
  .steps{
    display:flex;
    gap:6px;
    flex:1;
    min-width:220px;
    flex-wrap:wrap;
  }
  .step{
    font-size:0.78rem;
    padding:6px 12px;
    border-radius:999px;
    background:var(--panel-2);
    color:var(--muted);
    border:1px solid var(--border);
    white-space:nowrap;
  }
  .step.current{
    background:var(--grad-hot);
    color:#2A1300;
    border-color:transparent;
    font-weight:700;
    box-shadow:0 4px 12px rgba(255,106,61,0.30);
  }
  .step.done{
    color:var(--accent);
    background:var(--accent-soft);
    border-color:transparent;
    font-weight:600;
  }
  .icon-btn{
    background:var(--panel);
    border:1px solid var(--border);
    color:var(--text);
    width:40px;height:40px;
    border-radius:999px;
    cursor:pointer;
    font-size:1.05rem;
    display:flex;align-items:center;justify-content:center;
    box-shadow:var(--shadow);
    flex-shrink:0;
  }
  .screen{ display:none; }
  .screen.active{ display:block; animation:fadeIn .35s ease; }
  @keyframes fadeIn{ from{opacity:0; transform:translateY(6px);} to{opacity:1; transform:translateY(0);} }
  @media (prefers-reduced-motion: reduce){
    .screen.active{ animation:none; }
  }

  .card{
    background:var(--panel);
    border:1px solid var(--border);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    padding:28px;
    position:relative;
  }
  .card::before{
    content:""; position:absolute; left:28px; right:28px; top:-1px; height:3px;
    border-radius:0 0 3px 3px; background:var(--grad-brand); opacity:0.9;
  }
  .card-narrow{ max-width:560px; margin:0 auto; }

  .field{ margin-bottom:20px; }
  .field label{
    display:block;
    font-size:0.92rem;
    font-weight:600;
    margin-bottom:6px;
  }
  .field .hint{
    font-size:0.82rem;
    color:var(--muted);
    margin-top:6px;
  }
  .strategy-options{ display:flex; flex-direction:column; gap:10px; }
  .strategy-option{
    display:flex;
    align-items:flex-start;
    gap:10px;
    padding:12px 14px;
    border-radius:10px;
    border:1.5px solid var(--border);
    background:var(--panel-2);
    cursor:pointer;
    font-size:0.88rem;
  }
  .strategy-option:has(input:checked){
    border-color:var(--accent);
    background:var(--accent-soft);
  }
  .strategy-option input{ accent-color:var(--accent); }
  .strategy-option input{ margin-top:3px; flex-shrink:0; }
  .round-note{
    font-size:0.78rem;
    color:var(--muted);
    text-align:center;
    margin-top:2px;
    padding:0 4px;
  }
  .field input[type="number"], .field input[type="text"]{
    width:100%;
    padding:11px 13px;
    border-radius:10px;
    border:1.5px solid var(--border);
    background:var(--panel-2);
    color:var(--text);
    font-size:1rem;
    transition:border-color .15s ease, box-shadow .15s ease;
  }
  .field input:focus, .field textarea:focus, .name-row input:focus, .team-name-input:focus{
    outline:none;
    border-color:var(--accent);
    box-shadow:0 0 0 4px var(--accent-soft);
  }
  .field textarea{
    width:100%;
    padding:10px 12px;
    border-radius:10px;
    border:1.5px solid var(--border);
    background:var(--panel-2);
    color:var(--text);
    font-family:inherit;
    font-size:0.92rem;
    resize:vertical;
  }
  .link-btn{
    background:none; border:none; padding:0;
    color:var(--accent);
    text-decoration:underline;
    cursor:pointer;
    font-size:0.88rem;
    font-family:inherit;
  }
  .load-box{
    border:1.5px dashed var(--border);
    border-radius:10px;
    padding:16px;
    margin:6px 0 22px;
  }
  .share-box{
    margin-top:18px;
    padding:16px;
    border-radius:10px;
    border:1.5px solid var(--gold);
    background:rgba(232,163,61,0.08);
  }
  .recent-list{ display:flex; flex-direction:column; gap:6px; margin-top:12px; }
  .recent-item{
    display:flex; justify-content:space-between; align-items:center; gap:10px;
    padding:8px 12px; border-radius:8px;
    background:var(--panel-2); border:1px solid var(--border);
    font-size:0.85rem;
  }
  .recent-item .btn{ padding:6px 12px; font-size:0.8rem; }

  .podium{ display:flex; gap:14px; flex-wrap:wrap; margin-bottom:24px; }
  .podium-slot{
    flex:1 1 160px; text-align:center;
    padding:18px 10px; border-radius:12px;
    border:1.5px solid var(--border);
    background:var(--panel);
    box-shadow:var(--shadow);
  }
  .podium-slot.gold{
    border-color:rgba(245,165,36,0.7);
    background:linear-gradient(180deg, rgba(245,165,36,0.16), var(--panel) 70%);
    box-shadow:0 10px 26px rgba(245,165,36,0.20);
  }
  .podium-slot.silver{ background:linear-gradient(180deg, rgba(154,165,184,0.16), var(--panel) 70%); }
  .podium-slot.bronze{ background:linear-gradient(180deg, rgba(185,118,74,0.16), var(--panel) 70%); }
  .podium-slot .place-label{ text-transform:uppercase; letter-spacing:1px; font-weight:600; }
  .podium-slot .medal{ font-size:1.9rem; }
  .podium-slot .place-label{ font-size:0.75rem; color:var(--muted); margin-top:2px; }
  .podium-slot .place-name{ font-weight:700; margin-top:6px; font-family:'Oswald',sans-serif; font-size:1.02rem; }

  .modal-overlay{
    position:fixed; inset:0; z-index:50;
    background:rgba(10,14,26,0.55);
    display:flex; align-items:center; justify-content:center;
    padding:20px;
  }
  .modal-box{
    background:var(--panel);
    border-radius:var(--radius);
    padding:26px; max-width:400px; width:100%;
    box-shadow:var(--shadow);
  }
  .modal-box h3{ font-size:1.2rem; margin-bottom:8px; }

  .wildcard-panel{
    text-align:center; padding:30px 20px;
    border-radius:12px;
    border:1.5px dashed var(--accent);
    background:var(--accent-soft);
    min-width:240px;
  }
  .wildcard-panel .medal{ font-size:2rem; color:var(--accent); }
  .row{ display:flex; gap:16px; flex-wrap:wrap; }
  .row > .field{ flex:1; min-width:160px; }

  .game-results{ display:flex; flex-direction:column; gap:8px; margin:10px 0 18px; max-height:260px; overflow-y:auto; }
  .game-result{
    display:flex; justify-content:space-between; align-items:center; gap:10px;
    padding:11px 14px; border-radius:10px;
    border:1.5px solid var(--border); background:var(--panel-2);
  }
  .game-result .g-name{ font-weight:700; }
  .game-result .g-desc{ font-size:0.8rem; color:var(--muted); margin-top:2px; }
  .game-result .btn{ padding:7px 14px; font-size:0.82rem; flex-shrink:0; }
  .divider-label{
    display:flex; align-items:center; gap:10px;
    color:var(--muted); font-size:0.8rem; margin:18px 0;
  }
  .divider-label::before, .divider-label::after{ content:""; flex:1; height:1px; background:var(--border); }

  .roster-table{ display:flex; flex-direction:column; gap:10px; max-height:60vh; overflow-y:auto; }
  .roster-group{
    border:1.5px solid var(--border); border-radius:10px; padding:12px 14px;
    background:var(--panel-2);
  }
  .roster-group.disabled{ opacity:0.5; }
  .roster-group-head{ display:flex; justify-content:space-between; align-items:center; gap:10px; }
  .roster-group-head .g-name{ font-weight:700; }
  .roster-member-row{
    display:flex; justify-content:space-between; align-items:center; gap:10px;
    padding:6px 0; font-size:0.9rem;
  }
  .roster-member-row + .roster-member-row{ border-top:1px solid var(--border); }
  .roster-member-row select{
    font-size:0.8rem; padding:5px 8px; border-radius:6px;
    border:1.5px solid var(--border); background:var(--panel); color:var(--text);
  }
  .switch{ position:relative; display:inline-block; width:38px; height:22px; flex-shrink:0; }
  .switch input{ opacity:0; width:0; height:0; }
  .switch .slider{
    position:absolute; inset:0; background:var(--border); border-radius:999px;
    transition:background .15s ease; cursor:pointer;
  }
  .switch .slider::before{
    content:""; position:absolute; width:16px; height:16px; left:3px; top:3px;
    background:#fff; border-radius:50%; transition:transform .15s ease;
  }
  .switch input:checked + .slider{ background:var(--accent); }
  .switch input:checked + .slider::before{ transform:translateX(16px); }
  .modal-box.wide{ max-width:560px; }

  .icon{
    display:inline-block; width:1em; height:1em;
    vertical-align:-0.15em; flex-shrink:0;
  }
  .icon-line{ fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
  .icon-solid{ fill:currentColor; stroke:none; }
  .icon-solid .icon-cutout{ fill:transparent; stroke:currentColor; stroke-width:1.4; }
  .icon-lg{ width:1.6em; height:1.6em; }
  .icon-xl{ width:2.2em; height:2.2em; }
  .medal-gold{ color:#F5A524; }
  .medal-silver{ color:#9AA5B8; }
  .medal-bronze{ color:#B9764A; }

  .team-icon-picker{ display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
  .team-icon-btn{
    width:36px; height:36px; border-radius:8px;
    border:1.5px solid var(--border); background:var(--panel-2);
    color:var(--muted); display:flex; align-items:center; justify-content:center;
    cursor:pointer; padding:0;
  }
  .team-icon-btn .icon{ width:18px; height:18px; }
  .team-icon-btn.selected{ border-color:var(--gold); background:rgba(232,163,61,0.15); color:var(--gold-dark); }
  @media (prefers-color-scheme: dark){ :root:not([data-theme="light"]) .team-icon-btn.selected{ color:var(--gold); } }
  :root[data-theme="dark"] .team-icon-btn.selected{ color:var(--gold); }
  .team-icon-btn.none-selected{ font-size:0.7rem; }

  .team-blocks{ display:flex; flex-direction:column; gap:14px; margin-bottom:6px; }
  .team-name-row-wrap{
    border:1.5px solid var(--border); border-radius:10px;
    padding:12px 14px; background:var(--panel-2);
  }
  .team-name-row-wrap .team-name-row{ display:flex; }
  .team-name-row-wrap .team-name-input{
    flex:1; padding:9px 11px; border-radius:8px;
    border:1.5px solid var(--border); background:var(--panel);
    color:var(--text); font-size:0.92rem;
  }

  .report-btn{
    position:fixed; right:18px; bottom:18px; z-index:40;
    background:var(--panel); color:var(--text);
    border:1.5px solid var(--border); border-radius:999px;
    padding:10px 16px; font-size:0.85rem; font-weight:600;
    box-shadow:var(--shadow); cursor:pointer;
    display:flex; align-items:center; gap:8px;
  }

  .standings-table{ width:100%; border-collapse:collapse; font-size:0.92rem; }
  .standings-table th, .standings-table td{
    text-align:left; padding:8px 10px; border-bottom:1px solid var(--border);
  }
  .standings-table th{ color:var(--muted); font-weight:600; font-size:0.8rem; }
  .standings-table th{ text-transform:uppercase; letter-spacing:0.8px; font-size:0.72rem; }
  .standings-table tbody tr:first-child td{ font-weight:700; background:rgba(245,165,36,0.12); }
  .standings-table tbody tr:first-child td:first-child{ box-shadow:inset 4px 0 0 var(--gold); }
  .standings-table td.num{ text-align:center; }

  .schedule-round{ margin-bottom:22px; }
  .schedule-round:last-child{ margin-bottom:0; }
  .schedule-round-title{
    display:inline-block;
    font-family:'Oswald',sans-serif; font-size:0.78rem; font-weight:600;
    letter-spacing:1.4px; text-transform:uppercase;
    color:var(--accent); background:var(--accent-soft);
    padding:5px 14px; border-radius:999px; margin-bottom:12px;
  }
  .schedule-matches .match-card.live{ box-shadow:var(--shadow); border-color:var(--border-strong); }
  .schedule-matches .match-card.live:hover{ border-color:var(--accent); }
  .schedule-matches{ display:grid; grid-template-columns:repeat(auto-fill, minmax(220px,1fr)); gap:12px; }

  .group-card{
    border:1.5px solid var(--border); border-radius:12px; padding:16px;
    margin-bottom:18px; background:var(--panel-2);
  }
  .group-card:last-child{ margin-bottom:0; }
  .group-card h3{ font-size:1rem; margin-bottom:10px; }
  .group-card .standings-table{ background:var(--panel); border-radius:8px; overflow:hidden; margin-bottom:14px; }

  .reshuffle-panel{
    text-align:center; padding:30px 20px;
    border-radius:12px; border:1.5px dashed var(--teal);
    background:rgba(33,143,139,0.08);
  }

  .cover-preview{
    margin-bottom:18px; padding:10px; border-radius:10px;
    background:var(--panel-2); border:1px solid var(--border);
  }
  .cover-preview-row{ display:flex; gap:14px; align-items:center; }
  .cover-preview img{ width:56px; height:74px; border-radius:6px; object-fit:cover; box-shadow:var(--shadow); flex-shrink:0; }
  .cover-preview .cover-note{ font-size:0.8rem; color:var(--muted); }
  .cover-thumb{ width:34px; height:44px; border-radius:5px; object-fit:cover; flex-shrink:0; margin-right:10px; }
  .game-result{ align-items:center; }
  .game-result-main{ display:flex; align-items:center; flex:1; min-width:0; }

  .team-name-row{ display:flex; gap:8px; }
  .team-name-row .emoji-input{
    width:52px; text-align:center; padding:9px 4px;
    border-radius:8px; border:1.5px solid var(--border);
    background:var(--panel-2); color:var(--text); font-size:1.1rem;
  }
  .team-name-row .team-name-input{
    flex:1; padding:9px 11px; border-radius:8px;
    border:1.5px solid var(--border); background:var(--panel-2);
    color:var(--text); font-size:0.92rem;
  }

  .btn{
    display:inline-flex;
    align-items:center;
    gap:8px;
    justify-content:center;
    padding:12px 22px;
    border-radius:10px;
    border:none;
    font-weight:600;
    font-size:0.98rem;
    cursor:pointer;
    background:var(--grad-hot);
    color:#2A1300;
    box-shadow:0 4px 14px rgba(255,106,61,0.28), inset 0 1px 0 rgba(255,255,255,0.35);
    transition:transform .12s ease, box-shadow .12s ease, border-color .12s ease, background-color .12s ease;
  }
  .btn:hover{ transform:translateY(-1px); box-shadow:0 8px 22px rgba(255,106,61,0.40), inset 0 1px 0 rgba(255,255,255,0.35); }
  .btn:active{ transform:translateY(0); }
  .btn.secondary{
    background:var(--panel);
    color:var(--text);
    border:1.5px solid var(--border);
    box-shadow:none;
  }
  .btn.secondary:hover{ box-shadow:none; border-color:var(--accent); color:var(--accent); }
  .btn:disabled{ opacity:0.5; cursor:not-allowed; transform:none; box-shadow:none; }
  .btn-row{ display:flex; gap:12px; margin-top:8px; flex-wrap:wrap; }

  .names-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill, minmax(190px,1fr));
    gap:12px;
    margin-bottom:22px;
  }
  .name-row{ display:flex; gap:6px; align-items:center; }
  .name-row input{
    flex:1;
    padding:9px 11px;
    border-radius:8px;
    border:1.5px solid var(--border);
    background:var(--panel-2);
    color:var(--text);
    font-size:0.92rem;
  }
  .name-remove-btn{
    width:32px; height:32px; flex-shrink:0;
    border-radius:8px; border:1.5px solid var(--border);
    background:var(--panel-2); color:var(--muted);
    display:flex; align-items:center; justify-content:center; cursor:pointer;
  }
  .name-remove-btn:hover{ color:var(--red); border-color:var(--red); }
  .name-remove-btn:disabled{ opacity:0.35; cursor:not-allowed; }
  .name-remove-btn .icon{ width:13px; height:13px; }

  .btn.is-loading{ position:relative; color:transparent !important; pointer-events:none; }
  .btn.is-loading .icon{ visibility:hidden; }
  .btn.is-loading::after{
    content:"";
    position:absolute; left:50%; top:50%; width:16px; height:16px;
    margin:-8px 0 0 -8px;
    border:2px solid rgba(255,255,255,0.4);
    border-top-color:#fff;
    border-radius:50%;
    animation:btnSpin 0.7s linear infinite;
  }
  .btn.secondary.is-loading::after{ border-color:var(--border); border-top-color:var(--text); }
  @keyframes btnSpin{ to{ transform:rotate(360deg); } }

  .cover-candidates{ display:flex; flex-wrap:wrap; gap:10px; margin-top:10px; }
  .cover-candidate{
    width:84px; border:none; background:none; padding:0; cursor:pointer;
    border-radius:8px; overflow:hidden;
  }
  .cover-candidate img{
    width:84px; height:110px; object-fit:cover; border-radius:8px;
    border:2px solid var(--border); display:block;
  }
  .cover-candidate.selected img{ border-color:var(--gold); }
  .cover-candidate .cc-name{
    font-size:0.7rem; color:var(--muted); margin-top:4px;
    display:block; text-align:center; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  }

  .wheel-layout{
    display:flex;
    gap:32px;
    flex-wrap:wrap;
    align-items:flex-start;
  }
  .wheel-col{
    flex:1 1 340px;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:18px;
  }
  .wheel-wrap{
    position:relative;
    width:min(340px, 84vw);
    height:min(340px, 84vw);
  }
  .wheel-pointer{
    position:absolute;
    top:-6px; left:50%;
    transform:translateX(-50%);
    width:0;height:0;
    border-left:14px solid transparent;
    border-right:14px solid transparent;
    border-top:26px solid var(--ember);
    filter:drop-shadow(0 2px 3px rgba(0,0,0,0.25));
    z-index:3;
  }
  canvas#wheelCanvas{
    width:100%;height:100%;
    border-radius:50%;
    box-shadow:0 0 0 6px var(--panel), 0 0 0 10px var(--accent), 0 16px 40px rgba(124,92,255,0.30);
  }
  .wheel-prompt{
    text-align:center;
    font-size:1.05rem;
    min-height:1.4em;
  }
  .wheel-prompt strong{ color:var(--gold-dark); }
  @media (prefers-color-scheme: dark){
    :root:not([data-theme="light"]) .wheel-prompt strong{ color:var(--gold); }
  }
  :root[data-theme="dark"] .wheel-prompt strong{ color:var(--gold); }
  .wheel-result{
    font-family:'Oswald',sans-serif;
    font-size:1.2rem;
    min-height:1.4em;
    text-align:center;
  }

  .progress-col{
    flex:1 1 300px;
  }
  .progress-title{ font-size:0.85rem; color:var(--muted); margin-bottom:10px; text-transform:none; }
  .team-list{ display:flex; flex-direction:column; gap:10px; max-height:420px; overflow-y:auto; padding-right:4px; }
  .team-chip{
    border:1.5px solid var(--border);
    border-radius:10px;
    padding:10px 14px;
    background:var(--panel-2);
  }
  .team-chip .t-name{ font-weight:700; font-size:0.92rem; }
  .team-chip .t-members{ font-size:0.85rem; color:var(--muted); margin-top:4px; }
  .team-chip.full{ border-color:var(--accent); background:var(--accent-soft); }
  .slot-track{ display:flex; flex-wrap:wrap; gap:8px; }
  .slot-pill{
    padding:6px 12px;
    border-radius:999px;
    background:var(--panel-2);
    border:1.5px solid var(--border);
    font-size:0.85rem;
  }
  .slot-pill.filled{ background:var(--grad-hot); color:#2A1300; border-color:transparent; font-weight:600; }

  .bracket-scroll{
    overflow-x:auto;
    padding-bottom:14px;
    margin:0 -4px;
  }
  .bracket-track{
    position:relative;
    display:flex;
    gap:64px;
    align-items:stretch;
    min-width:max-content;
    padding:6px 4px 4px;
  }
  .bracket-lines{
    position:absolute; left:0; top:0;
    pointer-events:none; overflow:visible;
  }
  .bracket-lines path{
    fill:none; stroke:var(--border-strong); stroke-width:2;
    stroke-linecap:round; stroke-linejoin:round;
    transition:stroke .2s ease;
  }
  .bracket-lines path.decided{ stroke:var(--gold); stroke-width:2.5; }
  .round-col{
    display:flex;
    flex-direction:column;
    min-width:230px;
    max-width:260px;
  }
  .round-title{
    align-self:center;
    font-family:'Oswald',sans-serif;
    font-size:0.78rem;
    font-weight:600;
    letter-spacing:1.4px;
    text-transform:uppercase;
    color:var(--accent);
    background:var(--accent-soft);
    padding:5px 14px;
    border-radius:999px;
    margin-bottom:10px;
  }
  .round-col.is-final .round-title{
    background:var(--grad-hot); color:#2A1300;
    box-shadow:0 4px 12px rgba(255,106,61,0.28);
  }
  .round-matches{
    flex:1;
    display:flex;
    flex-direction:column;
    justify-content:space-around;
    gap:18px;
  }
  .match-card{
    position:relative;
    background:var(--panel);
    border:1.5px solid var(--border);
    border-radius:12px;
    overflow:hidden;
    box-shadow:var(--shadow);
    transition:border-color .15s ease, box-shadow .15s ease, transform .15s ease;
  }
  .match-card.live{
    border-color:var(--accent);
    box-shadow:0 0 0 4px var(--accent-soft), var(--shadow);
  }
  .match-card.decided{ border-color:rgba(245,165,36,0.55); }
  .round-col.is-final .match-card{ border-width:2px; }
  .entity-row{
    position:relative;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    padding:11px 14px;
    font-size:0.92rem;
    font-weight:500;
    cursor:default;
    transition:background-color .12s ease, opacity .12s ease;
  }
  .entity-row > span:first-child{ min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .entity-row + .entity-row{ border-top:1px solid var(--border); }
  .entity-row.pickable{ cursor:pointer; }
  .entity-row.pickable::after{
    content:"Advance \203A";
    font-size:0.72rem; font-weight:600; color:var(--accent);
    opacity:0; transition:opacity .12s ease; white-space:nowrap;
  }
  .entity-row.pickable:hover, .entity-row.pickable:focus-visible{ background:var(--accent-soft); }
  .entity-row.pickable:hover::after, .entity-row.pickable:focus-visible::after{ opacity:1; }
  .entity-row.winner{
    background:linear-gradient(90deg, rgba(245,165,36,0.24), rgba(245,165,36,0.06));
    box-shadow:inset 4px 0 0 var(--gold);
    font-weight:700;
  }
  .entity-row.winner .icon{ color:var(--gold); }
  .entity-row.loser{ opacity:0.45; text-decoration:line-through; text-decoration-color:var(--muted); }
  .entity-row.tbd, .entity-row.bye{ color:var(--muted); font-style:italic; font-weight:400; }

  .champion-banner{
    text-align:center;
    padding:44px 20px;
    border-radius:var(--radius);
    background:
      radial-gradient(600px 220px at 50% 0%, rgba(245,165,36,0.35), transparent 70%),
      linear-gradient(160deg, #2A1B5E 0%, #17122E 60%, #3A1726 100%);
    color:#FFF8EC;
    border:1.5px solid rgba(245,165,36,0.6);
    box-shadow:0 18px 40px rgba(124,92,255,0.25);
    position:relative;
    overflow:hidden;
    margin-bottom:28px;
  }
  .champion-banner .trophy{ font-size:3rem; color:var(--gold); filter:drop-shadow(0 4px 14px rgba(245,165,36,0.6)); }
  .champion-banner h2{
    font-size:2.4rem; margin-top:6px; text-transform:uppercase; letter-spacing:1px;
    background:linear-gradient(180deg, #FFE3A3, #F5A524); -webkit-background-clip:text; background-clip:text; color:transparent;
  }
  .champion-banner h2 .icon{ color:#F5A524; }
  .champion-banner p{ color:rgba(255,248,236,0.75); margin-top:6px; }

  .confetti-piece{
    position:absolute;
    top:-12px;
    width:9px;height:14px;
    opacity:0.9;
    border-radius:2px;
    animation:fall linear forwards;
  }
  @keyframes fall{
    to{ transform:translateY(360px) rotate(300deg); opacity:0; }
  }
  @media (prefers-reduced-motion: reduce){
    .confetti-piece{ display:none; }
  }

  .top-actions{
    display:flex;
    justify-content:flex-end;
    gap:10px;
    margin-bottom:14px;
    flex-wrap:wrap;
  }
  .muted-note{ color:var(--muted); font-size:0.88rem; margin-top:14px; }
  .sr-only{
    position:absolute; width:1px; height:1px; padding:0; margin:-1px;
    overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
  }

  .fillin-tag{
    display:inline-block; margin-left:6px; padding:1px 8px; border-radius:999px;
    font-size:0.72rem; font-weight:600; font-style:normal;
    color:var(--accent); background:var(--accent-soft); vertical-align:1px;
  }
  .wildcard-note{ display:block; font-style:normal; color:var(--muted); font-size:0.82rem; margin-top:4px; }
  .wildcard-note:empty{ display:none; }
  .strategy-option:has(input:disabled){ opacity:0.55; cursor:not-allowed; }

  .pull-review{
    width:100%; max-width:420px;
    border:1.5px solid var(--accent); border-radius:12px;
    background:var(--accent-soft); padding:14px;
  }
  .pull-review-head{ font-weight:700; margin-bottom:10px; text-align:center; }
  .pull-review-head span{ display:block; font-weight:400; font-size:0.82rem; color:var(--muted); margin-top:2px; }
  .pull-row{
    display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap;
    padding:8px 10px; border-radius:8px; background:var(--panel); border:1px solid var(--border);
    margin-bottom:8px;
  }
  .pull-name{ font-weight:700; }
  .pull-actions{ display:flex; gap:8px; flex-wrap:wrap; }
  .pull-actions select{
    font-size:0.82rem; padding:6px 8px; border-radius:8px;
    border:1.5px solid var(--border); background:var(--panel-2); color:var(--text);
  }
  .pull-actions .btn{ padding:6px 12px; font-size:0.82rem; }

  /* Footer: a pill that belongs to the app, scoped under .stage so a host
     theme's footer/span/link rules can't restyle it. */
  .stage .bf-footer{
    display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:6px 12px;
    width:fit-content; max-width:100%; box-sizing:border-box;
    margin:28px auto 0; padding:9px 18px;
    background:var(--panel); border:1px solid var(--border); border-radius:999px;
    box-shadow:var(--shadow);
    font:500 0.8rem/1.4 'Inter',system-ui,sans-serif; color:var(--muted); text-align:center;
  }
  .stage .bf-footer span, .stage .bf-footer a{ margin:0; padding:0; background:none; border:0; font:inherit; line-height:inherit; }
  .stage .bf-footer a{ color:var(--muted); text-decoration:underline; text-decoration-color:var(--border-strong); text-underline-offset:3px; }
  .stage .bf-footer a:hover{ color:var(--accent); text-decoration-color:var(--accent); }
  .stage .bf-footer .bf-footer-brand{ display:inline-flex; align-items:center; gap:6px; font-weight:700; color:var(--text); }
  .stage .bf-footer .bf-footer-brand .icon{ color:var(--accent); width:1.25em; height:1.25em; }
  .stage .bf-footer .bf-footer-version{
    font-size:0.72rem; font-weight:700; line-height:1; color:var(--accent);
    background:var(--accent-soft); padding:3px 8px; border-radius:999px;
  }
  .stage .bf-footer .bf-footer-sep{ width:3px; height:3px; border-radius:50%; background:var(--border-strong); }

  /* Keep the host page's (e.g. a WordPress theme's) line spacing out of the tool. */
  .stage, .modal-overlay, .report-btn{ line-height:1.5; }
  .stage p, .modal-overlay p{ line-height:1.5; }

  .cover-candidates{ display:grid; grid-template-columns:repeat(auto-fill, minmax(84px, 1fr)); }
  .cover-candidate{ width:auto; }
  .cover-candidate img{ width:100%; height:auto; aspect-ratio:2/3; }

  @media (max-width: 640px){
    .stage{ padding:12px 12px 64px; }
    .topbar{ gap:10px; padding:4px 2px 14px; }
    .brand{ font-size:1.2rem; }
    .brand-mark{ width:36px; height:36px; border-radius:10px; }
    .icon-btn{ order:2; margin-left:auto; width:36px; height:36px; }
    .steps{
      order:3; flex:1 0 100%; min-width:0;
      flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none;
      margin:0 -12px; padding:2px 12px;
    }
    .steps::-webkit-scrollbar{ display:none; }
    .step{ padding:5px 11px; font-size:0.74rem; flex-shrink:0; }

    .card{ padding:22px 16px; border-radius:14px; }
    .card::before{ left:16px; right:16px; }
    .card h2{ font-size:1.45rem; }
    .row{ gap:12px; }
    .row > .field{ min-width:130px; }

    .game-result{ flex-wrap:wrap; }
    .game-result-main{ flex:1 1 100%; }
    .game-result .btn{ flex:1 1 100%; }
    .cover-thumb{ width:40px; height:54px; }

    .report-btn{ right:12px; bottom:12px; padding:8px 13px; font-size:0.8rem; }
  }
  .cover-note a{ color:var(--accent); }

  /* Form controls have an intrinsic minimum width (~20 characters), so as
     flex/grid children they refuse to shrink and push their neighbours
     (like a player row's remove button) into the next cell. Let every
     control shrink to the space its row actually has. */
  .stage input, .stage select, .stage textarea,
  .modal-overlay input, .modal-overlay select, .modal-overlay textarea{
    min-width:0; max-width:100%; box-sizing:border-box;
  }
  .name-row, .team-name-row, .recent-item, .pull-row, .roster-member-row, .game-result{ min-width:0; }
  .name-row input{ width:100%; }
  /* ".field label{display:block}" outranks .strategy-option, which made each
     radio sit inline with its text so wrapped lines ran back under it. */
  .field .strategy-option{ display:flex; margin-bottom:0; font-weight:400; }
  .strategy-option > span{ flex:1; min-width:0; }

  /* Event bar: game, cover and names carried onto every screen after the game step */
  .event-bar{
    display:flex; align-items:center; gap:16px;
    margin:0 auto 18px; padding:12px 18px 12px 12px;
    background:var(--panel); border:1px solid var(--border); border-radius:var(--radius);
    box-shadow:var(--shadow);
    position:relative; overflow:hidden;
  }
  .event-bar::after{
    content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--grad-brand);
  }
  .event-cover{
    width:52px; height:70px; flex:none; border-radius:8px; object-fit:cover;
    background:var(--panel-2); box-shadow:0 4px 12px rgba(0,0,0,0.25);
  }
  .event-text{ min-width:0; }
  .event-title{
    font-family:'Oswald',sans-serif; font-weight:700; font-size:1.35rem; line-height:1.15;
    letter-spacing:0.3px; overflow-wrap:anywhere;
  }
  .event-meta{ margin-top:4px; font-size:0.86rem; color:var(--muted); overflow-wrap:anywhere; }
  @media (max-width: 640px){
    .event-bar{ gap:12px; padding:10px 14px 10px 10px; margin-bottom:14px; }
    .event-cover{ width:40px; height:54px; border-radius:6px; }
    .event-title{ font-size:1.12rem; }
    .event-meta{ font-size:0.8rem; }
  }
