:root {
  --bg: #07140c;
  --bg-2: #0c2214;
  --line: rgba(255, 223, 0, 0.18);
  --text: #f4ffe8;
  --muted: #9bb89a;
  --accent: #ffdf00;
  --accent-ink: #002776;
  --green: #009c3b;
  --danger: #ff8b7a;
  --focus: #ffdf00;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: Sora, system-ui, sans-serif;
  line-height: 1.5;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(0, 156, 59, 0.28), transparent 55%),
    radial-gradient(700px 400px at 100% 0%, rgba(0, 39, 118, 0.35), transparent 50%),
    linear-gradient(180deg, #07140c, #04100a);
}

.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent 80%);
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

a {
  color: var(--accent);
}

.top,
main,
footer {
  width: min(920px, calc(100% - 2rem));
  margin-inline: auto;
}

body.is-room .top,
body.is-room main,
body.is-room footer {
  width: min(1180px, calc(100% - 1.5rem));
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.4rem 0 0;
}

.mode-nav {
  display: flex;
  gap: 0.9rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mode-nav a {
  color: var(--muted);
  text-decoration: none;
}

.mode-nav a:hover,
.mode-nav a[aria-current="page"] {
  color: var(--accent);
}

a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  padding: 0.8rem 1.15rem;
  border-radius: 999px;
}

a.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.yt-load {
  display: flex;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
}

.yt-load input {
  flex: 1;
  width: auto;
  text-transform: none;
  letter-spacing: 0;
}

.yt-stage {
  min-height: 0;
  cursor: default;
}

.yt-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 220px;
  background: #000;
}

.yt-frame iframe,
#yt-player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

body.is-room .top {
  padding-top: 0.9rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  font-size: 1.2rem;
  color: var(--text);
  text-decoration: none;
}

.logo img {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: 1px solid var(--line);
}

