/* guard.prizemc.net. Tokens, fonts and buttons follow stats.prizemc.net (PrizeMC/stats web/css/site.css) so
   the two sites read as one family. No build step. */

@font-face {
  font-family: "Inter";
  src: url("/vendor/inter-5.3.0/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
    U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  src: url("/vendor/inter-5.3.0/inter-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Minecraft's font: one font pixel is 1/12 of the size, so sizes sit on 12 / 18 / 24 / 36 px. */
@font-face {
  font-family: "Mojangles";
  src: url("/vendor/minecraft-ttf-1.6/MinecraftDefault-Regular.ttf") format("truetype");
  font-display: swap;
}

/* ------------------------------------------------------------------ tokens */

:root {
  color-scheme: dark;
  --bg: #25282d;
  --bg-sunk: #1f2226;
  --panel: #2e3137;
  --raised: #383c43;
  --line: #474b54;
  --line-soft: #363940;
  --text: #ece8de;
  --muted: #aaa79e;
  --faint: #807e77;
  /* PrisonEscape = jumpsuit orange */
  --accent: #ff9e4a;
  --accent-ink: #331a05;
  --accent-soft: rgba(255, 158, 74, 0.14);
  --good: #7bd88f;
  --danger: #ff8f80;
  --btn-ink: rgba(236, 232, 222, 0.6);
  --btn-fill: rgba(31, 34, 38, 0.55);
  --btn-drop: rgba(0, 0, 0, 0.55);
  --pixel: "Mojangles", ui-monospace, "Cascadia Mono", monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 3px;
  --wrap: 880px;
  --gutter: 16px;
  --scroll-thumb: #e8860c;
  --scroll-light: #ffb43a;
  --scroll-dark: #9c4f04;
}

/* ------------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-y: scroll; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.55 var(--sans);
  font-feature-settings: "cv11", "ss01";
}

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 1px; }
button, input, textarea { font: inherit; color: inherit; }

h1, h2, h3, .pixel {
  font-family: var(--pixel);
  font-weight: 400;
  letter-spacing: 0;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
}
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-size: 36px; text-shadow: 0.0833em 0.0833em 0 rgba(0, 0, 0, 0.45); }
h2 { font-size: 24px; text-shadow: 0.0833em 0.0833em 0 rgba(0, 0, 0, 0.35); }
h3 { font-size: 18px; }
.num { font-variant-numeric: tabular-nums; }
img.pixelated { image-rendering: pixelated; image-rendering: crisp-edges; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute; left: 8px; top: -48px; z-index: 50;
  padding: 8px 12px; background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none;
}
.skip:focus { top: 8px; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

::-webkit-scrollbar { width: 16px; height: 12px; }
::-webkit-scrollbar-track { background: var(--bg-sunk); box-shadow: inset 2px 0 0 var(--line-soft); }
::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb); border-radius: 0;
  box-shadow: inset 3px 3px 0 var(--scroll-light), inset -3px -3px 0 var(--scroll-dark);
}
::-webkit-scrollbar-thumb:hover { background: #f5961c; }
@supports not selector(::-webkit-scrollbar) { html { scrollbar-color: var(--scroll-thumb) var(--bg-sunk); } }

/* ------------------------------------------------------------------ buttons (stats.prizemc.net style) */

.btn {
  appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 2px solid var(--btn-ink);
  border-radius: 2px;
  background: var(--btn-fill);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  font-family: var(--pixel);
  font-size: 18px;
  font-variant-ligatures: none;
  line-height: 1.2;
  padding: 8px 16px;
  white-space: nowrap;
  transition: transform 180ms cubic-bezier(0.2, 0.8, 0.3, 1), box-shadow 180ms cubic-bezier(0.2, 0.8, 0.3, 1),
    background-color 180ms, color 180ms, border-color 180ms;
}
.btn:is(:hover, :focus-visible) {
  background: var(--text); border-color: var(--text); color: var(--bg);
  transform: translate(-3px, -3px); box-shadow: 5px 5px 0 var(--btn-drop);
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn:active { transform: none; box-shadow: 0 0 0 transparent; transition-duration: 60ms; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-discord { background: #5865f2; border-color: #5865f2; color: #fff; }
.btn-discord svg { width: 22px; height: 22px; flex: none; }
.btn-small { height: 32px; font-size: 12px; line-height: 1; padding: 1px 12px 0; }
.btn-copy { height: 24px; font-size: 12px; line-height: 1; padding: 1px 8px 0; margin-left: 8px; vertical-align: middle; }
.btn[disabled], .btn[aria-busy="true"] { opacity: 0.6; cursor: progress; transform: none; box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:is(:hover, :focus-visible) { transform: none; } }

/* ------------------------------------------------------------------ header */

.site-header { border-bottom: 1px solid var(--line-soft); background: var(--bg-sunk); position: relative; z-index: 2; }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; max-width: calc(1120px + 2 * var(--gutter)); }
.brand {
  display: inline-flex; align-items: baseline; gap: 8px;
  font-family: var(--pixel); font-size: 24px; white-space: nowrap; color: var(--text); text-decoration: none;
}
.brand:hover { color: var(--accent); }
.brand-mark { width: 20px; height: 20px; align-self: center; }
.brand small { font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); }

.account { margin-left: auto; display: flex; align-items: center; gap: 12px; min-width: 0; }
.account-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--raised); flex: none; }
.account-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 520px) {
  .account-name { display: none; }
}

/* ------------------------------------------------------------------ banner (logo + title are in the picture) */

.banner { position: relative; background: var(--bg-sunk); }
.banner-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: cover;
  object-position: center 45%;
}
/* fade the bottom into the page so the first card can sit over it */
.banner::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 28%;
  background: linear-gradient(180deg, rgba(37, 40, 45, 0), var(--bg));
  pointer-events: none;
}

