/* Onochi Tournament v0.2.88: screen-only responsive interface.
   Preserve print page dimensions, bracket coordinates and saved results. */
@media screen {
 .ot-wrap,.ot-public-wrap,.ot-event-tabs,.ot-event-tab-panel {box-sizing:border-box;min-width:0;max-width:100%;}
 .ot-wrap {width:100%;padding:0 clamp(8px,1.5vw,22px);margin:12px auto;}
 .ot-wrap *, .ot-public-wrap * {box-sizing:border-box;}
 .ot-panel {min-width:0;max-width:100%;padding:clamp(10px,1.6vw,20px);}
 .ot-wrap h2,.ot-wrap h3,.ot-wrap h4 {overflow-wrap:anywhere;line-height:1.4;}
 .ot-form {display:flex;flex-wrap:wrap;gap:12px 16px;align-items:flex-end;max-width:100%;}
 .ot-form>label {display:flex;flex:1 1 185px;min-width:0;max-width:100%;flex-direction:column;align-items:stretch;justify-content:flex-end;gap:6px;margin:0!important;line-height:1.45;overflow-wrap:anywhere;}
 .ot-form>label:has(>input[type=checkbox]),.ot-form>label:has(>input[type=radio]) {flex-direction:row;align-items:center;justify-content:flex-start;flex:0 1 auto;min-height:38px;}
 .ot-form>label>input:not([type=checkbox]):not([type=radio]),.ot-form>label>select,.ot-form>label>textarea {display:block;width:100%;min-width:0;max-width:100%;min-height:38px;margin:0;}
 .ot-form>label>textarea {min-height:90px;resize:vertical;}
 .ot-form>button,.ot-form>.button {min-height:38px;white-space:normal;text-align:center;margin:0;}
 .ot-form>input:not([type=hidden]),.ot-form>select,.ot-form>textarea {max-width:100%;min-height:38px;}
 .ot-form>p,.ot-form>div,.ot-form>fieldset {max-width:100%;min-width:0;}
 .ot-flex,.ot-mountain-controls,.ot-league-display-controls,.ot-print-actions {display:flex;flex-wrap:wrap;gap:10px 14px;align-items:center;max-width:100%;}
 .ot-league-display-controls label,.ot-mountain-controls label,.ot-print-actions label {display:inline-flex;flex-wrap:wrap;align-items:center;gap:6px;min-width:0;}
 .ot-league-display-controls select,.ot-mountain-controls select,.ot-print-actions select {min-height:36px;max-width:100%;}
 .ot-manual-rank {max-width:100%;min-width:0;margin:12px 0;padding:12px;border:1px solid #d8dee6;border-radius:7px;}
 .ot-manual-rank summary {cursor:pointer;font-weight:600;}
 .ot-manual-rank .ot-form {align-items:stretch;}
 .ot-manual-rank .ot-form>label {display:flex!important;flex:1 1 185px;min-width:0;flex-direction:column;align-items:stretch!important;gap:6px!important;margin:0!important;}
 .ot-manual-rank .ot-form>label select {width:100%;}
 .ot-manual-rank .ot-form>p {flex:1 1 100%;margin:2px 0;}
 .ot-manual-rank .ot-form>p label {display:inline-flex;gap:8px;align-items:center;}
 .ot-table {max-width:100%;}
 .ot-league-scroll,.ot-bracket-svg-scroll,.ot-print-tree {max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;}
 .ot-league-results {width:max-content;min-width:100%;}
 .ot-tab-bar {max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;}
 .ot-event-tab {min-height:42px;}
 .ot-flow-grid,.ot-league-swap-grid,.ot-mountain-players {min-width:0;}
 .ot-result-editor,.ot-print-overlay {padding:clamp(6px,2vw,18px);}
 .ot-result-dialog {width:min(100%,620px);max-height:calc(100dvh - 20px);padding:clamp(12px,2vw,24px);overflow-y:auto;}
 .ot-result-dialog .ot-form {align-items:stretch;}
 .ot-result-dialog input,.ot-result-dialog select,.ot-result-dialog textarea {max-width:100%;}
 .ot-score-options {display:flex;flex-wrap:wrap;gap:8px;}
 .ot-score-options label {display:inline-flex;align-items:center;gap:6px;min-height:38px;}
 .ot-print-dialog {width:min(98vw,1250px);max-height:calc(100dvh - 12px);padding:clamp(6px,1.5vw,16px);}
 .ot-print-actions {top:0;}
 .ot-print-page.ot-national-page {max-width:100%!important;}
}
@media screen and (min-width: 1100px) {
 .ot-form>label {flex-basis:210px;}
 .ot-form>label:has(>textarea) {flex-basis:350px;}
 .ot-flow-grid {grid-template-columns:repeat(auto-fit,minmax(220px,1fr));}
}
@media screen and (min-width: 701px) and (max-width: 1099px) {
 .ot-form>label {flex-basis:calc(33.333% - 16px);}
 .ot-form>label:has(>textarea) {flex-basis:calc(66.666% - 16px);}
 .ot-flow-grid {grid-template-columns:repeat(auto-fit,minmax(180px,1fr));}
 .ot-mountain-players {grid-template-columns:repeat(auto-fit,minmax(145px,1fr));}
}
@media screen and (max-width: 700px) {
 .ot-wrap {margin:8px auto;padding:0 8px;}
 .ot-panel {padding:10px;margin:10px 0;}
 .ot-form {gap:10px;}
 .ot-form>label {flex:1 1 calc(50% - 10px);}
 .ot-form>label:has(>textarea),.ot-form>label:has(>input[type=file]) {flex-basis:100%;}
 .ot-manual-rank .ot-form>label {flex-basis:calc(50% - 10px);}
 .ot-tab-bar {gap:3px;margin-top:10px;}
 .ot-event-tab {padding:8px 11px;white-space:normal;min-width:95px;flex:0 0 auto;}
 .ot-league-display-controls label,.ot-mountain-controls label {flex:1 1 135px;justify-content:space-between;}
 .ot-league-display-controls select,.ot-mountain-controls select {flex:1 1 auto;min-width:72px;}
 .ot-result-dialog {padding:12px;max-height:calc(100dvh - 12px);}
 .ot-score-options {gap:5px;}
 .ot-print-actions {gap:7px;}
 .ot-print-actions>strong {flex:1 1 100%;}
 .ot-flow-grid {grid-template-columns:repeat(auto-fit,minmax(min(100%,155px),1fr));}
 .ot-mountain-players {grid-template-columns:repeat(auto-fit,minmax(min(100%,130px),1fr));}
}
@media screen and (max-width: 420px) {
 .ot-form>label,.ot-manual-rank .ot-form>label {flex-basis:100%;}
 .ot-form>label:has(>input[type=checkbox]),.ot-form>label:has(>input[type=radio]) {flex-basis:100%;}
 .ot-form>button,.ot-form>.button {width:100%;}
 .ot-league-display-controls label,.ot-mountain-controls label {flex-basis:100%;}
 .ot-flow-grid {grid-template-columns:1fr;}
 .ot-result-dialog .button {max-width:100%;white-space:normal;}
}
@media print {
 /* Keep the pre-existing A4/SVG page layout unchanged. */
}

/* v0.2.89: long team/player names never share a row with score inputs. */
@media screen {
 .ot-form:has(>.ot-match-entry) {display:grid;grid-template-columns:minmax(0,1fr);gap:10px;margin:12px 0 22px;}
 .ot-form>.ot-match-entry {width:100%;min-width:0;max-width:100%;display:grid;gap:9px;}
 .ot-match-title {font-weight:650;line-height:1.55;overflow-wrap:anywhere;word-break:normal;}
 .ot-match-score-fields {display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:end;gap:8px;min-width:0;max-width:100%;}
 .ot-match-score-fields>label {display:flex;flex-direction:column;align-items:stretch;min-width:0;gap:5px;line-height:1.45;overflow-wrap:anywhere;}
 .ot-match-score-fields>label>span {display:block;min-width:0;overflow-wrap:anywhere;font-size:13px;color:#475467;}
 .ot-match-score-fields input[type=number] {display:block;width:100%;min-width:0;max-width:100%;height:42px;padding:6px 8px;margin:0;text-align:center;font-size:16px;}
 .ot-match-separator {align-self:end;height:42px;display:flex;align-items:center;justify-content:center;font-weight:700;}
 .ot-form:has(>.ot-match-entry)>button[type=submit] {width:100%;min-height:44px;margin:0;}
 .ot-result-dialog .ot-form>label:not(:has(input[type=checkbox])):not(:has(input[type=radio])) {display:flex;flex-direction:column;align-items:stretch;gap:6px;flex-basis:100%;min-width:0;overflow-wrap:anywhere;}
 .ot-result-dialog .ot-form>label>input[type=number] {display:block;width:100%;max-width:100%;min-height:42px;margin:0;}
}
@media screen and (max-width:420px) {
 .ot-match-score-fields {gap:6px;}
 .ot-match-score-fields>label>span {font-size:12px;}
}
