@font-face {
  font-family: "Cinzel Decorative";
  src: url("fonts/CinzelDecorative-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: block;
}
@font-face {
  font-family: "Merriweather";
  src: url("fonts/Merriweather-Medium.woff2") format("woff2");
  font-weight: 400;
  font-display: block;
}
@font-face {
  font-family: "Merriweather";
  src: url("fonts/Merriweather-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: block;
}

:root {
  --brand-primary: #ffd080;
  --text-primary: #ffffff;
  --text-secondary: #aaaaaa;
  --warning: #ffa61a;
  --status-up: #4ad86a;
  --status-down: #ff4d4d;
  --status-offline: #7a7a7a;
  --background: #000000;
  --field-background: #2a2a2a;
  --field-border: #3d3d3d;
  --button-width: 10.5rem;
  --button-wide: 15.5rem;
  --gap-line: 0.3rem;
  --page-top: 1.5rem;
  --gap-medium: 0.7rem;
  --gap-large: 3.6rem;
  font-family: "Merriweather", Georgia, serif;
  font-size: min(30px, 4.19vw);
  color: var(--text-secondary);
}

[hidden] { display: none !important; }
.unseen {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

html, body { height: 100%; }
html { scrollbar-gutter: stable; }
body {
  margin: 0;
  padding: var(--page-top) 0.75rem 0.3rem;
  box-sizing: border-box;
  overflow-y: auto;
  background: var(--background);
  color: var(--text-secondary);
}
main { max-width: 30rem; margin: 0 auto; padding-bottom: var(--gap-large); }
header { text-align: center; margin-bottom: var(--gap-medium); }

h1 {
  font-family: "Cinzel Decorative", Georgia, serif;
  font-weight: 400;
  font-size: 3.1rem;
  line-height: 0.98;
  letter-spacing: 0.06em;
  color: var(--brand-primary);
  text-align: center;
  margin: 0.05rem 0 var(--gap-medium);
  display: flex;
  flex-direction: column;
}
h1 a {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}
p { margin: 0.25rem 0; }
header p { max-width: 30rem; margin: 0 auto; }
header p + p { margin-top: var(--gap-line); }
#subtitle { text-align: center; }
[data-page="privacy"] #subtitle { font-size: 0.75rem; }
[data-page="privacy"] header { margin-bottom: calc(var(--gap-large) / 2); }

label { color: var(--text-primary); }

.row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
main > * + *, form > * + *, section > * + * { margin-top: var(--gap-medium); }
.row + .row { margin-top: var(--gap-line); }
.tick { display: flex; align-items: center; gap: 0.5rem; }
.consent { font-size: 0.7rem; }
.consent a { white-space: nowrap; }
fieldset { margin-left: 0; margin-right: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; margin-bottom: var(--gap-line); color: var(--text-primary); }
.options { display: flex; flex-wrap: wrap; gap: var(--gap-line) 1rem; }

input[type="email"], input[type="password"], input[type="text"] {
  width: 100%;
  padding: 0.4rem 0.6rem;
  font-family: "Merriweather", Georgia, serif;
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--field-background);
  border: 2px solid var(--field-border);
  border-radius: 4px;
}
input[type="email"]:focus, input[type="password"]:focus, input[type="text"]:focus {
  outline: none;
  border-color: var(--brand-primary);
}
input[type="checkbox"], input[type="radio"] { width: 0.87rem; height: 0.87rem; margin: 0.2rem; accent-color: var(--brand-primary); }

button, .button {
  width: var(--button-width);
  max-width: 100%;
  padding: 0.3rem 0.5rem;
  font-family: "Merriweather", Georgia, serif;
  font-size: 0.82rem;
  color: var(--text-primary);
  background: var(--field-background);
  border: 2px solid var(--field-border);
  border-radius: 4px;
  cursor: pointer;
}
button:hover:not(:disabled), .button:hover { border-color: var(--brand-primary); }
.button {
  display: inline-block;
  box-sizing: border-box;
  text-align: center;
  text-decoration: none;
}
.button:hover { color: var(--text-primary); }
.wide { width: var(--button-wide); }
button:disabled { color: var(--text-secondary); cursor: default; opacity: 0.45; }

.centre-action { display: flex; justify-content: center; gap: 0.6rem; margin-top: var(--gap-medium); }

.home-buttons {
  display: grid;
  grid-template-rows: auto auto;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: var(--gap-medium) 0.6rem;
  margin-top: var(--gap-medium);
}
.home-buttons .button { width: auto; }

.centre-aside {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.9rem;
  margin-top: var(--gap-medium);
}

.centre-aside a { font-size: 0.82rem; white-space: nowrap; }
.warn-text, .field-text.warn-text { color: var(--warning); }
button.warn, .button.warn {
  color: var(--text-primary);
  background: var(--warning);
  border-color: var(--warning);
  font-weight: 700;
}
.button.warn:hover { color: var(--text-primary); border-color: var(--brand-primary); }
button.selected { border-color: var(--brand-primary); }
a.dimmed, a.dimmed:hover { color: var(--text-secondary); opacity: 0.45; cursor: default; }
input.ok, input.ok:focus { border-color: var(--status-up); }
.field-text.up, .state-gap.done { color: var(--status-up); }
.field-text.down { color: var(--status-down); }
.field-text.warn { color: var(--warning); }
.field-text.dark { color: var(--status-offline); }
.field-text .fresh { color: var(--status-up); }
.field-text .old { color: var(--text-secondary); }
.status-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--gap-line) var(--gap-medium);
}
.status-grid > * + * { margin-top: 0; }
.status-grid > div { display: grid; grid-row: span 2; grid-template-rows: subgrid; min-width: 0; }
.status-grid label { align-self: end; }
.centred { text-align: center; }

