* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}
body {
  background-color: #000;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Vertical ticker placement (controlled by admin via settings.vertical_position) */
body.pos-top {
  align-items: flex-start;
}
body.pos-center {
  align-items: center;
}
body.pos-bottom {
  align-items: flex-end;
}

.tape {
  width: 100%;
  border-top: 1px solid #111;
  border-bottom: 1px solid #111;
  background: #000;
  overflow: hidden;
  white-space: nowrap;
}

.track {
  display: inline-flex;
  align-items: stretch;
  height: var(--card-height, 200px);
  /* The dynamic scroll speed is applied via inline style from JS but falls back here */
  animation: tape-scroll var(--scroll-speed, 140s) linear infinite;
  will-change: transform;
}

.track.pause-on-hover:hover { 
  animation-play-state: paused; 
}

@keyframes tape-scroll { 
  from { transform: translateX(0); } 
  to { transform: translateX(-50%); } 
}

/* For right-to-left scrolling direction if configured */
@keyframes tape-scroll-reverse {
  from { transform: translateX(-50%); } 
  to { transform: translateX(0); } 
}

.item {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: calc(var(--card-height, 200px) * 0.025); /* ~5px */
  padding: calc(var(--card-height, 200px) * 0.1) calc(var(--card-width, 340px) * 0.12); /* 20px 40px */
  min-width: var(--card-width, 340px);
  height: var(--card-height, 200px);
  margin-right: var(--card-gap, 0px);
  border-right: 1px solid #1c1c1e;
  flex-shrink: 0;
}

.price {
  color: #fff;
  font-size: calc(var(--card-height, 200px) * 0.25); /* ~50px */
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.chg {
  display: inline-flex;
  align-items: center;
  gap: calc(var(--card-height, 200px) * 0.03); /* ~6px */
  font-size: calc(var(--card-height, 200px) * 0.075); /* ~15px */
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.chg svg {
  width: calc(var(--card-height, 200px) * 0.07); /* ~14px */
  height: calc(var(--card-height, 200px) * 0.07); /* ~14px */
  flex-shrink: 0;
}

.up, .flat { color: #00e600; }
.down { color: #ff3232; }

.code {
  color: #fff;
  font-size: calc(var(--card-height, 200px) * 0.14); /* ~28px */
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-decoration: none;
}

.cname {
  color: #8e8e93;
  font-size: calc(var(--card-height, 200px) * 0.07); /* ~14px */
  font-weight: 400;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.psym {
  color: #636366;
  font-size: calc(var(--card-height, 200px) * 0.06); /* ~12px */
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
}

.loading {
  padding: 0 42px;
  font-size: calc(var(--card-height, 200px) * 0.075);
  color: #8e8e93;
  line-height: var(--card-height, 200px);
}

@media (max-width: 640px) {
  .track { height: calc(var(--card-height, 200px) * 0.85); }
  .item { 
    min-width: calc(var(--card-width, 340px) * 0.75); 
    padding: 16px 24px; 
    height: calc(var(--card-height, 200px) * 0.85); 
  }
  .loading { line-height: calc(var(--card-height, 200px) * 0.85); }
}

@media (prefers-reduced-motion: reduce) {
  .track { animation: none; }
}
