:root {
  font-family: Inter, Arial, Helvetica, sans-serif;
  color: #edf5ff;
  background: #030b19;
  font-synthesis: none;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 82% -14%, #123d72 0, transparent 38%),
    radial-gradient(circle at 4% 48%, #0b2b51 0, transparent 42%), #030b19;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .34;
  background: linear-gradient(#518dc30b 1px, transparent 1px),
    linear-gradient(90deg, #518dc30b 1px, transparent 1px);
  background-size: 46px 46px;
}
.masthead, main { position: relative; z-index: 1; }
.masthead {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem max(1.2rem, 4vw);
  border-bottom: 1px solid #4381b745;
  background: #071426a8;
  box-shadow: 0 6px 32px #0005;
}
.masthead img { width: 3.5rem; height: 3.5rem; object-fit: contain; filter: drop-shadow(0 0 10px #3b94e766); }
.masthead span { font-size: .7rem; font-weight: 800; letter-spacing: .18em; color: #69baff; }
.masthead h1 { margin: .16rem 0 .08rem; font-size: clamp(1.55rem, 3vw, 3rem); letter-spacing: -.035em; }
.masthead p { margin: 0; color: #a9bed2; font-size: .88rem; }
main { max-width: 1080px; margin: auto; padding: 1.2rem; }
.statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .7rem;
  padding: .8rem 1rem;
  margin-bottom: 1rem;
  color: #dbeaff;
  background: #0b1c31d9;
  border: 1px solid #4381b752;
  border-radius: .75rem;
}
.statusbar strong { font-size: .9rem; letter-spacing: .03em; }
.statusbar span { font-size: .82rem; color: #7de8c0; text-align: right; }
.statusbar.session-open { justify-content: flex-end; padding-block: .45rem; background: transparent; border-color: transparent; box-shadow: none; }
.meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.2rem;
  padding: .75rem 1rem;
  background: linear-gradient(100deg, #0c2441, #0b1a31);
  border: 1px solid #4184bd55;
  border-radius: .75rem;
}
.meta p { margin: 0; color: #a9bed2; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; }
.meta strong { display: block; margin-top: .25rem; font-size: clamp(1.35rem, 2.5vw, 2.35rem); color: #fff; font-variant-numeric: tabular-nums; letter-spacing: .05em; }
.meta { padding: .4rem .7rem; margin-bottom: .55rem; background: transparent; border-color: transparent; }
.meta p { color: #829ab1; font-size: .7rem; letter-spacing: .03em; text-transform: none; }
.meta strong { display: inline; margin: 0 0 0 .35rem; font-size: 1rem; font-weight: 600; color: #a8bfd3; letter-spacing: 0; }
.meta #crash {
  padding: .65rem .9rem;
  border: 1px solid #ffad5b;
  border-radius: .55rem;
  background: #6a351d;
  color: #fff;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: none;
}
.market-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin: .4rem .25rem .65rem;
  border-bottom: 1px solid #387bb66b;
  padding: 0 .4rem .65rem;
}
.market-heading span { color: #65d5a3; font-size: .7rem; font-weight: 800; letter-spacing: .18em; }
.market-heading h2 { margin: .12rem 0 0; font-size: 1.25rem; letter-spacing: -.025em; }
.market-heading strong { color: #88a2bc; font-size: .7rem; white-space: nowrap; letter-spacing: .13em; }
.quotes { display: grid; gap: .7rem; }
.quote {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto minmax(30px, 1fr);
  align-items: center;
  gap: .15rem .75rem;
  overflow: hidden;
  min-width: 0;
  padding: .85rem 1rem .55rem;
  background: linear-gradient(120deg, #0c203b, #081a31 65%, #0a2340);
  border: 1px solid #3679b36b;
  border-left: 3px solid #6a98bd;
  border-radius: .7rem;
  box-shadow: inset 0 1px #ffffff0b, 0 8px 28px #0003;
}
.quote.up {
  border-left-color: #ff3154;
  background: linear-gradient(120deg, #341528, #101d39 42%, #081a31);
  box-shadow: inset 0 0 0 1px #ff31542e, 0 8px 28px #0003;
}
.quote.down {
  border-left-color: #1cf18b;
  background: linear-gradient(120deg, #103a33, #0c2534 42%, #081a31);
  box-shadow: inset 0 0 0 1px #1cf18b2b, 0 8px 28px #0003;
}
.quote.crash { border-color: #f2a55c; border-left-width: 3px; background: linear-gradient(120deg, #382418, #1f2236); }
.quote-name {
  min-width: 0;
  align-self: start;
  font-size: clamp(1rem, 1.7vw, 1.35rem);
  font-weight: 850;
  line-height: 1.2;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  letter-spacing: .015em;
}
.quote-price {
  align-self: start;
  justify-self: end;
  color: #f5faff;
  font-size: clamp(1.35rem, 2.5vw, 2.15rem);
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  letter-spacing: -.04em;
}
.quote.up .quote-price { color: #ff4b69; text-shadow: 0 0 18px #ff315466; }
.quote.down .quote-price { color: #2bf59a; text-shadow: 0 0 18px #1cf18b66; }
.quote-change { justify-self: end; align-self: end; text-align: right; font-size: .8rem; font-weight: 750; white-space: nowrap; }
.quote-change.up { color: #ff7b8f; }
.quote-change.down { color: #73ffb7; }
.quote-change.neutral { color: #9eb5c9; }
.quote-trend { align-self: end; min-width: 0; max-width: 240px; overflow: hidden; }
.quote-trend span { display: block; margin-bottom: .1rem; color: #6d8da9; font-size: .58rem; font-weight: 700; letter-spacing: .1em; }
.quote-trend svg { display: block; width: 100%; height: 34px; overflow: visible; color: #72a6d1; }
.quote.up .quote-trend svg { color: #ff3154; }
.quote.down .quote-trend svg { color: #1cf18b; }
.quote.crash .quote-trend svg { color: #ffb36d; }
.quote-trend polyline { fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.quote-trend circle { fill: currentColor; }
.crash-tag { display: inline-block; margin-top: .3rem; color: #ffbd76; font-size: .68rem; letter-spacing: .08em; }
.timestamps { margin: 1rem .3rem 0; color: #90a9c1; font-size: .78rem; line-height: 1.6; }
.warning { padding: .85rem 1rem; border: 1px solid #ff9b8d; border-radius: .6rem; background: #5c2629; color: white; font-weight: 700; }
.closed { padding: clamp(2rem, 8vw, 7rem) 1rem; text-align: center; background: #0b1c31; border: 1px solid #4381b752; border-radius: .9rem; }
.closed h2 { font-size: clamp(1.5rem, 4vw, 3rem); }
.closed p { color: #a9bed2; font-size: clamp(1.1rem, 2.3vw, 2rem); }
.pages { text-align: center; color: #86bee8; }
button { margin-left: auto; padding: .6rem .9rem; background: #102b4d; color: #eaf5ff; border: 1px solid #4a92c7; border-radius: .5rem; font: inherit; cursor: pointer; }
button:hover, button:focus-visible { background: #1b4774; outline-color: #8ad8ff; }

body[data-view=tv] { height: 100vh; overflow: hidden; }
body[data-view=tv] .masthead { height: 10vh; padding: 1vh 3vw; }
body[data-view=tv] .masthead img { width: 7vh; height: 7vh; }
body[data-view=tv] .masthead h1 { font-size: clamp(1.6rem, 3vw, 3.4rem); }
body[data-view=tv] main { max-width: none; height: 90vh; padding: 1.2vh 3vw; display: flex; flex-direction: column; }
body[data-view=tv] .statusbar { min-height: 4vh; margin: 0 0 .6vh; padding: .3vh .8vw; }
body[data-view=tv] #open { display: flex; flex-direction: column; flex: 1; min-height: 0; }
body[data-view=tv] #open[hidden] { display: none; }
body[data-view=tv] .meta { min-height: 4vh; margin: 0 0 .4vh; padding: .25vh 1vw; }
body[data-view=tv] .meta strong { font-size: clamp(1rem, 1.3vw, 1.4rem); }
body[data-view=tv] .market-heading { margin: 0 .2vw .6vh; padding-bottom: .4vh; }
body[data-view=tv] .market-heading h2 { font-size: clamp(1.1rem, 1.5vw, 1.9rem); }
body[data-view=tv] .quotes { flex: 1; min-height: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(0, 1fr)); gap: .7vh; }
body[data-view=tv] .quote { min-height: 0; padding: .6vh 1.1vw .35vh; }
body[data-view=tv] .quote-name { font-size: clamp(1.3rem, 2.1vw, 2.6rem); }
body[data-view=tv] .quote-price { font-size: clamp(1.6rem, 2.6vw, 3rem); }
body[data-view=tv] .quote-change { font-size: clamp(.85rem, 1.2vw, 1.4rem); }
body[data-view=tv] .quote-trend { max-width: 360px; }
body[data-view=tv] .quote-trend svg { height: clamp(22px, 3vh, 40px); }
body[data-view=tv] .quote-trend span { font-size: clamp(.5rem, .65vw, .8rem); }
body[data-view=tv] .timestamps, body[data-view=tv] .pages { margin: .4vh 0; font-size: clamp(.7rem, .9vw, 1rem); }
body[data-view=tv] .closed { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
body[data-view=tv] .closed[hidden] { display: none; }

@media (max-width: 750px) {
  .masthead { padding: .9rem 1rem; }
  .masthead img { width: 2.8rem; height: 2.8rem; }
  .masthead span { font-size: .56rem; }
  main { padding: .85rem; }
  .statusbar { align-items: flex-start; flex-direction: column; }
  .statusbar span { text-align: left; }
  .meta { align-items: flex-start; flex-direction: column; }
  .quote { padding: .85rem .8rem .55rem; }
  .quote-trend { max-width: 180px; }
  .quote-change { font-size: .72rem; }
  body[data-view=tv] .masthead span { display: none; }
  body[data-view=tv] .quotes { grid-template-columns: 1fr; grid-template-rows: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 751px) and (max-height: 649px) {
  body[data-view=tv] .quotes { grid-template-rows: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: no-preference) {
  .quote { transition: border-color .2s, background-color .2s; }
}
