:root {
  --bg: #0d0c0b;
  --panel: rgba(21, 19, 17, 0.94);
  --panel-solid: #151311;
  --line: rgba(217, 168, 69, 0.18);
  --gold: #d9a845;
  --gold-bright: #f3cc72;
  --gold-dim: rgba(217, 168, 69, 0.55);
  --text: #ece8e1;
  --muted: #9d958a;
  --danger: #e2735f;
  --radius: 8px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

.top, main, .foot { position: relative; z-index: 1; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(16px, 4vw, 40px);
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.brand strong { color: var(--gold); font-weight: 800; }

.account { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.account .who { color: var(--muted); max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn {
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  border-radius: var(--radius);
  padding: 12px 20px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn-gold { background: var(--gold); color: #17120a; }
.btn-gold:hover:not(:disabled) { background: var(--gold-bright); }
.btn-ghost { background: transparent; color: var(--text); border-color: rgba(236, 232, 225, 0.22); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-bright); }
.wide { width: 100%; }

.link-btn {
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
}
.link-btn:hover { color: var(--gold-bright); text-decoration-color: currentColor; }

:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }

.hero {
  min-height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  padding: 0 16px 8vh;
  position: relative;
}
/* Darkens the scene just behind the text so the subtitle stays readable over passing letters. */
.hero::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4vh;
  width: min(1100px, 120vw);
  height: 420px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(13, 12, 11, 0.82) 0%, rgba(13, 12, 11, 0.55) 45%, transparent 72%);
  pointer-events: none;
  z-index: -1;
}

h1 {
  font-size: clamp(34px, 6.4vw, 76px);
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: -0.035em;
  margin: 0 0 14px;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.6);
}

.sub {
  color: #bdb5aa;
  font-size: clamp(16px, 2vw, 19px);
  margin: 0 0 28px;
  max-width: 34em;
}

.paste {
  display: flex;
  gap: 10px;
  width: min(680px, 100%);
  padding: 8px;
  background: rgba(13, 12, 11, 0.78);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  backdrop-filter: blur(8px);
}
.paste.small { width: 100%; padding: 6px; }

input[type="text"], input[type="email"], input[type="password"] {
  font: inherit;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
}
input::placeholder { color: #6c665e; }

.status { min-height: 1.6em; margin: 18px 0 0; color: var(--gold-bright); font-weight: 500; }
.status.error { color: var(--danger); }
.allowance { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.panel {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 48px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
}

#result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 0;
  height: min(78vh, 820px);
  overflow: hidden;
}
#result.hidden, .hidden { display: none; }

.panel-media {
  padding: 24px;
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.player-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}
.player-frame iframe, #player { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.panel h2 { font-size: 22px; line-height: 1.3; margin: 20px 0 6px; font-weight: 700; letter-spacing: -0.01em; }
.meta { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.meta .src { color: var(--gold); font-weight: 600; }

.tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tools .btn { padding: 10px 14px; font-size: 14px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; cursor: pointer; margin-left: 4px; }
.toggle input { accent-color: var(--gold); width: 16px; height: 16px; }
.new-link { margin-top: 22px; font-size: 14px; }

.lines {
  list-style: none;
  margin: 0;
  padding: 16px 12px 40vh 12px;
  overflow-y: auto;
  scroll-behavior: smooth;
}
.lines li {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
  color: #cfc9c0;
  transition: background 0.2s, color 0.2s;
}
.lines.no-times li { grid-template-columns: 1fr; }
.lines.no-times .t { display: none; }
.lines li:hover { background: rgba(217, 168, 69, 0.07); }
.lines li.active { background: rgba(217, 168, 69, 0.14); color: var(--gold-bright); }
.lines .t { color: var(--gold-dim); font-size: 13px; font-variant-numeric: tabular-nums; padding-top: 2px; }
.lines li.active .t { color: var(--gold); }

.limit { max-width: 620px; padding: 36px 28px 28px; text-align: center; }
.limit h2 { margin-top: 0; }
.countdown-label { color: var(--muted); margin: 18px 0 0; font-size: 14px; }
.countdown {
  font-size: clamp(44px, 9vw, 72px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--gold);
  margin: 0 0 22px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 40px rgba(217, 168, 69, 0.35);
}
.soon { border-top: 1px solid var(--line); padding-top: 22px; margin-bottom: 18px; }
.soon p { color: #cfc9c0; margin: 0 0 14px; }
.form-msg { min-height: 1.4em; margin: 10px 0 0; font-size: 14px; color: var(--gold-bright); }
.form-msg.error { color: var(--danger); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(5, 4, 3, 0.62);
  backdrop-filter: blur(4px);
}
.modal.hidden { display: none; }
.card {
  position: relative;
  width: min(420px, 100%);
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 30px 26px 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.card h2 { margin: 0 0 6px; font-size: 22px; }
.card-sub { color: var(--muted); margin: 0 0 20px; font-size: 15px; }
.card label { display: block; font-size: 14px; color: var(--muted); margin: 12px 0 6px; }
.card input {
  width: 100%;
  border: 1px solid rgba(236, 232, 225, 0.16);
  border-radius: var(--radius);
  background: #0f0e0c;
}
.card input:focus { border-color: var(--gold); }
.card .btn { margin-top: 8px; }
.close {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 26px;
  line-height: 1;
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
}
.close:hover { color: var(--text); }
.switch { text-align: center; color: var(--muted); font-size: 14px; margin: 16px 0 0; }

.foot { text-align: center; color: #6c665e; font-size: 13px; padding: 0 16px 24px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

body.reading .hero { min-height: 0; padding: 4vh 16px 24px; justify-content: flex-start; }
body.reading .hero h1, body.reading .hero .sub { display: none; }

@media (max-width: 860px) {
  #result { grid-template-columns: 1fr; height: auto; }
  .panel-media { border-right: 0; border-bottom: 1px solid var(--line); }
  .lines { max-height: 70vh; padding-bottom: 30vh; }
}

@media (max-width: 520px) {
  .paste:not(.small) { flex-direction: column; }
  .paste .btn { width: 100%; }
  .account .who { display: none; }
  .panel-media { padding: 16px; }
}