.row-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2.1rem;
}

a {
  color: var(--text-secondary);
  text-decoration: underline;
  cursor: pointer;
}
a:hover { color: var(--brand-primary); }


.field-text {
  width: 100%;
  min-height: 2.13rem;
  padding: 0.4rem 0.6rem;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  color: var(--text-primary);
  font-size: 1rem;
  background: var(--field-background);
  border: 2px solid var(--field-border);
  border-radius: 4px;
}

.state-gap {
  min-height: 1.4em;
  margin: calc((var(--gap-large) - 1.4em) / 2) 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.policy { font-size: 0.5rem; }
.policy > * + * { margin-top: calc(var(--gap-medium) / 2); }
.policy h2 {
  font-size: 1em;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0;
}
.policy * + h2 { margin-top: calc(var(--gap-large) / 2); }
.policy h2 + h2 { margin-top: calc(var(--gap-medium) / 2); }
.policy h2.full { font-size: 1rem; }
.policy > p:last-child { margin-top: calc(var(--gap-large) / 2); }
.policy p { margin-bottom: 0; }
.policy ul { margin-bottom: 0; padding-left: 1.2em; }
.policy li + li { margin-top: calc(var(--gap-line) / 2); }
.policy strong { color: var(--text-primary); }

.rail {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 6px;
  margin: calc(0px - var(--page-top)) -0.75rem var(--page-top);
  padding: 8px 10px;
  background: var(--background);
  border-bottom: 2px solid var(--field-border);
}
.rail .button, .rail-soon { font-size: 13px; padding: 4px 7px; }
.rail .button { width: auto; }
.rail-soon { text-align: center; line-height: 1.25; }
.rail-soon small { display: block; font-size: 11px; line-height: 1.2; opacity: 0.8; }
.rail-brand {
  width: 100%;
  font-family: "Cinzel Decorative", Georgia, serif;
  font-size: 22px;
  letter-spacing: 0.06em;
  color: var(--brand-primary);
  text-align: center;
  text-decoration: none;
}
.rail-brand:hover { color: var(--brand-primary); }
.rail-brand span { display: inline-block; margin-right: 0.3em; }
.rail .here { border-color: var(--brand-primary); color: var(--brand-primary); }
.rail .button.rail-try, .rail .button.rail-try:hover {
  color: var(--background);
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  font-weight: 700;
}
.rail-privacy { width: 100%; font-size: 12px; text-align: center; }
.rail-socials { display: flex; justify-content: center; gap: 6px; width: 100%; }
.social { display: flex; align-items: center; color: var(--text-primary); text-decoration: none; }
.social-orb {
  position: relative;
  z-index: 1;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  box-sizing: border-box;
  border: 2px solid var(--field-border);
  border-radius: 50%;
  background: var(--field-background);
}
.social-orb img { width: 50%; height: 50%; }
.social-x { background: #000000; border-color: #ffffff; }
.social-bluesky { background: #1185fe; border-color: #ffffff; }
.social-patreon { background: #ff424d; border-color: #ffffff; }
.social-steam { background: #171a21; border-color: #ffffff; }
.social-label { display: none; }
.rail-group, .rail-rule { display: none; }
.social-name, .social-handle { grid-area: 1 / 1; }
.social-handle { visibility: hidden; }
.social:hover .social-name, a.social:focus-visible .social-name { visibility: hidden; }
.social:hover .social-handle, a.social:focus-visible .social-handle { visibility: visible; }
a.social:hover { color: var(--brand-primary); }
a.social:hover .social-orb, a.social:hover .social-label { border-color: var(--brand-primary); }

@media (min-width: 700px) {
  :root { font-size: min(30px, calc((100vw - 250px) * 0.0419)); }
  body { padding-left: calc(250px + 0.75rem); }
  .rail {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 250px;
    box-sizing: border-box;
    margin: 0;
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: stretch;
    gap: 8px;
    padding: 14px 14px 12px;
    overflow-y: auto;
    border-bottom: 0;
    border-right: 2px solid var(--field-border);
  }
  .rail .button, .rail-soon { font-size: 18px; line-height: 1.25; padding: 7px 10px; }
  .rail .button { width: 100%; }
  .rail-soon { padding-block: 3px; }
  .rail-gap { margin-top: 10px; }
  .rail-brand { font-size: 32px; line-height: 1; text-align: left; margin-bottom: 12px; }
  .rail-brand span { display: block; margin-right: 0; }
  .rail-privacy { margin-top: 12px; }
  .rail-socials { flex-direction: column; gap: 8px; margin-top: auto; padding-top: 12px; }
  .rail-group { display: block; margin: 0; font-size: 15px; line-height: 1.2; text-align: center; color: var(--text-secondary); }
  .rail-group + .rail-rule { display: block; width: auto; margin: 0 16px 2px; border: 0; border-top: 2px solid var(--field-border); }
  .social + .rail-group { margin-top: 10px; }
  .social-orb { width: 42px; height: 42px; }
  .social-label {
    display: grid;
    flex: 1;
    min-width: 0;
    margin-left: -12px;
    padding: 3px 8px 3px 18px;
    font-size: 15px;
    line-height: 1.3;
    border: 2px solid var(--field-border);
    border-left: 0;
    border-radius: 0 4px 4px 0;
  }
}

[data-page="try"] main {
  --box-height: min(720px, calc(100vh - var(--page-top) - 56px), calc((100vw - 250px - 1.5rem) * 9 / 16));
  max-width: none;
}
.game-box {
  display: flex;
  flex-direction: column;
  height: var(--box-height);
  width: calc(var(--box-height) * 16 / 9);
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  background: var(--background);
  border: 2px solid var(--field-border);
}
.game-bar { display: none; align-items: center; justify-content: flex-end; gap: 10px; height: 40px; padding: 0 10px; }
.game-bar button { width: auto; font-size: 15px; padding: 3px 12px; white-space: nowrap; }
.game-stage { position: relative; flex: 1; min-height: 0; }
#canvas { display: block; width: 100%; height: 100%; outline: none; }
.game-layer {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--gap-medium);
  padding: 12px;
  text-align: center;
}
#game-loading { background: var(--background); }
button.primary, button.primary:hover:not(:disabled) {
  color: var(--background);
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  font-weight: 700;
}
progress { width: var(--button-wide); max-width: 100%; accent-color: var(--brand-primary); }
.game-ending { opacity: 0; transition: opacity 1s; }
.game-ending.shown { opacity: 1; }
.game-title {
  display: flex;
  flex-direction: column;
  margin: 0;
  font-family: "Cinzel Decorative", Georgia, serif;
  font-size: 3.1rem;
  line-height: 0.98;
  letter-spacing: 0.06em;
  color: var(--brand-primary);
}
.game-under {
  display: flex;
  align-items: center;
  gap: 10px;
  width: calc(var(--box-height) * 16 / 9);
  max-width: 100%;
  min-height: 44px;
  margin: 12px auto 0;
}
.game-under button { width: auto; font-size: 17px; padding: 4px 14px; white-space: nowrap; }
.game-under.ended button:not(#game-mute) { display: none; }
.game-spring { flex: 1; }
#game-expand, #game-full, #game-collapse, #game-full-bar { border-color: var(--brand-primary); }

.game-box.expanded {
  position: fixed;
  inset: 0;
  z-index: 10;
  width: 100vw;
  height: 100vh;
  max-width: none;
  margin: 0;
  border: 0;
}
.game-box.expanded .game-bar { display: flex; }
.game-box:fullscreen { width: 100%; height: 100%; max-width: none; border: 0; }
.game-box:fullscreen .game-bar { display: none; }
body.game-expanded { overflow: hidden; }

.faq-links {
  position: sticky;
  top: -0.3rem;
  z-index: 2;
  display: flex;
  justify-content: safe center;
  gap: 1.1rem;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
  padding: 0.45rem 0 0.35rem;
  background: var(--background);
  font-size: 0.82rem;
}
.faq-links a { color: var(--text-secondary); text-underline-offset: 0.2em; flex: none; }
.faq-links a:hover { color: var(--brand-primary); }
body.sections { height: auto; min-height: 100%; }
body.info-page { padding-top: 0.3rem; }
.info-top {
  position: sticky;
  top: -0.3rem;
  z-index: 2;
  margin-top: -0.3rem;
  padding: 0.3rem 0 0.2rem;
  background: var(--background);
}
.info-top header { margin: 0; }
.faq-links::-webkit-scrollbar { display: none; }
.info-top .faq-links { position: relative; padding-top: 0.15rem; }
body.sections .faq-links { max-width: var(--info-col, 30rem); margin: 0 auto; }
#try-buttons + .info-top { margin-top: 2.2rem; }
.faq-links a.lit { color: var(--brand-primary); }
.info-top .faq-links {
  --fade-left: 0px;
  --fade-right: 0px;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--fade-left), #000 calc(100% - var(--fade-right)), transparent);
  mask-image: linear-gradient(to right, transparent, #000 var(--fade-left), #000 calc(100% - var(--fade-right)), transparent);
}
.info-top .faq-links.more-left { --fade-left: 2.5rem; }
.info-top .faq-links.more-right { --fade-right: 2.5rem; }
body.info-page main { max-width: none; }
.info { max-width: var(--info-col, 30rem); margin: 0 auto; padding-bottom: 100vh; font-size: 0.7rem; color: #e2e2e2; }
.info section { scroll-margin-top: calc(var(--info-top, 0px) + 0.3rem); }
.info summary {
  display: flex;
  align-items: center;
  margin: 1.4rem 0 0.4rem;
  list-style: none;
  cursor: pointer;
}
.info summary::-webkit-details-marker { display: none; }
.info summary::before {
  content: "";
  flex: none;
  width: 0.45rem;
  height: 0.45rem;
  margin: 0 0.575rem 0 0.175rem;
  background: var(--brand-primary);
  transform: rotate(45deg);
  transition: transform 0.14s cubic-bezier(0.33, 1, 0.68, 1);
}
.info details:not([open]) > summary::before { transform: rotate(-45deg); }
.info h2 { margin: 0; font-size: 1rem; color: var(--brand-primary); }
.info p { margin: 1lh 0 0; }
.info summary + p { margin-top: 0; }
.info ul { margin: 0.5lh 0 0; padding-left: 1.4em; }
.info li + li { margin-top: 0.45em; }
.info a { color: inherit; }
.info details > :not(summary) { margin-left: 1.2rem; max-width: 30rem; }

body.game-window { padding: 0; }
body.game-window .rail, body.game-window #game-collapse { display: none; }
body.game-window #try-buttons { position: fixed; z-index: 11; left: 0; right: 0; bottom: 1rem; visibility: hidden; }
body.game-window .game-under { display: none; }
body.game-window .game-under.ended + #try-buttons { visibility: visible; }
