:root {
  --bg: #0e1116;
  --panel: #171b22;
  --panel-2: #1f242d;
  --text: #e8edf4;
  --muted: #8d99ab;
  --accent: #3d8bfd;
  --accent-soft: rgba(61, 139, 253, 0.15);
  --danger: #ff6b6b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

header {
  padding: 14px 16px 8px;
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, var(--bg) 70%, rgba(14, 17, 22, 0.85));
  backdrop-filter: blur(8px);
  z-index: 5;
}

h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.status {
  margin-top: 3px;
  font-size: 13px;
  color: var(--muted);
}

/* ------------------------------------------------------------------ gate -- */
.gate {
  padding: 24px 16px;
}

.gate-card {
  background: var(--panel);
  border: 1px solid #2b323d;
  border-radius: 14px;
  padding: 22px 18px;
  text-align: center;
}

.gate-icon {
  font-size: 34px;
  line-height: 1;
  margin-bottom: 10px;
}

.gate-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}

.gate-text {
  margin: 0 0 16px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
}

/* ---------------------------------------------------------------- picker -- */
#picker { padding: 4px 16px 10px; }

.group { margin-bottom: 10px; }

.group-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  appearance: none;
  border: 1px solid #2b323d;
  background: var(--panel);
  color: var(--text);
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.08s;
}

.chip:active { transform: scale(0.97); }

.chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: #cfe0ff;
}

/* ---------------------------------------------------------------- viewer -- */
main { padding: 0 16px 24px; }

#player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #222833;
}

#frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

#placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  padding: 20px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.action {
  appearance: none;
  border: 1px solid #2b323d;
  background: var(--panel-2);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.action:active { background: #262d38; }

.quality.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: #cfe0ff;
}

.quality.unsupported {
  border-style: dashed;
  color: var(--muted);
}

.note {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.5;
  border: 1px solid #2b323d;
  background: var(--panel);
  color: var(--muted);
}

.note.ok {
  border-color: rgba(64, 192, 128, 0.45);
  background: rgba(64, 192, 128, 0.08);
  color: #9fe0bd;
}

.note.warn {
  border-color: rgba(255, 176, 64, 0.45);
  background: rgba(255, 176, 64, 0.08);
  color: #f0cf9a;
}

.hint {
  margin-top: 14px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}
