/* «Лига: Торг» — the table with a townsman (ui/torg-ui). Paper and ink; gold for the League, green for a nod, blood for a frown. */
.tgx{ position:fixed; inset:0; z-index:300; background:rgba(28,26,24,.38); display:flex; justify-content:center; align-items:flex-start; overflow:auto; padding:18px 16px 40px; animation:tgxIn .22s var(--ease-out) both; }
@keyframes tgxIn{ from{ opacity:0; } }
.tgx__in{ position:relative; width:min(1080px,100%); background:#fcfbf9; border-radius:16px; box-shadow:var(--shadow); padding:18px 18px 22px; color:var(--ink); }
.tgx .kicker{ font-size:11px; font-weight:600; letter-spacing:.14em; text-transform:uppercase; color:var(--muted); margin:0 0 4px; display:flex; align-items:center; gap:6px; }
.tgx .sub{ font-size:12.5px; color:var(--ink-soft); margin:4px 0; }
.tgx__top{ display:flex; flex-wrap:wrap; align-items:flex-end; gap:12px; justify-content:space-between; position:relative; padding-right:44px; }
.tgx__top h1{ margin:0; font-size:22px; font-weight:500; }
.tgx__chips{ display:flex; flex-wrap:wrap; gap:8px; }
.tgx__x{ position:absolute; right:0; top:0; width:34px; height:34px; border-radius:50%; border:1px solid var(--hair-2); background:#fff; font-size:20px; line-height:1; cursor:pointer; color:var(--ink-soft); }
.tgx__grid{ display:grid; grid-template-columns:230px minmax(0,1fr); gap:14px; margin-top:14px; align-items:start; }
@media (max-width:760px){ .tgx__grid{ grid-template-columns:minmax(0,1fr); } }
/* the man */
.tgx__him{ background:#fff; border:1px solid var(--hair); border-radius:12px; padding:14px; display:flex; flex-direction:column; align-items:center; text-align:center; gap:4px; }
.tgx__por .ic{ width:72px; height:72px; color:var(--ink); }
.tgx__nm{ font-size:17px; font-weight:600; }
.tgx__him > small{ color:var(--muted); font-size:12px; }
.tgx__trs{ display:flex; flex-wrap:wrap; gap:4px; justify-content:center; margin:4px 0; }
.tgx__tr{ font-size:11.5px; padding:2px 8px; border-radius:999px; border:1px solid var(--hair-2); background:var(--bg-soft); }
.tgx__tr.unk{ color:var(--muted); font-style:italic; }
.tgx__pat{ display:flex; align-items:center; gap:8px; font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); margin-top:4px; }
.tgx__pips{ display:flex; gap:4px; }
.tgx__pips i{ width:11px; height:11px; border-radius:50%; border:1.5px solid var(--ink); display:block; }
.tgx__pips i.on{ background:var(--ink); }
.tgx__pips i.on.low{ background:var(--danger); border-color:var(--danger); }
.tgx__say{ margin:8px 0 0; font-size:13.5px; line-height:1.45; font-style:italic; color:var(--ink); background:var(--bg-soft); border-radius:10px; padding:9px 11px; position:relative; }
.tgx__say:empty{ display:none; }
.tgx__near{ font-size:11.5px; margin-top:6px; padding:2px 8px; border-radius:999px; border:1px dashed var(--hair-2); color:var(--muted); }
.tgx__near.on{ border-style:solid; border-color:#6f9f5a; color:#3f6b2e; }
/* the table: three terms, five notches */
.tgx__tbl{ background:#fff; border:1px solid var(--hair); border-radius:12px; padding:10px 14px 14px; min-width:0; }
.tgx__row{ display:grid; grid-template-columns:150px minmax(0,1fr) 84px; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--hair); }
@media (max-width:760px){ .tgx__row{ grid-template-columns:minmax(0,1fr) 70px; } .tgx__notches{ grid-column:1 / -1; order:3; } }
.tgx__term{ display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.tgx__term .ic{ width:22px; height:22px; }
.tgx__mk{ font-size:10.5px; padding:1px 7px; border-radius:999px; }
.tgx__mk.top{ background:var(--ink); color:#fff; }
.tgx__mk.low{ border:1px solid var(--hair-2); color:var(--muted); }
.tgx__notches{ display:flex; align-items:stretch; gap:4px; min-width:0; }
.tgx__side{ font-size:10px; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); align-self:center; flex:none; width:30px; text-align:center; }
.tgx__n{ flex:1; min-width:0; border:1px solid var(--hair-2); background:#fff; border-radius:9px; padding:6px 2px; cursor:pointer; font-size:15px; font-weight:600; font-variant-numeric:tabular-nums; display:flex; flex-direction:column; align-items:center; line-height:1.1; transition:all .15s var(--ease); }
.tgx__n small{ font-size:10px; font-weight:400; color:var(--muted); white-space:nowrap; }
.tgx__n:hover:not(:disabled){ border-color:var(--ink); }
.tgx__n.on{ background:var(--ink); color:#fff; border-color:var(--ink); }
.tgx__n.on small{ color:#ddd; }
.tgx__n:disabled{ opacity:.35; cursor:default; }
.tgx__g{ text-align:right; }
.tgx__gest{ display:inline-block; font-size:12px; padding:3px 9px; border-radius:999px; animation:tgxPop .3s var(--ease-pop) both; }
@keyframes tgxPop{ from{ transform:scale(.6); opacity:0; } }
.tgx__gest.tg-yes{ background:#e3eed8; color:#3f6b2e; }
.tgx__gest.tg-meh{ background:var(--bg-soft); color:var(--ink-soft); }
.tgx__gest.tg-no{ background:#f4d9d5; color:#8a2b20; font-weight:600; }
.tgx__gest.old{ color:var(--faint); animation:none; }
.tgx__lot{ display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; justify-content:space-between; margin-top:12px; font-size:14px; }
.tgx__ctr{ display:flex; align-items:center; gap:10px; margin-top:12px; padding:10px 12px; border:1px solid var(--ink); border-radius:12px; background:var(--bg-soft); animation:tgxPop .3s var(--ease-pop) both; }
.tgx__ctr span{ flex:1; font-size:14px; }
.tgx__ctr .opt{ padding:8px 14px; }
.tgx__go{ margin-top:12px; display:flex; justify-content:flex-end; }
.tgx__go .opt{ min-width:200px; text-align:center; }
.tgx__go .opt:disabled{ opacity:.5; cursor:default; }
.tgx__end{ margin-top:12px; padding:12px; border-radius:12px; border:1px solid var(--hair-2); display:flex; flex-wrap:wrap; align-items:center; gap:12px; justify-content:space-between; }
.tgx__end.deal{ border-color:#6f9f5a; background:#f2f7ec; }
.tgx__end.walk{ border-color:#d9a29c; background:#fbf0ee; }
.tgx__end b{ font-size:16px; }
.tgx__out{ flex:1 1 100%; }
/* the moves */
.tgx__mvs{ display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; margin-top:14px; }
@media (max-width:760px){ .tgx__mvs{ grid-template-columns:repeat(2,minmax(0,1fr)); } }
.tgx__mv{ display:flex; flex-direction:column; align-items:center; gap:5px; padding:10px 8px; border:1px solid var(--hair-2); border-radius:12px; background:#fff; cursor:pointer; text-align:center; transition:all .15s var(--ease); }
.tgx__mv:hover:not(:disabled){ border-color:var(--ink); transform:translateY(-1px); }
.tgx__mv:disabled{ opacity:.4; cursor:default; }
.tgx__mv .ic{ width:26px; height:26px; }
.tgx__mv b{ font-size:13px; font-weight:600; }
.tgx__mv small{ font-size:11px; color:var(--muted); }
.tgx__mv .tgx__bar{ width:100%; height:6px; }
.tgx__chk{ min-height:0; }
.tgx__ck{ display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:12px; margin-top:12px; padding:10px 12px; border:1px solid var(--hair); border-radius:12px; background:#fff; }
.tgx__ct{ font-size:12.5px; font-weight:600; }
.tgx__cc{ font-size:13px; font-weight:600; padding:2px 10px; border-radius:999px; }
.tgx__cc.fail{ background:#f4d9d5; color:#8a2b20; } .tgx__cc.part{ background:#f6ead0; color:#7a5a12; } .tgx__cc.ok{ background:#e3eed8; color:#3f6b2e; } .tgx__cc.great{ background:#6f9f5a; color:#fff; }
.tgx__log{ list-style:none; margin:12px 0 0; padding:0; display:flex; flex-direction:column; gap:3px; }
.tgx__log li{ font-size:12.5px; color:var(--ink-soft); line-height:1.4; }
.tgx__log li:first-child{ color:var(--ink); }
/* the sweetener picker */
.tgx__sweet{ position:absolute; left:50%; top:120px; transform:translateX(-50%); width:min(440px,92%); background:#fff; border:1px solid var(--ink); border-radius:14px; box-shadow:var(--shadow); padding:14px; z-index:2; }
.tgx__sw{ display:flex; flex-direction:column; gap:6px; max-height:320px; overflow:auto; }
.tgx__si{ display:flex; align-items:center; gap:10px; padding:8px 10px; border:1px solid var(--hair-2); border-radius:10px; background:#fff; cursor:pointer; text-align:left; }
.tgx__si:hover{ border-color:var(--ink); }
.tgx__si span{ display:flex; flex-direction:column; font-size:13.5px; }
.tgx__si small{ font-size:11px; color:var(--muted); }
.tgx__si .iti, .tgx__si > .ic{ flex:none; width:34px; height:34px; }
.tgx__x2{ margin-top:10px; border:none; background:none; color:var(--muted); cursor:pointer; text-decoration:underline; }
/* what an act may cost: the pips it would take, the line under the offer, the risk under a move */
.tgx__pips i.lose{ background:var(--danger); border-color:var(--danger); animation:tgxBlink .7s ease-in-out infinite alternate; }
@keyframes tgxBlink{ to{ opacity:.35; } }
.tgx__go{ align-items:center; gap:12px; }
.tgx__cost{ font-size:12.5px; color:var(--ink-soft); }
.tgx__cost.last{ color:#8a2b20; font-weight:600; }
.tgx__risk{ font-style:normal; font-size:10.5px; color:var(--muted); line-height:1.2; }
.tgx__risk.end{ color:#8a2b20; }
/* v2: a reversed term, his request, the thing on the table, the scale of agreement */
.tgx__mk.rev{ background:#f6ead0; color:#7a5a12; }
.tgx__rq{ flex-basis:100%; font-size:11.5px; color:var(--ink-soft); line-height:1.3; }
.tgx__notches.n2 .tgx__n, .tgx__notches.n3 .tgx__n, .tgx__notches.n4 .tgx__n{ max-width:none; }
.tgx__it{ display:flex; align-items:center; gap:10px; padding:8px 0 10px; border-bottom:1px solid var(--hair); }
.tgx__it > span{ display:flex; flex-direction:column; min-width:0; }
.tgx__it small{ font-size:12px; color:var(--ink-soft); }
.tgx__it .iti{ flex:none; width:40px; height:40px; }
.tgx__sc{ display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:10px; margin-top:12px; }
.tgx__scl, .tgx__scr{ font-size:10.5px; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); white-space:nowrap; }
.tgx__scr{ color:#3f6b2e; }
.tgx__rail{ position:relative; height:14px; border-radius:7px; background:linear-gradient(90deg,#f4d9d5,#efe9df 55%); }
.tgx__rail > i{ position:absolute; top:0; bottom:0; }
.tgx__yes{ background:#a9c48f; border-radius:0 7px 7px 0; }
.tgx__blur{ background:repeating-linear-gradient(135deg,#cfe0bf 0 5px,#e6eedd 5px 10px); }
.tgx__dot{ position:absolute; top:50%; width:9px; height:9px; margin:-4.5px 0 0 -4.5px; border-radius:50%; background:var(--ink); opacity:.45; }
.tgx__dot.last{ opacity:1; box-shadow:0 0 0 2px #fff; }
.tgx__ring{ position:absolute; top:50%; width:18px; height:18px; margin:-9px 0 0 -9px; border-radius:50%; border:2.5px solid var(--ink); background:rgba(255,255,255,.6); transition:left .25s var(--ease); }
.tgx__ring.pv{ border-style:dashed; }
/* patience as a gauge: calm ink, amber when it frays, blood at the edge; the cells an act may cost blink */
.tgx__pat{ display:flex; flex-direction:column; gap:5px; width:100%; margin-top:8px; text-transform:none; letter-spacing:0; }
.tgx__pth{ display:flex; justify-content:space-between; align-items:baseline; font-size:11px; }
.tgx__pth span{ letter-spacing:.1em; text-transform:uppercase; color:var(--muted); }
.tgx__pth b{ font-size:12.5px; font-weight:600; }
.tgx__pbar{ display:flex; gap:3px; height:12px; }
.tgx__pbar i{ flex:1; border-radius:3px; background:var(--hair); transition:background .3s; }
.tgx__pat.calm .tgx__pbar i.on{ background:#6f9f5a; } .tgx__pat.calm .tgx__pth b{ color:#3f6b2e; }
.tgx__pat.tense .tgx__pbar i.on{ background:#d4a23c; } .tgx__pat.tense .tgx__pth b{ color:#8a6412; }
.tgx__pat.edge .tgx__pbar i.on{ background:#b8432f; } .tgx__pat.edge .tgx__pth b{ color:#8a2b20; }
.tgx__pbar i.off{ background:repeating-linear-gradient(135deg,var(--hair) 0 3px,transparent 3px 6px); }
.tgx__pbar i.lose{ background:var(--danger) !important; animation:tgxBlink .7s ease-in-out infinite alternate; }
.tgx__him .tgx__pat{ align-self:stretch; }
.tgx__pth{ gap:8px; }
.tgx__him .tgx__pat{ align-items:stretch; }
/* what bears on the table: small signs under the man; his known desire and fear beside his nature */
.tgx__ctx{ display:flex; flex-wrap:wrap; gap:4px; justify-content:center; margin-top:10px; padding-top:8px; border-top:1px solid var(--hair); width:100%; }
.tgx__ctxh{ flex-basis:100%; font-size:10px; letter-spacing:.1em; text-transform:uppercase; color:var(--muted); }
.tgx__cf{ display:inline-flex; align-items:center; gap:4px; font-size:11px; padding:2px 8px 2px 5px; border-radius:999px; border:1px solid var(--hair-2); background:#fff; }
.tgx__cf .ic{ width:14px; height:14px; }
.tgx__cf.good{ border-color:#a9c48f; color:#3f6b2e; } .tgx__cf.bad{ border-color:#d9a29c; color:#8a2b20; }
.tgx__tr.want{ border-color:#e6c98a; } .tgx__tr.fear{ border-color:#d9a29c; }
