/* ============================================================
   MATCH LIVE PAGE — DOOGGIESPORT PREMIUM WIDGET
   ============================================================ */
.dg-match-app{max-width:1120px;margin:0 auto;font-family:'DM Sans',-apple-system,BlinkMacSystemFont,sans-serif;color:var(--dg-text,#e2e8f0)}
.dgm-shell{background:linear-gradient(180deg,rgba(2,6,23,.96) 0%,rgba(7,15,33,.98) 100%);border:1px solid rgba(96,165,250,.16);border-radius:28px;overflow:hidden;box-shadow:0 30px 70px rgba(2,6,23,.45);padding-left:env(safe-area-inset-left,0px);padding-right:env(safe-area-inset-right,0px)}
.dgm-header{padding:18px 18px 8px;background:radial-gradient(circle at top,rgba(37,99,235,.22),rgba(37,99,235,0) 38%),linear-gradient(180deg,#0f172a 0%,#081123 100%);border-bottom:1px solid rgba(148,163,184,.1)}
.dgm-header-top{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:6px}.dgm-competition{font-size:11px;font-weight:800;letter-spacing:.12em;text-transform:uppercase;color:#93c5fd}.dgm-datetime{font-size:13px;line-height:1.55;color:#cbd5e1;margin:0 0 14px}
.dgm-status-badge,.dgm-ai-badge{display:inline-flex;align-items:center;justify-content:center;padding:6px 10px;border-radius:999px;font-size:11px;font-weight:800;letter-spacing:.03em;border:1px solid rgba(255,255,255,.1);background:rgba(255,255,255,.04);color:#dbeafe}.dgm-status-badge.is-live,.dgm-ai-badge.is-live{background:rgba(239,68,68,.14);color:#fecaca;border-color:rgba(239,68,68,.26)}.dgm-status-badge.is-halftime,.dgm-ai-badge.is-halftime{background:rgba(245,158,11,.14);color:#fde68a;border-color:rgba(245,158,11,.24)}.dgm-status-badge.is-finished,.dgm-ai-badge.is-finished{background:rgba(34,197,94,.14);color:#bbf7d0;border-color:rgba(34,197,94,.24)}
.dgm-score-area{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:18px;align-items:center;padding:6px 0 18px}.dgm-team{text-align:center;min-width:0}.dgm-team-logo,.dgm-team-badge{width:62px;height:62px;display:flex;align-items:center;justify-content:center;border-radius:999px;margin:0 auto 10px;object-fit:contain;background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.08)}.dgm-team-logo{padding:6px;background:#fff}.dgm-team-badge{font-size:20px;font-weight:900;box-shadow:0 12px 22px rgba(0,0,0,.22)}.dgm-team-name{font-size:18px;font-weight:900;line-height:1.15;color:#fff;word-break:break-word}.dgm-formation{font-size:12px;color:#93c5fd;margin-top:4px;font-weight:700}
.dgm-score-center{text-align:center;min-width:180px}.dgm-score{font-size:54px;line-height:1;font-weight:900;letter-spacing:3px;font-family:'JetBrains Mono',monospace;color:#fff}.dgm-score-sep{color:rgba(148,163,184,.46)}.dgm-score-sub{margin-top:10px;font-size:12px;color:#cbd5e1;font-weight:700}.dgm-live-badge{display:inline-flex;align-items:center;gap:8px;margin-top:12px;padding:7px 12px;border-radius:999px;background:rgba(15,23,42,.72);border:1px solid rgba(96,165,250,.18);font-size:12px;font-weight:800;color:#bfdbfe}.dgm-pulse{width:8px;height:8px;border-radius:999px;background:#22c55e;box-shadow:0 0 0 0 rgba(34,197,94,.42);animation:dgm-pulse-anim 1.2s infinite}.dgm-ht{font-size:12px;color:#94a3b8;margin-top:8px}
@keyframes dgm-pulse-anim{0%{transform:scale(1);box-shadow:0 0 0 0 rgba(34,197,94,.42)}70%{transform:scale(1.05);box-shadow:0 0 0 12px rgba(34,197,94,0)}100%{transform:scale(1);box-shadow:0 0 0 0 rgba(34,197,94,0)}}
.dgm-pick-banner{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:0 -18px;padding:14px 18px;background:linear-gradient(90deg,rgba(37,99,235,.14),rgba(139,92,246,.14));border-top:1px solid rgba(96,165,250,.18);border-bottom:1px solid rgba(96,165,250,.18)}.dgm-pick-tag{display:inline-flex;align-items:center;padding:6px 10px;border-radius:999px;background:#2563eb;color:#fff;font-size:10px;font-weight:900;letter-spacing:.08em;text-transform:uppercase}.dgm-pick-main{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}.dgm-pick-value{font-size:18px;font-weight:900;color:#fff}.dgm-pick-market{font-size:12px;color:#cbd5e1}.dgm-pick-odds{padding:8px 12px;border-radius:14px;background:rgba(15,23,42,.68);font-family:'JetBrains Mono',monospace;font-size:15px;font-weight:900;color:#facc15;border:1px solid rgba(250,204,21,.2)}.dgm-pick-confidence{display:flex;align-items:center;gap:4px;margin-left:auto}.dgm-dot{width:9px;height:9px;border-radius:999px;background:#334155}.dgm-dot.filled{background:#60a5fa;box-shadow:0 0 0 4px rgba(96,165,250,.12)}
.dgm-odds-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding:14px 0 4px}.dgm-odds-pill{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;border-radius:16px;background:rgba(15,23,42,.72);border:1px solid rgba(148,163,184,.12);color:#e2e8f0;font-weight:800}.dgm-odds-pill span{font-size:12px;color:#93c5fd;text-transform:uppercase;letter-spacing:.08em}.dgm-odds-pill strong{font-size:18px;color:#fff}
.dgm-content{padding:18px;display:flex;flex-direction:column;gap:18px}.dgm-section{background:linear-gradient(180deg,rgba(15,23,42,.92) 0%,rgba(9,15,28,.92) 100%);border:1px solid rgba(96,165,250,.1);border-radius:22px;padding:16px 16px 18px;box-shadow:inset 0 1px 0 rgba(255,255,255,.02)}.dgm-section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:14px}.dgm-section-head h3{margin:0;font-size:18px;line-height:1.1;color:#fff}.dgm-section-head p{margin:4px 0 0;font-size:13px;color:#94a3b8}.dgm-grid-top{display:grid;grid-template-columns:minmax(0,1.08fr) minmax(0,.92fr);gap:18px;align-items:start}
.dgm-pitch-meta{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:12px}.dgm-pitch-team-meta{display:flex;align-items:center;gap:8px;color:#dbeafe;font-size:13px;font-weight:700}.dgm-pitch-team-meta span{color:#93c5fd;font-weight:700}.dgm-pitch-team-meta-away{justify-content:flex-end}.dgm-pitch-team-dot{width:10px;height:10px;border-radius:999px;box-shadow:0 0 0 4px rgba(255,255,255,.04)}
.dgm-pitch-frame{touch-action:auto;--dgm-pitch-ratio:16/18;--dgm-pitch-tilt:22deg;--dgm-pitch-padding:12px;--dgm-pitch-maxw:100%;position:relative;border-radius:22px;padding:var(--dgm-pitch-padding);background:linear-gradient(180deg,rgba(5,10,20,.5),rgba(2,6,23,.22));overflow:hidden}.dgm-pitch{position:relative;width:100%;max-width:var(--dgm-pitch-maxw);margin:0 auto;aspect-ratio:var(--dgm-pitch-ratio);border-radius:20px;overflow:hidden;background:linear-gradient(180deg,#0a5c38 0%,#11804f 14%,#0b6a42 28%,#0b5b39 42%,#0e6b43 58%,#0b5b39 72%,#0c6e44 86%,#094d31 100%);border:1px solid rgba(255,255,255,.14);transform-origin:center center;transform:perspective(1600px) rotateX(var(--dgm-pitch-tilt));box-shadow:inset 0 0 0 1px rgba(255,255,255,.06),inset 0 30px 70px rgba(255,255,255,.06)}.dgm-pitch-preset-length{--dgm-pitch-ratio:13/19;--dgm-pitch-tilt:22deg;--dgm-pitch-maxw:min(100%,640px)}.dgm-pitch-preset-width{--dgm-pitch-ratio:18/13;--dgm-pitch-tilt:16deg;--dgm-pitch-maxw:100%}.dgm-pitch-preset-panorama_width{--dgm-pitch-ratio:21/10;--dgm-pitch-tilt:14deg;--dgm-pitch-maxw:100%}.dgm-pitch-preset-panorama_height{--dgm-pitch-ratio:15/17;--dgm-pitch-tilt:20deg;--dgm-pitch-maxw:min(100%,780px)}.dgm-pitch-edge{--dgm-pitch-padding:4px}.dgm-pitch-lines{position:absolute;inset:0;background:repeating-linear-gradient(180deg,rgba(255,255,255,.06) 0,rgba(255,255,255,.06) 11%,rgba(255,255,255,0) 11%,rgba(255,255,255,0) 22%)}.dgm-pitch-center-line{position:absolute;left:6%;right:6%;top:50%;height:1px;background:rgba(255,255,255,.3)}.dgm-pitch-circle{position:absolute;top:calc(50% - 11%);left:50%;transform:translateX(-50%);width:22%;aspect-ratio:1;border:1px solid rgba(255,255,255,.22);border-radius:999px}.dgm-pitch-box{position:absolute;left:28%;width:44%;height:14%;border:1px solid rgba(255,255,255,.22)}.dgm-pitch-box-top{top:2.8%;border-radius:0 0 10px 10px}.dgm-pitch-box-bottom{bottom:2.8%;border-radius:10px 10px 0 0}.dgm-pitch-spot{position:absolute;left:50%;width:6px;height:6px;border-radius:999px;background:rgba(255,255,255,.7);transform:translateX(-50%)}.dgm-pitch-spot-top{top:14%}.dgm-pitch-spot-bottom{bottom:14%}.dgm-pitch-overlay{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) rotateX(-22deg);padding:10px 14px;border-radius:999px;background:rgba(2,6,23,.7);border:1px solid rgba(255,255,255,.12);font-size:13px;font-weight:800;color:#e2e8f0;backdrop-filter:blur(4px)}
.dgm-player{position:absolute;transform:translate(-50%,-50%);text-align:center;z-index:2;max-width:72px}.dgm-player-circle{width:34px;height:34px;border-radius:999px;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:900;border:2px solid rgba(255,255,255,.86);box-shadow:0 12px 22px rgba(0,0,0,.35);margin:0 auto}.dgm-player-name{font-size:10px;font-weight:800;color:#fff;text-shadow:0 2px 6px rgba(0,0,0,.72);margin-top:3px;white-space:nowrap}.dgm-player-rating{display:inline-flex;align-items:center;justify-content:center;min-width:28px;height:18px;padding:0 6px;border-radius:999px;color:#fff;font-size:10px;font-weight:900;margin-top:3px}
.dgm-momentum-card,.dgm-radar-card,.dgm-ai-card{background:linear-gradient(180deg,rgba(15,23,42,.78),rgba(2,6,23,.78));border:1px solid rgba(148,163,184,.12);border-radius:20px;padding:16px}.dgm-momentum-card{padding:18px 18px 16px}.dgm-momentum-card canvas{width:100%;height:clamp(150px,24vw,220px);display:block;touch-action:auto}.dgm-radar-card canvas{width:100%;height:auto;display:block;touch-action:auto}.dgm-momentum-scale{display:flex;justify-content:space-between;gap:8px;font-size:12px;color:#94a3b8;margin-top:12px}.dgm-momentum-note{margin-top:12px;font-size:14px;color:#e2e8f0;line-height:1.65}.dgm-ai-card{height:100%;display:flex;flex-direction:column;justify-content:center;gap:12px;position:relative;overflow:hidden}.dgm-ai-card:before{content:"";position:absolute;inset:auto -20% -40% auto;width:180px;height:180px;background:radial-gradient(circle,rgba(139,92,246,.22),rgba(139,92,246,0) 68%);pointer-events:none}.dgm-ai-head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;position:relative;z-index:1}.dgm-ai-kicker{font-size:11px;font-weight:800;letter-spacing:.1em;text-transform:uppercase;color:#bfdbfe}.dgm-ai-card p{margin:0;position:relative;z-index:1;font-size:16px;line-height:1.7;color:#fff;font-weight:700}
.dgm-timeline{display:flex;flex-direction:column}.dgm-event{display:grid;grid-template-columns:60px 34px minmax(0,1fr) 56px;gap:12px;align-items:center;padding:12px 0}.dgm-event-border{border-bottom:1px solid rgba(148,163,184,.1)}.dgm-event-min{font-size:13px;font-weight:900;color:#93c5fd;font-family:'JetBrains Mono',monospace}.dgm-event-pin{width:34px;height:34px;border-radius:999px;display:flex;align-items:center;justify-content:center;color:#fff;font-size:16px;box-shadow:0 10px 16px rgba(0,0,0,.2)}.dgm-event-body strong{display:block;color:#fff;font-size:14px;line-height:1.45}.dgm-event-body span{display:block;color:#94a3b8;font-size:12px;margin-top:2px}.dgm-event-side{text-align:right;color:#94a3b8;font-size:11px;font-weight:800;letter-spacing:.06em;text-transform:uppercase}
.dgm-stats-layout{display:grid;grid-template-columns:minmax(260px,340px) minmax(0,1fr);gap:18px;align-items:start}.dgm-stat-bars-list{display:flex;flex-direction:column;gap:10px}.dgm-stat-row{padding:12px 14px;border-radius:16px;background:rgba(15,23,42,.72);border:1px solid rgba(148,163,184,.1)}.dgm-stat-head{display:grid;grid-template-columns:64px minmax(0,1fr) 64px;gap:12px;align-items:center;margin-bottom:8px;color:#e2e8f0;font-size:13px;font-weight:800}.dgm-stat-head span:nth-child(2){text-align:center;color:#cbd5e1;font-weight:700}.dgm-stat-track{display:flex;height:10px;border-radius:999px;overflow:hidden;background:#020617}.dgm-stat-fill-home{background:linear-gradient(90deg,#2563eb,#60a5fa)}.dgm-stat-fill-away{background:linear-gradient(90deg,#ef4444,#f87171)}
.dgm-lineups-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.dgm-lineup-card{background:rgba(15,23,42,.72);border:1px solid rgba(148,163,184,.12);border-radius:20px;padding:16px}.dgm-lineup-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}.dgm-lineup-head h4{margin:0;font-size:18px;color:#fff}.dgm-lineup-head>div:first-child{display:flex;align-items:center;gap:10px}.dgm-lineup-color{width:12px;height:12px;border-radius:999px;box-shadow:0 0 0 5px rgba(255,255,255,.03)}.dgm-lineup-meta{display:flex;flex-direction:column;gap:4px;font-size:12px;color:#94a3b8;text-align:right}.dgm-lineup-subtitle{margin:14px 0 10px;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:#93c5fd}.dgm-lineup-list{display:flex;flex-direction:column;gap:8px}.dgm-player-chip{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:16px;background:rgba(2,6,23,.72);border:1px solid rgba(148,163,184,.08)}.dgm-chip-number,.dgm-chip-rating{display:inline-flex;align-items:center;justify-content:center;min-width:30px;height:30px;border-radius:999px;font-size:12px;font-weight:900}.dgm-chip-rating{min-width:44px;height:24px;color:#fff}.dgm-player-chip-main{display:flex;flex-direction:column;gap:2px;min-width:0}.dgm-player-chip-main strong{font-size:14px;color:#fff;line-height:1.2}.dgm-player-chip-main small{font-size:11px;color:#94a3b8}

@media (max-width: 720px){
  .dgm-lineups-grid{
    display:grid;
    grid-auto-flow:column;
    grid-auto-columns:minmax(88%,1fr);
    grid-template-columns:none;
    overflow-x:auto;
    gap:14px;
    padding-bottom:4px;
    scroll-snap-type:x mandatory;

    scrollbar-width:none;
  }
  .dgm-lineups-grid::-webkit-scrollbar{display:none}
  .dgm-lineup-card{
    scroll-snap-align:start;
    min-width:0;
  }
}
@media (max-width: 920px) and (orientation: landscape){
  .dgm-lineups-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
    grid-auto-flow:row;
    grid-auto-columns:auto;
    overflow:visible;
    scroll-snap-type:none;
  }
}
.dgm-empty-card{padding:16px 14px;border-radius:16px;background:rgba(2,6,23,.7);border:1px dashed rgba(148,163,184,.22);color:#94a3b8;font-size:13px;line-height:1.6}.dgm-empty-card-small{padding:12px 14px}.dgm-notes{padding:14px 16px;border-radius:18px;background:rgba(59,130,246,.08);border:1px solid rgba(96,165,250,.18);color:#dbeafe;font-size:14px;line-height:1.65}.dgm-footer{text-align:center;padding:18px 16px calc(24px + env(safe-area-inset-bottom,0px));color:#64748b;font-size:11px;letter-spacing:.04em}
@media (max-width: 1024px){.dgm-grid-top,.dgm-stats-layout,.dgm-lineups-grid{grid-template-columns:1fr}.dgm-score{font-size:48px}.dgm-team-name{font-size:16px}.dgm-pitch{--dgm-pitch-maxw:100%}}
@media (max-width: 720px){.dg-match-app{max-width:100%}.dgm-shell{border-radius:22px}.dgm-header,.dgm-content{padding:14px}.dgm-score-area{grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:12px}.dgm-team-logo,.dgm-team-badge{width:48px;height:48px}.dgm-team-name{font-size:14px}.dgm-score{font-size:clamp(38px,9vw,54px);letter-spacing:1px}.dgm-score-center{min-width:110px}.dgm-datetime{font-size:12px}.dgm-section{padding:14px}.dgm-section-head h3{font-size:16px}.dgm-pitch{transform:perspective(1400px) rotateX(18deg)}.dgm-pitch-preset-length{--dgm-pitch-ratio:13/20}.dgm-pitch-preset-width{--dgm-pitch-ratio:17/13;--dgm-pitch-tilt:15deg}.dgm-pitch-preset-panorama_width{--dgm-pitch-ratio:19/11;--dgm-pitch-tilt:13deg}.dgm-pitch-preset-panorama_height{--dgm-pitch-ratio:14/18;--dgm-pitch-tilt:18deg}.dgm-player{max-width:58px}.dgm-player-circle{width:28px;height:28px;font-size:9px}.dgm-player-name{font-size:8px}.dgm-player-rating{font-size:9px;min-width:24px;height:16px}.dgm-odds-row{gap:8px}.dgm-odds-pill{padding:10px 12px;border-radius:14px}.dgm-odds-pill strong{font-size:16px}.dgm-event{grid-template-columns:48px 30px minmax(0,1fr) 36px;gap:10px}.dgm-event-pin{width:30px;height:30px;font-size:14px}.dgm-event-side{font-size:10px}.dgm-stat-head{grid-template-columns:52px minmax(0,1fr) 52px;font-size:12px}.dgm-pick-banner{margin:0 -14px;padding:12px 14px}.dgm-pick-value{font-size:16px}.dgm-pick-confidence{margin-left:0}}
@media (max-width: 920px) and (orientation: landscape){.dgm-grid-top{grid-template-columns:1.1fr .9fr}.dgm-pitch{transform:perspective(1600px) rotateX(14deg)}.dgm-pitch-preset-length{--dgm-pitch-ratio:14/12;--dgm-pitch-tilt:15deg}.dgm-pitch-preset-width{--dgm-pitch-ratio:19/10;--dgm-pitch-tilt:13deg}.dgm-pitch-preset-panorama_width{--dgm-pitch-ratio:23/9;--dgm-pitch-tilt:12deg}.dgm-pitch-preset-panorama_height{--dgm-pitch-ratio:17/11;--dgm-pitch-tilt:14deg}.dgm-lineups-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.dgm-stats-layout{grid-template-columns:minmax(230px,280px) minmax(0,1fr)}}

/* === v4 widget refinements: horizontal pitch, goals, stat legends, frozen finished UX === */
.dgm-pitch-frame.dgm-pitch-horizontal .dgm-pitch{transform:perspective(1800px) rotateX(12deg)}
.dgm-pitch-frame.dgm-pitch-horizontal .dgm-pitch-center-line{left:50%;right:auto;top:6%;bottom:6%;width:1px;height:auto}
.dgm-pitch-frame.dgm-pitch-horizontal .dgm-pitch-circle{top:50%;left:50%;transform:translate(-50%,-50%);width:18%;aspect-ratio:1}
.dgm-pitch-frame.dgm-pitch-horizontal .dgm-pitch-box-top,.dgm-pitch-frame.dgm-pitch-horizontal .dgm-pitch-box-bottom,.dgm-pitch-frame.dgm-pitch-horizontal .dgm-pitch-spot-top,.dgm-pitch-frame.dgm-pitch-horizontal .dgm-pitch-spot-bottom,.dgm-pitch-frame.dgm-pitch-horizontal .dgm-pitch-goal-top,.dgm-pitch-frame.dgm-pitch-horizontal .dgm-pitch-goal-bottom{display:none}
.dgm-pitch-frame.dgm-pitch-horizontal .dgm-pitch-box-left,.dgm-pitch-frame.dgm-pitch-horizontal .dgm-pitch-box-right{display:block;position:absolute;top:28%;height:44%;width:12%;border:1px solid rgba(255,255,255,.22);left:auto;right:auto}
.dgm-pitch-frame.dgm-pitch-horizontal .dgm-pitch-box-left{left:2.8%;border-radius:0 10px 10px 0}
.dgm-pitch-frame.dgm-pitch-horizontal .dgm-pitch-box-right{right:2.8%;border-radius:10px 0 0 10px}
.dgm-pitch-frame.dgm-pitch-horizontal .dgm-pitch-spot-left,.dgm-pitch-frame.dgm-pitch-horizontal .dgm-pitch-spot-right{display:block;position:absolute;top:50%;width:6px;height:6px;border-radius:999px;background:rgba(255,255,255,.7);transform:translateY(-50%)}
.dgm-pitch-frame.dgm-pitch-horizontal .dgm-pitch-spot-left{left:14%}
.dgm-pitch-frame.dgm-pitch-horizontal .dgm-pitch-spot-right{right:14%}
.dgm-pitch-frame.dgm-pitch-horizontal .dgm-pitch-goal-left,.dgm-pitch-frame.dgm-pitch-horizontal .dgm-pitch-goal-right{display:block;position:absolute;top:38%;width:3%;height:24%;border:2px solid rgba(255,255,255,.24);background:linear-gradient(180deg,rgba(255,255,255,.08),rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(255,255,255,.06)}
.dgm-pitch-frame.dgm-pitch-horizontal .dgm-pitch-goal-left{left:-0.5%;border-right:0;border-radius:8px 0 0 8px}
.dgm-pitch-frame.dgm-pitch-horizontal .dgm-pitch-goal-right{right:-0.5%;border-left:0;border-radius:0 8px 8px 0}
.dgm-pitch-frame.dgm-pitch-vertical .dgm-pitch-box-left,.dgm-pitch-frame.dgm-pitch-vertical .dgm-pitch-box-right,.dgm-pitch-frame.dgm-pitch-vertical .dgm-pitch-spot-left,.dgm-pitch-frame.dgm-pitch-vertical .dgm-pitch-spot-right,.dgm-pitch-frame.dgm-pitch-vertical .dgm-pitch-goal-left,.dgm-pitch-frame.dgm-pitch-vertical .dgm-pitch-goal-right{display:none}
.dgm-pitch-frame.dgm-pitch-vertical .dgm-pitch-goal-top,.dgm-pitch-frame.dgm-pitch-vertical .dgm-pitch-goal-bottom{display:block;position:absolute;left:38%;width:24%;height:3%;border:2px solid rgba(255,255,255,.24);background:linear-gradient(90deg,rgba(255,255,255,.08),rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(255,255,255,.06)}
.dgm-pitch-frame.dgm-pitch-vertical .dgm-pitch-goal-top{top:-0.5%;border-bottom:0;border-radius:8px 8px 0 0}
.dgm-pitch-frame.dgm-pitch-vertical .dgm-pitch-goal-bottom{bottom:-0.5%;border-top:0;border-radius:0 0 8px 8px}
.dgm-player{max-width:60px}
.dgm-player-circle{width:28px;height:28px;font-size:10px}
.dgm-player-name{font-size:9px;max-width:64px;overflow:hidden;text-overflow:ellipsis}
.dgm-player-rating{font-size:9px;min-width:26px;height:16px;padding:0 5px}
.dgm-player-keeper .dgm-player-circle{width:30px;height:30px}
.dgm-stats-legend{display:flex;align-items:center;gap:8px}
.dgm-stat-team-logo,.dgm-stat-team-badge{width:22px;height:22px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;object-fit:contain;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.1);font-size:10px;font-weight:900;color:#fff}
.dgm-stat-head{grid-template-columns:minmax(96px,116px) minmax(110px,1fr) minmax(96px,116px);gap:10px}
.dgm-stat-side{display:flex;align-items:center;gap:8px;white-space:nowrap}
.dgm-stat-side strong{font-size:20px;line-height:1;color:#fff}
.dgm-stat-side-away{justify-content:flex-end}
.dgm-stat-label{text-align:center;color:#cbd5e1;font-weight:800;white-space:normal;line-height:1.2;word-break:normal;overflow-wrap:anywhere}
@media (max-width: 720px){
  .dgm-player{max-width:50px}
  .dgm-player-circle{width:24px;height:24px;font-size:8px}
  .dgm-player-name{font-size:7px;max-width:50px}
  .dgm-player-rating{font-size:8px;min-width:22px;height:14px}
  .dgm-stat-head{grid-template-columns:minmax(72px,84px) minmax(74px,1fr) minmax(72px,84px)}
  .dgm-stat-side strong{font-size:16px}
}
@media (max-width: 920px) and (orientation: landscape){
  .dgm-pitch-frame.dgm-pitch-horizontal .dgm-pitch{transform:perspective(1800px) rotateX(10deg)}
  .dgm-player{max-width:56px}
}

/* === v5 refinements: clearer formation spacing + broader stats layout === */
.dgm-pitch-frame.dgm-pitch-horizontal .dgm-pitch-goal-left,
.dgm-pitch-frame.dgm-pitch-horizontal .dgm-pitch-goal-right{
  top:34%;
  width:4.8%;
  height:32%;
  border:3px solid rgba(255,255,255,.34);
  background:linear-gradient(180deg,rgba(255,255,255,.14),rgba(255,255,255,0));
  box-shadow:0 0 18px rgba(255,255,255,.08), inset 0 0 0 1px rgba(255,255,255,.08);
}
.dgm-pitch-frame.dgm-pitch-horizontal .dgm-pitch-goal-left{left:1.1%;border-right:0;border-radius:10px 0 0 10px}
.dgm-pitch-frame.dgm-pitch-horizontal .dgm-pitch-goal-right{right:1.1%;border-left:0;border-radius:0 10px 10px 0}

.dgm-player{
  width:44px;
  max-width:44px;
  text-align:center;
  z-index:3;
}
.dgm-player-circle{
  width:22px;
  height:22px;
  font-size:8px;
  border-width:1.5px;
  box-shadow:0 8px 18px rgba(0,0,0,.32);
}
.dgm-player-keeper .dgm-player-circle{
  width:24px;
  height:24px;
}
.dgm-player-name{
  display:block;
  margin:3px auto 0;
  max-width:48px;
  font-size:8px;
  line-height:1.05;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.dgm-player-rating{
  position:absolute;
  top:-6px;
  right:-7px;
  margin-top:0;
  min-width:18px;
  height:13px;
  padding:0 4px;
  font-size:7px;
  line-height:13px;
  box-shadow:0 6px 12px rgba(0,0,0,.28);
}

.dgm-section-stats .dgm-section-head{
  align-items:center;
}
.dgm-stats-legend{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:14px;
  flex-wrap:wrap;
  margin-left:auto;
}
.dgm-stats-team{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
  color:#e2e8f0;
  font-size:13px;
  font-weight:800;
}
.dgm-stats-team-away{justify-content:flex-end}
.dgm-stats-team-name{max-width:180px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dgm-stats-team-color{width:10px;height:10px;border-radius:999px;box-shadow:0 0 0 4px rgba(255,255,255,.04)}
.dgm-stats-layout{
  display:grid;
  grid-template-columns:1fr;
  gap:16px;
}
.dgm-radar-card{
  width:min(100%,860px);
  margin:0 auto;
  padding:18px 18px 8px;
}
.dgm-stat-bars-list{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(250px,1fr));
  gap:12px;
}
.dgm-stat-row{
  padding:14px 16px;
  border-radius:18px;
  background:rgba(15,23,42,.74);
}
.dgm-stat-row-top{
  display:grid;
  grid-template-columns:minmax(58px,auto) 1fr minmax(58px,auto);
  gap:10px;
  align-items:center;
  margin-bottom:10px;
}
.dgm-stat-value{
  font-size:18px;
  font-weight:900;
  color:#fff;
  line-height:1;
}
.dgm-stat-value-home{color:var(--dgm-home-color,#60a5fa)}
.dgm-stat-value-away{color:var(--dgm-away-color,#f87171);text-align:right}
.dgm-stat-label{
  text-align:center;
  color:#dbeafe;
  font-size:13px;
  font-weight:800;
  white-space:normal;
  overflow-wrap:anywhere;
}
.dgm-stat-track{
  display:flex;
  height:10px;
  border-radius:999px;
  overflow:hidden;
  background:#020617;
}
.dgm-stat-fill-home{background:var(--dgm-home-color,#2563eb)}
.dgm-stat-fill-away{background:var(--dgm-away-color,#ef4444)}

@media (max-width: 720px){
  .dgm-player{width:36px;max-width:36px}
  .dgm-player-circle{width:18px;height:18px;font-size:7px}
  .dgm-player-keeper .dgm-player-circle{width:20px;height:20px}
  .dgm-player-name{font-size:7px;max-width:40px}
  .dgm-player-rating{top:-5px;right:-6px;min-width:16px;height:12px;font-size:6px;line-height:12px}
  .dgm-stats-team-name{max-width:110px}
  .dgm-stat-bars-list{grid-template-columns:1fr}
  .dgm-radar-card{padding:14px 10px 2px}
}

@media (max-width: 920px) and (orientation: landscape){
  .dgm-radar-card{width:min(100%,760px)}
  .dgm-stat-bars-list{grid-template-columns:repeat(2,minmax(0,1fr))}
}


/* v6 stats header + match read */
.dgm-ai-kicker{font-size:11px;font-weight:800;letter-spacing:.1em;text-transform:uppercase;color:#bfdbfe}

.dgm-section-stats .dgm-section-head{display:none}
.dgm-stats-header{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
  align-items:center;
  gap:14px;
  margin-bottom:14px;
}
.dgm-stats-title-wrap{text-align:center}
.dgm-stats-title-wrap h3{margin:0;font-size:18px;line-height:1.1;color:#fff}
.dgm-stats-title-wrap p{margin:4px 0 0;font-size:13px;color:#94a3b8}
.dgm-stats-side{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
  color:#e2e8f0;
  font-size:13px;
  font-weight:800;
}
.dgm-stats-side-home{justify-content:flex-start}
.dgm-stats-side-away{justify-content:flex-end}
.dgm-stats-team-name{max-width:180px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dgm-stats-team-color{width:10px;height:10px;border-radius:999px;box-shadow:0 0 0 4px rgba(255,255,255,.04)}
.dgm-stats-layout{
  display:grid;
  grid-template-columns:1fr;
  gap:16px;
}
.dgm-radar-card{
  width:min(100%,860px);
  margin:0 auto;
  padding:18px 18px 10px;
}
.dgm-stat-bars-list{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
.dgm-stat-row{
  padding:14px 16px;
  border-radius:18px;
  background:rgba(15,23,42,.74);
  border:1px solid rgba(148,163,184,.10);
}
.dgm-stat-row-top{
  display:grid;
  grid-template-columns:minmax(58px,auto) 1fr minmax(58px,auto);
  gap:10px;
  align-items:center;
  margin-bottom:10px;
}
.dgm-stat-value{font-size:18px;font-weight:900;color:#fff;line-height:1}
.dgm-stat-value-home{color:var(--dgm-home-color,#2563eb)}
.dgm-stat-value-away{color:var(--dgm-away-color,#ef4444);text-align:right}
.dgm-stat-label{text-align:center;color:#dbeafe;font-size:13px;font-weight:800;white-space:normal;overflow-wrap:anywhere}
.dgm-stat-track{display:flex;height:10px;border-radius:999px;overflow:hidden;background:#020617}
.dgm-stat-fill-home{background:linear-gradient(90deg,var(--dgm-home-color,#2563eb),#60a5fa)}
.dgm-stat-fill-away{background:linear-gradient(90deg,var(--dgm-away-color,#ef4444),#f87171)}

@media (max-width: 720px){
  .dgm-stats-header{
    grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
    gap:10px;
    align-items:center;
  }
  /* dgm-stats-title-wrap order removed — natural DOM order */
  .dgm-stats-side-home{justify-content:flex-start;order:0}
  .dgm-stats-side-away{justify-content:flex-end;order:0}
  .dgm-stats-team-name{max-width:110px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px}
  .dgm-stat-bars-list{grid-template-columns:1fr}
}

/* datahub tabs + swipeable panels */
.dgm-datahub{
  margin-top:18px;
  padding:14px;
  border-radius:24px;
  background:linear-gradient(180deg,rgba(12,23,48,.82) 0%,rgba(8,18,38,.96) 100%);
  border:1px solid rgba(59,130,246,.14);
  box-shadow:0 24px 54px rgba(2,6,23,.28);
}
.dgm-datahub-tabs{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
  margin:0 0 16px;
  padding:8px;
  border-radius:18px;
  background:rgba(2,6,23,.42);
  border:1px solid rgba(148,163,184,.12);
}
.dgm-datahub-tab{
  appearance:none;
  border:1px solid rgba(148,163,184,.12);
  background:linear-gradient(180deg,rgba(15,23,42,.92) 0%,rgba(11,18,32,.98) 100%);
  color:#cbd5e1;
  padding:12px 18px;
  border-radius:14px;
  font-size:14px;
  font-weight:800;
  line-height:1;
  letter-spacing:.01em;
  cursor:pointer;
  transition:all .22s ease;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04);
}
@media (hover:hover) and (pointer:fine){
.dgm-datahub-tab:hover{
  border-color:rgba(34,197,94,.22);
  color:#fff;
  transform:translateY(-1px);
}
}
.dgm-datahub-tab:active{opacity:.75;transform:scale(.98)}
.dgm-datahub-tab.is-active,
.dgm-datahub[data-active-index="0"] .dgm-datahub-tab[data-dgm-pane="0"],
.dgm-datahub[data-active-index="1"] .dgm-datahub-tab[data-dgm-pane="1"],
.dgm-datahub[data-active-index="2"] .dgm-datahub-tab[data-dgm-pane="2"]{
  background:linear-gradient(180deg,rgba(18,95,58,.96) 0%,rgba(10,72,43,.98) 100%);
  border-color:rgba(34,197,94,.44);
  color:#ecfdf5;
  box-shadow:0 14px 30px rgba(22,163,74,.20), inset 0 1px 0 rgba(255,255,255,.08);
}
.dgm-datahub-viewport{
  position:relative;
  min-height:260px;
  touch-action:auto;
}
.dgm-datahub-pane{
  display:none;
  width:100%;
  box-sizing:border-box;
}
.dgm-datahub-pane.is-active{
  display:block;
  animation:dgm-pane-fade .22s ease;
}
.dgm-datahub-pane .dgm-section{margin:0}
.dgm-datahub-pane[hidden]{display:none!important}
@keyframes dgm-pane-fade{from{opacity:.18;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}

@media (max-width: 720px){
  .dgm-datahub{padding:12px}
  .dgm-datahub-tabs{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
    justify-content:stretch;
    overflow:visible;
    flex-wrap:nowrap;
    padding-bottom:0;
  }
  .dgm-datahub-tab{
    min-width:0;
    padding:11px 10px;
    font-size:12px;
    line-height:1.15;
    white-space:normal;
    text-wrap:balance;
    border-radius:12px;
    min-height:46px;
  }
  .dgm-datahub-viewport{min-height:220px}
}


/* === mobile portrait hotfix: lineups swipe + stats left/right === */
@media (max-width: 720px) and (orientation: portrait){
  .dgm-datahub-tabs{
    gap:10px;
    overflow-x:auto;
    scrollbar-width:none;
  }
  .dgm-datahub-tabs::-webkit-scrollbar{display:none}
  .dgm-datahub-tab{
    flex:0 0 auto;
    min-width:132px;
    white-space:normal;
    line-height:1.15;
    padding:14px 16px;
  }

  .dgm-stats-header{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
    align-items:center;
    gap:8px;
  }
  .dgm-stats-title-wrap{min-width:0;text-align:center}
  .dgm-stats-title-wrap h3{font-size:17px}
  .dgm-stats-side{
    min-width:0;
    font-size:12px;
    gap:6px;
  }
  .dgm-stats-side-home{justify-content:flex-start;text-align:left}
  .dgm-stats-side-away{justify-content:flex-end;text-align:right}
  .dgm-stats-team-name{
    max-width:88px;
    font-size:12px;
  }
  .dgm-stats-side-away .dgm-stats-team-name{order:2}
  .dgm-stats-side-away .dgm-stats-team-logo,
  .dgm-stats-side-away .dgm-stats-team-badge{order:3}
  .dgm-stats-side-away .dgm-stats-team-color{order:1}

  .dgm-lineups-grid{
    display:flex !important;
    flex-wrap:nowrap;
    align-items:flex-start;
    overflow-x:auto;
    overflow-y:hidden;
    gap:14px;
    padding-bottom:6px;
    scroll-snap-type:x mandatory;

    scrollbar-width:none;
  }
  .dgm-lineups-grid::-webkit-scrollbar{display:none}
  .dgm-lineup-card{
    flex:0 0 calc(100% - 2px);
    width:calc(100% - 2px);
    min-width:calc(100% - 2px);
    max-width:calc(100% - 2px);
    box-sizing:border-box;
    scroll-snap-align:start;
  }
  .dgm-lineup-head{
    display:grid;
    grid-template-columns:1fr;
    gap:10px;
    align-items:start;
  }
  .dgm-lineup-head > div:first-child{
    min-width:0;
    align-items:flex-start;
  }
  .dgm-lineup-head h4{
    font-size:16px;
    line-height:1.15;
    word-break:break-word;
  }
  .dgm-lineup-meta{
    text-align:left;
    align-items:flex-start;
    gap:3px;
    font-size:12px;
  }
  .dgm-player-chip{
    gap:10px;
    padding:10px 12px;
  }
  .dgm-player-chip-main strong{
    font-size:13px;
    line-height:1.2;
    word-break:break-word;
  }
}


/* === widget mobile portrait/landscape refinement v3 === */
@media (max-width: 920px){
  .dgm-stats-header{
    grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)!important;
    align-items:center;
    gap:10px;
  }
  .dgm-stats-title-wrap{grid-column:2;text-align:center;min-width:0}
  .dgm-stats-side{min-width:0;display:flex;align-items:center;gap:8px}
  .dgm-stats-side-home{justify-self:start;justify-content:flex-start;text-align:left}
  .dgm-stats-side-away{justify-self:end;justify-content:flex-end;text-align:right}
  .dgm-stats-side-away .dgm-stats-team-color{order:1}
  .dgm-stats-side-away .dgm-stats-team-name{order:2}
  .dgm-stats-side-away .dgm-stats-team-logo,
  .dgm-stats-side-away .dgm-stats-team-badge{order:3}
}

@media (max-width: 720px){
  .dgm-datahub-tabs{
    display:flex!important;
    flex-wrap:nowrap!important;
    justify-content:flex-start!important;
    gap:10px;
    overflow-x:auto;
    overflow-y:hidden;

    scrollbar-width:none;
    touch-action:auto;
    overscroll-behavior-x:contain;
  }
  .dgm-datahub-tabs::-webkit-scrollbar{display:none}
  .dgm-datahub-tab{
    flex:0 0 auto;
    min-width:132px;
    max-width:180px;
    padding:12px 14px;
    min-height:48px;
    white-space:normal;
    line-height:1.12;
    text-wrap:balance;
  }
}

@media (max-width: 720px) and (orientation: portrait){
  .dgm-lineups-grid{
    display:flex!important;
    flex-wrap:nowrap!important;
    grid-template-columns:none!important;
    grid-auto-flow:initial!important;
    grid-auto-columns:auto!important;
    overflow-x:auto;
    overflow-y:hidden;
    gap:14px;
    padding-bottom:4px;
    scroll-snap-type:x mandatory;

    scrollbar-width:none;
    touch-action:auto;
  }
  .dgm-lineups-grid::-webkit-scrollbar{display:none}
  .dgm-lineup-card{
    flex:0 0 calc(100% - 2px);
    width:calc(100% - 2px);
    min-width:calc(100% - 2px);
    scroll-snap-align:start;
    box-sizing:border-box;
  }
  .dgm-lineup-head{
    display:grid;
    grid-template-columns:minmax(0,1fr);
    gap:10px;
    align-items:start;
  }
  .dgm-lineup-head > div:first-child{min-width:0}
  .dgm-lineup-head h4{
    font-size:18px;
    line-height:1.15;
    white-space:normal;
    word-break:break-word;
  }
  .dgm-lineup-meta{
    text-align:left;
    justify-self:start;
  }
}

@media (max-width: 920px) and (orientation: landscape){
  .dgm-datahub-tabs{
    display:flex!important;
    flex-wrap:nowrap!important;
    justify-content:flex-start!important;
    overflow-x:auto;
    overflow-y:hidden;

    touch-action:auto;
    overscroll-behavior-x:contain;
  }
  .dgm-datahub-tab{
    flex:0 0 auto;
    min-width:150px;
    max-width:220px;
    min-height:44px;
  }
  .dgm-datahub-viewport{touch-action:auto}
}

/* === widget portrait v4: full swipe area + stats header no overlap === */
@media (max-width: 720px) and (orientation: portrait){
  .dgm-datahub{
    overflow:hidden;
  }
  .dgm-datahub-viewport,
  .dgm-datahub-pane,
  .dgm-datahub-pane > .dgm-section,
  .dgm-radar-card,
  .dgm-stat-bars-list,
  .dgm-stat-row,
  .dgm-lineup-card,
  .dgm-timeline-list,
  .dgm-event,
  .dgm-event-main,
  .dgm-lineup-list,
  .dgm-lineup-list .dgm-player-chip,
  .dgm-radar-card canvas{
    touch-action:auto;
  }

  .dgm-stats-header{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important;
    grid-template-areas:
      "title title"
      "home away";
    row-gap:12px;
    column-gap:10px;
    align-items:center;
    margin-bottom:14px;
  }
  .dgm-stats-title-wrap{
    grid-area:title !important;
    text-align:center;
    justify-self:center;
    width:100%;
  }
  .dgm-stats-title-wrap h3{
    margin:0;
    font-size:16px;
    line-height:1.1;
  }
  .dgm-stats-title-wrap p{
    margin:4px 0 0;
    font-size:11px;
    line-height:1.35;
  }
  .dgm-stats-side{
    min-width:0;
    width:100%;
    display:flex;
    align-items:center;
    gap:6px;
  }
  .dgm-stats-side-home{
    grid-area:home;
    justify-content:flex-start;
    text-align:left;
  }
  .dgm-stats-side-away{
    grid-area:away;
    justify-content:flex-end;
    text-align:right;
  }
  .dgm-stats-team-name{
    max-width:96px !important;
    font-size:12px;
    line-height:1.15;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .dgm-stats-side .dgm-stats-team-logo,
  .dgm-stats-side .dgm-stats-team-badge{
    width:22px;
    height:22px;
    flex:0 0 22px;
  }
  .dgm-stats-team-color{
    width:10px;
    height:10px;
    flex:0 0 10px;
  }

  .dgm-datahub-tabs{
    padding:8px;
    gap:8px;
  }
  .dgm-datahub-tab{
    min-width:120px;
    max-width:156px;
    min-height:44px;
    padding:10px 12px;
    font-size:11px;
    line-height:1.1;
  }
}


/* v11 lineup switcher + safer mobile lineups */
.dgm-lineups-switch{display:none;margin:0 0 12px;gap:10px}
.dgm-lineups-switch-btn{
  appearance:none;
  border:1px solid rgba(148,163,184,.16);
  background:linear-gradient(180deg,rgba(15,23,42,.92) 0%,rgba(11,18,32,.98) 100%);
  color:#e5e7eb;
  border-radius:14px;
  padding:10px 14px;
  font-weight:700;
  font-size:13px;
  line-height:1.1;
  white-space:nowrap;
}
.dgm-lineups-switch-btn.is-active{
  background:linear-gradient(180deg,rgba(18,95,58,.96) 0%,rgba(10,72,43,.98) 100%);
  border-color:rgba(34,197,94,.44);
  color:#ecfdf5;
  box-shadow:0 10px 24px rgba(22,163,74,.18), inset 0 1px 0 rgba(255,255,255,.08);
}

@media (max-width: 720px) and (orientation: portrait){
  .dgm-lineups-switch{
    display:flex;
    overflow-x:auto;

    scrollbar-width:none;
  }
  .dgm-lineups-switch::-webkit-scrollbar{display:none}
  .dgm-lineups-switch-btn{flex:0 0 auto; max-width:calc(50vw - 28px); overflow:hidden; text-overflow:ellipsis}
  .dgm-lineups-grid{touch-action:auto !important; overscroll-behavior-x:contain}
  .dgm-player-chip{
    grid-template-columns:30px minmax(0,1fr) auto !important;
    gap:8px !important;
  }
  .dgm-player-chip-main strong{
    writing-mode:horizontal-tb !important;
    white-space:normal !important;
    word-break:normal !important;
    overflow-wrap:anywhere !important;
    line-height:1.15 !important;
  }
}

/* ========== CORRECTIONS SCROLL MOBILE ========== */

/* 1. Activer le défilement vertical dans les onglets */
@media (max-width: 720px) {
  .dgm-datahub-viewport {
    max-height: none;
    overflow-y: visible;
  }
}

/* 2. Permettre le scroll horizontal des compositions en portrait */
@media (max-width: 720px) and (orientation: portrait) {
  .dgm-lineup-card,
  .dgm-lineup-list .dgm-player-chip,
  .dgm-lineup-list {
    touch-action: auto !important;
  }
}

/* ========== ONGLET ANALYSE : canvas ========== */
.dgm-section-analyse{padding:14px 16px 16px}
.dgm-analyse-legend{display:flex;align-items:center;gap:14px;justify-content:center;margin-bottom:10px}
.dgm-analyse-dot{width:9px;height:9px;border-radius:50%;flex-shrink:0}
.dgm-analyse-legend-name{font-size:13px;font-weight:700;color:#94a3b8}
.dgm-analyse-canvas-wrap{width:100%}
.dgm-analyse-canvas-wrap canvas{width:100%;height:auto;display:block;touch-action:auto}

/* ── Refresh flash animation ── */
@keyframes dgm-fresh-pulse{0%{box-shadow:0 0 0 0 rgba(96,165,250,.28)}100%{box-shadow:0 0 0 8px rgba(96,165,250,0)}}
.dgm-shell.dgm-fresh{animation:dgm-fresh-pulse .55s ease-out}

/* ── Match animation engine ── */

/* Joueur qui tire — halo doré */
.dgm-player--scorer .dgm-player-circle {
  box-shadow: 0 0 0 5px rgba(255,200,50,.95), 0 0 18px 8px rgba(255,180,0,.55) !important;
  transition: box-shadow .15s ease !important;
}

/* Joueur qui assiste — halo bleu clair */
.dgm-player--assist .dgm-player-circle {
  box-shadow: 0 0 0 4px rgba(96,165,250,.90), 0 0 14px 6px rgba(96,165,250,.45) !important;
  transition: box-shadow .15s ease !important;
}

/* Flash lumineux sur le terrain au moment du but */
.dgm-goal-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 11;
  border-radius: inherit;
  animation: dgm-goal-flash-in .75s ease-out forwards;
}
@keyframes dgm-goal-flash-in {
  0%   { opacity: 0; }
  12%  { opacity: 1; }
  100% { opacity: 0; }
}

/* Carte but — contre-rotée pour être lisible sur le pitch 3D */
.dgm-goal-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotateX(-22deg);
  z-index: 20;
  background: linear-gradient(135deg, rgba(2,6,23,.94) 0%, rgba(15,23,42,.96) 100%);
  border: 1px solid rgba(255,200,60,.32);
  border-radius: 18px;
  padding: 14px 20px 12px;
  text-align: center;
  min-width: 160px;
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 40px rgba(0,0,0,.60), 0 0 0 1px rgba(255,220,60,.18);
  animation: dgm-card-in .35s cubic-bezier(.22,1,.36,1) both;
  pointer-events: none;
}
@keyframes dgm-card-in {
  from { opacity: 0; transform: translate(-50%, -50%) rotateX(-22deg) scale(.72); }
  to   { opacity: 1; transform: translate(-50%, -50%) rotateX(-22deg) scale(1); }
}
.dgm-gc-icon  { font-size: 26px; line-height: 1; margin-bottom: 4px; filter: drop-shadow(0 0 8px rgba(255,220,50,.8)); }
.dgm-gc-score { font-size: 32px; font-weight: 900; font-family: 'JetBrains Mono', monospace; letter-spacing: 2px; margin-bottom: 2px; }
.dgm-gc-team  { font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: rgba(203,213,225,.62); margin-bottom: 5px; }
.dgm-gc-scorer { font-size: 13px; font-weight: 800; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.dgm-gc-assist { font-size: 11px; font-weight: 600; color: rgba(147,197,253,.82); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }

/* ── Pagination dots DataHub ── */
.dgm-datahub-dots{display:none;justify-content:center;gap:6px;padding:10px 0 4px}
.dgm-datahub-dot{width:5px;height:5px;border-radius:999px;background:rgba(148,163,184,.28);transition:background .2s,width .2s}
.dgm-datahub-dot.is-active{background:#3b82f6;width:16px}
@media(max-width:720px){.dgm-datahub-dots{display:flex}}

/* ── Joueurs fantômes (terrain sans lineups) ── */
.dgm-player-ghost{opacity:.45;pointer-events:none}
.dgm-player-ghost-circle{
  width:22px;height:22px;border-radius:50%;
  border:1.5px solid;
  background:transparent;
  box-shadow:none;
}
@media(max-width:720px){
  .dgm-player-ghost-circle{width:18px;height:18px}
}

/* ── Minutage entrée remplaçant ── */
.dgm-chip-sub-in{
  display:inline-flex;align-items:center;
  margin-left:6px;
  font-size:10px;font-weight:800;
  color:#22c55e;
  letter-spacing:.02em;
}

/* ── V5 : AI compact block (toujours visible sous le score) ── */
.dgm-ai-compact{
  background:linear-gradient(135deg,rgba(15,23,42,.94),rgba(26,16,56,.94));
  border:1px solid rgba(167,139,250,.16);
  border-radius:18px;
  padding:14px 18px;
}
.dgm-ai-compact-head{
  display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px;
}
.dgm-ai-compact-text{
  margin:0;font-size:15px;font-weight:700;color:#fff;line-height:1.65;
  display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;
}

/* ── V5 : Dashboard section ── */
.dgm-section-dashboard{display:flex;flex-direction:column;gap:16px}
.dgm-radar-block{display:flex;flex-direction:column;gap:10px}
.dgm-radar-block-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;flex-wrap:wrap}
.dgm-radar-block-kicker{display:block;font-size:11px;font-weight:800;letter-spacing:.1em;text-transform:uppercase;color:#bfdbfe;margin-bottom:4px}
.dgm-radar-block-title{display:block;font-size:16px;font-weight:900;color:#f8fafc;line-height:1.2}
.dgm-radar-block-note{display:block;margin-top:4px;font-size:12px;line-height:1.45;color:#94a3b8;max-width:680px}
.dgm-radar-block-side{display:flex;flex-direction:column;align-items:flex-end;gap:6px}
.dgm-radar-block-status,.dgm-radar-block-signal{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;border:1px solid rgba(148,163,184,.16);background:rgba(15,23,42,.56);font-size:11px;font-weight:700;color:#cbd5e1}
.dgm-live-radar-card canvas,.dgm-match-radar-card canvas{width:100%;height:auto;display:block;touch-action:auto}
.dgm-expand-radar-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-bottom:12px}
.dgm-momentum-sub{margin-top:8px;font-size:12px;font-weight:700;color:#94a3b8;letter-spacing:.04em;text-transform:uppercase}

/* ── V5 : Couleurs premium avec effet reflet ── */
/* Stat bars */
.dgm-stat-fill-home{
  background:linear-gradient(90deg,#1d4ed8 0%,#3b82f6 55%,#93c5fd 100%);
  position:relative;overflow:hidden;
}
.dgm-stat-fill-away{
  background:linear-gradient(90deg,#dc2626 0%,#ef4444 55%,#fca5a5 100%);
  position:relative;overflow:hidden;
}
.dgm-stat-fill-home::after,.dgm-stat-fill-away::after{
  content:'';position:absolute;top:0;left:0;right:0;height:45%;
  background:rgba(255,255,255,.22);pointer-events:none;
}
/* Pression track */
.dgm-pression-fill{
  position:relative;overflow:hidden;
}
.dgm-pression-fill::after{
  content:'';position:absolute;top:0;left:0;right:0;height:45%;
  background:rgba(255,255,255,.20);pointer-events:none;
}
/* Momentum canvas bars — override via canvas class gloss done in JS */
/* Stat track base */
.dgm-stat-track{
  background:rgba(2,6,23,.65);
  border:1px solid rgba(148,163,184,.08);
}

/* ── V5 : Tab label overrides for new structure ── */
@media(max-width:480px){
  .dgm-datahub-tab{font-size:11px;padding:10px 10px}
}

/* ── V5 : touch-action — scroll natif partout sauf swipe tabs ── */
.dgm-section,
.dgm-section-dashboard,
.dgm-stat-bars-list,
.dgm-stat-row,
.dgm-timeline,
.dgm-pitch,
.dgm-ai-compact,
.dgm-momentum-card,
.dgm-radar-card{touch-action:auto}
/* Overscroll containment — empêche le bounce de page depuis les listes internes */
.dgm-datahub-pane{overscroll-behavior:contain}
/* Évite que le terrain retransmette des events touch à la page */
.dgm-pitch-frame .dgm-pitch{touch-action:auto}

/* ── V5 : legend team logos ── */
.dgm-analyse-team-logo{
  width:22px;height:22px;border-radius:50%;object-fit:contain;
  background:#fff;border:1px solid rgba(255,255,255,.15);
  flex-shrink:0;
}
.dgm-analyse-legend{gap:18px;align-items:center}
.dgm-analyse-legend-sep{width:1px;height:16px;background:rgba(148,163,184,.2);flex-shrink:0}

/* ── V5 : Tendance chart ── */
.dgm-tendance-wrap{background:rgba(15,23,42,.72);border:1px solid rgba(148,163,184,.1);border-radius:18px;overflow:hidden}
.dgm-tendance-header{display:flex;align-items:center;gap:12px;padding:12px 16px 8px;flex-wrap:wrap}
.dgm-tendance-title{font-size:13px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:#bfdbfe;flex-shrink:0}
.dgm-tendance-tabs{display:flex;gap:4px;overflow-x:auto;scrollbar-width:none;flex:1}
.dgm-tendance-tabs::-webkit-scrollbar{display:none}
.dgm-tendance-tab{flex:0 0 auto;padding:5px 11px;border-radius:999px;font-size:11px;font-weight:700;background:rgba(15,23,42,.6);border:1px solid rgba(148,163,184,.18);color:#64748b;cursor:pointer;transition:all .15s;white-space:nowrap}
.dgm-tendance-tab:hover{color:#cbd5e1;border-color:rgba(148,163,184,.35)}
.dgm-tendance-tab.is-active{background:rgba(37,99,235,.22);border-color:rgba(96,165,250,.4);color:#93c5fd}
#dgm-tendance-canvas{width:100%;height:auto;display:block;touch-action:auto}
.dgm-tendance-tab.is-unavailable{opacity:.38;cursor:not-allowed}
.dgm-tendance-tab.is-unavailable:hover{color:#64748b;border-color:rgba(148,163,184,.18);background:rgba(15,23,42,.6)}


/* ============================================================
   EXPAND OVERLAY — bulles d'agrandissement mobile
   ============================================================ */
.dgm-expand-overlay{
  position:fixed;inset:0;z-index:99999;
  background:rgba(2,6,23,.92);
  display:flex;align-items:center;justify-content:center;
  padding:14px;
  backdrop-filter:blur(7px);
  opacity:0;pointer-events:none;
  transition:opacity .22s ease;
}
.dgm-expand-overlay.is-open{opacity:1;pointer-events:all}
.dgm-expand-bubble{
  position:relative;
  width:min(98vw,920px);
  max-height:min(92dvh,92vh);
  overflow-y:auto;
  background:linear-gradient(180deg,rgba(10,20,44,.99),rgba(6,14,30,.99));
  border:1px solid rgba(59,130,246,.28);
  border-radius:26px;
  padding:14px 14px 18px;
  box-shadow:0 30px 80px rgba(2,6,23,.65);
  overscroll-behavior:contain;
}
.dgm-expand-close{
  position:absolute;top:12px;right:12px;z-index:5;
  appearance:none;
  border:1px solid rgba(148,163,184,.22);
  background:rgba(15,23,42,.92);
  color:#e2e8f0;width:38px;height:38px;
  border-radius:999px;font-size:22px;line-height:1;
  display:flex;align-items:center;justify-content:center;
  cursor:pointer;padding:0;font-weight:300;
}
.dgm-expand-close:active{background:rgba(37,99,235,.4)}
.dgm-expand-content canvas{width:100%!important;height:auto!important;display:block;touch-action:auto}
.dgm-expand-hint{text-align:center;font-size:11px;color:#475569;margin:10px 0 0;letter-spacing:.04em}
.dgm-expand-legend{display:flex;align-items:center;gap:14px;justify-content:center;margin-bottom:12px}

/* Bouton agrandissement — toujours réactif, même sur canvas */
.dgm-expand-btn{
  position:absolute;top:8px;right:10px;z-index:10;
  appearance:none;
  display:flex;align-items:center;justify-content:center;
  width:34px;height:34px;
  border-radius:999px;
  background:rgba(8,15,35,.82);
  border:1px solid rgba(148,163,184,.28);
  color:rgba(203,213,225,.8);
  font-size:16px;
  cursor:pointer;
  padding:0;
  box-shadow:0 4px 12px rgba(2,6,23,.35);
  transition:background .15s, border-color .15s, transform .15s;
  -webkit-tap-highlight-color:transparent;
}
@media (hover:hover) and (pointer:fine){
.dgm-expand-btn:hover,.dgm-expand-btn:focus{
  background:rgba(37,99,235,.5);
  border-color:rgba(96,165,250,.5);
  color:#fff;
  transform:scale(1.08);
}
}
.dgm-expand-btn:active{
  background:rgba(37,99,235,.75);
  transform:scale(.96);
}

/* Bulle tooltip joueur sur terrain agrandi */
.dgm-player-tooltip{
  position:absolute;z-index:20;
  background:rgba(8,18,40,.97);
  border:1px solid rgba(96,165,250,.36);
  border-radius:16px;
  padding:10px 14px;
  pointer-events:none;
  white-space:nowrap;
  transform:translate(-50%,-110%);
  box-shadow:0 14px 30px rgba(2,6,23,.55);
  animation:dgm-tooltip-in .15s ease;
}
@keyframes dgm-tooltip-in{from{opacity:0;transform:translate(-50%,-88%)}to{opacity:1;transform:translate(-50%,-110%)}}
.dgm-player-tooltip strong{display:block;font-size:15px;color:#fff;font-weight:900;line-height:1.15}
.dgm-player-tooltip .dgm-tooltip-pos{font-size:11px;color:#94a3b8;margin-top:2px;font-weight:700}
.dgm-player-tooltip .dgm-tooltip-rating{
  display:inline-flex;padding:3px 10px;
  border-radius:999px;font-size:13px;font-weight:900;
  color:#fff;margin-top:6px;
}

/* Joueurs plus grands dans le terrain agrandi */
.dgm-expand-content .dgm-player{width:54px;max-width:54px}
.dgm-expand-content .dgm-player-circle{width:34px;height:34px;font-size:13px;border-width:2px}
.dgm-expand-content .dgm-player-keeper .dgm-player-circle{width:36px;height:36px}
.dgm-expand-content .dgm-player-name{font-size:10px;max-width:60px}
.dgm-expand-content .dgm-player-rating{top:-7px;right:-8px;min-width:24px;height:16px;font-size:9px;line-height:16px}
.dgm-expand-content .dgm-pitch-frame{cursor:default!important}
.dgm-expand-content .dgm-pitch-meta{display:none}
.dgm-expand-content .dgm-section-head{display:none}
.dgm-expand-content .dgm-section{border:none;background:transparent;padding:0}

/* Tendance expand */
.dgm-expand-content .dgm-tendance-wrap{border-radius:16px}
.dgm-expand-content #dgm-expand-tendance-canvas{min-height:160px}



/* ============================================================
   TOOLTIP JOUEUR — attaché au frame, jamais clippé (v5.5)
   ============================================================ */
.dgm-pitch-frame { overflow: visible !important; }
.dgm-player-tooltip {
  position: absolute;
  z-index: 30;
  transform: translate(-50%, -100%) translateY(-10px);
  pointer-events: none;
  white-space: nowrap;
  background: rgba(8,18,40,.97);
  border: 1px solid rgba(96,165,250,.42);
  border-radius: 16px;
  padding: 10px 16px;
  box-shadow: 0 14px 30px rgba(2,6,23,.6), 0 0 0 1px rgba(96,165,250,.12);
  animation: dgm-tooltip-in .14s ease;
}
@keyframes dgm-tooltip-in {
  from { opacity:0; transform:translate(-50%,-90%) translateY(-10px); }
  to   { opacity:1; transform:translate(-50%,-100%) translateY(-10px); }
}
.dgm-player-tooltip.dgm-tt-below {
  transform: translate(-50%, 10px);
  animation: dgm-tooltip-below-in .14s ease;
}
@keyframes dgm-tooltip-below-in {
  from { opacity:0; transform:translate(-50%,-4px); }
  to   { opacity:1; transform:translate(-50%,10px); }
}
.dgm-player-tooltip strong { display:block; font-size:15px; color:#fff; font-weight:900; line-height:1.15; }
.dgm-player-tooltip .dgm-tooltip-pos { font-size:11px; color:#94a3b8; margin-top:2px; font-weight:700; display:block; }
.dgm-player-tooltip .dgm-tooltip-rating { display:inline-flex; padding:3px 10px; border-radius:999px; font-size:13px; font-weight:900; color:#fff; margin-top:6px; }

@media(max-width:720px){.dgm-radar-block-title{font-size:14px}.dgm-radar-block-note{font-size:11px}.dgm-radar-block-side{align-items:flex-start}.dgm-radar-block-head{gap:10px}}

/* ── Fix P3: zone tactile joueurs élargie sans changer le visuel ── */
@media (max-width: 720px){
  .dgm-player-tappable{
    padding:8px;
    margin:-8px;
  }
}

/* ── Fix P5: header compact en paysage mobile ── */
@media (max-width: 920px) and (orientation:landscape){
  .dgm-header{padding:8px 16px 4px}
  .dgm-score-area{padding:4px 0 8px;gap:8px}
  .dgm-team-logo,.dgm-team-badge{width:36px;height:36px}
  .dgm-team-name{font-size:13px}
  .dgm-score{font-size:34px;letter-spacing:1px}
  .dgm-score-center{min-width:88px}
  .dgm-live-badge{padding:4px 10px;font-size:11px;margin-top:5px}
  .dgm-pick-banner{padding:7px 14px}
  .dgm-pick-value{font-size:14px}
  .dgm-datetime{font-size:11px;margin-bottom:8px}
}

/* ── Fix P8: pick-banner layout portrait ── */
@media (max-width: 720px){
  .dgm-pick-banner{flex-wrap:nowrap;align-items:center}
  .dgm-pick-main{flex:1;min-width:0}
  .dgm-pick-confidence{margin-left:auto;flex-shrink:0}
}
@media (max-width: 360px){
  .dgm-pick-tag{display:none}
}

/* ── Feature: formation switch ── */
.dgm-formation-switch{
  display:flex;align-items:center;justify-content:center;
  gap:8px;margin-top:10px;flex-wrap:wrap;
}
.dgm-fswitch-btn{
  display:flex;align-items:center;gap:7px;
  padding:7px 12px;
  border-radius:999px;
  border:1.5px solid rgba(148,163,184,.2);
  background:rgba(15,23,42,.72);
  color:#cbd5e1;font-size:12px;font-weight:800;
  cursor:pointer;transition:all .2s;
  -webkit-tap-highlight-color:transparent;
}
.dgm-fswitch-btn:active{transform:scale(.96)}
.dgm-fswitch-btn.is-active{border-color:rgba(96,165,250,.5);background:rgba(37,99,235,.22);color:#fff}
.dgm-fswitch-btn.is-active-away{border-color:rgba(239,68,68,.5);background:rgba(239,68,68,.18);color:#fff}
.dgm-fswitch-logo{width:22px;height:22px;border-radius:999px;object-fit:contain;background:#fff;padding:2px;flex-shrink:0}
.dgm-fswitch-badge{width:22px;height:22px;border-radius:999px;display:flex;align-items:center;justify-content:center;font-size:9px;font-weight:900;flex-shrink:0}
.dgm-fswitch-sep{width:1px;height:20px;background:rgba(148,163,184,.2);flex-shrink:0}
.dgm-player[data-side="home"].dgm-side-hidden,
.dgm-player[data-side="away"].dgm-side-hidden{
  opacity:0;
  transform:translate(-50%,-50%) scale(0.6);
  pointer-events:none;
}

/* ── Formation switch: smooth position transition when isolating a team ── */
.dgm-player{transition:opacity .25s ease, transform .25s ease, left .35s cubic-bezier(.4,0,.2,1), top .35s cubic-bezier(.4,0,.2,1)}

/* ── Terrain full-bleed en portrait mobile ─────────────────────────────────
   Problème : shell(14px) + content(14px) + section(14px) + pitch-frame(12px)
   = ~54px de padding de chaque côté → terrain minuscule sur 390px.
   Solution : la section pitch « saigne » hors du padding du content,
   le pitch-frame flush contre les bords, section-head reste lisible.
── */
@media (max-width: 720px) and (orientation: portrait) {
  .dgm-section-pitch {
    /* Negative margin pour casser les 14px de .dgm-content */
    margin-left: -14px;
    margin-right: -14px;
    /* Supprimer le look "carte dans une carte" */
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
  }
  .dgm-section-pitch .dgm-section-head {
    padding: 0 14px 10px;
  }
  .dgm-pitch-frame {
    border-radius: 0;
    padding: 0;
  }
  .dgm-pitch {
    border-radius: 0;
    /* Réduire la tilt perspective pour gagner de la hauteur visible */
    transform: perspective(1200px) rotateX(12deg) !important;
  }
  /* Formation switch flush avec les bords */
  .dgm-formation-switch {
    padding: 10px 14px;
    margin: 0;
  }
  /* Pitch-meta (formation labels) flush */
  .dgm-pitch-meta {
    padding: 0 14px 8px;
  }
}
