/* Metrigame capture simulator — STYLES
   Colours, type and spacing read off the 2026-10-17 screenshots of metrigame.com/ca.
   Sections: tokens · sim chrome · mock header · capture layout (landscape / portrait / phone)
             · board · history · modals · tanda · resum · coach-mark overlay */

:root {
  --bg: #0b0d10; --panel: #11161c; --panel-2: #151b23; --line: #262e38; --line-2: #333c48;
  --text: #e8ebef; --muted: #96a0ad; --dim: #6b7582;
  --green: #22c55e; --green-2: #4ade80; --green-ink: #0b2a18; --status: #34d399;
  --amber: #e9b949; --red: #f43f5e;
  --t-green-bg: #163a31; --t-green: #34d399;
  --t-blue-bg: #1b2e45;  --t-blue: #60a5fa;
  --t-purple-bg: #2a2a47; --t-purple: #b48cf6;
  --t-red-bg: #372a2c;   --t-red: #fb7d5b;
  --t-yellow-bg: #2e3128; --t-yellow: #facc15;
  --t-teal-bg: #15363a;  --t-teal: #2dd4bf;
  --t-amber-bg: #34312a; --t-amber: #f59e0b;
  --t-rose-bg: #3a222a;  --t-rose: #f43f5e;
  --radius: 12px;
  --font: Inter, "Inter var", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Roboto Mono", monospace;
  --chrome-h: 46px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .4; cursor: not-allowed; }
.ic { width: 18px; height: 18px; flex: none; }

