/* tours.css (v0.18) — the Tournaments pages: the list, one tournament (standings / bracket / players / info), the form that makes one, the hub strip and the "your match is ready" popup.
   Same language as the rest of Rally: ink outlines, hard offset shadows, slanted display type, one colour per game (data-g). Texts are always set with textContent in js/tours.js. */

/* ---------- screens ---------- */
#tours, #tour, #tourNew { overflow-y: auto; overflow-x: hidden; touch-action: pan-y; -webkit-overflow-scrolling: touch; padding-left: 0; padding-right: 0; align-items: stretch; justify-content: flex-start; }
#tours .boardhead, #tour .boardhead, #tourNew .boardhead { display: flex; align-items: center; gap: 12px; padding: calc(var(--safeT) + 14px) 16px 0; max-width: 430px; width: 100%; margin: 0 auto; flex: none; }
#tours .boardhead .iconbtn, #tour .boardhead .iconbtn, #tourNew .boardhead .iconbtn { position: static; }
#tours .boardhead h2, #tour .boardhead h2, #tourNew .boardhead h2 { flex: 1; min-width: 0; text-align: left; font-size: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#tours .boardhead h2::after, #tour .boardhead h2::after, #tourNew .boardhead h2::after { content: ''; display: block; height: 5px; width: 64px; background: var(--hot); margin-top: 6px; border-radius: 2px; }
.tbody { width: calc(100% - 32px); max-width: 398px; margin: 14px auto 0; display: flex; flex-direction: column; gap: 14px; flex: none; padding-bottom: calc(var(--safeB) + 28px); }
#tours .tbody { padding-bottom: 8px; }
#tourNew .tbody { padding-bottom: calc(var(--safeB) + 118px); }
#tour .tbody.dock { padding-bottom: calc(var(--safeB) + 124px); }
.tnew { flex: none; display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; border: 3px solid var(--ink); border-radius: 12px; background: var(--volt); box-shadow: 3px 4px 0 var(--ink); font: 400 14px/1 var(--disp); text-transform: uppercase; transform: var(--sk); }
.tnew svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 3.4; stroke-linecap: round; transform: skewX(8deg); }
.tnew span { display: none; }
.tnew:active { transform: var(--sk) translate(2px, 3px); box-shadow: 1px 1px 0 var(--ink); }

