@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700;800;900&family=Montserrat:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #1F0A0E;
  --surface: #2D1117;
  --surface-2: #3A1820;
  --border: #5A2631;
  --text: #FFF7ED;
  --muted: #B8A9A0;
  --accent: #E8B84A;
  --accent-text: #1F0A0E;
  --accent-08: rgba(232, 184, 74, 0.08);
  --accent-18: rgba(232, 184, 74, 0.18);
  --accent-35: rgba(232, 184, 74, 0.35);
  --up: #4ADE80;
  --up-15: rgba(74, 222, 128, 0.15);
  --down: #FCA5A5;
  --down-15: rgba(252, 165, 165, 0.15);
  --ticker-bg: #E8B84A;
  --ticker-text: #1F0A0E;
  --font-scale: 1;
  --font-display: 'Cinzel', 'Playfair Display', Georgia, serif;
  --font-nums: 'Montserrat', system-ui, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg);
  font-family: var(--font-nums);
  color: var(--text);
  user-select: none;
}

.scr {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  color: var(--text);
  overflow: hidden;
  font-size: calc(1vmin * var(--font-scale, 1));
  background-color: var(--bg);
  background-image: 
    radial-gradient(ellipse 70% 55% at 50% -10%, var(--accent-18), transparent 70%),
    radial-gradient(ellipse 60% 50% at 50% 115%, var(--accent-08), transparent 70%);
}

/* Repeating Diamond Monogram Watermark Pattern (img04.png) */
.scr::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('/ekran/pattern.png');
  background-size: 7.5vmin 7.5vmin;
  background-repeat: repeat;
  background-position: center;
  opacity: 0.16;
  filter: brightness(2.2) contrast(1.15);
  pointer-events: none;
  z-index: 0;
}

.scr-header,
.scr-body,
.scr-ticker {
  position: relative;
  z-index: 1;
}

/* Luxury gold text gradient */
.scr-gold-text {
  background-image: linear-gradient(180deg, #fff7d6 0%, var(--accent) 45%, #b8860b 75%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.scr-gold {
  color: var(--accent);
}

.scr-divider {
  width: 9vmin;
  height: 1.3vmin;
  color: var(--accent);
  flex: none;
}

.scr-divider-wide {
  width: 60%;
  height: 2vmin;
}

/* HEADER */
.scr-header {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 1.2fr);
  align-items: center;
  gap: 2vmin;
  height: 13vh;
  padding: 0 3vw;
  background: linear-gradient(180deg, var(--surface), transparent);
}

.scr-header::after {
  content: "";
  position: absolute;
  left: 2vw;
  right: 2vw;
  bottom: 0;
  height: 0.22vmin;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.scr-header-side {
  display: flex;
  align-items: center;
  min-width: 0;
}

.scr-header-right {
  justify-content: flex-end;
  gap: 1.5vmin;
}

.scr-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5vmin;
  min-width: 0;
}

.scr-brand-logo {
  max-height: 7.5vh;
  max-width: 30vw;
  object-fit: contain;
}

.scr-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 5.6em;
  line-height: 1.05;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 45vw;
}

.scr-subtitle {
  display: flex;
  align-items: center;
  gap: 1.2vmin;
  color: var(--muted);
  font-size: 1.5em;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* CLOCK */
.scr-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
}

.scr-clock-time {
  font-family: var(--font-nums);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 5.8em;
  letter-spacing: 0.02em;
}

.scr-clock-date {
  color: var(--muted);
  font-size: 1.9em;
  font-weight: 500;
  text-transform: capitalize;
}

/* STATUS PILL */
.scr-pill {
  display: inline-flex;
  align-items: center;
  gap: 1vmin;
  padding: 0.8vmin 2vmin;
  border-radius: 999px;
  font-size: 2.1em;
  font-weight: 600;
  white-space: nowrap;
  border: 0.18vmin solid var(--accent-35);
  background: var(--accent-08);
  color: var(--text);
  transition: all 0.3s ease;
}

.scr-pill[data-kind=offline] {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
}

.scr-pill[data-kind=weekend] {
  background: linear-gradient(180deg, #fff1b8, var(--accent));
  color: var(--accent-text);
  border-color: var(--accent);
}

.scr-dot {
  width: 1.3vmin;
  height: 1.3vmin;
  border-radius: 50%;
  background: var(--up);
  box-shadow: 0 0 1.2vmin var(--up);
  animation: scr-pulse 2s ease-in-out infinite;
}

.scr-pill[data-kind=offline] .scr-dot {
  background: #f59e0b;
  box-shadow: 0 0 1vmin #f59e0b;
  animation: none;
}

@keyframes scr-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

/* BODY & AREAS */
.scr-body {
  display: grid;
  gap: 1.8vmin;
  padding: 1.8vmin 2.2vmin;
  min-height: 0;
  height: calc(87vh - 6vh);
}

.scr-body[data-preset=side-panel] {
  grid-template-areas: "main side";
  grid-template-columns: 2.4fr 1fr;
}

.scr-body[data-preset=full] {
  grid-template-areas: "main";
  grid-template-columns: 1fr;
}

.scr-area {
  position: relative;
  min-width: 0;
  min-height: 0;
  border-radius: 1.4vmin;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(45, 17, 23, 0.82), rgba(31, 10, 14, 0.90));
  backdrop-filter: blur(8px);
  border: 0.15vmin solid var(--accent-35);
  box-shadow: 
    inset 0 0 0 0.45vmin var(--bg),
    inset 0 0 0 0.58vmin var(--accent-18),
    0 1.5vmin 4vmin rgba(0, 0, 0, 0.4);
}

