/* Shared look and behaviour for the two vector matching tasks (match-board.js). */
:root{ --navy:#002060; --red:#C8102E; --green:#1E7A3C; --gold:#E0A000; --light:#EFF3F9; --line:#d8e0ee; --ink:#1a1a1a; --muted:#5a6478; --bg:#f4f6fb; }
*{ box-sizing:border-box; }
body{ margin:0; font-family:"Segoe UI", Aptos, Calibri, Arial, sans-serif; background:var(--bg); color:var(--ink); }
header{ background:var(--navy); color:#fff; padding:10px 24px; }
header .head{ max-width:1700px; margin:0 auto; }
header h1{ margin:0; font-size:1.3rem; letter-spacing:.3px; }
header p{ display:none; }
main{ max-width:1700px; margin:12px auto 24px; padding:0 16px; }
.panel{ background:#fff; border-radius:14px; box-shadow:0 2px 10px rgba(0,32,96,.08); padding:10px 14px; }
.armnote{ flex:1 1 100%; margin:0; min-height:1.3em; font-size:.85rem; font-weight:700; color:#C8102E; }
.btn.armed{ background:#C8102E !important; border-color:#C8102E !important; color:#fff !important; }
.controls{ display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin-bottom:12px; }
.controls .how{ font-size:.92rem; color:var(--muted); flex:1 1 520px; line-height:1.5; }
.spacer{ flex:1 1 auto; }
.btn{ font:inherit; font-size:.9rem; font-weight:700; height:38px; padding:0 14px; border-radius:9px; border:1.5px solid var(--navy); background:#fff; color:var(--navy); cursor:pointer; white-space:nowrap; }
.btn:hover{ background:var(--light); }
.btn.primary{ background:var(--navy); color:#fff; }
.status{ font-weight:800; min-width:10em; }
.status.ok{ color:var(--green); } .status.bad{ color:var(--red); }
.play{ display:grid; grid-template-columns:minmax(0, 1fr) 440px; gap:14px; align-items:start; }
.left{ min-width:0; }
.pin{ display:flex; flex-wrap:wrap; align-items:center; gap:6px 18px; margin-bottom:12px; }
.pin:empty{ display:none; }
.pin .gsvg{ width:min(100%, 330px); height:auto; flex:none; cursor:zoom-in; }
.pin .pinfo{ flex:1 1 220px; font-size:1.05rem; line-height:2; color:var(--navy); font-weight:600; }
.pin .pinfo .lead{ font-size:.82rem; letter-spacing:.5px; text-transform:uppercase; font-weight:800; color:var(--muted); display:block; line-height:1.4; }
.graphs{ display:grid; grid-template-columns:repeat(auto-fill, minmax(var(--item, 250px), 1fr)); gap:12px; }
.g{ background:#fff; border:2px solid var(--line); border-radius:14px; padding:8px 8px 10px; position:relative; }
.g.right{ border-color:var(--green); box-shadow:0 0 0 3px rgba(30,122,60,.18); }
.g.wrong{ border-color:var(--red); box-shadow:0 0 0 3px rgba(200,16,46,.15); }
.g .letter{ position:absolute; left:6px; top:5px; font-size:1rem; font-weight:900; color:var(--navy); z-index:1; background:#fff; border:2px solid var(--navy); border-radius:8px; min-width:28px; text-align:center; line-height:1.4; }
.g .gsvg{ display:block; width:100%; height:auto; cursor:zoom-in; }
.g .pic.tx{ min-height:72px; display:flex; align-items:center; justify-content:center; text-align:center; padding:26px 8px 6px; font-size:1.35rem; color:var(--navy); }
.zoom{ position:fixed; inset:0; z-index:60; background:rgba(0,20,60,.55); display:flex; align-items:center; justify-content:center; cursor:zoom-out; }
.zoom .zbox{ background:#fff; border-radius:16px; padding:16px; width:min(92vw, 120vh); position:relative; box-shadow:0 20px 60px rgba(0,0,0,.35); }
.zoom .gsvg{ display:block; width:100%; height:auto; }
.slots{ display:grid; grid-template-columns:1fr; gap:6px; margin-top:6px; }
.slot{ min-height:48px; border:2px dashed #b9c6dc; border-radius:10px; display:flex; align-items:center; justify-content:center; background:#F7F9FD; cursor:pointer; }
.slot:empty::before{ content:attr(data-ph); color:#8794ad; font-size:.8rem; font-weight:600; }
.slot.sel-target{ border-color:var(--gold); background:#FFF8E1; }
.slot.over{ border-color:var(--navy); background:#EAF0FB; }
.lvls{ display:flex; flex-wrap:wrap; gap:6px; }
.lvls .btn{ font-size:.86rem; padding:0 10px; }
.lvls .btn.active{ background:var(--navy); color:#fff; }
.tray{ position:sticky; top:10px; }
.tray-tools{ display:flex; gap:6px; margin-bottom:6px; }
.tray-tools .btn{ flex:1; height:36px; padding:0 8px; }
.tray-tools .btn:disabled{ opacity:.4; cursor:default; background:#fff; }
.tray .status{ display:block; min-width:0; font-size:.85rem; margin:0 2px 8px; }
.tray .status:empty{ display:none; }
.tray h2{ margin:0 0 6px; font-size:.8rem; letter-spacing:.6px; text-transform:uppercase; color:var(--navy); }
.cards{ display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:6px; max-height:calc(100vh - 150px); overflow:auto; padding:2px; }
.card{ background:#fff; border:2px solid #c9d4e6; border-radius:10px; padding:4px 10px; min-height:44px; display:flex; align-items:center; justify-content:center;
  cursor:grab; user-select:none; touch-action:none; font-size:1.05rem; white-space:nowrap; overflow:hidden; color:var(--navy); box-shadow:0 2px 5px rgba(0,32,96,.08); }
.card > .katex{ flex:none; }
.card.arrow{ padding:2px; min-height:0; }
.card.arrow svg{ display:block; width:100%; height:auto; pointer-events:none; }
.cards .card.arrow{ max-width:150px; justify-self:center; width:100%; }
.slot .card.arrow{ max-width:150px; margin:0 auto; border-color:#aebbd2; box-shadow:none; }
.card.sel{ border-color:var(--gold); box-shadow:0 0 0 3px rgba(224,160,0,.35); }
.card.dragging{ opacity:.35; }
.slot .card{ width:100%; min-height:40px; box-shadow:none; border-color:#aebbd2; }
.slot .card.right{ border-color:var(--green); background:#E6F5EB; }
.slot .card.wrong{ border-color:var(--red); background:#FBE6E9; }
.ghost{ position:fixed; z-index:50; pointer-events:none; opacity:.9; transform:translate(-50%, -50%); }
@media (max-width:900px){ .play{ grid-template-columns:1fr; } .tray{ position:static; } .cards{ max-height:none; grid-template-columns:repeat(auto-fill, minmax(120px, 1fr)); } header{ padding:10px 16px; } }
