/* Lavirent — the challenge pages (ctf.lavirent.com). Loaded on those pages only, on top of site.css. */

/* ---------- entry page: steps and the opt-in tick box ---------- */
.doc .steps { list-style: none; counter-reset: step; margin-top: 1.2em; }
.doc .steps li { counter-increment: step; padding-left: 4ch; }
.doc .steps li + li { margin-top: 0.7em; }
.doc .steps li::before { content: counter(step); color: var(--accent-soft); font-weight: 500; }

.entry { margin-top: 2.6em; }
.entry .signup { width: min(100%, 520px); }
.entry label.field { display: block; font-size: 13px; color: var(--dim); margin-bottom: 8px; }
.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--body);
  cursor: pointer;
}
.check input {
  -webkit-appearance: none;
          appearance: none;
  flex: none;
  display: grid;
  place-content: center;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  background: #000;
  cursor: pointer;
}
.check input::after {
  content: "";
  width: 10px;
  height: 5px;
  border-left: 2px solid #000;
  border-bottom: 2px solid #000;
  transform: translateY(-1px) rotate(-45deg);
  opacity: 0;
}
.check input:checked { background: var(--accent-soft); border-color: var(--accent-soft); }
.check input:checked::after { opacity: 1; }
.check input:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 3px; }
.check small { color: var(--dim); font-size: inherit; }

/* ---------- the challenge itself ---------- */
.ctf { padding-top: clamp(20px, 5vh, 56px); padding-bottom: clamp(72px, 14vh, 150px); min-height: 70vh; }
.ctf-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 24px;
  margin-bottom: clamp(28px, 5vh, 56px);
}
.ctf-head h1 { font-weight: 300; font-size: clamp(30px, 4.6vw, 54px); line-height: 1.1; letter-spacing: -0.025em; }
.ctf-progress { color: var(--dim); font-size: 14px; }
.ctf-note { color: var(--notice); margin-bottom: 2em; }
.ctf [hidden] { display: none !important; }

/* the door: asks for the confirmed email address before anything else is shown */
.gate { border-top: 1px solid var(--rule); padding-top: clamp(36px, 7vh, 76px); }
.gate > p { color: var(--body); max-width: 50ch; }

.stage {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
  gap: clamp(28px, 5.5vw, 84px);
  align-items: start;
  padding-top: clamp(36px, 7vh, 76px);
  padding-bottom: clamp(36px, 7vh, 76px);
  border-top: 1px solid var(--rule);
}
.shot img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); background: #000; }
.shot figcaption { margin-top: 10px; font-size: 13px; color: var(--dim); }
.task h2, .locked h2, .finale h2, .gate h2 {
  font-weight: 300;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 0.7em;
}
.task h2:focus, .finale h2:focus { outline: none; }
.task p { color: var(--body); max-width: 50ch; }
.task p + p { margin-top: 0.9em; }

.answer { margin-top: 2em; width: min(100%, 480px); }
.answer label { display: block; font-size: 13px; color: var(--dim); margin-bottom: 8px; }
.answer .signup-note { max-width: none; }
.answer.solved .signup-row { border-color: var(--accent-soft); }
.answer.solved input { color: var(--accent-soft); }
.signup-status.good { color: var(--accent-soft); }

/* a stage before it is unlocked, and the text-only stage */
.stage.is-locked, .stage.is-text { display: block; }
.stage.is-text .task p { max-width: 62ch; }
.locked { border: 1px dashed var(--rule-strong); border-radius: 3px; padding: clamp(22px, 4vw, 40px); color: var(--dim); }
.locked h2 { color: var(--dim); margin-bottom: 0.4em; }

