﻿/* TV composition using the shared Fortis white, royal purple and gold theme. */
:root { color-scheme: light; }
body { margin: 0; background: var(--black-0); }
.tv-screen {
  width: 100%; height: 100vh; height: 100dvh; min-height: 440px;
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto; background: #fff;
}
.tv-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 2vw; padding: 1.3vh 2.5vw; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.world-clocks { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center; gap: 2vw; width: 78%; max-width: 1500px; margin-inline: auto; }
.world-clock { min-width: 0; text-align: center; }
.flag { display: block; width: clamp(30px, 3.1vw, 84px); height: auto; aspect-ratio: 3 / 2; margin: 0 auto .4vh; }
.clock-city { display: block; color: var(--purple); font-size: clamp(10px, .85vw, 24px); line-height: 1.3; }
.clock-date { display: block; color: var(--text-muted); font-size: clamp(9px, .72vw, 22px); line-height: 1.3; white-space: nowrap; }
.world-clock time { display: block; color: var(--purple); font-size: clamp(10px, .91vw, 30px); line-height: 1.3; white-space: nowrap; font-variant-numeric: tabular-nums; }
#fullscreen-button { display: flex; align-items: center; justify-content: center; flex-shrink: 0; gap: .5vw; border: 1px solid var(--border-gold); border-radius: 8px; background: #fff; color: var(--purple); cursor: pointer; padding: 10px 12px; font: inherit; font-size: clamp(10px, .8vw, 24px); line-height: 1.3; }
#fullscreen-button:hover { background: #faf4e7; }
#fullscreen-button svg { width: 1.4vw; min-width: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.tv-board { --board-heading-height: clamp(32px, 5.4vh, 80px); min-height: 0; display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 1.1vw; padding: 1.4vh 1.25vw 0; }
.tv-sidebar { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 2fr) minmax(min-content, 1fr); grid-auto-rows: minmax(100px, auto); gap: 1.4vh; }
.spot-panel, .commodity-panel, .futures-panel { min-width: 0; min-height: 0; overflow: hidden; background: #fcf3dd; border: 1px solid var(--border-gold); border-radius: 12px; }
.spot-panel { display: grid; grid-template-rows: var(--board-heading-height) 1fr 1fr; }
.spot-heading, .spot-row { display: grid; grid-template-columns: 23% 1fr 1fr; gap: 1vw; align-items: center; padding-inline: 1.4vw; }
.spot-heading { background: linear-gradient(180deg, #4d1074, #230436); color: #fff; }
.spot-heading h1 { margin: 0; color: inherit; font: inherit; }
.spot-heading, .commodity-panel th { font-size: clamp(12px, 1.35vw, 38px); font-weight: 700; line-height: 1.2; }
.spot-heading > span { text-align: right; }
.currency-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 1.1em; height: 1.15em; padding-inline: .15em; border-radius: .2em; background: #ffd05c; color: var(--purple-deep); font-size: .8em; line-height: 1; vertical-align: .05em; }
.spot-row { margin-top: 0; }
.spot-row h2 { margin: 0; color: var(--purple); font-size: clamp(16px, 1.65vw, 50px); font-weight: 700; line-height: 1.12; overflow-wrap: anywhere; }
.spot-row h2 small { display: block; margin-top: .35vh; font-size: .42em; font-weight: 400; color: var(--text-muted); }
.spot-quote { container-type: inline-size; min-width: 0; overflow: hidden; border: 4px solid #ffd05c; border-radius: 12px; background: linear-gradient(135deg, #34094f, #290641); }
.spot-price { display: flex; align-items: center; justify-content: center; min-height: 6.3vh; margin: 0; padding: .65vh .2vw; font-size: clamp(20px, 2.6vw, 90px); font-weight: 700; line-height: 1.2; letter-spacing: -.025em; font-variant-numeric: tabular-nums; white-space: nowrap; background: transparent; color: #fff; }
.spot-price.up { background: var(--ok); }
.spot-price.down { background: var(--bad); }
.spot-range { display: block; padding: .45vh .1vw; border-top: 1px solid #ffffff75; color: #ff8496; font-size: clamp(8px, .7vw, 22px); font-weight: 700; line-height: 1.3; text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.spot-quote[data-side="ask"] .spot-range { color: #5def73; }
.spot-range span { color: #fff; }
.tv-contact { min-width: 0; padding: clamp(12px, 1.2vw, 32px); border: 1px solid var(--border-gold); border-radius: 12px; background: #fcf3dd; color: var(--purple); }
.tv-contact h2 { margin: 0 0 .6em; color: inherit; font-size: clamp(14px, 1.25vw, 34px); font-weight: 700; line-height: 1.2; }
.tv-contact dl { display: grid; gap: .45em; margin: 0; font-size: clamp(11px, 1vw, 28px); line-height: 1.4; }
.tv-contact dl > div { display: grid; grid-template-columns: 6em minmax(0, 1fr); gap: .5em; }
.tv-contact dt { font-weight: 700; }
.tv-contact dd { min-width: 0; margin: 0; }
.tv-contact a { color: inherit; text-decoration: none; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tv-contact a:hover { text-decoration: underline; }
.tv-contact address { margin: .8em 0 0; color: var(--text-muted); font-size: clamp(10px, .85vw, 24px); font-style: normal; line-height: 1.4; overflow-wrap: anywhere; }
.commodity-panel table { width: 100%; height: 100%; margin: 0; border-collapse: collapse; table-layout: fixed; }
.commodity-name { width: 32%; }
.commodity-weight { width: 20%; }
.commodity-price { width: 24%; }
.commodity-panel thead { height: var(--board-heading-height); background: linear-gradient(180deg, #4d1074, #230436); color: #fff; }
.commodity-panel th { padding: .5vh 1vw; background: transparent; color: inherit; text-align: left; }
.commodity-panel td { padding: .65vh 1vw; border-bottom: 1px solid var(--line); background: #fffefd; color: var(--purple); font-size: clamp(17px, 1.87vw, 54px); font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.commodity-panel tr:nth-child(even) td { background: #fffbf1; }
.commodity-panel td:nth-child(2) { font-size: clamp(14px, 1.55vw, 44px); font-weight: 400; color: #302439; }
.commodity-panel th:nth-child(n+3), .commodity-panel td:nth-child(n+3) { text-align: right; }
.commodity-panel tbody td:nth-child(n+3) { background: linear-gradient(105deg, #ffc33e, #ffd76c); font-variant-numeric: tabular-nums; white-space: nowrap; }
.commodity-panel td:nth-child(n+3) { color: #17130d; }
.commodity-panel td.up { color: var(--ok); }
.commodity-panel td.down { color: var(--bad); }
@media (min-width: 701px) {
  .commodity-panel tbody tr[data-scrip-id] td:first-child { font-size: clamp(15px, 1.6vw, 48px); }
}
.commodity-panel th small { margin-left: .15em; font-size: .6em; font-weight: 400; }
.row-currency { display: block; font-size: .45em; font-weight: 400; line-height: 1.3; }
.futures-panel { overflow: auto; }
.futures-panel table { width: 100%; height: 100%; table-layout: fixed; border-collapse: collapse; }
.futures-panel col:first-child { width: 40%; }
.futures-panel col:nth-child(n+2) { width: 30%; }
.futures-panel th { padding: .7vh .8vw; background: var(--purple-deep); color: #fff; font-size: clamp(10px, .95vw, 30px); text-align: left; }
.futures-panel td { padding: .7vh .8vw; border-bottom: 1px solid var(--line); background: #fffefd; color: var(--purple); font-size: clamp(12px, 1.3vw, 40px); font-weight: 700; overflow-wrap: anywhere; }
.futures-panel th:nth-child(n+2), .futures-panel td:nth-child(n+2) { text-align: right; font-variant-numeric: tabular-nums; }
.futures-panel td.up { color: var(--ok); }
.futures-panel td.down { color: var(--bad); }
.commodity-panel .placeholder-row td { background: transparent; color: var(--text-muted); font-weight: 400; text-align: center; font-size: clamp(14px, 1.5vw, 42px); }
.tv-footer { display: flex; align-items: center; justify-content: center; gap: 1.5vw; min-width: 0; min-height: 5vh; padding: .7vh 1.25vw; color: var(--purple); font-size: clamp(10px, 1.05vw, 30px); line-height: 1.4; }
.tv-announcement { flex: 1; min-width: 0; overflow: hidden; }
.tv-announcement-track { display: flex; width: max-content; }
.tv-announcement-track > span { display: block; flex: none; padding-right: 48px; white-space: nowrap; }
#feed-status { margin-left: auto; font-size: .83em; color: var(--text-muted); text-align: right; }
#feed-status[data-feed-state="error"], #feed-status[data-feed-state="partial"] { color: var(--bad); }
.no-script { position: fixed; inset: auto 0 0; z-index: 1000; margin: 0; padding: 1em; background: var(--purple-deep); color: #fff; text-align: center; }
[hidden] { display: none !important; }
@media (min-aspect-ratio: 21/9) {
  .tv-board { width: min(100%, 235vh); margin-inline: auto; }
  .spot-price { font-size: 7.5vh; }
}
@supports (font-size: 1cqi) {
  .spot-price { font-size: clamp(18px, calc(160cqi / var(--price-length, 8)), 112px); }
}
@media (min-width: 701px) and (orientation: portrait) {
  .tv-screen { height: auto; min-height: 100dvh; }
  .tv-board { grid-template-columns: 1fr; }
  .tv-sidebar { grid-template-rows: minmax(260px, auto) auto; }
  .spot-panel { min-height: 260px; }
  .commodity-panel { min-height: 420px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .tv-screen { height: auto; min-height: 100dvh; }
  .tv-board { min-height: 360px; }
}
@media (max-width: 700px) and (orientation: portrait) {
  .tv-screen { height: auto; min-height: 100vh; min-height: 100dvh; }
  .tv-toolbar { gap: 8px; padding: 14px 12px; }
  .world-clocks { flex: 1; width: auto; min-width: 0; gap: 6px; }
  .world-clock { flex: 1; }
  .flag { width: 30px; height: 20px; margin-bottom: 7px; }
  .world-clock time { font-size: 10px; white-space: nowrap; }
  .clock-city { font-size: 9px; }
  .clock-date { font-size: 8px; }
  #fullscreen-button { padding: 8px; }
  #fullscreen-button span { display: none; }
  .tv-board { grid-template-columns: 1fr; gap: 12px; padding: 12px 12px 0; }
  .tv-sidebar { grid-template-rows: minmax(260px, auto) auto; gap: 12px; }
  .spot-panel { min-height: 260px; grid-template-rows: 36px 1fr 1fr; }
  .spot-heading, .spot-row { padding-inline: 12px; gap: 8px; }
  .spot-heading { font-size: 12px; }
  .spot-row h2 { font-size: 19px; }
  .spot-quote { border-width: 3px; border-radius: 8px; }
  .spot-price { min-height: 50px; padding: 8px 1px; }
  .spot-range { font-size: 10px; padding: 4px 1px; }
  .commodity-panel { min-height: 360px; }
  .commodity-panel thead { height: 36px; }
  .commodity-panel th { font-size: 11px; padding: 8px; }
  .commodity-panel td { font-size: 15px; padding: 14px 8px; }
  .commodity-panel td:nth-child(2) { font-size: 13px; }
  .futures-panel th, .futures-panel td { padding: 10px 8px; }
  .tv-footer { flex-wrap: wrap; padding: 16px 12px; gap: 8px; font-size: 11px; }
  .tv-announcement { flex-basis: 100%; }
  #feed-status { font-size: 10px; text-align: center; }
}
@media (max-width: 359px) {
  .tv-toolbar { gap: 6px; padding-inline: 8px; }
  .world-clocks { gap: 3px; }
  .world-clock time { font-size: 9px; }
  .clock-city { font-size: 8px; }
  .commodity-panel th { font-size: 9px; padding-inline: 5px; }
  .commodity-panel td { font-size: 12px; padding-inline: 5px; }
  .commodity-panel td:nth-child(2) { font-size: 11px; }
  .spot-row h2 { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .tv-announcement-track { width: 100%; }
  .tv-announcement-track > span { white-space: normal; max-height: 2.8em; overflow: hidden; padding-right: 0; }
}
/* In fullscreen, clocks take the navigation's place beside the logo. */
.tv-fullscreen .tv-screen { grid-template-rows: auto minmax(0, 1fr) auto; }
.tv-fullscreen #mainNav, .tv-fullscreen .navbar-toggler { display: none !important; }
.tv-fullscreen .site-header .rate-container { width: 100%; max-width: none; padding-inline: 2vw; }
.tv-fullscreen .site-header .navbar { flex-wrap: nowrap; gap: 2vw; }
.tv-fullscreen .site-header .logo-img { width: auto; height: clamp(56px, 5.5vw, 150px); }
.tv-fullscreen .tv-toolbar { flex: 1; min-width: 0; gap: 1.5vw; padding: 8px 0; background: transparent; border: 0; }
.tv-fullscreen .world-clocks { flex: 1; width: auto; min-width: 0; max-width: none; gap: 1vw; }
.tv-fullscreen .flag { width: clamp(26px, 2.4vw, 56px); }
.tv-fullscreen .world-clock time { font-size: clamp(12px, 1.25vw, 36px); }
.tv-fullscreen #fullscreen-button { padding: 10px; }
.tv-fullscreen #fullscreen-button span { display: none; }
@media (max-width: 700px) and (orientation: portrait) {
  .tv-fullscreen .site-header .navbar { flex-wrap: wrap; gap: 4px; }
  .tv-fullscreen .tv-toolbar { flex-basis: 100%; }
  .tv-fullscreen .world-clocks { gap: 3px; }
  .tv-fullscreen .world-clock time { font-size: 10px; }
}
