/* Marginpad TV board. Sized in vw/vh so any TV (720p to 4K) fills the screen. */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: #060D0B; color: #E4EFEA; font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; overflow: hidden; }
[hidden] { display: none !important; }
b { font-weight: 700; }
.muted { color: #6F8A81; }

.screen { position: absolute; top: 0; right: 0; bottom: 0; left: 0; padding: 3vh 3vw; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 1vw; font-size: 2.2vw; font-weight: 600; color: #fff; }
.logo { width: 2.6vw; height: 2.6vw; border-radius: 0.7vw; background: #1F6F5C url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M14 44l12-13 9 8 15-18' fill='none' stroke='%233EE6A6' stroke-width='6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/80% no-repeat; }

/* Pairing */
#pair { align-items: center; justify-content: center; text-align: center; gap: 3vh;
  background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(62,230,166,0.16), transparent); }
.pair-lead { font-size: 2.4vw; color: #B9CEC6; }
.pair-code { font-size: 11vw; font-weight: 700; letter-spacing: 0.08em; color: #fff; font-variant-numeric: tabular-nums;
  text-shadow: 0 0 4vw rgba(62,230,166,0.35); }
.pair-steps { font-size: 1.8vw; line-height: 1.8; color: #B9CEC6; text-align: left; }
.pair-steps b { color: #3EE6A6; }
#pair-note { font-size: 1.3vw; }

/* Board */
.top { display: flex; justify-content: space-between; align-items: center; }
.top-right { display: flex; align-items: center; gap: 1.4vw; font-size: 1.4vw; }
.clock { color: #B9CEC6; font-variant-numeric: tabular-nums; }
.live { display: flex; align-items: center; gap: 0.5vw; color: #3EE6A6; }
.live i { width: 0.8vw; height: 0.8vw; border-radius: 50%; background: #3EE6A6; animation: blink 2s infinite; }
.live.off { color: #FFB547; } .live.off i { background: #FFB547; }
.btn { font: inherit; font-size: 1.1vw; color: #E4EFEA; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14);
  border-radius: 99px; padding: 0.6vh 1.2vw; cursor: pointer; }
.btn:focus { outline: 3px solid #3EE6A6; outline-offset: 3px; }
.btn.big { font-size: 2vw; padding: 2vh 3vw; background: #3EE6A6; color: #060D0B; border: 0; font-weight: 700; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4vw; margin-top: 3vh; }
.kpi { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07); border-radius: 1.4vw; padding: 2.2vh 1.6vw; }
.kpi span { display: block; font-size: 1.3vw; color: #8FA79F; }
.kpi b { display: block; margin-top: 0.6vh; font-size: 4.4vw; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.kpi.warn b { color: #FFB547; }

.middle { flex: 1; min-height: 0; display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.4vw; margin-top: 2.4vh; }
.panel { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); border-radius: 1.4vw; padding: 2.4vh 1.6vw; display: flex; flex-direction: column; min-height: 0; }
.panel h2 { font-size: 1.3vw; font-weight: 500; color: #8FA79F; }
.chart { flex: 1; display: flex; align-items: flex-end; gap: 0.5vw; margin-top: 2vh; min-height: 0; }
.chart .bar { flex: 1; border-radius: 0.4vw 0.4vw 0 0; background: linear-gradient(to top, #1F6F5C, #3EE6A6); min-height: 2px; transition: height 0.8s ease; position: relative; }
.chart .bar.now { background: linear-gradient(to top, #2B8A73, #8FF5C9); box-shadow: 0 0 1.5vw rgba(62,230,166,0.4); }
.chart .bar em { position: absolute; top: -2.6vh; left: 0; right: 0; text-align: center; font-style: normal; font-size: 1vw; color: #B9CEC6; }
.axis { display: flex; gap: 0.5vw; margin-top: 1vh; font-size: 0.9vw; color: #6F8A81; }
.axis span { flex: 1; text-align: center; }

.orders { list-style: none; margin-top: 1.4vh; overflow: hidden; flex: 1; }
.orders li { display: flex; justify-content: space-between; align-items: baseline; padding: 1.3vh 0; border-bottom: 1px solid rgba(255,255,255,0.06); font-size: 1.6vw; }
.orders li .who { color: #E4EFEA; }
.orders li .tag { font-size: 1.05vw; margin-left: 0.6vw; padding: 0.2vh 0.6vw; border-radius: 99px; border: 1px solid rgba(255,181,71,0.5); color: #FFB547; }
.orders li .tag.pre { border-color: rgba(62,230,166,0.5); color: #3EE6A6; }
.orders li .amt { font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.orders li.new { animation: newrow 3s ease; }
.orders .empty { color: #6F8A81; border: 0; }

.ticker-wrap { display: flex; align-items: center; gap: 1.2vw; margin-top: 2.4vh; font-size: 1.4vw; }
.ticker-label { color: #FFB547; font-weight: 600; white-space: nowrap; }
.ticker { flex: 1; overflow: hidden; white-space: nowrap; mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); }
.ticker-track { display: inline-block; padding-left: 100%; animation: ticker 40s linear infinite; color: #B9CEC6; }
.ticker-track span { margin-right: 3vw; }

.flash { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: center; background: rgba(6,13,11,0.82); animation: fadein 0.4s ease; }
.flash-card { text-align: center; padding: 6vh 6vw; border-radius: 3vw; border: 3px solid #3EE6A6; background: linear-gradient(135deg, #1F6F5C, #0D1714);
  box-shadow: 0 0 8vw rgba(62,230,166,0.35); animation: pop 0.6s cubic-bezier(0.2, 1.4, 0.4, 1); }
.flash-title { font-size: 3.6vw; font-weight: 600; color: #fff; }
.flash-amount { font-size: 12vw; font-weight: 800; color: #fff; line-height: 1.05; font-variant-numeric: tabular-nums; }
.flash-meta { font-size: 2.6vw; color: #8FF5C9; }

.gate { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6vh; pointer-events: none; }
.gate .btn { pointer-events: auto; }

body.no-money .money { filter: blur(1.4vw); }

@keyframes blink { 50% { opacity: 0.3; } }
@keyframes ticker { to { transform: translateX(-100%); } }
@keyframes fadein { from { opacity: 0; } }
@keyframes pop { from { transform: scale(0.85); opacity: 0; } }
@keyframes newrow { from { background: rgba(62,230,166,0.25); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