/* final screen */
.finale { border-top: 1px solid var(--rule); padding-top: clamp(40px, 8vh, 84px); }
.finale p { color: var(--body); max-width: 60ch; }
.finale p + p { margin-top: 1em; }
.finale .lede { color: var(--ink); font-size: 18px; }
.finale h3 { font-weight: 500; font-size: 16px; margin-top: 2.2em; margin-bottom: 0.6em; }
.finale .flag-label { margin-top: 2.2em; font-size: 13px; color: var(--dim); }
.flag {
  display: flex;
  align-items: stretch;
  width: min(100%, 560px);
  margin-top: 8px;
  border: 1px solid var(--accent);
  border-radius: 2px;
}
.flag-text {
  flex: 1;
  min-width: 0;
  padding: 15px 16px;
  font: 500 15px/1.4 var(--mono);
  color: var(--ink);
  overflow-wrap: anywhere;
  user-select: all;
}
.flag-copy {
  flex: none;
  border: 0;
  border-left: 1px solid var(--accent);
  background: transparent;
  color: var(--ink);
  font: 500 13px/1 var(--mono);
  padding: 0 16px;
  cursor: pointer;
}
.flag-copy:hover { background: var(--accent); color: #000; }
.finale .steps { list-style: none; counter-reset: step; max-width: 60ch; }
.finale .steps li { counter-increment: step; position: relative; padding-left: 4ch; color: var(--body); }
.finale .steps li + li { margin-top: 0.6em; }
.finale .steps li::before { content: counter(step); position: absolute; left: 0; color: var(--accent-soft); font-weight: 500; }
.finale .steps + p { margin-top: 1.4em; }
.finale .minor { font-size: 13px; color: var(--dim); }

.again { margin-top: 3.4em; padding-top: 1.8em; border-top: 1px solid var(--rule); max-width: 60ch; }
.again p { font-size: 14px; color: var(--dim); }
.again .signup { margin-top: 14px; width: min(100%, 440px); }
.again .signup-row input { padding-top: 12px; padding-bottom: 12px; }
.again .signup-row button { background: transparent; color: var(--ink); border-left: 1px solid var(--rule-strong); }
.again .signup-row button:hover { background: var(--ink); color: #000; }

@media (max-width: 820px) {
  .stage { grid-template-columns: minmax(0, 1fr); }
  .shot { max-width: 460px; }
}

/* ---------- accounts: signing up, signing in, the account page ---------- */
.ctf-who { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: baseline; font-size: 14px; color: var(--dim); }
.ctf-who:empty { display: none; }
.linkish { border: 0; padding: 0; background: none; color: var(--ink); font: inherit; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; cursor: pointer; }
.linkish:hover { color: var(--accent-soft); }
.ctf-note.good { color: var(--accent-soft); }

/* .btn is in site.css (the home page uses it too) */
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 1.2em; }
form.inline { display: inline; }

.auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(36px, 7vw, 110px);
  border-top: 1px solid var(--rule);
  padding-top: clamp(36px, 7vh, 76px);
}
.auth h2, .keybox h2, .finish h2 {
  font-weight: 300;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 0.7em;
}
.auth h2:focus, .keybox h2:focus { outline: none; }
.auth-col > p, .finish > p, .keybox > p { color: var(--body); max-width: 46ch; }
.auth .answer, .finish .answer { margin-top: 1.6em; width: min(100%, 440px); }
.answer label + .signup-row + label, .answer .signup-note + label { margin-top: 18px; }
.answer label.check { display: flex; margin: 18px 0 0; font-size: 14px; color: var(--body); }
.answer .btn { margin-top: 22px; }
.providers { margin-top: 2.2em; padding-top: 1.6em; border-top: 1px solid var(--rule); width: min(100%, 440px); }
.providers p { font-size: 13px; color: var(--dim); }
.providers .row { margin-top: 12px; }

.finish, .keybox { border-top: 1px solid var(--rule); padding-top: clamp(36px, 7vh, 76px); }
.keybox .flag { margin-top: 1.4em; }
.keybox .flag-text { letter-spacing: 0.04em; }
.keybox-more { margin-top: 12px; font-size: 13px; color: var(--dim); }
.keybox .check { margin-top: 1.8em; }
.keybox .btn { margin-top: 1.4em; }