.tag,
.kicker,
.meta,
.status,
.hint,
.hud-meta,
footer {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

main {
  padding: 3.5rem 0 4rem;
}

body.is-room main {
  padding: 1.1rem 0 2.5rem;
}

h1 {
  margin: 0.4rem 0 1rem;
  font-size: clamp(2.4rem, 8vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.lede {
  max-width: 38rem;
  color: #c5ddd3;
  font-size: 1.05rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  padding: 0.8rem 1.15rem;
  border-radius: 999px;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.05);
}

button.ghost,
.hud-btn {
  background: rgba(7, 16, 24, 0.72);
  color: var(--text);
  border: 1px solid var(--line);
}

button.text {
  background: transparent;
  color: var(--accent);
  padding: 0;
  border-radius: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.join {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

input,
select {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
}

input {
  padding: 0.75rem 0.9rem;
  width: 9.5rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: "JetBrains Mono", monospace;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.error {
  color: var(--danger);
  margin-top: 1rem;
}

.room-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 0.85rem;
}

.keyline {
  display: flex;
  gap: 0.9rem;
  align-items: baseline;
  margin: 0.2rem 0 0;
}

#room-key {
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.12em;
}

.stage {
  position: relative;
  background: #02080c;
  border: 1px solid var(--line);
  border-radius: 18px;
  min-height: min(72vh, 740px);
  overflow: hidden;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.stage video {
  width: 100%;
  height: 100%;
  min-height: min(72vh, 740px);
  object-fit: contain;
  background: #000;
}

[hidden] {
  display: none !important;
}

.placeholder {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  gap: 0.35rem;
  text-align: center;
  padding: 2rem;
  background: #02080c;
  pointer-events: none;
}

.placeholder p {
  margin: 0;
}

#placeholder-title {
  font-size: 1.2rem;
  font-weight: 600;
}

.stage-hud {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 0.75rem;
  padding: 1.15rem 1.2rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
  opacity: 1;
  transition: opacity 0.25s ease;
}

.stage.is-idle .stage-hud {
  opacity: 0;
  pointer-events: none;
}

.hud-left,
.hud-right {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.live-pill {
  background: #e23d3d;
  color: #fff;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
}

.hud-btn {
  padding: 0.55rem 0.9rem;
  font-size: 0.88rem;
}

.volume {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.volume input[type="range"] {
  width: 7.5rem;
  height: 0.35rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  accent-color: var(--accent);
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
}

@media (max-width: 720px) {
  .volume input[type="range"] {
    width: 5.5rem;
  }
}

.room-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-top: 0.9rem;
}

.quality {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.quality label {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.quality label.check {
  cursor: pointer;
  user-select: none;
}

.quality input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.hint {
  margin: 0 0 0 auto;
}

.stage:fullscreen,
.stage:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  border: 0;
  border-radius: 0;
  background: #000;
}

.stage:fullscreen video,
.stage:-webkit-full-screen video {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
}

.stage:fullscreen.is-idle,
.stage:-webkit-full-screen.is-idle {
  cursor: none;
}

.ad-box {
  margin: 1.5rem auto 0;
  width: 100%;
  max-width: 100%;
}

.ad-box-footer {
  width: min(920px, calc(100% - 2rem));
  margin: 0 auto 1.5rem;
}

.ad-label {
  margin: 0 0 0.4rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.ad-slot {
  min-height: 90px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px dashed var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.ad-slot-wide {
  min-height: 100px;
}

.ad-box-room {
  margin: 0.75rem 0;
}

.ad-box-room .ad-slot {
  min-height: 80px;
}

body.is-room .ad-box-footer {
  display: none;
}

body:has(:fullscreen) .ad-box,
body:has(:-webkit-full-screen) .ad-box {
  display: none !important;
}

.seo-faq {
  margin-top: 3.5rem;
  max-width: 38rem;
}

.seo-faq h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
}

.seo-faq details {
  border-top: 1px solid var(--line);
  padding: 0.85rem 0;
}

.seo-faq summary {
  cursor: pointer;
  font-weight: 600;
}

.seo-faq p {
  margin: 0.55rem 0 0;
  color: #c5ddd3;
}

body.is-room .seo-faq {
  display: none;
}

.article {
  padding: 2.4rem 0 3rem;
}

.article h1 {
  font-size: clamp(2rem, 6.5vw, 3.4rem);
}

.article h2 {
  margin: 2.2rem 0 0.7rem;
  font-size: 1.25rem;
}

.article p,
.article li {
  color: #c5ddd3;
  max-width: 40rem;
}

.article .lede {
  font-size: 1.08rem;
  color: #d7f3d4;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.6rem 0 2rem;
}

.seo-list,
.seo-steps {
  margin: 0.4rem 0 1.2rem;
  padding-left: 1.2rem;
}

.seo-steps li,
.seo-list li {
  margin: 0.45rem 0;
}

.legal {
  padding-bottom: 3rem;
}

.legal h2 {
  margin: 1.75rem 0 0.6rem;
  font-size: 1.15rem;
}

.legal p {
  color: #d7eedb;
}

footer {
  padding-bottom: 2rem;
}

.discord-help {
  margin: 0.85rem 0 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 156, 59, 0.12);
}

.discord-help .keyline {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.discord-help input {
  flex: 1;
  min-width: 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.85rem;
}

body.in-discord .ad-box,
body.in-discord footer,
body.in-discord .mode-nav,
body.in-discord .tag,
body.in-discord .seo-faq {
  display: none !important;
}

body.in-discord .top,
body.in-discord main {
  width: min(1180px, calc(100% - 1rem));
}

body.in-discord .stage,
body.in-discord .stage video {
  min-height: 42vh;
}

@media (max-width: 720px) {
  .room-bar,
  .actions,
  .join,
  .room-actions,
  .quality {
    flex-direction: column;
    align-items: stretch;
  }

  input:not([type="checkbox"]),
  select {
    width: 100%;
  }

  .hint {
    margin-left: 0;
  }

  .stage,
  .stage video {
    min-height: 52vh;
  }
}
