main.container.t-tournament-layout { max-width: min(99vw, 1900px); }
.tournament-view { max-width: 1900px; margin: 0 auto; }
.tournament-view > .card:not(.t-desktop-workspace) { max-width: 1100px; margin-left: auto; margin-right: auto; }
.tournament-view .card { margin-bottom: 1rem; }
.tournament-view button, .tournament-view input, .tournament-view select { font: inherit; }
.tournament-view button { cursor: pointer; }
.tournament-view button:disabled { opacity: .5; cursor: not-allowed; }
.tournament-view label { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.tournament-view input:not([type=checkbox]), .tournament-view select { box-sizing: border-box; min-height: 2.65rem; width: 100%; }
.t-inline { display: flex; gap: .7rem; flex-wrap: wrap; align-items: end; margin: 1rem 0; }
.t-inline > label { flex: 1 1 190px; }
.t-inline > button { min-height: 2.65rem; }
.t-choice { display: flex; gap: .3rem; flex-direction: column; width: 100%; text-align: left; margin: .5rem 0; padding: .85rem; }
.t-choice span, .tournament-view small { opacity: .82; }
.t-header { display: flex; align-items: flex-start; flex-direction: column; gap: .4rem; }
.t-header h2, .t-header p { margin: .15rem 0; }
.t-stepper { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .45rem; margin: 0 0 1rem; }
.t-stepper button { min-height: 2.8rem; white-space: normal; }
.t-stepper [aria-current=step] { border: 2px solid #399365; background: rgba(41,148,94,.22); font-weight: 750; }
.t-checks { display: grid; grid-template-columns: repeat(auto-fill,minmax(165px,1fr)); gap: .45rem; margin: .8rem 0; }
.tournament-view .t-check { display: flex; flex-direction: row; align-items: center; gap: .7rem; min-height: 2.9rem; padding: .55rem .7rem; border: 1px solid rgba(128,128,128,.55); border-radius: .65rem; cursor: pointer; }
.t-check:has(input:checked) { border-color: #408f65; background: rgba(40,145,92,.16); }
.tournament-view .t-check input { width: 1.15rem; height: 1.15rem; flex: none; accent-color: #398f61; }
.t-check span { display: flex; flex-direction: column; }
.t-group { border: 1px solid rgba(128,128,128,.35); border-radius: .6rem; padding: .7rem; margin: .7rem 0; }
.t-group summary { cursor: pointer; font-weight: 700; }
.t-fields { display: grid; grid-template-columns: repeat(auto-fit,minmax(155px,1fr)); align-items: end; gap: .65rem; margin: .9rem 0; }
.t-chips, .t-event-tabs, .t-row { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; margin: .8rem 0; }
.t-chips > span { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .7rem; border: 1px solid rgba(128,128,128,.55); border-radius: .65rem; }
.t-chips button { min-width: 1.8rem; min-height: 1.8rem; }
.t-launch { text-align: center; }
.t-launch .primary-button { display: block; width: min(100%,400px); min-height: 3.5rem; margin: .7rem auto; font-size: 1.1rem; }
.t-event-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: .5rem; }
.t-event-tabs button { white-space: nowrap; min-height: 2.6rem; }
.t-event-tabs .selected, .t-points .selected { border: 2px solid #399365; background: rgba(41,148,94,.22); font-weight: 750; }
.t-event-heading { display: flex; justify-content: space-between; gap: .4rem; align-items: center; flex-wrap: wrap; }
.t-players { display: grid; grid-template-columns: repeat(auto-fill,minmax(200px,1fr)); gap: .65rem; }
.t-player { display: flex; flex-direction: column; gap: .5rem; border: 1px solid rgba(128,128,128,.42); border-radius: .65rem; padding: .75rem; }
.t-player span { font-weight: 700; }
.t-targets { display: grid; grid-template-columns: repeat(auto-fit,minmax(195px,1fr)); gap: .65rem; }
.t-target { border: 1px solid rgba(128,128,128,.45); border-radius: .7rem; padding: .75rem; }
.t-target strong { display: block; margin-bottom: .65rem; }
.t-points { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .3rem; }
.t-points button { min-height: 2.8rem; padding: .2rem; }
.t-points button:first-child { grid-column: span 2; }
.t-progress { background: rgba(128,128,128,.28); height: .6rem; border-radius: 1rem; overflow: hidden; }
.t-progress span { display: block; height: 100%; background: #3a995f; }
.t-series-total, .t-finish { font-size: 1.12rem; margin: 1rem 0; }
.t-scoring > .label { display: block; margin-top: .8rem; }
.t-scoring .primary-button { min-height: 2.9rem; }
.t-table-wrap { overflow-x: auto; }
.t-table { width: 100%; border-collapse: collapse; min-width: 520px; }
.t-table th, .t-table td { text-align: left; padding: .55rem; border-bottom: 1px solid rgba(128,128,128,.4); }
.t-export { display: inline-block; margin-top: 1rem; }
.t-export-links { display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.t-stats-tournament { margin: .85rem 0; padding: .8rem; border: 1px solid #d8d1c4; border-radius: .7rem; }
.t-stats-tournament h4 { margin: .15rem 0; }
.t-stats-tournament p { margin: .35rem 0; }
.t-stats-events { display: grid; gap: .4rem; }
.t-stats-event { border: 1px solid #ddd5c8; border-radius: .5rem; padding: .5rem .65rem; }
.t-stats-event summary { cursor: pointer; }
.t-stats-event .t-table { min-width: 350px; width: 100%; }
.t-phone-workspace { display: none; }
.t-board-scroll { overflow: auto; max-height: 72vh; border: 1px solid rgba(128,128,128,.5); border-radius: .7rem; }
.t-board { border-collapse: separate; border-spacing: 0; font-size: 1rem; min-width: 100%; }
.t-board th, .t-board td { text-align: left; padding: .9rem; border-right: 1px solid rgba(128,128,128,.25); border-bottom: 1px solid rgba(128,128,128,.35); min-width: 210px; vertical-align: top; }
.t-board th:first-child, .t-board td:first-child { min-width: 180px; }
.t-board thead th { position: sticky; top: 0; z-index: 2; background: #193d34; color: #fff; }
.t-board tbody th { position: sticky; left: 0; z-index: 1; background: #f1f6ef; color: #172c23; }
.t-board thead th:first-child { left: 0; z-index: 3; }
.t-board th small, .t-board td small { display: block; font-weight: normal; margin: .35rem 0; }
.t-board button { display: block; min-height: 2.7rem; margin-top: .5rem; width: 100%; }
.t-board tbody tr:nth-child(even) td { background: rgba(128,128,128,.07); }
.t-desktop-workspace .t-event-heading { padding-bottom: .5rem; }
.t-back-to-phone { display: none; }
.tournament-view > .card.t-scoring { max-width: none; min-height: calc(100dvh - 160px); margin: 0 auto; display: flex; flex-direction: column; gap: .65rem; }
.t-scoring > small button { display: inline-block; margin: .4rem; }
.t-score-context { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .5rem .7rem; border: 1px solid #dfd4bf; background: #fff8e9; border-radius: .7rem; }
.t-score-context h3, .t-score-context p { margin: .2rem 0; }
.t-live-sheet { flex: 1; min-height: 280px; padding: .7rem; border-radius: .8rem; background: #fff; }
.t-live-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .45rem; }
.t-live-head small { color: #666; }
.t-live-position { padding: .55rem .7rem; border: 1px solid #9c2929; border-radius: .6rem; background: #fbeeed; font-weight: 750; }
.t-walback-current-score { float: right; padding: .05rem .6rem; border-radius: .4rem; background: #fff; color: #8f2a27; }
.t-live-running-total { text-align: center; margin: .35rem 0 .65rem; padding: .45rem; border-radius: .6rem; background: #f4f1ec; }
.t-live-running-total strong { font-size: 1.2rem; }
.t-live-precision { display: grid; gap: .15rem; }
.t-live-precision-row { display: grid; grid-template-columns: 52px repeat(3, 40px) minmax(45px, 1fr); align-items: center; gap: .25rem; min-height: 2.5rem; padding: .15rem .45rem; text-align: center; border-radius: .5rem; background: #faf9f7; }
.t-live-precision-row.current { background: #f8eaea; box-shadow: inset 3px 0 #9c2929; }
.t-live-column-head { min-height: 1.7rem; color: #6a6865; background: transparent; font-size: .72rem; font-weight: 700; }
.t-live-series-total { text-align: right; }
.t-live-chip { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border: 1px solid #d8d3cc; border-radius: .65rem; font-weight: 850; }
.t-live-chip.empty { background: #efeeeb; color: #999; }
button.t-live-chip { cursor: pointer; touch-action: manipulation; }
.t-live-chip.miss, .t-live-chip.score-0 { background: #8f2a27; color: #fff; }
.t-live-chip.score-1 { background: #ce3158; color: #fff; }
.t-live-chip.score-2 { background: #df671b; color: #fff; }
.t-live-chip.score-3 { background: #c48618; color: #fff; }
.t-live-chip.score-4 { background: #168b81; color: #fff; }
.t-live-chip.score-5 { background: #258848; color: #fff; }
.t-live-chip.score--10 { background: #922b29; color: #fff; }
.t-live-chip.editing { outline: 3px solid #296bc7; outline-offset: 1px; }
.t-live-walback { overflow-x: auto; }
.t-live-walback-head, .t-live-walback-row, .t-live-walback-totals { display: grid; grid-template-columns: 75px repeat(4, minmax(145px, 1fr)) 70px; align-items: center; gap: .55rem; min-width: 790px; }
.t-live-walback-head { color: #666; font-size: .75rem; text-align: center; }
.t-live-walback-row { border-top: 1px solid #ddd; padding: .35rem 0; }
.t-live-walback-cell { display: grid; justify-items: center; gap: .15rem; min-height: 3.6rem; padding: .2rem; border: 1px solid #d8cfc1; border-radius: .6rem; background: #f8f6f1; }
.t-live-walback-cell.current { background: #f8eaea; outline: 1px solid #9c2929; }
.t-live-walback-targets { display: grid; grid-template-columns: repeat(3, 36px); justify-content: center; gap: .25rem; width: 100%; }
.t-live-walback-cell small { display: none; }
.t-live-walback-cell small:last-child { display: block; font-weight: 750; }
.t-live-distance-total, .t-live-walback-totals { text-align: center; }
.t-live-distance-total small, .t-live-walback-totals small { display: block; font-size: .7rem; color: #666; }
.t-live-walback-totals { border-top: 2px solid #aaa; padding-top: .4rem; }
.t-score-dock { position: sticky; bottom: 0; z-index: 5; margin-top: auto; padding: .4rem 0 max(.45rem, env(safe-area-inset-bottom)); border-top: 2px solid #d8d1c4; background: #fff; }
.t-score-dock > strong { display: block; text-align: center; padding: .35rem; margin-bottom: .35rem; background: #f8eaea; }
.t-score-buttons { display: grid; grid-template-columns: 1.2fr repeat(6, minmax(0, 1fr)); gap: .3rem; }
.t-score-buttons button { min-height: 3.15rem; padding: .2rem; border: 1px solid #ded6cd; border-radius: .55rem; background: #fff; font-size: 1.15rem; font-weight: 850; touch-action: manipulation; }
.t-score-buttons button.miss { color: #9a2929; font-size: .8rem; }
.t-finish { padding: 1rem; text-align: center; background: #edf6ec; border-radius: .7rem; }
.t-finish .primary-button { min-height: 3.2rem; }
@media (max-width: 800px) and (orientation: portrait) {
  .t-desktop-workspace { display: none; }
  .t-phone-workspace { display: block; }
  .t-show-board-on-phone .t-desktop-workspace { display: block; }
  .t-show-board-on-phone .t-phone-workspace { display: none; }
  .t-show-board-on-phone .t-back-to-phone { display: inline-block; }
  .tournament-view.t-show-board-on-phone > .t-desktop-workspace { max-width: none; }
  .t-board-scroll { max-height: 68vh; }
}
@media (max-width: 650px) {
  .t-stepper button { padding: .35rem .2rem; }
  .t-checks { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .t-players { grid-template-columns: 1fr; }
  .t-event-heading { flex-direction: column; align-items: flex-start; }
  .t-targets { grid-template-columns: 1fr; }
  .t-points { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .t-choice { text-align: left; }
  .t-score-context { padding: .5rem; }
  .t-live-sheet { padding: .45rem; }
  .t-live-precision-row { grid-template-columns: 43px repeat(3, 38px) minmax(40px, 1fr); padding: .15rem; }
  .t-live-chip { width: 36px; height: 36px; }
  .t-score-buttons { gap: .18rem; }
  .t-score-buttons button { min-height: 3.3rem; }
  .t-live-walback-head { display: none; }
  .t-live-walback-row { min-width: 0; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .4rem; margin: .45rem 0; padding: .55rem; border: 1px solid #ded6ca; border-radius: .7rem; }
  .t-live-walback-row > strong:first-child { grid-column: 1; grid-row: 1; }
  .t-live-distance-total { grid-column: 2; grid-row: 1; text-align: right; }
  .t-live-walback-cell:nth-child(2) { grid-column: 1; grid-row: 2; }
  .t-live-walback-cell:nth-child(3) { grid-column: 2; grid-row: 2; }
  .t-live-walback-cell:nth-child(4) { grid-column: 1; grid-row: 3; }
  .t-live-walback-cell:nth-child(5) { grid-column: 2; grid-row: 3; }
  .t-live-walback-cell { padding: .35rem; background: #f6f2eb; }
  .t-live-walback-cell small { display: block; }
  .t-live-walback-totals { min-width: 0; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .t-walback-current-score { float: none; display: block; margin-top: .35rem; text-align: center; }
}

/* APW_TOURNAMENT_RESULTS_V1 */
#tRankings .trv-tabs{display:flex;flex-wrap:wrap;gap:8px;margin:18px 0}
#tRankings .trv-tabs button{min-height:44px;padding:10px 16px;border:1px solid #b8c5d6;border-radius:8px;background:#f2f4f8;color:#172338}
#tRankings .trv-tabs button[aria-pressed=true]{background:#15477f;color:#fff;border-color:#15477f}
#tRankings .trv-matrix th,#tRankings .trv-matrix td{min-width:165px;vertical-align:top}
#tRankings .trv-matrix small,#tRankings .trv-result small{display:block;margin-top:5px;color:#43516a;font-size:13px}
#tRankings .trv-person{display:block;background:transparent;border:0;color:#15477f;text-decoration:underline;font-weight:700;text-align:left;min-height:44px;padding:6px 0}
#tRankings .trv-result{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:16px 0;border-bottom:1px solid #d3dae4}
#tRankings .trv-result>div{min-width:0;overflow-wrap:anywhere}
#tRankings .trv-picker{max-width:520px;margin:16px 0}
#tRankings .trv-medals{display:flex;gap:10px;flex-wrap:wrap;margin:14px 0}
#tRankings .trv-medals span{padding:7px 12px;background:#eaf1fa;color:#172338;border-radius:6px}
#tRankings .trv-scope{color:#43516a}
#tRankings .trv-rules,#tRankings .trv-score-details{margin:18px 0}
#tRankings summary{cursor:pointer;min-height:44px;align-content:center}
@media(max-width:800px){
 #tRankings .trv-matrix,#tRankings .trv-matrix tbody,#tRankings .trv-matrix tr,#tRankings .trv-matrix td,#tRankings .trv-matrix th{display:block;min-width:0;width:100%;box-sizing:border-box}
 #tRankings .trv-matrix thead{display:none}
 #tRankings .trv-matrix tr{margin:16px 0;border-top:2px solid #b8c5d6}
 #tRankings .trv-matrix td::before{content:attr(data-title);display:block;font-weight:700;margin-bottom:5px}
 #tRankings .trv-result{flex-wrap:wrap;gap:8px}
}