.solved-mark { margin-top: 1.4em; color: var(--accent-soft); }
.finale .quiet { margin-top: 2.2em; }

.acct { border-top: 1px solid var(--rule); margin-top: clamp(32px, 6vh, 56px); padding-top: clamp(26px, 5vh, 44px); }
.acct h2 { font-weight: 500; font-size: 16px; margin-bottom: 0.7em; }
.acct p { color: var(--body); max-width: 60ch; }
.acct p + p { margin-top: 0.8em; }
.acct .answer { margin-top: 1.4em; }
.acct .keybox { border-top: 0; padding-top: 1.6em; }
.account .lede { color: var(--ink); font-size: 17px; }

/* ---------- the board ---------- */
.board-summary p { color: var(--body); max-width: 66ch; }
.table-wrap { margin-top: 2.2em; overflow-x: auto; }
.board { width: 100%; max-width: 760px; border-collapse: collapse; font-size: 15px; }
.board th, .board td { text-align: left; padding: 11px 14px 11px 0; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.board th { font-weight: 500; font-size: 13px; color: var(--dim); border-bottom-color: var(--rule-strong); }
.board .num { text-align: right; padding-right: 0; padding-left: 14px; }
.board td.name { color: var(--ink); width: 100%; }
.board td { color: var(--body); }
.board tr.me td { color: var(--accent-soft); }
.board tbody tr:first-child td { color: var(--ink); font-weight: 500; }
.board tbody tr.me:first-child td { color: var(--accent-soft); }
.doc .cta { margin-top: 2.2em; display: flex; flex-wrap: wrap; gap: 12px; }

@media (max-width: 820px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- before a challenge opens: the countdown ---------- */
/* .count (the countdown digits) is in site.css (the home page uses it too) */

.opening { border-top: 1px solid var(--rule); padding-top: clamp(28px, 5vh, 52px); padding-bottom: clamp(30px, 6vh, 60px); }
.opening h2, .opening-line { font-weight: 400; font-size: 13px; line-height: 1.5; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.opening-when { margin-top: 18px; font-size: 14px; color: var(--body); max-width: 62ch; }
.doc .opening { margin-top: 2.6em; padding-bottom: 0; }
.doc .opening .opening-line { margin: 0; max-width: none; }
.doc .opening:not(.is-live) .opening-line { text-transform: none; letter-spacing: 0; font-size: 16px; color: var(--ink); }   /* without JavaScript: a plain sentence */
.board-summary .count { margin-top: 12px; }
.board-summary .lede { color: var(--dim); font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; }
.board-summary .opening-when + p { margin-top: 1em; }
.board-summary .cta { margin-top: 1.8em; }

/* signed in, waiting for the opening */
.waiting { border-top: 1px solid var(--rule); padding-top: clamp(36px, 7vh, 76px); }
.waiting h2 { font-weight: 300; font-size: clamp(24px, 3vw, 38px); line-height: 1.15; letter-spacing: -0.02em; margin-bottom: 0.7em; }
.waiting h2:focus { outline: none; }
.waiting p { color: var(--body); max-width: 58ch; }
.waiting .lede { color: var(--ink); font-size: 17px; }
.waiting .lede + p { margin-top: 1.4em; }
.waiting .row { margin-top: 1.8em; }
.waiting .signup-note { max-width: 58ch; }
.waiting .next { margin-top: 2.6em; display: flex; flex-wrap: wrap; gap: 10px 28px; font-size: 14px; }

/* account page: room between a row of buttons and what follows it */
.acct .row + p, .acct .row + div, .acct .signup-status + p, .acct div + p { margin-top: 1.2em; }
.acct .row { margin-top: 1em; }
#board-table > p { margin-top: 2.2em; }

/* the bot check on sign-up (Cloudflare Turnstile): invisible unless Cloudflare asks the visitor to tick a box */
.human { margin-top: 18px; }
.human:empty { display: none; }
