/* blffd.tv — shared styles for the placeholder, help and RTT pages.
 *
 * TV browsers go back to Chromium 68 (Samsung 2020, LG webOS 5), so this stays
 * on a conservative baseline: no flex `gap`, no logical properties, no
 * `inset`, no `:is()`. Sizes are in rem off a viewport-scaled root, so the
 * same layout fills a 1920-wide TV, a 960-wide TV and a laptop alike.
 */

@font-face {
  font-family: "Cairo";
  src: url("/assets/cairo.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --bg: #0b0914;
  --surface: #130d26;
  --card: #1c1438;
  --surface-mid: #2d1b4e;
  --primary: #a855f7;
  --brand: #c026d3;
  --green: #58cc02;
  --gold: #ffc800;
  --pink: #ff4b4b;
  --orange: #ff9600;
  --ink: #ffffff;
  --muted: rgba(255, 255, 255, 0.72);
  --dim: rgba(255, 255, 255, 0.54);
  --line: rgba(255, 255, 255, 0.2);
}

/* 1920 CSS px wide → 24px; 960 → 12px. Capped so a phone or narrow laptop
   window stays readable. */
html {
  font-size: 1.25vw;
}
@media (max-width: 1100px) {
  html { font-size: 13.75px; }
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background-color: var(--bg);
  /* A faint glow over the BLFFD space art (the same file the TV stage uses). */
  background-image:
    radial-gradient(ellipse 60% 50% at 50% 40%, rgba(168, 85, 247, 0.16), rgba(11, 9, 20, 0) 70%),
    url("/assets/backdrop.webp");
  background-size: auto, cover;
  background-position: center, center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--ink);
  font-family: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--ink);
}

/* Overscan: TVs crop a few percent off each edge. Keep everything inside 5%. */
.screen {
  box-sizing: border-box;
  min-height: 100%;
  padding: 5vh 5vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.logo {
  width: 18rem;
  height: auto;
  margin-bottom: 1.5rem;
}

.kicker {
  margin: 0 0 0.6rem;
  color: var(--gold);
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.35em; /* Latin-only text: tracking breaks Arabic joins */
}

.title {
  margin: 0;
  font-size: 3.2rem;
  font-weight: 900;
  line-height: 1.25;
}

.title-en {
  margin: 0.4rem 0 0;
  font-size: 2rem;
  font-weight: 800;
  color: var(--muted);
}

.soon {
  display: inline-block;
  margin: 2.2rem 0 0;
  padding: 0.5rem 1.6rem;
  border-radius: 999px;
  background: var(--green);
  color: #0b1a00;
  font-size: 1.5rem;
  font-weight: 900;
}

.hint {
  margin: 1.8rem 0 0;
  max-width: 46rem;
  color: var(--muted);
  font-size: 1.15rem;
}

.hint span {
  display: block;
}

.foot {
  position: fixed;
  bottom: 4vh;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--dim);
  font-size: 0.9rem;
}

.foot a {
  color: var(--dim);
  text-decoration: none;
  padding: 0.3rem 0.8rem;
  border-radius: 0.5rem;
}

/* Remote-control focus must be visible from across a room. */
a:focus,
button:focus {
  outline: 0.3rem solid var(--gold);
  outline-offset: 0.25rem;
}

/* ── Help ───────────────────────────────────────────────────────────── */

.doc {
  box-sizing: border-box;
  max-width: 64rem;
  margin: 0 auto;
  padding: 5vh 5vw 10vh;
}

.doc h1 {
  margin: 0 0 2rem;
  font-size: 2.4rem;
  font-weight: 900;
  text-align: center;
}

.pair {
  display: flex;
  margin-bottom: 1.6rem;
  border-radius: 1rem;
  background: rgba(28, 20, 56, 0.85);
  border: 1px solid var(--line);
}

.pair > div {
  flex: 1 1 0;
  padding: 1.2rem 1.6rem;
}

.pair > div + div {
  border-left: 1px solid var(--line);
}

.pair h2 {
  margin: 0 0 0.4rem;
  font-size: 1.3rem;
  color: var(--gold);
}

.pair p {
  margin: 0;
  font-size: 1.05rem;
  color: var(--muted);
}

@media (max-width: 700px) {
  .pair { display: block; }
  .pair > div + div { border-left: 0; border-top: 1px solid var(--line); }
}

.back {
  text-align: center;
  margin-top: 2rem;
}

/* ── RTT probe ──────────────────────────────────────────────────────── */

.probe {
  box-sizing: border-box;
  max-width: 70rem;
  margin: 0 auto;
  padding: 4vh 5vw 8vh;
}

.probe h1 {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 900;
  text-align: center;
}

.probe .sub {
  margin: 0.3rem 0 1.6rem;
  text-align: center;
  color: var(--muted);
  font-size: 1.05rem;
}

.where {
  text-align: center;
  font-size: 1.2rem;
  margin-bottom: 1.4rem;
}

.where b {
  color: var(--gold);
}

table.results {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.1rem;
  background: rgba(28, 20, 56, 0.85);
  border-radius: 1rem;
  overflow: hidden;
}

.results th,
.results td {
  padding: 0.7rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.results th {
  color: var(--dim);
  font-weight: 700;
  font-size: 0.95rem;
}

.results td.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.good { color: var(--green); }
.ok { color: var(--gold); }
.slow { color: var(--orange); }
.bad { color: var(--pink); }

.actions {
  text-align: center;
  margin: 1.6rem 0;
}

button.run {
  font-family: inherit;
  font-size: 1.3rem;
  font-weight: 900;
  color: #0b1a00;
  background: var(--green);
  border: 0;
  border-radius: 999px;
  padding: 0.6rem 2.4rem;
  cursor: pointer;
}

button.run[disabled] {
  opacity: 0.6;
  cursor: default;
}

pre.report {
  direction: ltr;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
  padding: 1rem 1.2rem;
  border-radius: 0.8rem;
  background: rgba(0, 0, 0, 0.35);
  color: var(--muted);
  font-size: 0.85rem;
  font-family: Menlo, Consolas, monospace;
}
