/* H3MAX broadcast-TV base. Black, white, broadcast red. No gradients, no glass, no rounded anything. */

:root {
  --bg: #000;
  --panel: #0b0b0b;
  --panel2: #101010;
  --line: #262626;
  --line-strong: #3a3a3a;
  --ink: #ececec;
  --dim: #9a9a9a;
  --red: #ff2a18;
  --red-dim: #7a1208;
  --font-display: "Arial Narrow", "Helvetica Neue Condensed", "Arial", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--red); }

/* scanline texture, tv glass without gradients */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  opacity: .35;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='4' height='4'><rect width='4' height='1' fill='%23000' fill-opacity='0.35'/></svg>");
  background-size: 4px 4px;
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 20px;
  background: #050505;
  border-bottom: 1px solid var(--line-strong);
}

.bug {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: .14em;
  color: #fff;
  border: 1px solid var(--line-strong);
  padding: 2px 10px;
}
.bug:hover { color: var(--red); border-color: var(--red); }

.live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .22em;
  color: var(--red);
  border: 1px solid var(--red-dim);
  padding: 2px 8px;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  animation: blink 1.4s steps(2, start) infinite;
}
@keyframes blink { 50% { opacity: .15; } }

.topnav { margin-left: auto; display: flex; gap: 14px; }
.topnav a {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .18em;
  color: var(--dim);
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
}
.topnav a:hover, .topnav a[aria-current="page"] { color: #fff; border-bottom-color: var(--red); }

/* ---------- hero ---------- */
.hero {
  padding: 72px 20px 48px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(44px, 9vw, 108px);
  line-height: .95;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.hero-sub {
  max-width: 640px;
  margin: 22px auto 0;
  color: var(--dim);
  font-size: 18px;
}

.hero-cta { margin-top: 30px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 13px 26px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.btn:hover { color: #000; background: #fff; border-color: #fff; }

.btn-accent { background: var(--red); border-color: var(--red); color: #000; }
.btn-accent:hover { background: #fff; border-color: #fff; color: #000; }

.btn-block { width: 100%; }

/* ---------- ticker ---------- */
.ticker {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line-strong);
}
.ticker-item {
  flex: 1 1 auto;
  min-width: 130px;
  background: var(--panel);
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .12em;
  color: var(--dim);
  white-space: nowrap;
}
.ticker-item:first-child { color: #fff; box-shadow: inset 3px 0 0 var(--red); }

/* ---------- sections ---------- */
.section { padding: 44px 20px; max-width: 860px; margin: 0 auto; }
.section-band { max-width: none; background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-band .section { } /* band sections keep inner width */
.section-band > .section-title, .section-band > p, .section-band > .checklist, .section-band > a, .section-band > .chips { max-width: 860px; margin-left: auto; margin-right: auto; }

.section-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 900;
  letter-spacing: .08em;
  margin-bottom: 18px;
  text-transform: uppercase;
}
.hash { color: var(--red); margin-right: 6px; }

.section p { margin-bottom: 14px; color: #d4d4d4; }
.section p:last-child { margin-bottom: 0; }

.checklist { list-style: none; margin: 18px 0; }
.checklist li {
  padding: 10px 0 10px 26px;
  border-top: 1px solid var(--line);
  position: relative;
  color: #d4d4d4;
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 17px;
  width: 10px;
  height: 10px;
  background: var(--red);
}

.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.chip {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--dim);
  border: 1px dashed var(--line-strong);
  padding: 8px 12px;
}

.link-arrow {
  display: inline-block;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .14em;
  color: var(--red);
  border-bottom: 1px solid var(--red);
  padding-bottom: 2px;
}
.link-arrow:hover { color: #fff; border-color: #fff; }

/* ---------- faq ---------- */
.faq-item { border: 1px solid var(--line); border-left: 3px solid var(--red-dim); margin-bottom: 10px; background: var(--panel); }
.faq-item summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 700;
  letter-spacing: .02em;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--red); font-family: var(--font-mono); font-size: 18px; }
.faq-item[open] summary::after { content: "x"; }
.faq-item p { padding: 0 16px 14px; color: var(--dim); font-size: 15.5px; }

/* ---------- guide ---------- */
.wrap { max-width: 860px; margin: 0 auto; padding: 0 20px; }

.breadcrumb {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--dim);
  padding: 18px 0 0;
}

.hero-guide { padding-bottom: 30px; text-align: left; }
.hero-guide h1 { font-size: clamp(34px, 6vw, 64px); }
.hero-guide .hero-sub { margin-left: 0; }

.numbered { list-style: none; counter-reset: n; }
.numbered li {
  counter-increment: n;
  position: relative;
  padding: 12px 0 12px 44px;
  border-top: 1px solid var(--line);
  color: #d4d4d4;
}
.numbered li::before {
  content: counter(n, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 12px;
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--red);
}

.table-wrap { overflow-x: auto; border: 1px solid var(--line); }
.spec-table { width: 100%; border-collapse: collapse; background: var(--panel); }
.spec-table th {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .16em;
  color: var(--dim);
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-strong);
  background: #0d0d0d;
}
.spec-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec-table tr:last-child td { border-bottom: 0; }
.spec-table .mono { font-family: var(--font-mono); color: #fff; white-space: nowrap; font-size: 14px; }
.spec-table td:last-child { color: var(--dim); font-size: 15px; }

.prompt-block { border: 1px solid var(--line); border-left: 3px solid var(--red); margin: 14px 0; background: var(--panel); padding: 16px 18px; }
.prompt-name { font-family: var(--font-display); font-size: 19px; font-weight: 900; letter-spacing: .08em; }
.prompt-num { color: var(--red); font-family: var(--font-mono); font-size: 13px; letter-spacing: 0; }
.prompt-text { font-family: var(--font-mono); font-size: 14.5px; color: #fff; margin: 8px 0 6px; }
.prompt-note { font-size: 14px; color: var(--dim); }

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--line-strong);
  padding: 34px 20px 40px;
  text-align: center;
}
.footer-banner {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: .18em;
  color: var(--red);
  margin-bottom: 16px;
}
.footer-line { color: var(--dim); font-size: 13px; margin-bottom: 6px; }
.footer-mark { font-family: var(--font-mono); font-size: 11px; color: #555; margin-top: 14px; letter-spacing: .14em; }

/* ---------- gate ---------- */
.gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity .4s ease;
}
.gate-overlay[hidden] { display: none; }
.gate-overlay.gate-open { opacity: 0; }

.gate-box {
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--line-strong);
  border-top: 6px solid var(--red);
  background: #050505;
  padding: 34px 30px 26px;
}
.gate-bug {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: .18em;
  font-size: 15px;
  color: var(--dim);
  margin-bottom: 18px;
}
.gate-title { font-family: var(--font-display); font-size: 52px; font-weight: 900; letter-spacing: .06em; line-height: 1; }
.gate-line { color: var(--dim); margin: 12px 0 22px; font-size: 15px; }
.gate-form { display: flex; flex-direction: column; gap: 10px; }
.gate-field { font-family: var(--font-mono); font-size: 11px; letter-spacing: .18em; color: var(--dim); }
.gate-form input {
  background: #0a0a0a;
  border: 1px solid var(--line-strong);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 18px;
  letter-spacing: .1em;
  padding: 12px 14px;
  outline: none;
}
.gate-form input:focus { border-color: var(--red); }
.gate-error { color: var(--red); font-family: var(--font-mono); font-size: 13px; margin-top: 12px; }
.gate-foot { margin-top: 20px; font-size: 12px; color: #666; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- app layout ---------- */
.app-wrap {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 14px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 20px 40px;
}

.player-col { min-width: 0; }
.player-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #050505;
  border: 1px solid var(--line-strong);
}
.player-frame video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.connecting { font-family: var(--font-mono); font-size: 13px; letter-spacing: .3em; color: var(--red); animation: blink 1.2s steps(2, start) infinite; }
.preview-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .24em;
  color: var(--red);
  border: 1px solid var(--red);
  padding: 4px 10px;
  background: rgba(0,0,0,.75);
}

.now-playing {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  background: var(--panel);
  padding: 14px 16px;
}
.np-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .24em; color: var(--dim); display: flex; gap: 10px; align-items: center; }
.np-title { font-family: var(--font-display); font-size: 24px; font-weight: 900; letter-spacing: .04em; margin: 8px 0 6px; text-transform: uppercase; }
.np-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-family: var(--font-mono); font-size: 12.5px; }
.np-source { color: var(--dim); }
.np-link { color: var(--red); border-bottom: 1px solid var(--red-dim); }
.np-link:hover { color: #fff; border-color: #fff; }
.np-offline { color: var(--red); border: 1px solid var(--red-dim); padding: 2px 8px; }

/* chat */
.chat-col { display: flex; flex-direction: column; min-height: 420px; border: 1px solid var(--line); background: var(--panel); }
.chat-heading {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: .12em;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.chat-feed {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 340px;
}
.msg { max-width: 92%; padding: 8px 12px; font-size: 14.5px; border: 1px solid var(--line); }
.msg-time { display: block; font-family: var(--font-mono); font-size: 10px; color: #666; letter-spacing: .1em; margin-bottom: 3px; }
.msg.user { background: #0d0d0d; align-self: flex-end; border-color: var(--line-strong); }
.msg.system { color: var(--dim); align-self: flex-start; border-left: 2px solid var(--red-dim); background: #080808; }

.chat-form { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); }
.chat-form input {
  flex: 1;
  background: #0a0a0a;
  border: 1px solid var(--line-strong);
  color: #fff;
  font-size: 15px;
  padding: 11px 12px;
  outline: none;
}
.chat-form input:focus { border-color: var(--red); }
.chat-hint { padding: 0 14px 14px; font-size: 12px; color: #666; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .app-wrap { grid-template-columns: 1fr; }
  .topnav { display: none; }
  .hero { padding-top: 48px; }
}
@media (max-width: 480px) {
  body { font-size: 16px; }
  .gate-title { font-size: 40px; }
}