/* TV rates board — fullscreen, no vertical scroll */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@600;700&family=Vazirmatn:wght@500;600;700;800&display=swap');

:root {
  --tv-bg: #070b14;
  --tv-panel: rgba(18, 28, 48, 0.92);
  --tv-line: rgba(212, 175, 55, 0.28);
  --tv-gold: #d4af37;
  --tv-gold-bright: #f0d78c;
  --tv-text: #eef3fb;
  --tv-muted: #9aabc4;
  --tv-up: #3dcf8e;
  --tv-down: #ef6b6b;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: var(--tv-bg);
  color: var(--tv-text);
  font-family: 'Vazirmatn', Tahoma, sans-serif;
}
body.tv-board {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  padding: clamp(1rem, 2.5vw, 2rem);
  display: flex;
  flex-direction: column;
  position: relative;
}
.tv-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}
.tv-glow-a {
  width: 42vw; height: 42vw;
  top: -12vw; right: -8vw;
  background: rgba(212, 175, 55, 0.18);
}
.tv-glow-b {
  width: 36vw; height: 36vw;
  bottom: -10vw; left: -6vw;
  background: rgba(59, 110, 180, 0.2);
}

/* برند / لوگو — دیزاین قبلی (بزرگ) */
.tv-brand {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 3vw, 2.5rem);
  flex-wrap: wrap;
  text-align: center;
  margin-bottom: clamp(1rem, 2.2vh, 1.75rem);
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--tv-line);
}
.tv-logo {
  height: clamp(96px, 18vh, 180px);
  width: auto;
  max-width: min(520px, 88vw);
  object-fit: contain;
  filter: drop-shadow(0 12px 40px rgba(212, 175, 55, 0.35));
}
.tv-brand-meta { min-width: 0; }
.tv-brand-meta h1 {
  margin: 0;
  font-family: 'Cormorant Garamond', 'Vazirmatn', serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--tv-gold-bright);
  letter-spacing: 0.04em;
  line-height: 1.15;
}
.tv-brand-meta p {
  margin: .35rem 0 0;
  color: var(--tv-muted);
  font-size: clamp(.9rem, 1.6vw, 1.1rem);
}
.tv-live {
  margin-top: .55rem;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: var(--tv-gold);
  font-weight: 700;
  font-size: clamp(.9rem, 1.3vw, 1.05rem);
}
.tv-live-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #3dcf8e;
  box-shadow: 0 0 12px #3dcf8e;
  animation: tvPulse 1.4s ease-in-out infinite;
}
@keyframes tvPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .55; transform: scale(.85); }
}

.tv-grid {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(.65rem, 1.2vw, 1.15rem);
  align-items: stretch;
}
.tv-col {
  background: var(--tv-panel);
  border: 1px solid var(--tv-line);
  border-radius: 16px;
  padding: .65rem .6rem .7rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.tv-col h2 {
  flex: 0 0 auto;
  margin: 0 0 .5rem;
  text-align: center;
  font-family: 'Cormorant Garamond', 'Vazirmatn', serif;
  font-size: clamp(1.2rem, 2.1vw, 1.7rem);
  color: var(--tv-gold-bright);
  font-weight: 700;
  letter-spacing: .03em;
  padding-bottom: .45rem;
  border-bottom: 1px solid var(--tv-line);
}

/* دو ستون — باکس کمی بزرگ‌تر، فضای ستون را پر می‌کند */
.tv-table {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 1fr;
  align-content: stretch;
  gap: .4rem .45rem;
  overflow: hidden;
}
.tv-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "name change"
    "price price";
  gap: .15rem .4rem;
  align-content: center;
  align-items: center;
  padding: .45rem .55rem .5rem;
  border-radius: 10px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.05);
  transition: background .25s, border-color .25s;
  min-height: 0;
  line-height: 1.2;
}
.tv-row:nth-child(even) { background: rgba(212, 175, 55, 0.06); }
.tv-row.is-flash { border-color: var(--tv-gold); background: rgba(212,175,55,.14); }
.tv-name {
  grid-area: name;
  font-weight: 700;
  font-size: clamp(0.98rem, 1.45vw, 1.3rem);
  line-height: 1.2;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tv-name small {
  display: inline;
  margin-right: .3rem;
  color: var(--tv-muted);
  font-weight: 600;
  font-size: .72em;
}
.tv-price {
  grid-area: price;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  text-align: right;
  direction: ltr;
  font-size: clamp(1.1rem, 1.85vw, 1.6rem);
  color: var(--tv-gold-bright);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tv-change {
  grid-area: change;
  font-size: clamp(.74rem, 1.05vw, .9rem);
  font-weight: 700;
  width: fit-content;
  justify-self: end;
  text-align: center;
  border-radius: 999px;
  padding: .12rem .42rem;
  line-height: 1.2;
}
.tv-change.up { color: var(--tv-up); background: rgba(61,207,142,.14); }
.tv-change.down { color: var(--tv-down); background: rgba(239,107,107,.14); }
.tv-change.flat { color: var(--tv-muted); background: rgba(255,255,255,.06); }

.tv-foot {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  margin-top: .55rem;
  text-align: center;
  color: var(--tv-muted);
  font-size: clamp(.75rem, 1vw, .9rem);
}

@media (max-width: 1100px) {
  .tv-table { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  body.tv-board { overflow: auto; height: auto; max-height: none; }
  .tv-grid { grid-template-columns: 1fr; }
  .tv-table { grid-template-columns: 1fr 1fr; }
  .tv-logo { height: clamp(88px, 14vh, 140px); }
}
@media (max-width: 560px) {
  .tv-table { grid-template-columns: 1fr; }
}
