/* Webrause v2 — operator-console aesthetic.
   Monospace, hairline borders, signal-green accent, faint scanlines.
   Player is centered in a dark stage, scaled to fit on small screens. */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Fraunces:opsz,wght@9..144,400;9..144,700&display=swap');

:root {
  --bg:       #0d0f0e;
  --bg-soft:  #14171a;
  --bg-deep:  #07090a;
  --fg:       #d7dfda;
  --fg-dim:   #7a8480;
  --line:     #232a28;
  --line-hi:  #3a4540;
  --accent:   #c2ff3d;   /* signal green */
  --warn:     #ff7849;
  --mono:     'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --serif:    'Fraunces', Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
}

/* faint scanline overlay */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.012) 0 1px,
    transparent 1px 3px
  );
  z-index: 9999;
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh; /* avoid mobile URL-bar height jitter where supported */
}

/* -------- top bar -------- */

.bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
  z-index: 10;
}

.brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  white-space: nowrap;
}
.brand .dot {
  width: 8px; height: 8px;
  background: var(--fg-dim);
  border-radius: 50%;
  transition: background .2s, box-shadow .2s;
}
.brand .dot.connected {
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}
.brand .dot.error {
  background: var(--warn);
  box-shadow: 0 0 12px var(--warn);
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.brand .name  { color: var(--fg); }
.brand .slash { color: var(--line-hi); }
.brand .tag   { color: var(--fg-dim); font-weight: 400; letter-spacing: 0.04em; }

/* -------- address bar -------- */

.addr {
  flex: 1;
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  background: var(--bg);
  height: 34px;
  min-width: 0;
}
.addr .nav {
  width: 34px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--fg-dim);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.addr .nav:hover  { color: var(--accent); background: rgba(194,255,61,0.06); }
.addr .nav:active { background: rgba(194,255,61,0.14); }
.addr input[type="text"] {
  flex: 1; min-width: 0;
  border: 0; background: transparent;
  color: var(--fg);
  font-family: inherit; font-size: 13px;
  padding: 0 12px;
  outline: none;
  letter-spacing: 0.01em;
}
.addr input::placeholder { color: var(--fg-dim); }
.addr input:focus { background: rgba(194,255,61,0.04); }
.addr .go {
  border: 0;
  border-left: 1px solid var(--line);
  padding: 0 18px;
  background: var(--accent);
  color: var(--bg);
  font-family: inherit; font-weight: 700;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: filter .15s;
}
.addr .go:hover  { filter: brightness(1.1); }
.addr .go:active { filter: brightness(0.9); }

.status {
  color: var(--fg-dim);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  min-width: 80px;
  text-align: right;
}
.status.busy  { color: var(--accent); }
.status.error { color: var(--warn); }

/* -------- stage -------- */

#stage {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  background: var(--bg-deep);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* radial vignette behind the player */
#stage::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 0%,
    rgba(0,0,0,0.55) 100%
  );
}

/* -------- player -------- */

.player-wrap {
  position: absolute;
  inset: 0;
  background: white;
  flex-shrink: 0;
}

#player {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}
#player iframe {
  display: block;
  border: 0;
  width: 100% !important;
  height: 100% !important;
}
/* rrweb wraps the iframe in .replayer-wrapper and may give it the recorded
   pixel size; force it to fill so the working area is never a short strip. */
#player .replayer-wrapper {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  transform: none !important;
}
#player .replayer-mouse,
#player .replayer-mouse-tail { display: none !important; }

#overlay {
  position: absolute;
  inset: 0;
  cursor: default;
  outline: none;
  /* Faint focus ring when overlay is keyboard-focused so users know
     it'll capture keys. */
  box-shadow: inset 0 0 0 1px transparent;
  transition: box-shadow .15s;
}
#overlay:focus {
  box-shadow: inset 0 0 0 2px var(--accent);
}

/* -------- welcome -------- */

.welcome {
  max-width: 720px;
  padding: 24px 32px;
}
.welcome h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 28px;
}
.welcome h1 .line {
  display: block;
  opacity: 0;
  transform: translateY(8px);
  animation: rise .7s ease forwards;
}
.welcome h1 .line:nth-child(1) { animation-delay: .05s; }
.welcome h1 .line:nth-child(2) { animation-delay: .20s; color: var(--accent); }
.welcome h1 .line:nth-child(3) { animation-delay: .35s; }
@keyframes rise { to { opacity: 1; transform: none; } }

.welcome .lead {
  font-size: 14px;
  color: var(--fg);
  border-left: 2px solid var(--accent);
  padding: 4px 0 4px 14px;
  margin: 0 0 28px;
  max-width: 62ch;
}

.welcome .hints {
  list-style: none;
  padding: 0; margin: 0;
  display: grid;
  gap: 10px;
  font-size: 13px;
  color: var(--fg-dim);
}
.welcome .hints li {
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}
.welcome .hints li::before {
  content: ">";
  color: var(--accent);
  margin-right: 8px;
}
.welcome .hints b { color: var(--fg); font-weight: 700; }

/* -------- responsive -------- */

@media (max-width: 760px) {
  .bar { flex-wrap: wrap; }
  .status { order: 99; width: 100%; text-align: right; }
  .brand .tag { display: none; }
  .welcome { padding: 32px 20px; }
}
