/* Standalone TV display: deliberately no Tailwind, CSS layers, grid or custom properties. */
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; padding: 0; overflow: hidden; background: #0b1430; color: #f5f7ff; font-family: Arial, Helvetica, sans-serif; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button, select, input, a { outline-offset: 3px; }
button:focus, select:focus, input:focus, a:focus { outline: 3px solid #ffdc65; }
button { min-height: 42px; padding: 8px 14px; border: 1px solid #6f83ac; border-radius: 4px; background: #1d315a; color: white; font-weight: bold; cursor: pointer; }
button:disabled { opacity: .6; }
#main-menu-toggle { position:fixed; z-index:6; top:12px; left:12px; color:#0b1430; background:#e8c36f; border-color:#f7d986; }
.tv-main-menu { position:fixed; z-index:30; top:0; bottom:0; left:0; width:340px; max-width:100%; background:#0a0c10; border-right:2px solid #e8c36f; box-shadow:0 0 0 3000px #000a; color:white; }
.tv-main-menu-heading { height:80px; padding:18px 14px; border-bottom:1px solid #34496e; }
.tv-main-menu-heading strong { display:inline-block; font-size:20px; line-height:44px; }
.tv-main-menu-heading button { float:right; }
#tv-main-menu-links { position:absolute; top:80px; bottom:130px; left:0; right:0; overflow-y:auto; padding:8px; }
.tv-main-menu a { display:block; min-height:44px; padding:12px; color:#d4d9e3; text-decoration:none; font-size:16px; font-weight:bold; }
.tv-main-menu a:hover,.tv-main-menu a:focus { background:#293040; color:#f7d986; }
.tv-main-menu-footer { position:absolute; bottom:0; left:0; right:0; min-height:120px; padding:10px; border-top:1px solid #34496e; }
.tv-main-menu-footer>button { width:47%; margin:2px 1%; }
.tv-main-menu-footer>a { text-align:center; font-size:13px; }
.tv-main-menu-footer #main-menu-pair { width:98%; background:#e8c36f; color:#0b1430; }
.tv-menu-pair-link { margin-top:6px; background:#e8c36f; color:#0b1430!important; border:1px solid #f7d986; border-radius:4px; }
.tv-pairing-page { height:auto; min-height:100%; overflow:auto; }
.tv-pairing-card { margin:80px auto 24px; max-width:720px; padding:28px; border:1px solid #e8c36f; border-radius:10px; background:#142748; font-size:20px; line-height:1.5; }
.tv-pairing-card h1 { margin:12px 0; color:#f7d986; font-size:36px; }
.tv-pairing-card h2 { margin:12px 0; font-size:26px; }
.tv-pairing-card label { display:block; margin:24px 0 8px; font-weight:bold; }
.tv-pairing-card input { display:block; width:100%; min-height:60px; padding:12px; border:1px solid #91a5c8; border-radius:4px; background:#0b1430; color:#fff; font-size:28px; letter-spacing:5px; }
.tv-pairing-card button { width:100%; min-height:60px; margin-top:14px; background:#e8c36f; color:#0b1430; font-size:22px; }
.tv-pairing-card a { display:inline-block; min-height:44px; padding:8px 0; color:#f7d986; }
@media(max-width:760px) { .tv-pairing-card { margin:80px 12px 16px; padding:20px; font-size:17px; } }
.tv-wall { position: absolute; top: 0; bottom: 0; left: 0; right: 0; background: #0b1430; background: linear-gradient(135deg, #162950, #0b1430); }
.wall-heading { height: 96px; border-bottom: 1px solid #34496e; padding: 16px 18px 16px 180px; background: #102044; }
.wall-logo { float: left; width: 60px; height: 60px; margin-right: 16px; border-radius: 5px; background: white; }
.wall-title { max-width: 68%; }
.wall-title > span { display: block; color: #e8c36f; font-size: 11px; font-weight: bold; letter-spacing: 2px; }
.wall-title h1 { margin: 5px 0; font-size: 27px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wall-title p { margin: 0; font-size: 12px; color: #ced9ed; }
.connection { margin-left: 14px; color: #65e1ce; font-weight: bold; }
.connection.is-offline { color: #ffbf6a; }
.wall-controls { position: absolute; top: 25px; right: 18px; }
.wall-controls button { margin-left: 7px; }
#fullscreen { color: #0b1430; background: #e8c36f; border-color: #e8c36f; }
.wall-boards { position: absolute; top: 104px; bottom: 54px; left: 10px; right: 10px; font-size: 0; overflow: hidden; }
.board-slot { display: inline-block; vertical-align: top; width: 25%; height: 50%; padding: 6px; font-size: 14px; }
.cols-1 .board-slot { width: 100%; }
.cols-2 .board-slot { width: 50%; }
.cols-3 .board-slot { width: 33.333333%; }
.cols-4 .board-slot { width: 25%; }
.rows-1 .board-slot { height: 100%; }
.rows-2 .board-slot { height: 50%; }
.rows-3 .board-slot { height: 33.333333%; }
.rows-4 .board-slot { height: 25%; }
.cols-1.rows-1 .name-cell strong { font-size:5vw; }
.cols-1.rows-1 .score-cell strong { font-size:14vw; }
.cols-1.rows-1 .legs-cell strong { font-size:10vw; }
.cols-1.rows-1 .portrait { width:90px; height:90px; line-height:86px; }
.cols-1.rows-1 .match-average { font-size:2vw; }
@media (min-width: 801px) {
  .cols-2.rows-1 .name-cell strong { font-size:3vw; }
  .cols-2.rows-1 .score-cell strong { font-size:9vw; }
  .cols-2.rows-1 .legs-cell strong { font-size:6vw; }
  .cols-2.rows-1 .portrait { width:76px; height:76px; line-height:72px; }
  .cols-2.rows-1 .match-average { font-size:1.5vw; }
}
.wall-empty { position:absolute; top:35%; left:10%; right:10%; margin:0; font-size:28px; line-height:1.6; color:#b7c5e1; text-align:center; }
.board-card { position: relative; height: 100%; width: 100%; overflow: hidden; border: 1px solid #415b88; border-radius: 5px; background: #111e3d; }
.board-heading { position: relative; height: 46px; background: #142748; border-bottom: 1px solid #34496e; }
.board-heading > strong { position: absolute; left: 12px; top: 6px; color: #f2d481; font-size: 16px; }
.match-state { position: absolute; right: 12px; top: 9px; font-size: 10px; font-weight: bold; color: #a8b9d4; }
.match-state.is-live { color: #ff8fa2; }
.stage { position: absolute; left: 12px; right: 12px; top: 27px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: #a8b9d4; }
.players { position: absolute; top: 46px; bottom: 38px; left: 0; right: 0; }
.player-row { display: table; table-layout: fixed; width: 100%; height: 50%; border-left: 5px solid transparent; background: #112044; color: #b7c5e1; border-bottom: 1px solid #34496e; }
.player-row.is-active { border-left-color: #e8c36f; color: white; background: #263656; }
.photo-cell, .name-cell, .score-cell, .legs-cell { display: table-cell; vertical-align: middle; }
.photo-cell { width: 15%; padding: 0 5px; text-align: center; }
.portrait { position: relative; display: inline-block; width: 48px; height: 48px; max-width: 100%; overflow: hidden; border: 2px solid #e8c36f; border-radius: 50%; background: #1e345b; line-height: 44px; font-weight: bold; color: #ffe59a; }
.portrait img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.name-cell { width: 44%; padding: 6px; }
.name-cell strong { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 22px; line-height: 1.1; }
.name-cell > span { display: block; margin-top: 8px; font-size: 10px; font-weight: bold; letter-spacing: 1px; text-transform: uppercase; color: #8ca1c5; }
.is-active .name-cell > span { color: #f2d481; }
.match-average { display: block; margin-top: 4px; font-size: 14px; line-height: 1.2; white-space: nowrap; color: #b7c5e1; }
.match-average b { color: #f2d481; }
.score-cell { width: 25%; text-align: center; }
.score-cell small, .legs-cell small { display: block; margin-bottom: 2px; font-size: 9px; font-weight: bold; letter-spacing: 1px; }
.score-cell strong { display: block; font-size: 54px; line-height: 1; letter-spacing: -2px; }
.legs-cell { width: 16%; text-align: center; background: #1a2b51; }
.legs-cell strong { display: block; font-size: 38px; line-height: 1; }
.legs-cell > span { display: block; margin-top: 4px; font-size: 9px; }
.is-active .legs-cell { color: #0b1430; background: #e8c36f; }
.board-footer { position: absolute; height: 38px; bottom: 0; left: 0; right: 0; padding: 0 12px; line-height: 38px; text-align: center; font-size: 12px; font-weight: bold; color: #f2d481; background: #0f1b38; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-empty { position: absolute; top: 46px; bottom: 0; left: 0; right: 0; display: table; width: 100%; height: 65%; padding: 40px 20px; text-align: center; color: #879cc0; }
.board-empty strong { display: block; font-size: 24px; margin: 10px 0; }
.board-empty span { font-size: 12px; }
.wall-footer { position: absolute; height: 48px; bottom: 0; left: 0; right: 0; padding: 12px 18px; border-top: 1px solid #34496e; background: #102044; font-size: 12px; }
#screen-note { display: inline-block; max-width: 33%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#updated { float: right; color: #65e1ce; line-height: 24px; }
#paging { position: absolute; left: 35%; right: 30%; top: 5px; text-align: center; }
#paging button { min-height: 36px; padding: 4px 12px; }
#page-label { padding: 0 8px; }
.wall-settings { position: absolute; z-index: 5; top: 102px; bottom: 54px; left: 18px; right: 18px; overflow: auto; padding: 24px; background: #142748; border: 2px solid #e8c36f; font-size: 18px; }
.wall-settings h2 { margin-top: 0; color: #f2d481; }
.wall-settings form { margin: 22px 0; }
.wall-settings label { display: block; margin-bottom: 8px; font-weight: bold; }
.wall-settings select, .wall-settings input { min-height: 48px; max-width: 100%; padding: 8px 12px; border: 1px solid #91a5c8; border-radius: 4px; background: #0b1430; color: white; }
.wall-settings select { width: 65%; }
.wall-settings button { margin: 4px 8px 4px 0; }
.wall-settings a { color: #9cd4ff; margin-left: 16px; }
.error { color: #ffafb6; }
.screen-message { position: absolute; z-index: 10; bottom: 54px; left: 10%; right: 10%; padding: 18px; background: #142748; border: 2px solid #e8c36f; font-size: 18px; text-align: center; }
.tv-intro { position: fixed; z-index: 20; top: 0; bottom: 0; left: 0; right: 0; background: black; }
.tv-intro video { width: 100%; height: 100%; object-fit: contain; }
.tv-intro-tools { position: absolute; bottom: 18px; right: 18px; }
.tv-intro-tools button { margin-left: 8px; }
#tv-intro-sound { color: #0b1430; background: #e8c36f; border-color: #e8c36f; }
#tv-intro-fullscreen { opacity: .35; }
#tv-intro-fullscreen:focus, #tv-intro-fullscreen:hover { opacity: 1; }
#tv-intro-error { position: absolute; bottom: 75px; left: 10%; right: 10%; padding: 18px; background: #142748; border: 1px solid #e8c36f; text-align: center; font-size: 18px; }
.tv-group-heading { height: 48px; padding: 12px; color: #f2d481; border-bottom: 1px solid #415b88; background: #142748; }
.tv-group-heading strong { font-size: 20px; }
.tv-group-heading span { float: right; padding-top: 4px; font-size: 14px; color: #ced9ed; }
.tv-group-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 18px; }
.tv-group-table th, .tv-group-table td { padding: 10px 6px; border-bottom: 1px solid #34496e; text-align: center; }
.tv-group-table thead { color: #8ca1c5; font-size: 14px; }
.tv-group-table thead th { padding: 8px 6px; }
.tv-group-table th:nth-child(1) { width: 8%; }
.tv-group-table th:nth-child(2) { width: 49%; text-align: left; }
.tv-group-table th:nth-child(3) { width: 10%; }
.tv-group-table th:nth-child(4) { width: 13%; }
.tv-group-table th:nth-child(5) { width: 20%; }
.tv-group-table tbody th { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: left; font-weight: bold; }
.tv-group-table tbody tr:nth-child(even) { background: #142748; }
.tv-group-points { color: #f2d481; font-weight: bold; }
@media (max-width: 1500px) {
  .tv-group-table { font-size: 16px; }
  .tv-group-table th, .tv-group-table td { padding: 7px 4px; }
  .name-cell strong { font-size: 18px; }
  .score-cell strong { font-size: 42px; }
  .legs-cell strong { font-size: 32px; }
  .portrait { width: 40px; height: 40px; line-height: 36px; }
  .wall-title { max-width: 66%; }
}
@media (max-height: 600px) {
  .tv-group-heading { height: 30px; padding: 5px 8px; }
  .tv-group-heading strong { font-size: 14px; }
  .tv-group-heading span { font-size: 11px; padding-top: 0; }
  .tv-group-table { font-size: 12px; }
  .tv-group-table th, .tv-group-table td { padding: 3px 3px; }
  .tv-group-table thead { font-size: 10px; }
  .tv-group-table thead th { padding: 3px; }
  .wall-heading { height: 78px; padding-top: 10px; }
  .wall-logo { width: 48px; height: 48px; }
  .wall-title h1 { font-size: 22px; }
  .wall-controls { top: 16px; }
  .wall-boards, .wall-settings { top: 84px; }
  .board-heading { height: 34px; }
  .board-heading > strong { font-size: 14px; top: 4px; }
  .stage { top: 22px; font-size: 10px; }
  .players { top: 34px; bottom: 24px; }
  .board-footer { height: 24px; line-height: 24px; }
  .name-cell > span { margin-top: 4px; }
  .match-average { margin-top: 2px; font-size: 12px; }
  .name-cell strong { font-size: 15px; white-space: nowrap; }
  .score-cell strong { font-size: 34px; }
  .legs-cell strong { font-size: 26px; }
  .portrait { width: 32px; height: 32px; line-height: 28px; }
}
@media (max-width: 800px) {
  .wall-heading { height: 110px; padding: 10px; }
  .wall-logo { width: 40px; height: 40px; margin-left:0; margin-right: 8px; }
  .wall-title { max-width: 100%; }
  .wall-title > span { font-size: 9px; letter-spacing: 1px; }
  .wall-title h1 { font-size: 20px; }
  .wall-title p { font-size: 10px; }
  .connection { margin-left: 4px; }
  .wall-controls { top: 64px; left: 10px; right: 10px; }
  #main-menu-toggle { top:64px; left:10px; min-height:34px; padding:8px; font-size:12px; }
  .wall-controls { left:140px; }
  .wall-controls button { min-height: 34px; font-size: 12px; margin-left: 0; margin-right: 6px; }
  .wall-boards, .wall-settings { top: 116px; left: 4px; right: 4px; }
  .wall-settings { padding: 15px; font-size: 16px; }
  .wall-settings select { width: 100%; }
  .wall-title, .wall-title h1 { overflow: hidden; }
  .wall-footer { padding: 12px 8px; font-size: 10px; }
  #paging { left: 20%; right: 25%; }
  #screen-note { max-width: 19%; }
  #page-label { padding: 0 3px; }
  #paging button { padding: 4px 7px; }
}
/* Portrait phones show two readable boards per page; TV wall geometry stays intact. */
@media (max-width: 599px) and (orientation: portrait) {
  .wall-heading { height:156px; }
  .wall-title h1 { font-size:18px; }
  .wall-controls { top:104px; left:10px; }
  .wall-boards, .wall-settings { top:162px; }
  .score-cell strong { font-size:36px; letter-spacing:-1px; }
  .legs-cell strong { font-size:28px; }
  .name-cell strong { font-size:17px; }
  .match-average { font-size:12px; }
  .cols-1.rows-1 .score-cell strong { font-size:11vw; }
  .cols-1.rows-1 .legs-cell strong { font-size:8vw; }
  .cols-1.rows-1 .name-cell strong { font-size:4.5vw; }
  .cols-1.rows-1 .portrait { width:48px; height:48px; line-height:44px; }
  #screen-note { display:none; }
  #paging { left:8px; right:auto; }
}
.legacy-tv-caller{position:fixed;bottom:12px;left:12px;z-index:80;font:14px/1.6 Arial,sans-serif;color:#edf3ff;width:420px;max-width:calc(100vw - 24px)}
.legacy-tv-caller button,.legacy-tv-caller select{min-height:44px;border:1px solid #b69753;background:#10203d;color:#ffe0a0;padding:8px 12px;font:inherit;border-radius:5px}
.legacy-tv-caller section{padding:18px;border:1px solid #b69753;background:#0a152b;max-height:75vh;overflow:auto;margin-top:8px;box-shadow:0 10px 30px #0009}
.legacy-tv-caller label{display:block;margin:12px 0}.legacy-tv-caller input[type=checkbox]{width:18px;height:18px;vertical-align:middle}.legacy-tv-caller p{font-size:12px;margin:12px 0;color:#b6c6df}.legacy-tv-caller h2{font-size:18px;color:#ffe0a0;margin:0 0 12px}
.legacy-tv-caller section[hidden]{display:none}