/* PRICE TABLE LIST */
.scr-list {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 1vmin 1.5vmin;
  justify-content: space-between;
}

.scr-row {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 6.5vmin minmax(0, 1.4fr) minmax(0, 1.15fr) minmax(0, 1.25fr) 12.5vmin;
  align-items: center;
  column-gap: 1.4vmin;
  padding: 0 1.6vmin;
  border-radius: 0.8vmin;
  transition: background-color 0.25s ease;
}

.scr-row + .scr-row:not(.scr-row-head) {
  border-top: 1px solid var(--accent-08);
}

.scr-row[data-zebra="true"] {
  background: var(--accent-08);
}

.scr-row-head {
  flex: 0.55 1 0;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
}

.scr-row-head > * {
  font-size: 1.7em;
  letter-spacing: 0.2em;
}

.scr-row-head > :nth-child(n+3) {
  text-align: right;
}

.scr-row-head > :nth-child(5) {
  text-align: center;
  letter-spacing: 0.08em;
}

.scr-row-art {
  width: 5.6vmin;
  height: 5.6vmin;
  filter: drop-shadow(0 0.3vmin 0.5vmin rgba(0, 0, 0, 0.6));
  display: flex;
  align-items: center;
  justify-content: center;
}

.scr-row-art svg {
  width: 100%;
  height: 100%;
}

.scr-row-name {
  font-weight: 700;
  font-size: 2.85em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
  color: #FFF7ED;
}

.scr-num {
  font-family: var(--font-nums);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 3.6em;
  text-align: right;
  white-space: nowrap;
  letter-spacing: -0.01em;
  color: #FFF7ED;
}

.scr-num.scr-gold {
  color: var(--accent);
  font-size: 3.85em;
  font-weight: 800;
  text-shadow: 0 0 1.2vmin rgba(232, 184, 74, 0.25);
}

/* Dynamic flash animation on price change */
@keyframes flash-green {
  0% { background-color: rgba(74, 222, 128, 0.35); }
  100% { background-color: transparent; }
}

@keyframes flash-red {
  0% { background-color: rgba(252, 165, 165, 0.35); }
  100% { background-color: transparent; }
}

.scr-row.flash-up {
  animation: flash-green 1.2s ease-out;
}

.scr-row.flash-down {
  animation: flash-red 1.2s ease-out;
}

/* CHANGE CHIP */
.scr-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4vmin;
  padding: 0.5vmin 1vmin;
  border-radius: 0.8vmin;
  font-family: var(--font-nums);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1.85em;
  white-space: nowrap;
  justify-self: stretch;
}

.scr-chip svg {
  width: 1.4vmin;
  height: 1.4vmin;
  flex: none;
}

.scr-chip[data-dir=up] {
  color: var(--up);
  background: var(--up-15);
}

.scr-chip[data-dir=down] {
  color: var(--down);
  background: var(--down-15);
}

.scr-chip[data-dir=flat] {
  color: var(--muted);
  background: var(--accent-08);
}

/* SIDE PANEL */
.scr-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2vmin;
  padding: 3vmin;
  text-align: center;
  position: relative;
}

.scr-panel-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.2vmin;
  height: 100%;
}

.scr-panel-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 5em;
  line-height: 1.15;
  letter-spacing: 0.02em;
}

.scr-panel-sub {
  color: var(--muted);
  font-size: 2.4em;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.scr-panel-media-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 1vmin;
}

.scr-panel-media {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  border-radius: 1vmin;
  box-shadow: 0 1vmin 3vmin rgba(0, 0, 0, 0.4);
}

/* TICKER (DUYURU BANDI) */
.scr-ticker {
  position: relative;
  height: 6vh;
  display: flex;
  align-items: center;
  background: var(--surface);
  border-top: 0.15vmin solid var(--accent-35);
  overflow: hidden;
  z-index: 10;
}

.scr-ticker-label {
  flex: none;
  height: 100%;
  padding: 0 3vmin 0 2.5vmin;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ticker-bg);
  color: var(--ticker-text);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.6em;
  letter-spacing: 0.18em;
  clip-path: polygon(0 0, 86% 0, 100% 100%, 0 100%);
  z-index: 2;
  box-shadow: 0.5vmin 0 1.5vmin rgba(0, 0, 0, 0.3);
}

.scr-ticker-window {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  display: flex;
  align-items: center;
}

.scr-ticker-track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  animation: scr-marquee var(--ticker-speed, 70s) linear infinite;
}

.scr-ticker-item {
  display: inline-flex;
  align-items: center;
  padding: 0 4vw;
  font-size: 1.8em;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.04em;
}

.scr-ticker-item::before {
  content: "♦";
  color: var(--accent);
  margin-right: 3vw;
  font-size: 1.1em;
}

@keyframes scr-marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Portrait TV Mode */
@media (orientation: portrait) {
  .scr-body[data-preset=side-panel] {
    grid-template-areas: "main" "side";
    grid-template-columns: 1fr;
    grid-template-rows: 2.2fr 1fr;
  }
  .scr-header {
    height: 11vh;
  }
  .scr-title {
    font-size: 4.4em;
  }
}