/* ------------------------------------------------------------------ panels */

.main { display: grid; gap: 16px; margin-top: clamp(-56px, -3.5vw, -12px); padding-bottom: 56px; position: relative; z-index: 1; flex: 1 0 auto; }

.panel {
  margin: 0;
  min-width: 0;
  padding: 20px 22px 22px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
.panel > h2 { margin-bottom: 14px; }
@media (max-width: 520px) { .panel { padding: 16px 16px 18px; } }

.intro { margin: 0 0 22px; font-size: 1.0625rem; }
.rules { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 48px; }
@media (max-width: 720px) { .rules { grid-template-columns: 1fr; } }
.rules-head { font-size: 18px; color: var(--text); margin: 0 0 14px; }
.rules ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; font-size: 1rem; line-height: 1.6; }
.rules li { position: relative; padding-left: 26px; }
/* little pixel blocks with a hard bottom-right shade, like the logo's lettering */
.ticks li::before, .bullets li::before {
  content: ""; position: absolute; left: 2px; top: calc(0.8em - 5px); width: 9px; height: 9px;
}
.ticks li::before { background: var(--accent); box-shadow: 2px 2px 0 var(--scroll-dark); }
.bullets li::before { background: #c9c6bd; box-shadow: 2px 2px 0 #66645e; }

/* ------------------------------------------------------------------ status card */

.flow { display: grid; gap: 14px; justify-items: start; }
.flow h2 { margin: 0; }
.flow p { margin: 0; max-width: 40em; }
.flow .muted { color: var(--muted); font-size: 0.9375rem; }
.flow.ok { border-color: color-mix(in srgb, var(--accent) 45%, var(--line-soft)); }
.flow.good { border-color: color-mix(in srgb, var(--good) 45%, var(--line-soft)); }
.flow.bad { border-color: color-mix(in srgb, var(--danger) 40%, var(--line-soft)); }
.flow .state-icon { width: 36px; height: 36px; image-rendering: pixelated; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.loading { color: var(--faint); font-family: var(--pixel); font-size: 18px; margin: 0; }
.steps { margin: 0; padding-left: 1.4em; display: grid; gap: 6px; }
.steps code, .flow code {
  font-family: var(--pixel); font-size: 18px; color: var(--accent);
  background: var(--bg-sunk); padding: 0 6px; border-radius: 2px;
}
.who { display: flex; align-items: center; gap: 12px; }
.who img { width: 40px; height: 40px; image-rendering: pixelated; border-radius: 2px; background: var(--raised); }
.who .ign { font-family: var(--pixel); font-size: 24px; line-height: 1; }
.who .sub { color: var(--muted); font-size: 0.875rem; }
.meter { width: min(320px, 100%); height: 12px; background: var(--bg-sunk); border: 2px solid var(--line); }
.meter span { display: block; height: 100%; background: var(--accent); }
.notice {
  padding: 10px 14px; border-left: 4px solid var(--danger); background: rgba(255, 143, 128, 0.08);
  font-size: 0.9375rem;
}

/* ------------------------------------------------------------------ form */

.apply { display: grid; gap: 16px; }
.q-title { display: block; font-weight: 600; font-size: 1.0625rem; margin: 0 0 14px; padding: 0; line-height: 1.4; }
/* a floated legend renders inside the fieldset like any other line, not cut into its border */
.question > legend { float: left; width: 100%; display: flex; align-items: baseline; gap: 10px; }
.question > legend + * { clear: both; }
.q-num { flex: none; color: var(--accent); font-size: 18px; line-height: 1; }

textarea {
  display: block; width: 100%; min-height: 150px; resize: vertical;
  padding: 12px 14px;
  background: var(--bg-sunk);
  border: 2px solid var(--line);
  border-radius: 2px;
  line-height: 1.5;
}
textarea:focus { outline: none; border-color: var(--accent); }
.why-meta { display: flex; justify-content: space-between; gap: 12px; margin: 8px 0 0; font-size: 0.875rem; }
.why-meta .count { color: var(--faint); margin-left: auto; }
.why-meta .count.over { color: var(--danger); }
.hint { color: var(--danger); }

.quiz-head { padding: 18px 2px 2px; }
.quiz-head p { margin: 8px 0 0; color: var(--muted); }

#questions { display: grid; gap: 16px; }
.question { border: 1px solid var(--line-soft); }
.question.missing { border-color: var(--danger); }
.q-img {
  display: block; width: 100%; height: auto; margin: 0 0 14px;
  border-radius: 2px; background: var(--bg-sunk);
}
.q-img.small { width: auto; max-width: 100%; margin-inline: auto; }

.choices { display: grid; gap: 8px; }
.choice {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: 2px;
  background: var(--bg-sunk);
  cursor: pointer;
  transition: border-color 120ms, background-color 120ms;
}
.choice:hover { border-color: var(--btn-ink); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .box {
  flex: none; width: 18px; height: 18px;
  border: 2px solid var(--btn-ink); background: var(--panel);
}
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice:has(input:checked) .box { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--panel); }
.choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.submit { display: grid; gap: 14px; justify-items: start; }
.turnstile:empty { display: none; }
.form-error { margin: 0; color: var(--danger); }

/* ------------------------------------------------------------------ footer */

.site-footer { border-top: 1px solid var(--line-soft); color: var(--faint); font-size: 0.8125rem; }
.site-footer .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px;
  padding-top: 18px; padding-bottom: 24px; max-width: calc(1120px + 2 * var(--gutter));
}
.site-footer p { margin: 0; }
.footer-links { display: flex; gap: 18px; }
.footer-links a { color: var(--muted); }
