        @font-face {
      font-family: 'Geist';
      src: url('/Geist.ttf') format('truetype-variations'), url('/Geist.ttf') format('truetype');
      font-weight: 100 900;
      font-style: normal;
      font-display: swap;
    }

    * { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

    :root {
      --blue: #3b82f6;
      --red: #ef4444;
      --green: #22c55e;
      --yellow: #f59e0b;
      --bg: #000;
      --surface: rgba(15, 25, 50, 0.8);
      --border: rgba(255,255,255,0.08);
      --sep: rgba(255,255,255,0.08);
      --text: var(--wc-text);
      --text-secondary: var(--wc-text-secondary);
      --text-dim: #a1a1a6;
      --accent: var(--wc-accent);
      --card-bg: rgba(255,255,255,0.03);
      --card-border: rgba(255,255,255,0.08);
    }

    html, body {
      height: 100vh;
      background: #000;
      color: var(--text);
      font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Inter', system-ui, sans-serif;
      -webkit-font-smoothing: antialiased;
      letter-spacing: -0.012em;
      overflow: hidden;
    }

    .bg-glow { position: fixed; inset: 0; z-index: 0; pointer-events: none;
      background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(41,151,255,0.10) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 85% 100%, rgba(175,82,222,0.07) 0%, transparent 55%); }
    #bubbles-wrap { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
    .bubble { position: absolute; border-radius: 50%; filter: blur(130px); pointer-events: none; will-change: transform; transform: translateZ(0); }
    .b1 { animation: f1 44s ease-in-out infinite; }
    .b2 { animation: f2 60s ease-in-out infinite; }
    .b3 { animation: f3 50s ease-in-out infinite; }
    .b4 { animation: f4 70s ease-in-out infinite; }
    @keyframes f1 { 0%{transform:translate(0,0) scale(1)} 15%{transform:translate(35vw,20vh) scale(1.1)} 35%{transform:translate(60vw,-10vh) scale(0.9)} 55%{transform:translate(20vw,55vh) scale(1.05)} 75%{transform:translate(-10vw,30vh) scale(0.95)} 100%{transform:translate(0,0) scale(1)} }
    @keyframes f2 { 0%{transform:translate(0,0) scale(1)} 20%{transform:translate(-40vw,25vh) scale(1.08)} 40%{transform:translate(-60vw,-20vh) scale(0.93)} 65%{transform:translate(15vw,50vh) scale(1.06)} 85%{transform:translate(-25vw,-35vh) scale(0.97)} 100%{transform:translate(0,0) scale(1)} }
    @keyframes f3 { 0%{transform:translate(0,0) scale(1)} 25%{transform:translate(-30vw,40vh) scale(0.92)} 45%{transform:translate(50vw,30vh) scale(1.07)} 70%{transform:translate(30vw,-40vh) scale(0.96)} 88%{transform:translate(-50vw,10vh) scale(1.04)} 100%{transform:translate(0,0) scale(1)} }
    @keyframes f4 { 0%{transform:translate(0,0) scale(1)} 18%{transform:translate(55vw,-30vh) scale(1.06)} 42%{transform:translate(-20vw,-50vh) scale(0.94)} 68%{transform:translate(40vw,45vh) scale(1.03)} 82%{transform:translate(-45vw,20vh) scale(0.97)} 100%{transform:translate(0,0) scale(1)} }


    /* ── Main layout ── */
    #app { display: flex; flex-direction: column; height: 100vh; padding-top: 64px; position: relative; z-index: 1; }
    @media (max-width: 600px) {
      #app { padding-top: 56px; }
    }






    /* ── Scroll area ── */
    .scroll {
      flex: 1; overflow-y: auto; padding: 12px 12px 100px;
      -webkit-overflow-scrolling: touch;
    }

    /* ── Section labels ── */
    .section-label {
      font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
      color: var(--text-dim); text-transform: uppercase;
      margin: 14px 4px 8px;
    }

    /* ── Button grid ── */
    .btn-grid {
      display: grid;
      gap: 10px;
    }
    .btn-grid-2 { grid-template-columns: 1fr 1fr; }
    .btn-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
    .btn-grid-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

    /* ── Base button ── */
    .sd-btn {
      display: flex; flex-direction: column;
      align-items: center; justify-content: center;
      gap: 6px;
      padding: 16px 8px;
      border-radius: 16px;
      border: 1px solid var(--border);
      background: var(--surface);
      color: var(--text);
      font-size: 12px; font-weight: 600;
      cursor: pointer;
      user-select: none;
      transition: opacity 0.1s, transform 0.1s;
      -webkit-user-select: none;
      touch-action: manipulation;
      min-height: 80px;
    }

    .sd-btn { position: relative; overflow: hidden; }
    .sd-btn:active { opacity: 0.65; transform: scale(0.92); }

    /* Ripple effect at click position */
    .sd-btn .ripple {
      position: absolute;
      border-radius: 50%;
      transform: scale(0);
      background: rgba(255,255,255,0.45);
      pointer-events: none;
      animation: rippleExpand 0.6s cubic-bezier(0.22,1,0.36,1) forwards;
    }
    @keyframes rippleExpand {
      to { transform: scale(3.5); opacity: 0; }
    }

    /* Success pulse after server ack */
    @keyframes sdAck {
      0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.6); }
      60%  { box-shadow: 0 0 0 14px rgba(34,197,94,0); }
      100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
    }
    @keyframes sdErr {
      0%   { box-shadow: 0 0 0 0 rgba(239,68,68,0.7); }
      60%  { box-shadow: 0 0 0 14px rgba(239,68,68,0); }
      100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
    }
    .sd-btn.ack { animation: sdAck 0.65s ease-out; }
    .sd-btn.err { animation: sdErr 0.65s ease-out; }

    /* Score / card / goal buttons: same ack feedback */
    .score-btn, .card-btn, .goal-edit-btn, .goal-del-btn { position: relative; overflow: hidden; }
    .score-btn.ack, .card-btn.ack, .goal-edit-btn.ack, .goal-del-btn.ack { animation: sdAck 0.55s ease-out; }
    .score-btn.err, .card-btn.err, .goal-edit-btn.err, .goal-del-btn.err { animation: sdErr 0.55s ease-out; }
    .score-btn .ripple, .card-btn .ripple, .goal-edit-btn .ripple, .goal-del-btn .ripple {
      position: absolute; border-radius: 50%; transform: scale(0);
      background: rgba(255,255,255,0.45); pointer-events: none;
      animation: rippleExpand 0.55s cubic-bezier(0.22,1,0.36,1) forwards;
    }

    .sd-btn .icon { font-size: 26px; line-height: 1; }
    .sd-btn .label { font-size: 11px; text-align: center; color: var(--text-dim); }

    /* ── Color variants ── */
    .sd-btn.green  { background: rgba(34,197,94,0.15);  border-color: rgba(34,197,94,0.35);  color: #86efac; }
    .sd-btn.red    { background: rgba(239,68,68,0.15);  border-color: rgba(239,68,68,0.35);  color: #fca5a5; }
    .sd-btn.blue   { background: rgba(59,130,246,0.15); border-color: rgba(59,130,246,0.35); color: #93c5fd; }
    .sd-btn.yellow { background: rgba(245,158,11,0.15); border-color: rgba(245,158,11,0.35); color: #fcd34d; }
    .sd-btn.orange { background: rgba(249,115,22,0.15); border-color: rgba(249,115,22,0.35); color: #fdba74; }
    .sd-btn.purple { background: rgba(168,85,247,0.15); border-color: rgba(168,85,247,0.35); color: #d8b4fe; }

    .sd-btn.active-state {
      box-shadow: 0 0 0 2px #22c55e66;
      border-color: #22c55e88;
    }

    /* ── Score team row ── */
    .team-score-row {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 14px 16px;
      display: flex; align-items: center; gap: 10px;
    }

    .team-name {
      flex: 1; font-size: 13px; font-weight: 700;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }

    .score-val {
      font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums;
      min-width: 48px; text-align: center; color: #e8f0ff;
    }

    .score-btn {
      width: 48px; height: 48px; border-radius: 12px;
      border: none; cursor: pointer;
      font-size: 22px; font-weight: 700;
      display: flex; align-items: center; justify-content: center;
      transition: opacity 0.1s, transform 0.1s;
      touch-action: manipulation;
    }
    .score-btn:active { opacity: 0.6; transform: scale(0.92); }
    .score-btn.inc { background: rgba(34,197,94,0.25); color: #86efac; }
    .score-btn.dec { background: rgba(239,68,68,0.2);  color: #fca5a5; }

    /* ── Cards row ── */
    .cards-row {
      display: flex; align-items: center; gap: 8px;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 12px 14px;
    }

    .cards-row .team-name { font-size: 12px; }

    .card-btn {
      padding: 8px 12px; border-radius: 10px;
      border: none; cursor: pointer; font-size: 14px;
      font-weight: 700; display: flex; align-items: center; gap: 4px;
      touch-action: manipulation; transition: opacity 0.1s, transform 0.1s;
    }
    .card-btn:active { opacity: 0.6; transform: scale(0.92); }
    .card-btn.yellow { background: rgba(245,158,11,0.2); color: #fcd34d; }
    .card-btn.red    { background: rgba(239,68,68,0.2);  color: #fca5a5; }

    .card-count { font-size: 11px; opacity: 0.7; }

    /* ── Scoreboard-dependent sections ── */
    #sb-sections {
      transition: opacity 0.4s ease;
    }
    #sb-sections.hidden {
      opacity: 0.22;
      pointer-events: none;
    }

    /* ── Buts / goal list ── */
    .goal-list { display: flex; flex-direction: column; gap: 8px; }

    .goal-item {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 12px 14px;
      display: flex; align-items: center; gap: 10px;
    }

    .goal-side-badge {
      width: 28px; height: 28px; border-radius: 8px;
      display: flex; align-items: center; justify-content: center;
      font-size: 13px; font-weight: 800; flex-shrink: 0;
    }
    .goal-side-badge.a { background: rgba(59,130,246,0.25); color: #93c5fd; }
    .goal-side-badge.b { background: rgba(239,68,68,0.25);  color: #fca5a5; }

    .goal-info { flex: 1; min-width: 0; }
    .goal-name { font-size: 13px; font-weight: 600; color: #e8f0ff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .goal-meta { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

    .goal-edit-btn {
      padding: 7px 12px; border-radius: 10px;
      background: rgba(59,130,246,0.15);
      border: 1px solid rgba(59,130,246,0.3);
      color: #93c5fd; font-size: 12px; font-weight: 600;
      cursor: pointer; flex-shrink: 0;
      touch-action: manipulation;
    }

    .goal-del-btn {
      width: 34px; height: 34px; border-radius: 10px;
      background: rgba(239,68,68,0.12);
      border: 1px solid rgba(239,68,68,0.25);
      color: #fca5a5; font-size: 16px; font-weight: 700;
      cursor: pointer; flex-shrink: 0;
      display: flex; align-items: center; justify-content: center;
      touch-action: manipulation; transition: opacity 0.1s, transform 0.1s;
    }
    .goal-del-btn:active { opacity: 0.6; transform: scale(0.92); }

    .goal-empty { font-size: 13px; color: var(--text-dim); text-align: center; padding: 14px 0; }

    /* ── Edit modal ── */
    .goal-modal {
      position: fixed; inset: 0; z-index: 150;
      background: rgba(0,0,0,0.75); backdrop-filter: blur(6px);
      display: flex; align-items: flex-end; justify-content: center;
      padding: 0 0 env(safe-area-inset-bottom, 0);
    }
    .goal-modal.hidden { display: none; }

    .goal-modal-box {
      background: #0d1b38;
      border: 1px solid rgba(30,80,160,0.4);
      border-radius: 24px 24px 0 0;
      padding: 24px 20px 32px;
      width: 100%; max-width: 480px;
    }

    .goal-modal-title {
      font-size: 15px; font-weight: 700; color: #e8f0ff;
      margin-bottom: 16px; text-align: center;
    }

    .goal-modal-field { margin-bottom: 12px; }
    .goal-modal-field label { display: block; font-size: 11px; font-weight: 600; color: var(--text-dim); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.08em; }
    .goal-modal-field input {
      width: 100%; padding: 12px 14px;
      background: rgba(20,40,80,0.5);
      border: 1px solid rgba(30,80,160,0.35);
      border-radius: 12px; color: #e8f0ff; font-size: 15px;
      outline: none;
    }
    .goal-modal-field input:focus { border-color: rgba(59,130,246,0.6); }

    .goal-modal-actions { display: flex; gap: 8px; margin-top: 16px; }

    .goal-modal-save {
      flex: 1; padding: 13px;
      background: #3b82f6; border: none; border-radius: 12px;
      color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
    }
    .goal-modal-delete {
      padding: 13px 18px;
      background: rgba(239,68,68,0.15);
      border: 1px solid rgba(239,68,68,0.3);
      border-radius: 12px; color: #fca5a5;
      font-size: 15px; font-weight: 600; cursor: pointer;
    }
    .goal-modal-cancel {
      padding: 13px 18px;
      background: rgba(30,60,110,0.3);
      border: 1px solid var(--border);
      border-radius: 12px; color: var(--text-dim);
      font-size: 15px; cursor: pointer;
    }

    /* ── Flash feedback ── */
    .flash {
      position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
      background: rgba(34,197,94,0.9); color: #fff;
      padding: 10px 20px; border-radius: 12px;
      font-size: 13px; font-weight: 600;
      pointer-events: none; z-index: 200;
      opacity: 0; transition: opacity 0.2s;
    }
    .flash.error { background: rgba(239,68,68,0.9); }
    .flash.show { opacity: 1; }
  
    /* ─── Standard Nav (logo | titre | id) ─── */
    nav {
      position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
      height: 64px;
      display: grid; grid-template-columns: 1fr auto 1fr;
      align-items: center;
      padding: 0 24px;
      background: rgba(0,0,0,0.75);
      backdrop-filter: saturate(180%) blur(20px);
      border-bottom: 1px solid rgba(255,255,255,0.08);
    }
    nav .brand { justify-self: start; display: inline-flex; align-items: center; height: 100%; }
    nav .brand img { height: 24px; display: block; }
    nav .nav-pill {
      justify-self: center;
      display: inline-flex; align-items: center;
      padding: 6px 14px;
      font-size: 12px; font-weight: 500;
      color: var(--wc-text-secondary);
      background: rgba(255,255,255,0.05);
      border: 1px solid rgba(255,255,255,0.08);
      border-radius: 999px;
      max-width: 60vw;
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
      line-height: 1;
    }
    nav .nav-user {
      justify-self: end;
      display: inline-flex; align-items: center; gap: 8px;
      padding: 6px 14px;
      border-radius: 999px;
      background: rgba(255,255,255,0.05);
      border: 1px solid rgba(255,255,255,0.08);
      font-size: 12px; font-weight: 500;
      color: var(--wc-text-secondary);
      cursor: pointer;
      transition: all .15s;
      line-height: 1;
    }
    nav .nav-user:hover { background: rgba(255,69,58,0.15); border-color: rgba(255,69,58,0.3); color: var(--wc-red); }
    nav .nav-user .x { opacity: 0.5; font-size: 10px; }
    nav .nav-clock {
      justify-self: end;
      font-size: 18px; font-weight: 700;
      font-variant-numeric: tabular-nums;
      letter-spacing: 0.04em;
      color: #e8f0ff;
      text-shadow: 0 0 8px rgba(96,165,250,0.45), 0 0 40px rgba(59,130,246,0.35);
      line-height: 1;
    }
    nav .nav-timer {
      justify-self: center;
      font-size: 22px; font-weight: 700;
      font-variant-numeric: tabular-nums;
      color: #e8f0ff; letter-spacing: 0.04em;
      line-height: 1;
    }
    @media (max-width: 600px) {
      nav { padding: 0 14px; height: 56px; }
      nav .brand img { height: 13px; }
      nav .nav-pill { font-size: 9px; padding: 4px 8px; max-width: 50vw; }
      nav .nav-user { font-size: 10px; padding: 4px 11px; }
    }

  
    /* ── Login overlay harmonisé ── */
    #login-backdrop {
      position: fixed; inset: 0;
      background: rgba(0,0,0,0.6);
      backdrop-filter: blur(12px) saturate(0.7);
      z-index: 1900;
      opacity: 0; pointer-events: none;
      transition: opacity .25s;
      display: block;
    }
    #login-backdrop.open { opacity: 1; pointer-events: auto; }
    .login-popover {
      position: fixed; top: 50%; left: 50%;
      transform: translate(-50%, -50%);
      width: min(340px, calc(100vw - 32px));
      background: rgba(12,18,40,0.97);
      border: 1px solid rgba(41,151,255,0.2);
      border-radius: 16px; padding: 24px;
      box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
      backdrop-filter: blur(20px);
      z-index: 2000; display: none;
    }
    .login-popover.open { display: block; animation: loginPopIn .18s cubic-bezier(0.16,1,0.3,1); }
    @keyframes loginPopIn {
      from { opacity:0; transform: translate(-50%,-50%) scale(0.95); }
      to   { opacity:1; transform: translate(-50%,-50%) scale(1); }
    }
    .login-popover img { height: 28px; display: block; margin: 0 auto 18px; }
    .login-popover h3 { font-size: 14px; font-weight: 600; color: #e8f0ff; margin-bottom: 4px; }
    .login-popover p { font-size: 12px; color: #4a6080; margin-bottom: 14px; }
    .login-popover input {
      width: 100%; padding: 9px 12px;
      background: rgba(10,18,40,0.8);
      border: 1px solid rgba(41,151,255,0.2);
      border-radius: 9px; color: var(--wc-text);
      font-family: inherit; font-size: 13px;
      outline: none; transition: border-color .2s;
      margin-bottom: 10px; display: block;
    }
    .login-popover input:focus { border-color: var(--wc-accent); }
    .login-popover .pop-btn {
      width: 100%; padding: 9px;
      background: var(--wc-accent); color: #fff;
      border: none; border-radius: 9px;
      font-family: inherit; font-size: 13px; font-weight: 600;
      cursor: pointer; transition: background .15s; display: block;
    }
    .login-popover .pop-btn:hover { background: #1a7fd4; }
    .login-popover .pop-btn-secondary {
      width: 100%; padding: 8px; margin-top: 8px;
      background: transparent; color: #60a5fa;
      border: 1px solid rgba(96,165,250,0.25); border-radius: 9px;
      font-family: inherit; font-size: 13px;
      cursor: pointer; transition: background .15s; display: block;
    }
    .login-popover .pop-btn-secondary:hover { background: rgba(96,165,250,0.08); }
    .login-popover .pop-error { font-size: 11px; color: #f87171; margin-top: 7px; display: none; }
    .login-popover .pop-success { font-size: 11px; color: #4ade80; margin-top: 7px; display: none; }
  
    /* ─── Footer ─── */
    .page-footer {
      padding: 18px 32px;
      border-top: 1px solid rgba(255,255,255,0.07);
      display: flex; justify-content: center; align-items: center;
      font-size: 12px; color: rgba(255,255,255,0.3);
      margin-top: auto;
    }
    .page-footer a { color: rgba(255,255,255,0.3); text-decoration: none; }
    .page-footer a:hover { color: rgba(255,255,255,0.6); }
