.stage-page {
  --stage-dark: #181716;
  --stage-accent: #ffd070;
  --stage-link: #8a4f13;
  --accent: var(--stage-accent);
  --stage-type: Geist, Inter, "Segoe UI", system-ui, sans-serif;
  font-family: var(--stage-type);
}

.stage-header, .stage, .stage-footer {
  color: #fff;
  background: var(--stage-dark);
}

.stage {
  background: radial-gradient(ellipse at 81% 42%, #543b2688, transparent 52%), var(--stage-dark);
}

.stage-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 1rem;
  min-height: 4.45rem;
}

.stage-header .stage-bar { border-bottom: 1px solid #40352e; }

.stage-brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
  font-size: 1.16rem;
  font-weight: 760;
  letter-spacing: -.055em;
}

.stage-brand > span:last-child { color: #cbc2b9; }

.brand-symbol {
  display: inline-grid;
  place-items: center;
  width: 1.95rem;
  height: 1.95rem;
  margin-right: .55rem;
  border-radius: .39rem;
  background: var(--stage-accent);
  color: var(--stage-dark);
  font: 800 1.32rem/1 var(--mono);
}

.stage-bar nav { display: flex; flex-wrap: wrap; gap: 0 clamp(.85rem, 2.5vw, 1.8rem); }
.stage-bar nav a { display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; font-size: .9rem; font-weight: 620; text-decoration: none; }
.stage-bar nav a:hover { text-decoration: underline; }
.stage-header nav a:last-child { color: var(--stage-accent); }

.stage-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.13fr) minmax(0, 1fr);
  align-items: center;
  gap: 1.5rem clamp(2.2rem, 6vw, 6rem);
  padding-block: clamp(2.6rem, 5vw, 5.15rem);
}

.stage-intro h1 { font-size: clamp(2.9rem, 5.75vw, 6.3rem); font-weight: 820; line-height: .92; letter-spacing: -.08em; }
.stage-intro h1 em { display: block; color: var(--stage-accent); }
.stage-intro .stage-kicker {
  margin: 0 0 .7rem;
  color: var(--stage-accent);
  font: 700 .82rem/1.35 var(--mono);
  letter-spacing: .02em;
}
.stage-intro p {
  max-width: 32rem;
  margin: clamp(1.1rem, 3vw, 1.7rem) 0 1rem;
  color: #dcd4cc;
  font-size: clamp(1.02rem, 1.6vw, 1.27rem);
  line-height: 1.43;
}

.stage-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin: 0;
  padding: 0;
  color: #f0e5d9;
  font-size: .875rem;
  font-weight: 640;
  list-style: none;
}

.stage-benefits li {
  padding: .22rem .6rem;
  border: 1px solid #5a4738;
  border-radius: 999px;
  background: #573e2b70;
}

.stage-benefits li:first-child { color: var(--stage-accent); }

.stage-entry {
  justify-self: end;
  width: min(100%, 30rem);
  min-width: 0;
  padding: clamp(1rem, 3vw, 1.7rem);
  border: 1px solid #695443;
  border-top-color: #8a6b52;
  border-radius: 1.05rem;
  background: linear-gradient(155deg, #392d25 0, #27211d 68%);
  box-shadow: 0 18px 60px #0b070566;
  scroll-margin-top: 1rem;
}

.entry-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .25rem .6rem;
  margin-bottom: 1rem;
  padding-bottom: .85rem;
  border-bottom: 1px solid #5b493d;
}

.entry-meta strong { font: 700 1.2rem/1.35 var(--mono); letter-spacing: -.025em; }
.entry-meta span { color: #d9cbbd; font-size: .85rem; }

.stage-page #enter {
  min-height: 56px;
  padding-inline: 1rem .8rem;
  border-radius: .62rem;
  background: var(--stage-accent);
  color: #251a12;
  font-size: 1.09rem;
}

.stage-page #enter:hover:not(:disabled) { background: #ffe3a4; }
.entry-arrow {
  display: inline-grid;
  place-items: center;
  width: 1.95rem;
  height: 1.95rem;
  border-radius: .45rem;
  background: #48271220;
  font-size: 1.15rem;
  line-height: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .entry-arrow { transition: transform 150ms ease; }
  #enter:hover:not(:disabled) .entry-arrow { transform: translateX(.12rem); }
}

