:root {
  color-scheme: dark;
  --ink: #f2f5ec;
  --muted: #8d9892;
  --acid: #d8ff3e;
  --panel: #101517;
  --line: rgba(255, 255, 255, 0.12);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

.auth-gate {
  position: fixed;
  z-index: 1000;
  inset: 0;
  padding: 24px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 60% 20%, rgba(216,255,62,.12), transparent 28rem),
    #070a0b;
}
.auth-card {
  width: min(440px, 100%);
  padding: 34px;
  border: 1px solid #30383b;
  border-radius: 6px;
  background: #101517;
  box-shadow: 0 30px 100px #000b;
}
.auth-kicker { color: var(--acid); font: 700 10px "SFMono-Regular", monospace; letter-spacing: .18em; }
.auth-card h1 { margin: 14px 0 10px; font-size: 38px; letter-spacing: -.04em; }
.auth-card p { color: var(--muted); line-height: 1.65; font-size: 13px; }
.auth-card form { width: 100%; margin-top: 24px; display: grid; gap: 10px; }
.auth-card input { height: 52px; padding: 0 15px; font-size: 15px; letter-spacing: normal; }
.auth-card form button { min-height: 50px; flex: none; }
.auth-tabs { margin-top: 24px; padding: 3px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; background: #080b0c; }
.auth-tabs button { min-height: 38px; flex: none; color: #8d9892; background: transparent; }
.auth-tabs button.active { color: #111607; background: var(--acid); }
.auth-message { min-height: 22px; color: #ff8d84 !important; }
.auth-link { width: 100%; min-height: 38px; margin-top: 14px; flex: none; color: #aab2ad; background: transparent; }
.campaign-list { display: grid; gap: 8px; }
.campaign-list div { padding: 11px; display: grid; gap: 4px; border: 1px solid #344034; background: #0b100c; }
.campaign-list b { color: var(--acid); font-size: 13px; }
.campaign-list span, .campaign-list small { color: #aeb8b0; font-size: 11px; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 72% 18%, rgba(216, 255, 62, 0.11), transparent 24rem),
    linear-gradient(135deg, #0b1012, #050607 72%);
  font-family: "Avenir Next", "PingFang SC", sans-serif;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

main { min-height: 100vh; }

.pair-panel {
  width: min(1120px, calc(100vw - 64px));
  min-height: 100vh;
  margin: auto;
  padding: 54px 0 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.brand {
  position: absolute;
  top: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.28em;
}

.brand-mark {
  width: 29px;
  height: 18px;
  display: inline-block;
  border: 2px solid var(--acid);
  border-radius: 100% 0 100% 0;
  transform: rotate(-12deg);
  box-shadow: inset 0 0 10px rgba(216, 255, 62, 0.4), 0 0 18px rgba(216, 255, 62, 0.15);
}
.account-nav {
  position: absolute;
  top: 38px;
  right: 0;
  align-items: stretch;
  display: flex;
  gap: 8px;
}
.deyes-account-status {
  min-width: 136px;
  padding: 7px 12px;
  display: grid;
  align-content: center;
  gap: 2px;
  color: #dce3de;
  border: 1px solid #3a443e;
  border-radius: 3px;
  background: #101517;
  line-height: 1.15;
  cursor: pointer;
}
.deyes-account-status span {
  max-width: 180px;
  overflow: hidden;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.deyes-account-status small {
  color: var(--acid);
  font: 700 9px "SFMono-Regular", Consolas, monospace;
}
.expiry-reminder { position: fixed; z-index: 1200; top: 18px; left: 50%; width: min(560px, calc(100% - 32px)); padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 20px; transform: translateX(-50%); color: #101406; border: 1px solid #ebff94; background: var(--acid); box-shadow: 0 18px 70px #000b; }
.expiry-reminder div { display: grid; gap: 3px; }
.expiry-reminder b { font-size: 13px; }
.expiry-reminder span { font-size: 11px; }
.expiry-reminder button { min-width: 30px; padding: 0; flex: none; color: #101406; border: 0; background: transparent; font-size: 24px; }
.account-nav a,
.account-nav button,
.tool-link {
  min-width: 0;
  padding: 10px 13px;
  flex: none;
  color: #aeb7b1;
  border: 1px solid #30383b;
  border-radius: 3px;
  background: #101517;
  font-size: 11px;
  text-decoration: none;
}

.eyebrow {
  color: var(--acid);
  font: 700 11px/1 "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.22em;
  margin-bottom: 24px;
}

h1 {
  max-width: 800px;
  margin: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(56px, 8vw, 112px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.07em;
}

.lead {
  max-width: 520px;
  color: var(--muted);
  margin: 36px 0 44px;
  font-size: 17px;
  line-height: 1.75;
}

form { width: min(760px, 100%); }
label {
  display: block;
  color: var(--muted);
  margin-bottom: 10px;
  font: 700 11px/1 "SFMono-Regular", monospace;
  letter-spacing: 0.18em;
}

.code-row { display: flex; gap: 12px; }

input {
  width: 100%;
  height: 78px;
  padding: 0 26px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 2px;
  outline: none;
  background: rgba(255, 255, 255, 0.035);
  font: 500 34px/1 "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.3em;
  transition: border-color 180ms, background 180ms;
}

input:focus {
  border-color: var(--acid);
  background: rgba(216, 255, 62, 0.04);
}

button {
  flex: 0 0 210px;
  border: 0;
  border-radius: 2px;
  color: #111607;
  background: var(--acid);
  font: 800 15px/1 "Avenir Next", sans-serif;
  cursor: pointer;
  transition: transform 160ms, filter 160ms;
}

button:hover { filter: brightness(1.08); transform: translateY(-2px); }
button:active { transform: translateY(0); }

.status {
  min-height: 20px;
  color: var(--muted);
  margin-top: 14px;
  font-size: 12px;
}
.status.error { color: #ff847c; }

.steps {
  width: min(760px, 100%);
  margin-top: 52px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.steps div { display: flex; gap: 13px; align-items: baseline; }
.steps b { color: var(--acid); font: 600 10px "SFMono-Regular", monospace; }
.steps span { color: #bbc3be; font-size: 12px; }

.viewer-panel {
  min-height: 100vh;
  position: relative;
  background: #000;
}

.viewer-panel video {
  width: 100vw;
  height: 100vh;
  object-fit: contain;
}

.viewer-top, .viewer-bottom {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  padding: 30px 36px;
}

.viewer-top {
  top: 0;
  justify-content: space-between;
  background: linear-gradient(#000b, transparent);
}

.brand.compact { position: static; font-size: 11px; }
.brand.compact .brand-mark { width: 23px; height: 14px; }

.live-pill {
  padding: 9px 12px;
  border: 1px solid #ffffff28;
  background: #0008;
  backdrop-filter: blur(14px);
  font: 700 10px "SFMono-Regular", monospace;
  letter-spacing: 0.12em;
}

.live-pill i {
  width: 7px;
  height: 7px;
  margin-right: 7px;
  display: inline-block;
  border-radius: 50%;
  background: #ff4d4d;
  box-shadow: 0 0 12px #ff4d4d;
}

.live-pill span { color: var(--acid); margin-left: 8px; }

.viewer-bottom {
  bottom: 0;
  gap: 40px;
  background: linear-gradient(transparent, #000d);
  padding-top: 80px;
}

.viewer-bottom > div:first-child {
  display: flex;
  flex-direction: column;
}
.meta-label { color: #9aa29d; font-size: 10px; letter-spacing: 0.12em; }
#activeCode { margin-top: 3px; font: 600 21px "SFMono-Regular", monospace; letter-spacing: 0.18em; }
.stats { display: flex; gap: 18px; color: #c2c9c5; font-size: 12px; }
.icon-button {
  width: 42px;
  height: 42px;
  flex: none;
  margin-left: auto;
  color: white;
  border: 1px solid #ffffff40;
  border-radius: 50%;
  background: #0007;
  font-size: 24px;
}

.waiting {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: radial-gradient(circle, #182119, #050706 62%);
}
.waiting strong { font-family: "Songti SC", serif; font-size: 22px; }
.waiting small { color: var(--muted); }
.radar {
  width: 76px;
  height: 76px;
  margin-bottom: 20px;
  border: 1px solid var(--acid);
  border-radius: 50%;
  animation: pulse 1.8s ease-out infinite;
}

@keyframes pulse {
  0% { opacity: 0.9; transform: scale(0.55); box-shadow: 0 0 0 0 rgba(216,255,62,.3); }
  100% { opacity: 0.2; transform: scale(1.15); box-shadow: 0 0 0 38px rgba(216,255,62,0); }
}

@media (max-width: 700px) {
  .pair-panel { width: calc(100vw - 36px); padding-top: 100px; justify-content: flex-start; }
  .brand { top: 28px; }
  h1 { font-size: 52px; margin-top: 30px; }
  .lead { margin: 24px 0 30px; }
  .code-row { flex-direction: column; }
  button { flex-basis: 62px; }
  input { height: 70px; }
  .steps { gap: 10px; }
  .steps div { flex-direction: column; gap: 5px; }
  .viewer-top, .viewer-bottom { padding-left: 18px; padding-right: 18px; }
  .stats { display: none; }
}

/* Capture console */
.viewer-panel {
  height: 100vh;
  min-height: 680px;
  overflow: hidden;
  background: #080b0d;
}

.console-header {
  height: 62px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #293034;
  background: #121719;
}

.console-title,
.console-tools,
.console-tools label {
  display: flex;
  align-items: center;
}

.console-title { gap: 24px; }
.brand.compact { position: static; }
.session-tag {
  color: #7f8a84;
  font: 600 10px "SFMono-Regular", monospace;
  letter-spacing: .12em;
}
.session-tag b { color: var(--acid); margin-left: 8px; letter-spacing: .18em; }

.console-tools { gap: 8px; }
.tool-link { padding: 11px 12px; }
.console-tools label {
  height: 34px;
  gap: 7px;
  margin: 0;
  padding-left: 10px;
  color: #8f9994;
  border: 1px solid #30383b;
  border-radius: 3px;
  background: #0b0f10;
  font: 600 10px "SFMono-Regular", monospace;
  letter-spacing: .06em;
}

.console-tools select {
  height: 32px;
  padding: 0 26px 0 8px;
  color: #e8eee9;
  border: 0;
  border-left: 1px solid #30383b;
  outline: 0;
  background: #171d1f;
}

.tool-button {
  height: 34px;
  min-width: 88px;
  flex: none;
  padding: 0 13px;
  color: #111607;
  border: 0;
  border-radius: 3px;
  background: var(--acid);
  font-size: 11px;
}
.tool-button.danger { color: #ff9c94; border: 1px solid #673934; background: #241413; }

.console-body {
  height: calc(100vh - 62px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 410px;
}

.capture-board {
  position: relative;
  min-width: 0;
  padding: 20px;
  overflow: auto;
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    #0b0f11;
  background-size: 30px 30px;
}

.board-heading {
  margin-bottom: 16px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}
.board-heading .eyebrow { margin: 0 0 6px; font-size: 9px; }
.board-heading h2 {
  margin: 0;
  font-family: "Songti SC", serif;
  font-size: 24px;
}
.board-stats { display: flex; gap: 20px; color: #88928d; font-size: 11px; }
.board-stats span { display: flex; align-items: center; gap: 7px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 10px var(--acid); }

.snapshot-grid {
  --columns: 4;
  display: grid;
  grid-template-columns: repeat(var(--columns), minmax(150px, 1fr));
  gap: 8px;
}

.snapshot-card {
  position: relative;
  min-height: 180px;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid #283034;
  border-radius: 4px;
  background: #151b1e;
  cursor: zoom-in;
  animation: captureIn 300ms ease both;
}
.snapshot-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.snapshot-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 54%, #000c);
}
.snapshot-index,
.snapshot-meta {
  position: absolute;
  z-index: 1;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
}
.snapshot-index { top: 9px; color: white; font: 700 10px "SFMono-Regular", monospace; }
.snapshot-index b { padding: 3px 6px; color: #111607; border-radius: 10px; background: var(--acid); }
.snapshot-meta { bottom: 9px; align-items: flex-end; color: #dce2de; font-size: 10px; }
.snapshot-meta span:last-child { color: #89928d; font-family: "SFMono-Regular", monospace; }

.empty-board {
  position: absolute;
  inset: 100px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #707a75;
  border: 1px dashed #2b3336;
}
.empty-board[hidden] { display: none; }
.empty-board strong { margin-top: 18px; color: #afb7b2; }
.empty-board small { margin-top: 7px; }
.empty-eye { width: 48px; height: 30px; border: 1px solid #63705f; border-radius: 100% 0 100% 0; transform: rotate(-12deg); }

.monitor-rail {
  padding: 12px;
  overflow: auto;
  border-left: 1px solid #293034;
  background: #111618;
}
.connection-card {
  min-height: 72px;
  padding: 13px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 5px 12px;
  border: 1px solid #2b3336;
  border-radius: 4px;
  background: #0b0f10;
}
.connection-card .live-pill { grid-row: span 2; }
.connection-card strong { font-size: 12px; }
.connection-card small { color: #77817c; font-size: 10px; }

.monitor-card {
  position: relative;
  width: 100%;
  height: 276px;
  min-width: 0;
  margin-top: 10px;
  display: block;
  overflow: hidden;
  color: white;
  border: 1px solid #30383b;
  border-radius: 4px;
  background: #050707;
  cursor: pointer;
}
.monitor-card.active { border-color: var(--acid); box-shadow: 0 0 0 1px #d8ff3e38; }
.monitor-card video,
.monitor-card img { width: 100%; height: 100%; object-fit: contain; background: #000; }
.monitor-shade { position: absolute; inset: 0; background: linear-gradient(#0007, transparent 32%, transparent 65%, #000b); pointer-events: none; }
.monitor-label { position: absolute; z-index: 2; top: 11px; left: 12px; font-size: 11px; }
.monitor-label i { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: #6d7772; }
.monitor-card.active .monitor-label i { background: #ff5149; box-shadow: 0 0 8px #ff5149; }
.monitor-label b { margin-left: 7px; color: var(--acid); font: 600 9px "SFMono-Regular", monospace; }
.monitor-action { position: absolute; z-index: 2; right: 11px; bottom: 10px; color: #97a09b; font-size: 9px; }
.monitor-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #d7ddd9; }
.monitor-placeholder[hidden] { display: none; }
.monitor-placeholder .radar { width: 40px; height: 40px; margin: 0 0 8px; }
.monitor-placeholder small { color: #77817c; }

.monitor-controls {
  margin-top: 10px;
  padding: 8px;
  display: flex;
  gap: 6px;
  border: 1px solid #2b3336;
  border-radius: 4px;
  background: #0b0f10;
}
.monitor-controls button {
  height: 32px;
  min-width: 64px;
  flex: none;
  color: #89938e;
  border: 1px solid #30383b;
  background: #151b1d;
  font: 700 9px "SFMono-Regular", monospace;
}
.monitor-controls button.active { color: #111607; border-color: var(--acid); background: var(--acid); }
.monitor-controls span { margin-left: auto; align-self: center; color: #8a948f; font-size: 10px; }

.recording-card {
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid #30383b;
  border-radius: 4px;
  background: #0b0f10;
}

.recording-preview {
  position: relative;
  height: 218px;
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(216, 255, 62, .08), transparent 55%),
    #050707;
}

.recording-preview video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
}

.recording-label,
.recording-state {
  position: absolute;
  z-index: 2;
  top: 11px;
  font: 700 10px "SFMono-Regular", monospace;
  letter-spacing: .06em;
}

.recording-label { left: 12px; }
.recording-label i {
  width: 7px;
  height: 7px;
  margin-right: 6px;
  display: inline-block;
  border-radius: 50%;
  background: #6d7772;
}
.recording-label b { margin-left: 8px; color: #dbe2dd; }
.recording-state { right: 12px; color: #8b9590; }
.recording-card.recording { border-color: #693835; }
.recording-card.recording .recording-label i {
  background: #ff5149;
  box-shadow: 0 0 9px #ff5149;
  animation: recordPulse 1.2s ease-in-out infinite;
}
.recording-card.recording .recording-state { color: #ff8f87; }
.recording-card.paused .recording-label i {
  animation: none;
  background: #ffb44d;
  box-shadow: 0 0 9px #ffb44d;
}

.recording-controls {
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  border-top: 1px solid #262e31;
}

.recording-controls button {
  min-width: 0;
  height: 34px;
  flex: none;
  color: #c1c9c4;
  border: 1px solid #30383b;
  background: #151b1d;
  font: 700 10px "SFMono-Regular", monospace;
}
.recording-controls button.record-primary {
  color: #fff;
  border-color: #823c37;
  background: #5d211e;
}
.recording-controls button:disabled {
  color: #59615d;
  border-color: #252b2d;
  background: #101416;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.recording-link {
  padding: 10px 12px;
  display: block;
  color: var(--acid);
  border-top: 1px solid #262e31;
  font: 600 10px "SFMono-Regular", monospace;
  text-decoration: none;
}

@keyframes recordPulse {
  50% { opacity: .35; }
}

.viewer-panel > .waiting { z-index: 10; }
.play-button {
  width: auto;
  min-width: 180px;
  min-height: 46px;
  margin-top: 18px;
  padding: 0 24px;
  flex: none;
  color: #111607;
  border: 0;
  border-radius: 2px;
  background: var(--acid);
  font-size: 13px;
  font-weight: 800;
}

@keyframes captureIn {
  from { opacity: 0; transform: scale(.96); }
}

@media (max-width: 980px) {
  .console-tools label { display: none; }
  .console-body { grid-template-columns: 1fr 320px; }
  .snapshot-grid { --columns: 3; }
}

@media (max-width: 720px) {
  .account-nav {
    top: 28px;
    max-width: calc(100% - 72px);
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .account-nav .deyes-account-status { order: -1; }
  .deyes-account-status { min-width: 116px; }
  .deyes-account-status span { max-width: 130px; }
}