/* ---------- the hub strip ---------- */
.tstrip { flex: none; display: flex; align-items: center; gap: 10px; width: calc(100% - 32px); max-width: 398px; margin: 12px auto 0; padding: 8px 12px 8px 8px; background: var(--ink); color: #fff; border: 3px solid var(--ink); border-radius: 16px; box-shadow: 0 4px 0 var(--volt); text-align: left; position: relative; overflow: hidden; }
.tstrip:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--volt); }
.tstrip::before { content: ''; position: absolute; right: -10px; top: 0; bottom: 0; width: 120px; opacity: .5; background-image: radial-gradient(circle at center, var(--cobalt) 1.6px, transparent 2.2px); background-size: 8px 8px; -webkit-mask-image: linear-gradient(to left, #000, transparent); mask-image: linear-gradient(to left, #000, transparent); pointer-events: none; }
.ts-ic { flex: none; width: 46px; height: 46px; border-radius: 12px; background: var(--volt); border: 3px solid #fff; display: grid; place-items: center; transform: var(--sk); position: relative; }
.ts-ic svg { width: 26px; height: 26px; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transform: skewX(8deg); }
.ts-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; position: relative; }
.ts-mid b { font: 800 14px/1.15 var(--ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-mid small { font: 700 11.5px/1.2 var(--ui); color: rgba(255,255,255,.72); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tstrip em { flex: none; position: relative; font: 400 11px/1 var(--disp); font-style: normal; text-transform: uppercase; padding: 6px 9px; border-radius: 6px; border: 2.5px solid #fff; background: var(--hot); color: #fff; transform: var(--sk); white-space: nowrap; }
.tstrip em:empty { display: none; }
.tstrip em.join { background: var(--volt); color: var(--ink); border-color: var(--ink); }
.tstrip em.in { background: var(--green); color: var(--ink); border-color: var(--ink); }
.tstrip .ts-go { flex: none; width: 15px; height: 15px; fill: none; stroke: rgba(255,255,255,.65); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; position: relative; }
.tstrip.live .ts-ic { animation: tsPulse 1.6s ease-in-out infinite; }
@keyframes tsPulse { 50% { box-shadow: 0 0 0 5px rgba(255,212,0,.45); } }

/* ---------- chips, status, small bits ---------- */
.tchips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; touch-action: pan-x; padding: 2px 2px 8px; margin: 0 -2px; flex: none; }
.tchips::-webkit-scrollbar { display: none; }
.tchip { flex: none; min-height: 38px; padding: 0 13px; border: 3px solid var(--ink); border-radius: 10px; background: #fff; font: 900 11.5px/1 var(--ui); letter-spacing: .06em; text-transform: uppercase; transform: var(--sk); white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.tchip i { width: 10px; height: 10px; border-radius: 50%; background: var(--g, var(--ink)); border: 2px solid var(--ink); flex: none; }
.tchip.on { background: var(--volt); box-shadow: 3px 4px 0 var(--hot); }
.tstat { display: inline-block; font: 400 10.5px/1 var(--disp); text-transform: uppercase; padding: 5px 8px; border: 2.5px solid var(--ink); border-radius: 6px; transform: var(--sk); white-space: nowrap; background: #fff; color: var(--ink); flex: none; }
.tstat.live { background: var(--hot); color: #fff; animation: tLive 1.4s ease-in-out infinite; }
.tstat.soon { background: var(--volt); }
.tstat.done { background: var(--mist); }
.tstat.off { background: #D9DBE3; color: var(--mute); }
.tstat.po { background: var(--violet); color: #fff; }
@keyframes tLive { 50% { box-shadow: 0 0 0 4px rgba(255,75,43,.35); } }
.ttag { display: inline-flex; align-items: center; gap: 4px; font: 800 10.5px/1 var(--ui); letter-spacing: .04em; text-transform: uppercase; padding: 4px 7px; border-radius: 6px; background: var(--paper); border: 2px solid var(--ink); color: var(--ink); white-space: nowrap; }
.ttag.g { background: var(--g); color: var(--gt); }
.ttag.prize { background: #FFF6BF; }
.ttag.mine { background: var(--green); color: var(--ink); }
.ttag svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.tmeta { display: flex; flex-wrap: wrap; gap: 6px; }
.tempty { padding: 26px 18px; text-align: center; background: #fff; border: 3px dashed var(--ink); border-radius: 16px; font: 700 14px/1.4 var(--ui); color: var(--mute); }
.tempty b { display: block; margin-bottom: 6px; font: 400 18px/1.1 var(--disp); color: var(--ink); text-transform: uppercase; }
.tsec { margin: 4px 0 -4px; font: 400 15px/1 var(--disp); text-transform: uppercase; transform: var(--sk); transform-origin: left center; }
.tskel { height: 118px; border: 3px solid var(--ink); border-radius: 16px; background: linear-gradient(100deg, #fff 30%, var(--paper) 50%, #fff 70%) 0 0 / 220% 100%; animation: tSkel 1.1s linear infinite; opacity: .6; }
@keyframes tSkel { to { background-position: -120% 0; } }
.tfail { width: 100%; padding: 14px; border: 3px solid var(--ink); border-radius: 14px; background: #fff; font: 800 14px/1.3 var(--ui); text-align: center; }

/* ---------- the "make your own" card at the top of the list ---------- */
.tcta { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 3px dashed var(--ink); border-radius: 16px; background: #FFF6BF; text-align: left; color: var(--ink); }
.tcta:active { transform: translateY(2px); }
.tcta .ci { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--volt); border: 3px solid var(--ink); display: grid; place-items: center; box-shadow: 3px 4px 0 var(--ink); transform: var(--sk); }
.tcta .ci svg { width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 3.2; stroke-linecap: round; transform: skewX(8deg); }
.tcta .ct { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; } .tcta b { font: 900 15px/1.15 var(--ui); } .tcta small { font: 700 12px/1.3 var(--ui); color: var(--mute); }
.tcta.off { background: #fff; border-color: var(--mute); } .tcta.off .ci { background: var(--mist); box-shadow: none; }

/* ---------- a tournament card in the list ---------- */
.tcard { position: relative; display: flex; gap: 12px; width: 100%; padding: 12px 12px 12px 10px; background: #fff; border: 3px solid var(--ink); border-radius: 16px; box-shadow: 0 5px 0 var(--ink); text-align: left; overflow: hidden; color: var(--ink); transition: transform .08s, box-shadow .08s; }
.tcard:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.tcard .tc-tile { flex: none; width: 62px; align-self: stretch; min-height: 76px; border-radius: 11px; border: 3px solid var(--ink); background: var(--g); color: var(--gt); display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.tcard .tc-tile::before { content: ''; position: absolute; inset: 0; opacity: .35; background: repeating-conic-gradient(from 0deg at 50% 120%, rgba(255,255,255,.55) 0 6deg, transparent 6deg 16deg); }
.tcard .tc-tile span { position: relative; font: 400 17px/1.05 var(--disp); writing-mode: vertical-rl; letter-spacing: .04em; transform: rotate(0deg); }
.tcard .tc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.tcard .tc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.tcard .tc-name { margin: 0; font: 900 16px/1.2 var(--ui); overflow-wrap: anywhere; min-width: 0; }
.tcard .tc-time { font: 700 12px/1.2 var(--ui); color: var(--mute); }
.tcard .tc-time b { color: var(--ink); font-weight: 900; }
.tcard .tc-bar { height: 8px; border-radius: 4px; background: var(--mist); border: 2px solid var(--ink); overflow: hidden; } .tcard .tc-bar i { display: block; height: 100%; background: var(--g); width: 0; }
.tcard.official { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: 0 5px 0 var(--volt); }
.tcard.official .tc-time { color: rgba(255,255,255,.72); } .tcard.official .tc-time b { color: var(--volt); }
.tcard.official .ttag { background: var(--navy); color: #fff; border-color: rgba(255,255,255,.4); } .tcard.official .ttag.g { background: var(--g); color: var(--gt); border-color: var(--ink); } .tcard.official .ttag.prize { background: var(--volt); color: var(--ink); border-color: var(--ink); } .tcard.official .ttag.mine { background: var(--green); color: var(--ink); }
.tcard.official::after { content: ''; position: absolute; right: -8px; bottom: 0; width: 110px; height: 70px; opacity: .45; background-image: radial-gradient(circle at center, var(--cobalt) 1.6px, transparent 2.2px); background-size: 8px 8px; -webkit-mask-image: linear-gradient(to left, #000, transparent); mask-image: linear-gradient(to left, #000, transparent); pointer-events: none; }
.tcard .tc-pin { position: absolute; left: 0; top: 0; z-index: 2; display: flex; align-items: center; gap: 4px; padding: 4px 9px 4px 7px; background: var(--volt); color: var(--ink); border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink); border-radius: 0 0 12px 0; font: 400 10px/1 var(--disp); text-transform: uppercase; }
.tcard .tc-pin svg { width: 12px; height: 12px; fill: var(--ink); }
.tcard.official .tc-tile { margin-top: 18px; }
.tcard.done, .tcard.off { background: #F2F0E8; box-shadow: 0 3px 0 var(--ink); } .tcard.off { opacity: .7; }
.tcard .tc-win { font: 800 12px/1.2 var(--ui); display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- one tournament: the hero ---------- */
.thero { position: relative; padding: 16px 14px 14px; border: 3px solid var(--ink); border-radius: 18px; background: var(--g); color: var(--gt); box-shadow: 0 5px 0 var(--ink); overflow: hidden; display: flex; flex-direction: column; gap: 10px; }
.thero::before { content: ''; position: absolute; left: 50%; top: 20%; width: 150%; aspect-ratio: 1; margin: -75% 0 0 -75%; opacity: .5; background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255,255,255,.2) 0 4deg, transparent 4deg 11deg); animation: spin 220s linear infinite; pointer-events: none; }
.thero > * { position: relative; }
.thero .th-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.thero h3 { margin: 0; font: 400 25px/1.1 var(--disp); text-transform: uppercase; transform: var(--sk); transform-origin: left center; text-shadow: 3px 3px 0 var(--ink); color: #fff; overflow-wrap: anywhere; }
.thero .th-sub { font: 800 12.5px/1.3 var(--ui); letter-spacing: .02em; color: inherit; opacity: .95; }
.thero .ttag { background: rgba(13,16,32,.85); color: #fff; border-color: var(--ink); } .thero .ttag.prize { background: var(--volt); color: var(--ink); }
.thero .tstat { color: var(--ink); }
.thero .tstat.live { color: #fff; }
.tclock { display: flex; align-items: baseline; justify-content: center; gap: 10px; padding: 10px 12px 9px; background: rgba(13,16,32,.88); border: 3px solid var(--ink); border-radius: 12px; color: #fff; }
.tclock b { font: 400 34px/1 var(--disp); letter-spacing: .02em; color: var(--volt); transform: var(--sk); display: inline-block; }
.tclock small { font: 800 10.5px/1.2 var(--ui); letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.75); }
.tclock.red b { color: #FF8F7A; animation: tLive 1s ease-in-out infinite; }
.tbarwrap { display: flex; flex-direction: column; gap: 6px; }
.tbarline { height: 12px; border-radius: 6px; background: rgba(13,16,32,.55); border: 2.5px solid var(--ink); overflow: hidden; } .tbarline i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(-45deg, var(--volt) 0 8px, var(--voltD) 8px 16px); transition: width .8s linear; }
.tcount { display: flex; gap: 8px; }
.tcount > div { flex: 1; min-width: 0; text-align: center; background: rgba(13,16,32,.82); border: 2.5px solid var(--ink); border-radius: 10px; padding: 7px 4px 6px; color: #fff; }
.tcount b { display: block; font: 400 17px/1.1 var(--disp); color: var(--volt); } .tcount small { display: block; margin-top: 3px; font: 800 8.5px/1.15 var(--ui); letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.75); }

/* ---------- the big action area (one clear thing to do) ---------- */
.tact { display: flex; flex-direction: column; gap: 10px; }
.tnote { margin: 0; padding: 10px 12px; background: #fff; border: 3px solid var(--ink); border-radius: 12px; font: 700 13px/1.4 var(--ui); color: var(--ink); text-wrap: pretty; }
.tnote.ok { background: #E8F8F0; } .tnote.warn { background: #FFF6BF; } .tnote.bad { background: #FFE3DA; } .tnote.dark { background: var(--ink); color: #fff; }
.tnote b { font-weight: 900; }
.tact .btn { min-height: 58px; font-size: 18px; }
.tact .btn.go { background: var(--green); color: var(--ink); animation: tGo 1.2s ease-in-out infinite; }
@keyframes tGo { 50% { box-shadow: 5px 6px 0 var(--ink), 0 0 0 6px rgba(22,185,122,.4); } }
.tact .btn.secondary { background: #fff; color: var(--ink); border-color: var(--ink); }
.tact .btn.danger { color: var(--hotD); border-color: var(--hotD); box-shadow: 4px 5px 0 var(--hotD); }
.tact .duo .btn { min-height: 50px; box-shadow: 3px 4px 0 var(--ink); }
.tdock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 12; display: none; padding: 10px 16px calc(var(--safeB) + 12px); background: var(--paper); border-top: 3px solid var(--ink); }
.tdock.on { display: block; }
.tdock > div { width: 100%; max-width: 398px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.tdock .tsum { text-align: center; font: 800 11.5px/1.25 var(--ui); color: var(--mute); letter-spacing: .02em; }
.tdock .btn { min-height: 58px; font-size: 18px; }

/* ---------- tabs ---------- */
.ttabs { display: flex; gap: 6px; flex: none; }
.ttabs button { flex: 1; min-width: 0; min-height: 42px; padding: 0 4px; border: 3px solid var(--ink); border-radius: 10px; background: #fff; color: var(--ink); font: 900 11px/1 var(--ui); letter-spacing: .05em; text-transform: uppercase; transform: var(--sk); }
.ttabs button.on { background: var(--volt); box-shadow: 3px 4px 0 var(--hot); }

/* ---------- standings ---------- */
.ttable { display: flex; flex-direction: column; background: #fff; border: 3px solid var(--ink); border-radius: 14px; overflow: hidden; box-shadow: 0 4px 0 var(--ink); }
.ttr { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-top: 2px solid rgba(13,16,32,.1); min-height: 46px; }
.ttr:first-child { border-top: 0; }
.ttr.head { min-height: 30px; padding: 5px 10px; background: var(--ink); color: #fff; font: 900 9.5px/1 var(--ui); letter-spacing: .1em; text-transform: uppercase; border-top: 0; }
.ttr.me { background: #FFF3A6; }
.ttr.out { opacity: .5; }
.ttr .rk { flex: none; width: 26px; text-align: center; font: 400 15px/1 var(--disp); }
.ttr .rk.m1 { color: #D49A00; } .ttr .rk.m2 { color: #7C8399; } .ttr .rk.m3 { color: #B4691F; }
.ttr .nm { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ttr .nm b { font: 800 14px/1.15 var(--ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ttr .nm small { font: 700 10.5px/1.1 var(--ui); color: var(--mute); display: flex; align-items: center; gap: 5px; }
.ttr .form { display: flex; gap: 2px; }
.ttr .form i { width: 8px; height: 8px; border-radius: 2px; background: var(--mist); } .ttr .form i.W { background: var(--green); } .ttr .form i.L { background: var(--hot); } .ttr .form i.D { background: #B8BDCF; }
.ttr .pt { flex: none; min-width: 34px; text-align: right; font: 400 18px/1 var(--disp); }
.ttr .wl { flex: none; width: 48px; text-align: right; font: 800 12px/1 var(--ui); color: var(--mute); }
.ttr .live { width: 9px; height: 9px; border-radius: 50%; background: var(--hot); flex: none; animation: tLive 1.2s infinite; }
.ttr .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); flex: none; }
.ttr .st { font: 900 9px/1 var(--ui); letter-spacing: .06em; padding: 3px 5px; border-radius: 4px; background: var(--ink); color: #fff; text-transform: uppercase; }
.ttr .st.fire { background: var(--hot); }
.ttr .kick { flex: none; width: 32px; height: 32px; border-radius: 50%; border: 2.5px solid var(--hotD); color: var(--hotD); background: #fff; font: 900 16px/1 var(--ui); }
.tmore { text-align: center; padding: 10px; font: 800 12px/1.2 var(--ui); color: var(--mute); }

/* ---------- the podium ---------- */
.tpod { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 8px; align-items: end; padding-top: 6px; }
.tpod > div { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; }
.tpod .pl { width: 100%; border: 3px solid var(--ink); border-radius: 12px 12px 0 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px; padding: 10px 4px 8px; background: #fff; box-shadow: 0 4px 0 var(--ink); }
.tpod .p1 .pl { background: var(--volt); min-height: 128px; } .tpod .p2 .pl { background: #E3E7F2; min-height: 100px; } .tpod .p3 .pl { background: #F1C79B; min-height: 84px; }
.tpod .medal { font-size: 28px; line-height: 1; } .tpod .p1 .medal { font-size: 36px; }
.tpod .pn { font: 900 13px/1.15 var(--ui); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 3px; }
.tpod .pp { font: 400 11px/1 var(--disp); text-transform: uppercase; color: var(--mute); }
.tpod .me .pl { outline: 3px solid var(--hot); outline-offset: 2px; }

/* ---------- bracket ---------- */
.tbr { display: flex; gap: 14px; overflow-x: auto; touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; padding: 4px 2px 12px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scroll-snap-type: x proximity; }
.tbr::-webkit-scrollbar { height: 6px; } .tbr::-webkit-scrollbar-thumb { background: var(--ink); border-radius: 3px; }
.tbr .col { flex: none; width: 200px; display: flex; flex-direction: column; justify-content: space-around; gap: 10px; scroll-snap-align: start; }
.tbr .col h4 { margin: 0 0 2px; font: 400 12px/1 var(--disp); text-transform: uppercase; text-align: center; transform: var(--sk); }
.tbr .col.now h4 { color: var(--hotD); }
.tm { position: relative; background: #fff; border: 3px solid var(--ink); border-radius: 11px; box-shadow: 0 3px 0 var(--ink); overflow: hidden; }
.tm.mine { border-color: var(--hot); box-shadow: 0 3px 0 var(--hot); }
.tm.live { outline: 3px solid var(--hot); outline-offset: 1px; }
.tm .sd { display: flex; align-items: center; gap: 6px; padding: 7px 8px; min-height: 34px; font: 800 12.5px/1.15 var(--ui); border-top: 2px solid rgba(13,16,32,.12); }
.tm .sd:first-child { border-top: 0; }
.tm .sd b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.tm .sd em { flex: none; font: 400 14px/1 var(--disp); font-style: normal; min-width: 14px; text-align: right; }
.tm .sd.w { background: #E8F8F0; } .tm .sd.w b { font-weight: 900; } .tm .sd.l { opacity: .5; } .tm .sd.unk b { color: var(--mute); font-weight: 700; } .tm .sd.me { background: #FFF3A6; }
.tm .sd.w.me { background: #CDF1DE; }
.tm .tag { position: absolute; right: 5px; top: 5px; font: 900 8.5px/1 var(--ui); letter-spacing: .06em; padding: 3px 5px; border-radius: 4px; background: var(--ink); color: #fff; text-transform: uppercase; }
.tm .tag.live { background: var(--hot); } .tm .tag.call { background: var(--volt); color: var(--ink); }
.tm .ft { padding: 4px 8px; font: 800 9.5px/1.2 var(--ui); letter-spacing: .04em; text-transform: uppercase; background: var(--paper); color: var(--mute); border-top: 2px solid rgba(13,16,32,.12); }
.trounds { display: flex; flex-direction: column; gap: 8px; }
.tpair { display: flex; align-items: center; gap: 8px; padding: 9px 10px; background: #fff; border: 3px solid var(--ink); border-radius: 12px; box-shadow: 0 3px 0 var(--ink); }
.tpair.mine { border-color: var(--hot); box-shadow: 0 3px 0 var(--hot); }
.tpair .a, .tpair .b { flex: 1; min-width: 0; font: 800 13px/1.15 var(--ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpair .b { text-align: right; }
.tpair .a.w, .tpair .b.w { font-weight: 900; color: var(--greenD); } .tpair .a.l, .tpair .b.l { opacity: .5; }
.tpair .sc { flex: none; font: 400 15px/1 var(--disp); padding: 4px 8px; border-radius: 6px; background: var(--paper); border: 2px solid var(--ink); min-width: 52px; text-align: center; }
.tpair .sc.live { background: var(--hot); color: #fff; } .tpair .sc.call { background: var(--volt); }

/* ---------- info tab ---------- */
.tinfo { display: flex; flex-direction: column; gap: 10px; background: #fff; border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 4px 0 var(--ink); padding: 12px; }
.tinfo h4 { margin: 0; font: 400 15px/1.1 var(--disp); text-transform: uppercase; }
.tinfo p { margin: 0; font: 600 13px/1.5 var(--ui); color: var(--ink); text-wrap: pretty; }
.tinfo dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; }
.tinfo dt { font: 800 10px/1.6 var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--mute); } .tinfo dd { margin: 0; font: 800 13px/1.4 var(--ui); overflow-wrap: anywhere; }

/* ---------- the create form ---------- */
.tform { display: flex; flex-direction: column; gap: 16px; }
.tbox { background: #fff; border: 3px solid var(--ink); border-radius: 16px; box-shadow: 0 4px 0 var(--ink); padding: 14px 12px; display: flex; flex-direction: column; gap: 12px; }
.tbox > h4 { margin: 0; display: flex; align-items: center; gap: 8px; font: 400 15px/1 var(--disp); text-transform: uppercase; }
.tbox > h4 i { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; font: 400 12px/24px var(--disp); font-style: normal; text-align: center; }
.tbox .hint { margin: 0; font: 600 12px/1.4 var(--ui); color: var(--mute); text-wrap: pretty; }
.tbox .hint.bad { color: var(--hotD); font-weight: 800; }
.tgames { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tgame { position: relative; min-width: 0; min-height: 54px; border: 3px solid var(--ink); border-radius: 12px; background: var(--g); color: var(--gt); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; overflow: hidden; padding: 6px 10px; opacity: .6; text-align: left; transition: transform .08s, opacity .15s; }
.tgame span { font: 400 10px/1 var(--disp); letter-spacing: .04em; opacity: .85; white-space: nowrap; } .tgame b { font: 900 13px/1.1 var(--ui); letter-spacing: .02em; text-transform: uppercase; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tgame.on { opacity: 1; box-shadow: 0 4px 0 var(--ink); transform: translateY(-2px); outline: 3px solid var(--volt); outline-offset: 1px; }
.tgame.on::after { content: '✓'; position: absolute; right: 7px; top: 50%; margin-top: -10px; width: 20px; height: 20px; border-radius: 50%; background: var(--volt); color: var(--ink); border: 2px solid var(--ink); font: 900 12px/16px var(--ui); text-align: center; }
.tfmts { display: flex; flex-direction: column; gap: 8px; }
.tfmt { display: flex; align-items: center; gap: 10px; padding: 10px; border: 3px solid var(--ink); border-radius: 12px; background: var(--paper); text-align: left; transition: background .12s; }
.tfmt .fi { flex: none; width: 40px; height: 40px; border-radius: 10px; border: 3px solid var(--ink); background: #fff; display: grid; place-items: center; transform: var(--sk); }
.tfmt .fi svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transform: skewX(8deg); }
.tfmt b { display: block; font: 900 14px/1.15 var(--ui); } .tfmt small { display: block; margin-top: 2px; font: 600 11.5px/1.3 var(--ui); color: var(--mute); }
.tfmt.on { background: var(--volt); box-shadow: 3px 4px 0 var(--hot); } .tfmt.on small { color: var(--ink); } .tfmt.on .fi { background: var(--ink); } .tfmt.on .fi svg { stroke: var(--volt); }
.tfld { display: flex; flex-direction: column; gap: 6px; }
.tfld > span, .tlab { font: 900 10px/1 var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--mute); }
.tfld input, .tfld textarea { width: 100%; min-height: 46px; padding: 8px 12px; border: 3px solid var(--ink); border-radius: 11px; background: var(--paper); color: var(--ink); font: 700 15px/1.25 var(--ui); outline: none; -webkit-user-select: text; user-select: text; }
.tfld textarea { resize: none; min-height: 64px; }
.tfld input:focus, .tfld textarea:focus { background: #fff; box-shadow: 0 0 0 3px var(--volt); }
.tfld input.bad { border-color: var(--hot); background: #FFE3DA; }
.tfld input[type="datetime-local"] { min-height: 50px; font-weight: 800; }
.topts { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 8px; }
.topts.num { grid-template-columns: repeat(auto-fit, minmax(48px, 1fr)); }
.topts button { min-width: 0; min-height: 42px; padding: 0 10px; border: 3px solid var(--ink); border-radius: 10px; background: #fff; font: 900 12px/1.1 var(--ui); letter-spacing: .04em; text-transform: uppercase; transform: var(--sk); }
.topts button.on { background: var(--volt); box-shadow: 3px 4px 0 var(--hot); }
.tstep { display: flex; align-items: center; gap: 10px; }
.tstep button { flex: none; width: 46px; height: 46px; border-radius: 12px; border: 3px solid var(--ink); background: #fff; box-shadow: 3px 4px 0 var(--ink); font: 400 24px/1 var(--disp); transform: var(--sk); }
.tstep button:active { transform: var(--sk) translate(2px, 3px); box-shadow: 1px 1px 0 var(--ink); } .tstep button[disabled] { opacity: .35; }
.tstep b { flex: 1; text-align: center; font: 400 28px/1 var(--disp); }
.tswitch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 3px solid var(--ink); border-radius: 12px; background: var(--paper); text-align: left; width: 100%; }
.tswitch .tx { flex: 1; min-width: 0; } .tswitch b { display: block; font: 900 14px/1.2 var(--ui); } .tswitch small { display: block; margin-top: 2px; font: 600 11.5px/1.3 var(--ui); color: var(--mute); }
.tswitch .sw { flex: none; position: relative; width: 54px; height: 30px; border-radius: 15px; border: 3px solid var(--ink); background: #C9CEDD; } .tswitch .sw::after { content: ''; position: absolute; left: 2px; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2.5px solid var(--ink); transition: transform .15s; }
.tswitch.on .sw { background: var(--green); } .tswitch.on .sw::after { transform: translateX(24px); background: var(--volt); }
.tcols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tgate { padding: 14px; background: #FFF6BF; border: 3px solid var(--ink); border-radius: 14px; font: 700 13.5px/1.45 var(--ui); display: flex; flex-direction: column; gap: 10px; }
.tgate b { font: 400 17px/1.1 var(--disp); text-transform: uppercase; }

/* ---------- "your match is ready" ---------- */
.tcall { position: fixed; inset: 0; z-index: 360; display: none; align-items: center; justify-content: center; padding: calc(var(--safeT) + 16px) 18px calc(var(--safeB) + 16px); background: rgba(13,16,32,.78); }
.tcall.on { display: flex; }
.tcall .tccard { position: relative; width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; padding: 24px 18px 16px; text-align: center; background: var(--ink); color: #fff; border: 4px solid #fff; border-radius: 20px; box-shadow: 6px 8px 0 var(--green); animation: pickIn .22s ease-out; overflow: hidden; }
.tcall .tcjp { position: absolute; right: 10px; top: 8px; font: 400 11px/1 var(--disp); background: var(--volt); color: var(--ink); padding: 6px 9px; border-radius: 5px; transform: var(--sk); }
.tcall small { font: 900 11px/1.2 var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--volt); padding: 0 40px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcall h3 { margin: 0; font: 400 27px/1.1 var(--disp); text-transform: uppercase; transform: var(--sk); text-shadow: 3px 3px 0 var(--hot); }
.tcall .tcvs { display: flex; align-items: center; justify-content: center; gap: 10px; }
.tcall .tcvs b { flex: 1; min-width: 0; font: 900 17px/1.15 var(--ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcall .tcvs i { flex: none; font: 400 22px/1 var(--disp); font-style: normal; color: var(--volt); transform: var(--sk); }
.tcall p { margin: 0; font: 700 13.5px/1.4 var(--ui); opacity: .92; }
.tcall .tchint { font-size: 12px; opacity: .7; }
.tcall .tcbar { height: 12px; border-radius: 6px; border: 3px solid #fff; background: var(--navy); overflow: hidden; } .tcall .tcbar i { display: block; height: 100%; width: 100%; background: var(--green); transform-origin: left; transition: transform .25s linear; }
.tcall .tcbar.low i { background: var(--hot); }
.tcall .btn.primary { background: var(--green); color: var(--ink); border-color: #fff; box-shadow: 5px 6px 0 var(--cobalt); animation: tGo 1.2s ease-in-out infinite; }
.tcall .btn.ghost { color: #fff; }

/* ---------- inside a tournament game: the end screen ---------- */
#end .tendbox { width: 100%; display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--ink); color: #fff; border: 3px solid #fff; border-radius: 14px; text-align: center; margin: 4px 0; }
#end .tendbox b { font: 400 17px/1.15 var(--disp); text-transform: uppercase; color: var(--volt); transform: var(--sk); }
#end .tendbox span { font: 700 13px/1.35 var(--ui); opacity: .92; }
#end .tendbox .tcbar { height: 10px; border-radius: 5px; border: 2.5px solid #fff; background: var(--navy); overflow: hidden; } #end .tendbox .tcbar i { display: block; height: 100%; width: 0; background: var(--volt); transition: width .25s linear; }
