/* Flip: a market screen on newsprint. Big tabular price, a single ink
   line for the chart, headlines set in slab italic like a wire story, and
   one fat button that's green to buy and red to sell. */

/* on :root so the results window (outside .flip) gets them too */
:root { --up: #1d7f3a; --down: #c8382a; }
.flip { --game: #8fd19e; gap: 16px; }

.quote { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.who { display: flex; flex-direction: column; min-width: 0; }
.who b { font-size: 22px; font-weight: 800; letter-spacing: 0.01em; }
.who span { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.px { display: flex; flex-direction: column; align-items: flex-end; }
#price { font: 800 34px/1 var(--ui); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.chg { margin-top: 4px; padding: 2px 8px; border-radius: 4px; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; color: #fff; background: var(--gray); }
.chg.up { background: var(--up); }
.chg.down { background: var(--down); }

.chart-wrap { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 10px 0 0; }
.chart { display: block; width: 100%; height: 200px; overflow: visible; }
.chart .base { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.chart .line { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart .area { stroke: none; }
.chart .area.up { fill: rgba(29, 127, 58, 0.08); }
.chart .area.down { fill: rgba(200, 56, 42, 0.08); }
.chart .news-tick { stroke: #b9b9b9; stroke-width: 1; vector-effect: non-scaling-stroke; }
.clockbar { height: 4px; margin-top: 10px; background: var(--wash); }
.clockbar i { display: block; height: 100%; width: 0; background: var(--ink); }

/* markers are drawn in an HTML layer so they stay round */
.chart-wrap { position: relative; }
.mk {
  position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%;
  display: grid; place-items: center; font-size: 10px; font-weight: 800; color: #fff; pointer-events: none;
}
.mk.buy { background: var(--up); }
.mk.sell { background: var(--down); }
.mk.now { width: 10px; height: 10px; margin: -5px 0 0 -5px; background: var(--ink); }

/* a wire item: heavy rule on top, the kind of news named in its color */
.news { min-height: 92px; padding: 10px 0 12px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule); }
.news-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.news-label b { font-weight: 700; }
.news.good .news-label b { color: var(--up); }
.news.bad .news-label b { color: var(--down); }
.news.rumor .news-label b { color: #9a7a10; }
.headline { margin: 4px 0 0; font: italic 600 21px/1.2 var(--slab); }
.news.fresh .headline { animation: wire 0.35s var(--ease); }
@keyframes wire { from { opacity: 0; transform: translateY(6px); } }

.book { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; }
.book div { display: flex; flex-direction: column; }
.book span { font-size: 13px; color: var(--muted); }
.book b { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.book b.up { color: var(--up); }
.book b.down { color: var(--down); }

.trade {
  width: 100%; height: 64px; border: 0; border-radius: 999px; cursor: pointer; touch-action: manipulation;
  font: 800 22px var(--ui); letter-spacing: 0.01em; color: #fff; background: var(--ink);
}
.trade.buy { background: var(--up); }
.trade.sell { background: var(--down); }
.trade:active { transform: scale(0.985); }
.trade:disabled { background: #e6e6e6; color: #9a9a9a; cursor: default; transform: none; }

/* results */
.res-ret { margin: 0; text-align: center; font: 700 48px/1 var(--slab); }
.res-ret.up { color: var(--up); }
.res-ret.down { color: var(--down); }
.res-chart { display: block; width: 100%; height: 90px; margin: 14px 0 6px; }
.res-chart .line { fill: none; stroke: var(--ink); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.res-chart .b { fill: var(--up); }
.res-chart .s { fill: var(--down); }
.cmp { margin: 8px 0 18px; border-top: 1px solid var(--rule); }
.cmp div { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: 15px; }
.cmp b { font-variant-numeric: tabular-nums; }

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