/* ---------- Simulator chrome (not part of the real app) ---------- */
.sim-bar { height: var(--chrome-h); display: flex; align-items: center; gap: 10px; padding: 0 12px; background: #07090b; border-bottom: 1px solid var(--line); position: relative; z-index: 50; }
.sim-brand { font-weight: 800; font-size: 14px; letter-spacing: .02em; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.sim-brand i { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.sim-brand small { color: var(--muted); font-weight: 600; }
.sim-back { color: var(--green-2); font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.sim-back:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.sim-dots { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.sim-dot { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; padding: 0; display: grid; place-items: center; }
.sim-dot.is-done { background: var(--green-ink); border-color: var(--green); color: var(--green-2); }
.sim-dot.is-current { background: var(--green); border-color: var(--green); color: #04150b; }
.sim-dot.is-free { width: auto; border-radius: 11px; padding: 0 8px; }
.sim-ctrl { display: flex; gap: 6px; align-items: center; }
.sim-ctrl select, .sim-ctrl button { height: 30px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); padding: 0 10px; font-size: 13px; }
.sim-ctrl button:hover { border-color: var(--green); }

#sim { height: calc(100% - var(--chrome-h)); overflow: auto; position: relative; }
.mg-app { max-width: 1280px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }

/* ---------- Mock header ---------- */
.mg-header { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.mg-icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); display: grid; place-items: center; padding: 0; }
.mg-scorebox { min-width: 0; text-align: center; }
.mg-title { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-score-row { display: flex; align-items: center; justify-content: center; gap: 12px; }
.mg-score { font-size: 30px; font-weight: 800; letter-spacing: .01em; line-height: 1.1; }
.mg-fouls { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 2px 7px; }
.mg-fouls .ic { width: 14px; height: 14px; }
.mg-clock { min-width: 128px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel); padding: 6px 14px; display: flex; flex-direction: column; align-items: center; }
.mg-clock.is-running { border-color: var(--green); }
.mg-clock-t { display: flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mg-clock .ic-clock { width: 16px; height: 16px; color: var(--green-2); }
.mg-clock-p { font-size: 12px; color: var(--muted); }
.mg-clock.is-static .mg-clock-t { font-size: 17px; }

/* ---------- Capture layout ---------- */
.mg-capture { display: grid; gap: 10px; padding: 10px 14px 14px; flex: 1; align-content: start; }
/* Tablet landscape & desktop: players | actions | history (history beside the board) */
@media (min-width: 1000px) {
  .mg-capture { grid-template-columns: 250px minmax(0, 1fr) 320px; grid-template-rows: auto 1fr auto auto;
    grid-template-areas: "tool tool hist" "players board hist" "bottom bottom hist" "footer footer hist"; height: calc(100vh - var(--chrome-h) - 70px); min-height: 640px; align-content: stretch; }
  .mg-toolbar { grid-area: tool; } .mg-players { grid-area: players; } .mg-board { grid-area: board; }
  .mg-bottom { grid-area: bottom; } .mg-footer { grid-area: footer; } .mg-history { grid-area: hist; }
  .mg-player-grid { grid-template-columns: 1fr 1fr; }
  .mg-groups { grid-template-columns: 1fr 1fr; flex: 1; }
  .mg-group { display: flex; flex-direction: column; }
  .mg-group .mg-grid { flex: 1; grid-auto-rows: minmax(76px, 1fr); }
  .mg-history { display: flex; flex-direction: column; min-height: 0; }
  .mg-hbody { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .mg-hlist { flex: 1; overflow: auto; }
}
/* Simulator bar wraps below 1000 px */
@media (max-width: 999px) {
  :root { --chrome-h: 80px; }
  .sim-bar { flex-wrap: wrap; height: auto; min-height: var(--chrome-h); padding: 6px 10px; row-gap: 6px; }
  .sim-dots { margin-left: 0; order: 3; width: 100%; justify-content: space-between; }
  .sim-ctrl { margin-left: auto; }
  .sim-brand small { display: none; }
}
/* Tablet portrait */
@media (min-width: 600px) and (max-width: 999px) {
  .mg-action { min-height: 84px; }
  .mg-player { min-height: 72px; }
  .mg-player-grid { grid-template-columns: repeat(5, 1fr); }
  .mg-groups { grid-template-columns: 1fr 1fr; }
  .mg-hlist { max-height: 260px; overflow: auto; }
}
/* Phone */
@media (max-width: 599px) {
  .mg-header { grid-template-columns: auto 1fr auto auto; gap: 8px; padding: 8px 10px; }
  .mg-score { font-size: 24px; }
  .mg-clock { min-width: 96px; padding: 5px 8px; }
  .mg-clock-t { font-size: 18px; }
  .mg-icon-btn { width: 36px; height: 36px; }
  .mg-capture { padding: 8px 10px 80px; gap: 8px; }
  .mg-player-grid { grid-template-columns: repeat(3, 1fr); }
  .mg-groups { grid-template-columns: 1fr; }
  .mg-grid-atac { grid-template-columns: repeat(3, 1fr) !important; }
  .mg-toolbar { grid-template-columns: repeat(2, 1fr) !important; }
  .mg-bottom { grid-template-columns: 1fr 1fr !important; }
  .mg-bottom .mg-card-btn { grid-column: auto; }
  .mg-hlist { max-height: 300px; overflow: auto; }
  .sim-ctrl select { max-width: 150px; }
}

/* ---------- Toolbar / players ---------- */
.mg-toolbar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mg-tool { height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 600; }
.mg-tool .ic { color: var(--muted); }
.mg-players { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.mg-mode { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); font-weight: 600; }
.mg-warn { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; font-weight: 800; color: var(--amber); padding: 0; }
.mg-player-grid { display: grid; gap: 8px; }
.mg-player { min-height: 64px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 8px 10px; text-align: left; gap: 2px; transition: background .15s, border-color .15s; }
.mg-dorsal { font-size: 20px; font-weight: 800; line-height: 1; }
.mg-dorsal small { font-size: 10px; font-weight: 800; color: var(--amber); letter-spacing: .05em; margin-left: 2px; vertical-align: middle; }
.mg-pname { font-size: 12px; color: var(--muted); }
.mg-player.is-por { background: #3a3020; border-color: var(--amber); }
.mg-player.is-holder { background: #1b6b44; border-color: var(--green-2); box-shadow: 0 0 0 2px rgba(74,222,128,.25); }
.mg-player.is-holder .mg-pname { color: #d9fbe7; }
.mg-status { margin: 0; font-size: 13px; color: var(--status); line-height: 1.35; min-height: 2.7em; }

/* ---------- Board ---------- */
.mg-board { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.mg-board-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.mg-hint { font-size: 13px; color: var(--muted); }
.mg-tabs { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.mg-tabs button { border: 0; background: transparent; padding: 7px 18px; font-size: 14px; font-weight: 600; color: var(--muted); }
.mg-tabs button.is-on { background: var(--green); color: #04150b; }
.mg-groups { display: grid; gap: 12px; }
.mg-group h4 { margin: 0 0 6px; font-size: 11px; letter-spacing: .1em; color: var(--dim); text-transform: uppercase; }
.mg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mg-action { min-height: 64px; border-radius: 10px; border: 1px solid transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 14px; font-weight: 600; text-align: center; padding: 6px; line-height: 1.15; transition: transform .08s, box-shadow .15s; }
.mg-action:active { transform: scale(.97); }
.mg-action .ic { width: 20px; height: 20px; }
.mg-action.is-selected { border-color: currentColor; box-shadow: 0 0 0 2px currentColor inset; }
.mg-action.is-selected span { color: #fff; }
.tone-green  { background: var(--t-green-bg);  } .tone-green .ic, .tone-green.is-selected  { color: var(--t-green); }
.tone-blue   { background: var(--t-blue-bg);   } .tone-blue .ic, .tone-blue.is-selected    { color: var(--t-blue); }
.tone-purple { background: var(--t-purple-bg); } .tone-purple .ic, .tone-purple.is-selected { color: var(--t-purple); }
.tone-red    { background: var(--t-red-bg);    } .tone-red .ic, .tone-red.is-selected      { color: var(--t-red); }
.tone-yellow { background: var(--t-yellow-bg); } .tone-yellow .ic, .tone-yellow.is-selected { color: var(--t-yellow); }
.tone-teal   { background: var(--t-teal-bg);   } .tone-teal .ic, .tone-teal.is-selected    { color: var(--t-teal); }
.tone-amber  { background: var(--t-amber-bg);  } .tone-amber .ic, .tone-amber.is-selected  { color: var(--t-amber); }
.tone-rose   { background: var(--t-rose-bg);   } .tone-rose .ic, .tone-rose.is-selected    { color: var(--t-rose); }
.mg-action span { color: var(--text); }

.mg-bottom { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr; gap: 8px; }
.mg-pass-btn, .mg-card-btn { height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; }
.mg-card-btn.is-selected { border-color: var(--text); }
.mg-swatch { width: 12px; height: 16px; border-radius: 2px; display: inline-block; }
.mg-swatch.y { background: #facc15; } .mg-swatch.b { background: #3b82f6; } .mg-swatch.r { background: #ef4444; }
.mg-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 6px 6px 12px; background: var(--panel); }
.mg-saved { font-size: 13px; color: var(--status); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-addzone { display: inline-flex; align-items: center; gap: 6px; height: 34px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); padding: 0 12px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.mg-addzone .ic { width: 15px; height: 15px; }

/* ---------- History ---------- */
.mg-history { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.mg-hhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mg-htoggle { white-space: nowrap; border: 0; background: transparent; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; letter-spacing: .06em; padding: 6px 0; }
.mg-history.is-closed .mg-htoggle .ic { transform: rotate(-90deg); }
.mg-history.is-closed .mg-hbody { display: none; }
.mg-hlast { white-space: nowrap; height: 34px; border-radius: 8px; border: 1px solid #5b2a33; background: #2a1519; color: #fda4af; font-size: 12px; font-weight: 800; letter-spacing: .05em; padding: 0 12px; }
.mg-hall { margin: 8px 0; border: 1px solid var(--line); background: transparent; border-radius: 8px; font-size: 12px; color: var(--muted); padding: 5px 10px; }
.mg-hlist, .mg-tlist, .mg-evlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.mg-hrow { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "meta x" "text x"; gap: 2px 8px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 8px 8px 10px; background: var(--panel-2); }
.mg-hmeta { grid-area: meta; font-family: var(--mono); font-size: 11px; color: var(--dim); }
.mg-htext { grid-area: text; font-size: 13px; }
.mg-hx { grid-area: x; align-self: center; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line-2); background: transparent; display: grid; place-items: center; padding: 0; color: var(--muted); }
.mg-hx .ic { width: 15px; height: 15px; }
.mg-hempty { color: var(--dim); font-size: 13px; padding: 8px 2px; }

/* ---------- Toasts ---------- */
.mg-flash { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #17944f; color: #fff; font-weight: 600; font-size: 14px; padding: 9px 18px; border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,.4); z-index: 40; max-width: 92vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.mg-undo { position: fixed; left: 50%; top: calc(var(--chrome-h) + 10px); transform: translateX(-50%); display: flex; align-items: center; gap: 12px; background: #17944f; color: #fff; font-weight: 700; padding: 6px 6px 6px 16px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.45); z-index: 41; }
.mg-undo button { border: 0; background: #0d1a12; color: #fff; font-weight: 800; border-radius: 8px; padding: 8px 14px; }

/* ---------- Modals ---------- */
.mg-modal-back { position: fixed; inset: 0; background: rgba(3,5,8,.72); display: grid; place-items: center; z-index: 30; padding: 14px; }
.mg-modal { position: relative; background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; padding: 18px; width: min(560px, 100%); max-height: calc(100vh - 28px); overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.55); }
.mg-modal h3 { margin: 0 0 10px; font-size: 20px; }
.mg-modal p { color: var(--muted); font-size: 14px; line-height: 1.45; margin: 0 0 14px; }
.mg-modal-sm { width: min(440px, 100%); }
.mg-mclose { position: absolute; top: 12px; right: 12px; }
.mg-btn { min-height: 44px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); font-weight: 700; font-size: 14px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.mg-btn-green { background: var(--green); border-color: var(--green); color: #04150b; }
.mg-btn-outline { background: transparent; border-color: var(--green); color: var(--green-2); width: 100%; margin-top: 10px; }
.mg-btn-danger { background: #2a1519; border-color: #5b2a33; color: #fda4af; width: 100%; margin-top: 10px; }
.mg-btn-ghost { background: transparent; border-color: transparent; color: var(--muted); width: 100%; margin-top: 6px; }
.mg-btn-sm { min-height: 34px; font-size: 13px; padding: 0 12px; }
.mg-btn .ic { width: 15px; height: 15px; }
.mg-col-btns { display: flex; flex-direction: column; gap: 8px; }
.mg-row-btns { display: flex; gap: 8px; } .mg-row-btns .mg-btn { flex: 1; }
.mg-muted { color: var(--muted); font-size: 13px; }
.mg-result-who { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; background: var(--panel-2); }
.mg-result-who span { font-size: 12px; color: var(--muted); letter-spacing: .08em; }
.mg-result-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mg-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }

/* Zone picker: side panel + court */
.mg-modal-zone { width: min(980px, 100%); display: grid; grid-template-columns: 220px 1fr; gap: 18px; padding: 20px; }
.mg-zone-q { font-size: 22px; font-weight: 800; margin-bottom: 14px; }
.mg-zone-act { font-size: 12px; letter-spacing: .1em; color: var(--muted); font-weight: 800; }
.mg-zone-who { font-size: 16px; font-weight: 800; margin-top: 4px; }
.mg-zone-help { margin-top: 16px !important; font-size: 12px !important; }
.mg-zone-main { min-width: 0; }
@media (max-width: 760px) { .mg-modal-zone { grid-template-columns: 1fr; gap: 10px; padding: 14px; } .mg-zone-q { font-size: 18px; margin: 0 0 6px; } .mg-zone-help { display: none; } }

.mg-court { position: relative; border: 2px solid #3b4654; border-radius: 26px; background: #0f1a16; padding: 10px; display: flex; flex-direction: column; gap: 0; aspect-ratio: 1 / 1.25; max-height: calc(100vh - 140px); margin: 0 auto; }
@media (min-width: 1000px) and (orientation: landscape) { .mg-modal-zone .mg-court { aspect-ratio: auto; height: min(640px, calc(100vh - 110px)); } }
.mg-half { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 6px; }
.mg-midline { height: 2px; background: #3b4654; margin: 8px 0; position: relative; }
.mg-midline::after { content: ""; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; border: 2px solid #3b4654; border-radius: 50%; transform: translate(-50%, -50%); }
.mg-goal { position: absolute; left: 50%; width: 46px; height: 6px; background: #5b6675; transform: translateX(-50%); border-radius: 3px; }
.mg-goal-top { top: -4px; } .mg-goal-bottom { bottom: -4px; }
.mg-zone { border-radius: 10px; border: 1px solid #2c3a36; background: rgba(34,197,94,.06); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 40px; padding: 0; }
button.mg-zone:hover, button.mg-zone:focus-visible { background: rgba(34,197,94,.22); border-color: var(--green); }
.mg-zone b { font-size: 15px; } .mg-half-p .mg-zone b { color: #cbd5e1; }
.mg-court.is-heat { max-width: 380px; aspect-ratio: 1 / 1.35; }
.mg-court.is-heat .mg-zone { background: rgba(239, 68, 68, calc(var(--heat, 0) * .85)); border-color: rgba(255,255,255,.06); }
.mg-court.is-heat .mg-zone.has { border-color: rgba(255,180,180,.4); }
.mg-zone em { font-style: normal; font-size: 12px; color: var(--muted); }
.mg-court.is-heat .mg-zone.has em { color: #fff; font-weight: 700; }

/* Options sheet */
.mg-modal-opts { width: min(520px, 100%); }
.mg-optlabel { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin: 12px 0 6px; font-weight: 700; }
.mg-seg-row { display: flex; gap: 6px; }
.mg-seg { flex: 1; min-height: 42px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); font-weight: 700; }
.mg-seg.is-on { background: var(--green); border-color: var(--green); color: #04150b; }
.mg-seg.is-on.is-ko { background: #7f1d1d; border-color: #b91c1c; color: #fff; }
.mg-opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.mg-optblock { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-top: 12px; display: grid; gap: 8px; background: var(--panel-2); }
.mg-optblock h4 { margin: 0; font-size: 15px; }
.mg-optblock label { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: var(--muted); gap: 10px; }
.mg-optblock select, .mg-optblock input, .mg-tanda select, .mg-filters select, .mg-ev-head select { height: 38px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg); padding: 0 10px; min-width: 90px; }
.mg-optblock input { width: 90px; }
.mg-optblock p { margin: 0; }

/* ---------- Tanda ---------- */
.mg-tanda { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px 14px; }
@media (max-width: 760px) { .mg-tanda { grid-template-columns: 1fr; } }
.mg-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.mg-panel h3 { margin: 0 0 8px; font-size: 17px; }
.mg-tanda select, .mg-fake-input { width: 100%; height: 44px; }
.mg-fake-input { border: 1px solid var(--line-2); border-radius: 8px; display: flex; align-items: center; padding: 0 12px; color: var(--muted); }
.mg-tanda .mg-btn-green { width: 100%; margin-top: 14px; }
.mg-tanda-head { display: flex; justify-content: space-between; align-items: center; }
.mg-tanda-score { font-size: 34px; font-weight: 800; color: var(--green-2); margin: 4px 0; }
.mg-tanda-state { font-weight: 700; color: var(--amber); }
.mg-tanda-state.is-done { color: var(--green-2); }
.mg-tlist li { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 13px; background: var(--panel-2); }
.mg-tlist li.mg-hempty { display: block; }
.mg-tlist b.ok { color: var(--green-2); } .mg-tlist b.ko { color: #fda4af; }
.mg-tanda .mg-hlast { margin-top: 10px; }

/* ---------- Partits ---------- */
.mg-partits { padding: 18px 14px; max-width: 720px; width: 100%; margin: 0 auto; }
.mg-partits h2 { margin: 0 0 12px; }
.mg-match { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.mg-match > div { flex: 1; min-width: 0; }
.mg-match-t { font-weight: 800; }
.mg-badge { font-size: 12px; font-weight: 700; color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 10px; }

/* ---------- Resum ---------- */
.mg-resum { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.mg-resum-top { display: flex; justify-content: space-between; align-items: center; }
.mg-resum-top h2 { margin: 0; font-size: 22px; text-transform: lowercase; }
.mg-resum-actions { display: flex; gap: 8px; align-items: center; }
.mg-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 760px) { .mg-kpis { grid-template-columns: 1fr 1fr; } }
.mg-kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.mg-kpi span { font-size: 11px; letter-spacing: .1em; color: var(--dim); font-weight: 700; }
.mg-kpi b { font-size: 28px; }
.mg-kpi b em { font-style: normal; } .mg-kpi b em.us { color: var(--green-2); }
.mg-kpi small { color: var(--muted); font-size: 11px; }
.mg-note { font-size: 14px; color: var(--muted); } .mg-note b { color: var(--text); }
.mg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mg-chips span { border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 12px; color: var(--muted); background: var(--panel); }
.mg-table-wrap { overflow-x: auto; }
.mg-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mg-table th, .mg-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.mg-table th:first-child, .mg-table td:first-child { text-align: left; }
.mg-table th { color: var(--dim); font-size: 11px; letter-spacing: .06em; }
.mg-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
@media (max-width: 760px) { .mg-filters { grid-template-columns: 1fr 1fr; } }
.mg-filters label, .mg-ev-head label { display: flex; flex-direction: column; gap: 4px; font-size: 10px; letter-spacing: .1em; color: var(--dim); font-weight: 700; }
.mg-filters select { width: 100%; font-size: 13px; }
.mg-ev-head select { font-size: 13px; }
.mg-attack { text-align: center; font-size: 12px; color: var(--muted); margin: 6px 0; }
.mg-scale { display: flex; align-items: center; gap: 8px; justify-content: center; font-size: 12px; color: var(--muted); margin: 8px 0; }
.mg-scale i { width: 120px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, rgba(239,68,68,.05), rgba(239,68,68,.85)); }
.mg-ev-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin-bottom: 8px; }
.mg-evlist li { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 13px; background: var(--panel-2); }

/* ---------- Coach-mark overlay (tutorial) ---------- */
.cm-ring { position: fixed; z-index: 90; pointer-events: none; border: 3px solid var(--green-2); border-radius: 14px; box-shadow: 0 0 0 9999px rgba(2, 4, 6, .62), 0 0 22px rgba(74, 222, 128, .55); transition: all .22s ease; animation: cm-pulse 1.6s ease-in-out infinite; }
.cm-ring.is-none { border: 0; width: 0 !important; height: 0 !important; left: 50% !important; top: 50% !important; animation: none; box-shadow: 0 0 0 9999px rgba(2, 4, 6, .62); }
@keyframes cm-pulse { 50% { box-shadow: 0 0 0 9999px rgba(2,4,6,.62), 0 0 34px rgba(74,222,128,.9); } }
.cm-bubble { position: fixed; z-index: 91; width: min(340px, calc(100vw - 20px)); background: #f8faf9; color: #0d1512; border-radius: 14px; padding: 14px 16px 12px; box-shadow: 0 16px 40px rgba(0,0,0,.5); font-size: 15px; line-height: 1.42; transition: top .22s ease, left .22s ease; }
.cm-bubble .cm-kicker { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #15803d; margin-bottom: 4px; display: flex; justify-content: space-between; gap: 8px; }
.cm-bubble .cm-kicker span:last-child { color: #6b7280; white-space: nowrap; }
.cm-bubble p { margin: 0; }
.cm-bubble .cm-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 8px; }
.cm-bubble button { border: 0; border-radius: 9px; padding: 8px 14px; font-weight: 800; font-size: 14px; }
.cm-next { background: #16a34a; color: #fff; }
.cm-skip { background: transparent; color: #6b7280; font-weight: 600 !important; padding: 8px 4px !important; }
.cm-bubble.is-center { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: min(420px, calc(100vw - 24px)); text-align: left; }
.cm-bubble.is-nudge { animation: cm-shake .35s; }
.cm-nudge-msg[hidden] { display: none !important; }
.cm-nudge-msg { display: block; margin-top: 6px; color: #b45309; font-weight: 700; font-size: 13px; }
@keyframes cm-shake { 20%, 60% { margin-left: -6px; } 40%, 80% { margin-left: 6px; } }
.cm-bubble h3 { margin: 0 0 6px; font-size: 19px; }
.cm-check { font-size: 34px; }
