/* ------------------------------------------------------------
   Share page — /v/<slug>/ and /e/<slug>/
   Standalone from the main site: no key visual, no scroll rig.
   Black room, one video, controls out of the way.
   ------------------------------------------------------------ */

:root {
  --accent: var(--viewer-accent);
  --display: "Orbitron", "Roboto", sans-serif;
  --ui: "Roboto", "Helvetica Neue", Arial, sans-serif;
  --line: var(--viewer-border);
  --dim: var(--viewer-muted);
  --bar: 54px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  min-width: 320px;
  background: #000;
  color: #fff;
  font-family: var(--ui);
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overflow: auto;
}
a { color: inherit; text-decoration: none; }
h1 { margin: 0; font: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- shell ---------- */
.share {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* ---------- top bar ---------- */
.bar {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--bar);
  flex: 0 0 auto;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}
.mark {
  font-family: var(--display);
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.12em;
  transform: skewX(-8deg);
  transform-origin: left center;
  white-space: nowrap;
}
.mark:hover { color: var(--accent); }
.bar_spacer { flex: 1 1 auto; }
.bar_link {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
}
.bar_link:hover { color: #fff; }

/* ---------- stage ---------- */
.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: #000;
}
.stage video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* unmute chip, sits over the top-left of the frame until it is used */
.sound {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid var(--accent);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(6px);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  transition: opacity 0.25s;
}
.sound[hidden] { display: none; }
.sound::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* quality menu, top-right of the frame */
.q {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  text-align: right;
}
.q_btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.q_btn:hover { border-color: var(--accent); color: var(--accent); }
.q_btn::after {
  content: "";
  width: 5px;
  height: 5px;
  margin-bottom: 2px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
}
.q_menu {
  margin-top: 6px;
  min-width: 168px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(10px);
  text-align: left;
}
.q_menu[hidden] { display: none; }
.q_menu button {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 9px 12px;
  font-size: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.q_menu button:last-child { border-bottom: 0; }
.q_menu button:hover { background: rgba(255, 255, 255, 0.07); }
.q_menu button[aria-checked="true"] { color: var(--accent); }
.q_menu span { color: var(--dim); font-variant-numeric: tabular-nums; }
.q_menu button[aria-checked="true"] span { color: inherit; }

/* ---------- bottom bar ---------- */
.info {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
}
.info_text { min-width: 0; }
.info_title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.info_sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.info_sub b { font-weight: 400; color: rgba(255, 255, 255, 0.75); }
.info_sub i { font-style: normal; opacity: 0.4; padding: 0 7px; }

.acts {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}
.act {
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}
.act:hover { border-color: #fff; }
.act_key { border-color: var(--accent); color: var(--accent); }
.act_key:hover { background: var(--accent); color: #000; }
.act.is_done { border-color: var(--accent); color: var(--accent); }

/* ---------- embed code drawer ---------- */
.embed {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  padding: 0 18px 14px;
}
.embed[hidden] { display: none; }
.embed input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #0a0a0a;
  color: rgba(255, 255, 255, 0.8);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
}

/* ---------- bare embed page ---------- */
body.embed_page { background: #000; }
body.embed_page .stage { height: 100%; }

@media (max-width: 700px) {
  :root { --bar: 48px; }
  .info { flex-wrap: wrap; gap: 12px; padding: 12px 14px; }
  .info_text { flex: 1 1 100%; }
  .acts { margin-left: 0; width: 100%; }
  .act { flex: 1 1 0; text-align: center; padding: 11px 8px; }
  .bar { padding: 0 14px; }
  .bar_link.pc_only { display: none; }
  .embed { padding: 0 14px 12px; }
}

/* Watch pages leave space for the credits and original file details. */
body:not(.embed_page) { background: var(--viewer-bg); color: var(--viewer-text); }
body:not(.embed_page) .share { max-width: 1280px; margin: 0 auto; background: var(--viewer-surface); color-scheme: dark; }
.bar .mark { color: var(--viewer-highlight); }
.act_key { background: var(--viewer-accent); color: #11172b; }
.act_key:hover { background: var(--viewer-highlight); border-color: var(--viewer-highlight); color: #11172b; }
body:not(.embed_page) .stage { flex: none; height: min(65vh, 740px); min-height: 280px; }
.info_title { font: 700 23px/1.3 var(--ui); letter-spacing: 0; text-transform: none; white-space: normal; }
.info_sub { white-space: normal; }
body.embed_page .share { height: 100%; min-height: 0; }
body.embed_page { overflow: hidden; }
@media (max-width: 700px) {
  body:not(.embed_page) .stage { height: calc(100vw * 9 / 16 + 82px); min-height: 250px; }
}