.stage-entry .choose-nick { margin-top: .3rem; border: 0; color: #f5e8dc; }
.stage-entry .choose-nick summary {
  display: flex;
  align-items: center;
  gap: .65rem;
  width: fit-content;
  padding-inline: .15rem .65rem;
  list-style: none;
  font-size: .94rem;
  font-weight: 640;
}
.stage-entry .choose-nick summary::-webkit-details-marker { display: none; }
.stage-entry .choose-nick summary::before, .stage-questions summary::after {
  content: "";
  width: .45rem;
  height: .45rem;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: translateY(-.11rem) rotate(45deg);
}
.stage-entry .choose-nick summary::before { color: var(--stage-accent); }
.stage-entry .choose-nick[open] summary::before, .stage-questions details[open] summary::after {
  transform: translateY(.12rem) rotate(225deg);
}
.nick-settings { padding: .15rem .1rem .7rem; }
.stage-entry .choose-nick label { display: block; margin: 0 0 .4rem; font-weight: 650; }
.stage-entry #nickname {
  width: 100%;
  min-height: 46px;
  padding: .6rem .7rem;
  border: 1px solid #937965;
  border-radius: .42rem;
  background: #191613;
  color: #fffaf4;
  font-size: 1rem;
}
.stage-entry #nick-help { margin: .45rem 0 0; color: #d9cbbd; }
.entry-note {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .15rem .7rem;
  margin: .3rem 0 0;
  padding-top: .65rem;
  border-top: 1px solid #5b493d;
  color: #d9cbbd;
  font-size: .84rem;
}
.entry-note a { display: inline-flex; align-items: center; min-height: 44px; color: #f8eee5; }
.stage-entry #disconnect-irc { margin-top: .5rem; }
.stage-entry .chat-screen input { min-width: 0; flex: 1; min-height: 44px; padding: .65rem .75rem; border: 1px solid var(--chat-border, #727272); border-radius: 0; background: var(--chat-surface, #1c1c1c); color: var(--white); }
.stage-entry .chat-screen input::placeholder { color: var(--chat-placeholder, #bdbdbd); }

.rules-band {
  padding-block: clamp(2rem, 4.2vw, 3.4rem);
  background: #fff0cb;
  color: var(--stage-dark);
  text-align: center;
}
.rules-band p {
  margin: 0 0 clamp(.55rem, 1.25vw, 1rem);
  color: #704315;
  font-size: clamp(1rem, 1.65vw, 1.25rem);
  font-weight: 740;
  letter-spacing: -.02em;
}
.rules-band h2 { font-size: clamp(3.05rem, 10.05vw, 8.5rem); font-weight: 850; line-height: .95; letter-spacing: -.085em; }

.rules-band h2 span { color: var(--stage-link); }

.explanation, .stage-questions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem clamp(2rem, 7vw, 6.3rem); }
.explanation, .reading, .stage-questions { padding-block: clamp(2.7rem, 6.5vw, 5.4rem); }
.explanation h2, .reading h2, .stage-questions h2 { max-width: 18ch; font-size: clamp(2rem, 4.1vw, 3.55rem); font-weight: 800; line-height: .99; }
.explanation p, .reading p { max-width: 55ch; color: #494449; }
.stage-link { display: inline-flex; align-items: center; gap: .55rem; min-height: 44px; text-underline-offset: .3em; font-weight: 720; }
.stage-link span { color: var(--stage-link); }
.how-list { margin: 0; padding: 0; list-style: none; }
.how-list li { padding: .95rem 0; border-top: 1px solid var(--line); }
.how-list h3 { margin: 0 0 .3rem; font-size: 1.13rem; line-height: 1.2; }
.how-list p { margin: 0; }

.reading { background: #f7f6f4; }
.reading-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.7rem clamp(2rem, 7vw, 6.3rem); }
.reading-grid article { padding-top: 1.05rem; border-top: 2px solid var(--stage-dark); }
.reading h2 { font-size: clamp(1.7rem, 3.1vw, 2.7rem); }

.stage-questions summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: .85rem;
  list-style: none;
}
.stage-questions summary::-webkit-details-marker { display: none; }
.stage-questions summary::after { flex: none; margin-inline-end: .3rem; color: var(--stage-link); }
.stage-questions summary:focus-visible { outline-offset: 1px; }
.final-entry { border-top: 1px solid #e4d8ce; background: #fff0cb; }
.final-entry .wrap { padding-block: .85rem; }

.irc-connect { background: #f7f6f4; scroll-margin-top: 1rem; }
.irc-connect-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 1.4rem clamp(2rem, 6vw, 5rem);
  padding-block: clamp(2rem, 5vw, 4rem);
}
.irc-connect-intro h2 { max-width: 19ch; font-size: clamp(1.9rem, 3.6vw, 3rem); }
.irc-connect-intro p { max-width: 43ch; margin: .85rem 0 .35rem; color: #544940; }
.irc-connect-intro p a { color: var(--stage-link); }
.irc-connection {
  padding: clamp(.9rem, 2.8vw, 1.45rem);
  border: 1px solid #ded5cc;
  border-radius: .9rem;
  background: #fff;
}
.irc-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem .75rem;
  margin: 0;
}
.irc-settings dt { margin-bottom: .23rem; color: #61554b; font-size: .83rem; }
.irc-settings dd { margin: 0; color: #2b2018; font-weight: 700; overflow-wrap: anywhere; }
.irc-connection code { font-family: var(--mono); }
.irc-connection p {
  margin: 1rem 0 0;
  padding-top: .85rem;
  border-top: 1px solid #e6dbd1;
  color: #544940;
  font-size: .9rem;
}
.irc-connection p code { color: var(--stage-link); font-weight: 700; }

@media (max-width: 760px) {
  .stage-layout { grid-template-columns: minmax(0, 1fr); gap: 1.05rem; padding-block: 2.3rem 2rem; }
  .stage-intro h1 { font-size: clamp(2.35rem, 8vw, 4.1rem); }
  .stage-entry { justify-self: start; }
  .explanation, .reading-grid, .stage-questions, .irc-connect-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 400px) {
  .stage-bar { min-height: 3.6rem; }
  .stage-header .stage-guide { display: none; }
  .stage-brand { font-size: 1.07rem; }
  .brand-symbol { width: 1.75rem; height: 1.75rem; margin-right: .4rem; }
  .stage-bar nav a { font-size: .84rem; }
  .stage-footer .stage-bar { flex-direction: column; align-items: start; padding-block: .45rem; }
  .stage-layout { padding-top: 1.45rem; }
  .stage-intro p { margin-top: .8rem; }
  .stage-kicker { display: none; }
  .entry-note { align-items: center; padding-top: .35rem; }
}

.stage-entry #join-form :focus-visible, .stage-entry #disconnect-irc:focus-visible { outline-color: #fff; }
.stage-entry #disconnect-irc { color: #fff; }
.stage-entry #disconnect-irc:hover { background: #2c272e; }
