/* Sport Scoring Solutions – tournaments (v1) */
.tm-sec{margin:0 0 28px;padding:0!important}
.tm-sec h3{font-size:1.15rem;margin:0 0 10px}
.tm-small{font-size:.85rem;color:var(--muted);margin:6px 0 0}
.tm-tbl-wrap{overflow-x:auto;border:1px solid var(--line);border-radius:var(--radius);background:#fff}
.tm-tbl{width:100%;border-collapse:collapse;font-size:.92rem;font-variant-numeric:tabular-nums}
.tm-tbl th,.tm-tbl td{padding:8px 8px;border-bottom:1px solid var(--line);text-align:center;white-space:nowrap}
.tm-tbl th{background:var(--soft);font-weight:700;color:var(--muted);font-size:.8rem;text-transform:uppercase;letter-spacing:.03em}
.tm-tbl td.l,.tm-tbl th.l{text-align:left;white-space:normal;min-width:120px}
.tm-tbl tr:last-child td{border-bottom:0}
.tm-tbl tr.q td:first-child{box-shadow:inset 4px 0 0 #2a9d38}
.tm-tbl tr.medal td{font-weight:700}
.tm-tbl tr.m1 td:first-child{color:#b8860b}.tm-tbl tr.m2 td:first-child{color:#7d8790}.tm-tbl tr.m3 td:first-child{color:#a0522d}

.tm-fix{margin-top:10px}
.tm-fix summary{cursor:pointer;font-weight:700;color:var(--red-dark);padding:6px 0}
.tm-round{margin:10px 0 16px}
.tm-round h4,.tm-col h4{font-size:.8rem;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);margin:0 0 8px;font-family:inherit}
.tm-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:10px}

/* match card */
.tm-m{background:#fff;border:1px solid var(--line);border-radius:8px;overflow:hidden;font-size:.92rem;min-width:0}
.tm-m[role=button]{cursor:pointer}
.tm-m[role=button]:hover,.tm-m[role=button]:focus-visible{border-color:var(--red);outline:none}
.tm-lbl{font-size:.75rem;color:var(--muted);padding:4px 10px;background:var(--soft);border-bottom:1px solid var(--line);display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.tm-row{display:flex;justify-content:space-between;gap:8px;padding:6px 10px}
.tm-row+.tm-row{border-top:1px solid var(--line)}
.tm-row .n{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.tm-row .s{font-weight:700;font-variant-numeric:tabular-nums}
.tm-row.win{font-weight:700;background:#f0faf2}
.tm-row.tbd .n,.tm-row.bye .n{color:var(--muted);font-style:italic}
.tm-m.bye{opacity:.6}
.tm-m.ready{border-left:4px solid var(--red)}
.tm-m.live{border-left:4px solid #2a9d38}
.tm-m.review{box-shadow:0 0 0 2px #e0a800}
.tm-live{background:#2a9d38;color:#fff;border-radius:999px;padding:1px 8px;font-weight:700}
.tm-code{background:var(--ink);color:#fff;border-radius:4px;padding:1px 6px;font-family:ui-monospace,Consolas,monospace;letter-spacing:.08em}
.tm-note{padding:10px;color:var(--muted);font-style:italic}

/* brackets */
.tm-bracket{display:flex;gap:16px;overflow-x:auto;padding:4px 2px 12px;align-items:stretch}
.tm-col{flex:0 0 220px;display:flex;flex-direction:column}
.tm-col-body{display:flex;flex-direction:column;justify-content:space-around;gap:10px;flex:1}
.tm-block{display:flex;flex-direction:column;gap:8px;padding:8px;border:1px dashed var(--line);border-radius:8px}
.tm-block-h{font-size:.78rem;font-weight:700;color:var(--red-dark)}

/* manager + create */
.tm-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;flex-wrap:wrap;margin-bottom:12px}
.tm-head h1{margin:0}
.tm-meta{color:var(--muted);font-size:.95rem}
.tm-tabs{display:flex;gap:6px;flex-wrap:wrap;border-bottom:2px solid var(--line);margin:16px 0 18px}
.tm-tabs button{appearance:none;border:0;background:none;padding:10px 14px;font:inherit;font-weight:700;color:var(--muted);cursor:pointer;border-bottom:3px solid transparent;margin-bottom:-2px}
.tm-tabs button.on{color:var(--red-dark);border-bottom-color:var(--red)}
.tm-panel[hidden]{display:none}
.tm-form label{display:block;font-weight:600;margin:0 0 12px;font-size:.95rem}
.tm-form input[type=text],.tm-form input[type=number],.tm-form input[type=password],.tm-form input[type=tel],.tm-form select,.tm-form textarea{display:block;width:100%;margin-top:5px;padding:10px 12px;border:1px solid #c9ced6;border-radius:8px;font:inherit;font-weight:400;background:#fff}
.tm-form textarea{min-height:180px;font-family:inherit}
.tm-form .row{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}
.tm-form .hint{font-size:.85rem;color:var(--muted);font-weight:400;margin-top:4px}
.tm-form .check{display:flex;gap:10px;align-items:flex-start;font-weight:400}
.tm-form .check input{margin-top:5px}
.tm-form fieldset{border:1px solid var(--line);border-radius:var(--radius);padding:14px 16px 4px;margin:0 0 16px}
.tm-form legend{font-weight:700;padding:0 6px}
.tm-fmt{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:10px;margin-bottom:12px}
.tm-fmt label{border:2px solid var(--line);border-radius:10px;padding:12px;cursor:pointer;margin:0;font-weight:400}
.tm-fmt label:has(input:checked){border-color:var(--red);background:#fff5f6}
.tm-fmt strong{display:block}
.tm-fmt input{margin-right:6px}
.tm-alert{background:#fff8e1;border:1px solid #f0d58a;border-radius:8px;padding:10px 14px;margin:10px 0}
.tm-err{background:#fdecee;border:1px solid #f3b8be;color:#8a1520;border-radius:8px;padding:10px 14px;margin:10px 0}
.tm-ok{background:#ecf9ef;border:1px solid #b7e4c2;border-radius:8px;padding:10px 14px;margin:10px 0}
.tm-btns{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:10px 0}
.btn.sec{background:#fff;color:var(--red-dark);border:2px solid var(--red)}
.btn.sec:hover{background:#fff5f6}
.btn.grey{background:#e9ecef;color:var(--ink)}
.tm-mlist .tm-mrow{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:center;padding:8px 0;border-bottom:1px solid var(--line)}
.tm-filter{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:10px}
.tm-filter button{border:1px solid var(--line);background:#fff;border-radius:999px;padding:6px 12px;font:inherit;font-size:.9rem;cursor:pointer}
.tm-filter button.on{background:var(--ink);color:#fff;border-color:var(--ink)}
.tm-link{display:flex;gap:6px;align-items:center;flex-wrap:wrap;margin:6px 0}
.tm-link input{flex:1;min-width:200px;padding:8px 10px;border:1px solid #c9ced6;border-radius:6px;font:inherit;font-size:.9rem}
.tm-entries{counter-reset:e}
.tm-entry{display:grid;grid-template-columns:28px 1fr auto;gap:8px;align-items:center;margin-bottom:6px}
.tm-entry input{padding:8px 10px;border:1px solid #c9ced6;border-radius:6px;font:inherit}
.tm-entry .no{color:var(--muted);text-align:right;font-variant-numeric:tabular-nums}
.tm-entry button{border:1px solid var(--line);background:#fff;border-radius:6px;padding:6px 8px;cursor:pointer}

/* dialog */
.tm-dlg{position:fixed;inset:0;background:rgba(0,0,0,.6);display:flex;align-items:center;justify-content:center;padding:16px;z-index:1000}
.tm-dlg-box{background:#fff;border-radius:12px;max-width:460px;width:100%;max-height:92vh;overflow:auto;padding:20px;box-shadow:0 10px 40px rgba(0,0,0,.4)}
.tm-dlg-box h2{font-size:1.25rem;margin:0 0 10px}
.tm-score{display:grid;grid-template-columns:1fr 90px;gap:8px;align-items:center;margin:6px 0}
.tm-score input{padding:10px;border:1px solid #c9ced6;border-radius:8px;font:inherit;font-size:1.2rem;text-align:center;width:100%}
.tm-score .nm{font-weight:700;overflow-wrap:anywhere}
.tm-bigcode{font-family:ui-monospace,Consolas,monospace;font-size:2.4rem;font-weight:800;letter-spacing:.12em;text-align:center;background:var(--soft);border-radius:10px;padding:12px;margin:10px 0}
.tm-toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);background:#111;color:#fff;padding:10px 18px;border-radius:999px;z-index:1001;font-size:.95rem}
@media (max-width:600px){.tm-col{flex-basis:190px}.tm-list{grid-template-columns:1fr}}
@media print{.site-header,.site-footer,.tm-tabs,.tm-btns,.tm-noprint{display:none!important}.tm-bracket{overflow:visible;flex-wrap:wrap}.tm-panel[hidden]{display:block!important}}
.tm-x{border:1px solid var(--line);background:#fff;border-radius:6px;padding:4px 8px;cursor:pointer;font:inherit}
.tm-checkin{background:var(--soft);border:1px solid var(--line);border-radius:var(--radius);padding:14px 16px;margin:0 0 18px}
.tm-checkin .grid3{display:grid;grid-template-columns:2fr 1fr auto;gap:8px;align-items:end}
.tm-checkin input{width:100%;padding:11px 12px;border:1px solid #c9ced6;border-radius:8px;font:inherit;background:#fff}
.tm-checkin label{font-weight:600;font-size:.9rem;display:block}
.tm-start{display:flex;gap:12px;align-items:center;flex-wrap:wrap;background:#fff5f6;border:1px solid #f3b8be;border-radius:var(--radius);padding:12px 16px;margin:0 0 18px}
@media (max-width:600px){.tm-checkin .grid3{grid-template-columns:1fr 1fr}.tm-checkin .grid3 .btn{grid-column:1/-1}}
.tm-entry.rated{grid-template-columns:28px 1fr 90px auto}
.tm-row.prov .n{font-style:italic;color:#5b6470}
.tm-pv{font-size:.72rem;font-style:normal;background:#fff3cd;color:#7a5a00;border-radius:4px;padding:0 4px;margin-left:2px}
.tm-dg-wrap{overflow-x:auto;padding:0 0 10px}
.tm-dg{position:relative}
.tm-dg-h{position:absolute;top:0;font-size:.75rem;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tm-dg-lines{position:absolute;left:0;top:0;pointer-events:none}
.tm-dg-lines path{fill:none;stroke:#c3c9d1;stroke-width:2}
.tm-dg-lines path.on{stroke:#2a9d38}
.tm-dg-box{position:absolute}
.tm-dg-box .tm-m{height:100%;font-size:.85rem}
.tm-dg-box .tm-lbl{padding:3px 8px;white-space:nowrap;overflow:hidden;flex-wrap:nowrap}
.tm-dg-box .tm-row{padding:5px 8px}
