:root {
  color-scheme: dark;
  --bg: #111522;
  --ink: #f3f5ff;
  --muted: #aeb9d0;
  --border: #2b3650;
  --panel: #192134;
  --accent: #ffc969;
  font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
main:focus, #goal:focus { outline: none; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #aebcff; outline-offset: 4px; }
[hidden] { display: none !important; }
.skip { position: absolute; z-index: 20; padding: 12px; background: var(--panel); transform: translateY(-110%); }
.skip:focus { transform: none; }
.top { background: #111522; border-bottom: 1px solid #273046; }
.top-inner, .wrap, footer { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.top-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: .88rem; font-weight: 850; letter-spacing: .055em; }
.brand strong { color: #ffc969; }
.brand-icon { display: grid; place-items: center; width: 36px; aspect-ratio: 1; border-radius: 9px; background: #ffc969; color: #171d2c; font-size: 1.45rem; line-height: 1; }
nav { display: flex; gap: 6px; align-items: center; }
nav a, .xp { padding: 11px 15px; border-radius: 9px; font-weight: 650; color: var(--muted); font-size: .9rem; white-space: nowrap; }
nav a:hover, nav a[aria-current] { background: #222b40; color: var(--ink); }
.xp { color: #ffc969; border: 1px solid #5b4934; background: #2a2527; }
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 510px; display: grid; align-items: center;
  background: radial-gradient(ellipse at 82% 55%, #304158 0%, #171e31 52%, #111522 78%);
  border-bottom: 1px solid var(--border);
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(90deg, #121827 5%, #121827 18%, #121827ec 30%, #12182738 60%, #12182710 100%), url("./assets/atelier.webp");
  background-position: center, right 49%; background-size: cover, auto 125%; background-repeat: no-repeat;
}
.hero-copy { width: min(1120px, calc(100% - 64px)); margin: auto; padding: 55px 0; }
.eyebrow { color: var(--accent); font-size: .76rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 12px; }
.hero .eyebrow { display: inline-flex; gap: 9px; align-items: center; }
.hero .eyebrow span, .online i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 13px currentColor; }
h1, h2, h3, p { overflow-wrap: break-word; }
h1, h2, h3 { margin: 0; line-height: 1.08; letter-spacing: -.035em; }
.hero h1 { font-size: clamp(4rem, 8vw, 7rem); font-weight: 900; line-height: .87; }
.hero em { font-style: normal; color: #ffc969; }
.hero h1 + p { max-width: 370px; color: #d7dfee; font-size: 1.12rem; margin-block: 25px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 14px; padding: 12px 19px; min-height: 48px; border-radius: 10px; border: 0; font-weight: 800; text-align: center; }
.primary { background: var(--accent); color: #171b26; }
.primary:hover { filter: brightness(1.11); }
.section { padding-block: 48px 56px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 23px; }
h2 { font-size: clamp(1.45rem, 3.2vw, 2.2rem); }
.text-link { display: inline-flex; align-items: center; min-height: 44px; gap: 8px; color: var(--accent); font-weight: 720; font-size: .92rem; }
.text-link:hover { text-decoration: underline; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.world-card { position: relative; padding: 20px; border: 1px solid var(--border); border-radius: 15px; background: linear-gradient(145deg, #222b40, #191f30 76%); }
.world-card.playable:hover, .world-card.playable:focus-within { border-color: var(--accent); }
.card-top { display: flex; align-items: start; justify-content: space-between; gap: 8px; margin-bottom: 19px; }
.world-icon { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 12px; color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, #182034); border: 1px solid color-mix(in srgb, var(--accent) 30%, #182034); }
.world-icon svg { width: 26px; height: 26px; }
.status { color: var(--accent); border: 1px solid currentColor; border-radius: 999px; padding: 3px 8px; font-size: .73rem; font-weight: 750; white-space: nowrap; }
.subject { color: var(--accent); text-transform: uppercase; font-size: .7rem; font-weight: 800; letter-spacing: .09em; margin: 0 0 7px; }
.world-card h3 { font-size: 1.26rem; }
.world-card h3 a { display: flex; justify-content: space-between; gap: 10px; }
.world-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: 15px; }
.world-card h3 span { color: var(--accent); }
.description, .muted, .lede { color: var(--muted); }
.description { font-size: .92rem; margin: 9px 0 0; }
.page h1 { font-size: clamp(2.35rem, 6vw, 4.65rem); }
.lede { margin: 14px 0 34px; }
.page > h2 { margin-bottom: 17px; }
.later { margin-top: 40px; }
.planned { background: var(--panel); }
.planned .card-top { margin-bottom: 10px; }
.planned .subject { text-transform: none; letter-spacing: 0; font-size: .97rem; }
footer { margin-top: auto; padding-block: 23px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--border); color: var(--muted); }
footer span { font-size: .75rem; font-weight: 850; letter-spacing: .07em; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 15px; padding: clamp(16px, 3vw, 28px); min-width: 0; }
.profile-grid, .mission-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 25px; align-items: start; }
.profile-grid form { display: grid; gap: 8px; margin-top: 14px; }
.profile-grid form .button { justify-self: start; }
input:not([type="radio"], [type="range"]) { width: 100%; padding: 12px; color: var(--ink); background: #101725; border: 1px solid #53617b; border-radius: 8px; }
progress { accent-color: var(--accent); display: block; width: 100%; height: 18px; }
.panel h2 + label { display: block; margin-top: 14px; }
.medals { list-style: none; padding: 0; margin-bottom: 0; }
.medals li { display: flex; align-items: center; gap: 8px; padding-block: 9px; border-bottom: 1px solid var(--border); }
.medals small { margin-left: auto; color: var(--muted); }
.mission-title { display: flex; gap: 14px; align-items: end; justify-content: space-between; margin-top: 16px; }
.mission-title .world-icon { width: 58px; height: 58px; }
.mission-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.sim-head { display: flex; justify-content: space-between; font-weight: 800; gap: 12px; }
.online { color: #80e7d4; font-size: .82rem; display: inline-flex; align-items: center; gap: 8px; }
.diagram { border: 1px solid #323e56; border-radius: 11px; margin-top: 13px; overflow: hidden; background: linear-gradient(#29334a70 1px, transparent 1px), linear-gradient(90deg, #29334a70 1px, #141b2e 1px); background-size: 20px 20px; }
.diagram svg { display: block; width: 100%; height: auto; }
.diagram-label { fill: #b7c5df; text-anchor: middle; font-size: 12px; font-weight: 750; letter-spacing: .08em; }
.lamp { color: #8998ae; }
.bulb { fill: #202b40; stroke: currentColor; stroke-width: 2; }
.halo { fill: #ffce58; opacity: 0; }
.lit { color: #fff3cc; }
.lit .bulb { fill: #a97722; fill-opacity: calc(.55 + var(--power) * .45); }
.lit .halo { opacity: calc(.08 + var(--power) * .19); animation: glow 1.4s ease-in-out infinite alternate; }
.flow { stroke-dasharray: 6 8; animation: flow .7s linear infinite; }
.spinning { animation: spin var(--speed) linear infinite var(--dir); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes glow { to { opacity: calc(.12 + var(--power) * .23); } }
@keyframes flow { to { stroke-dashoffset: -14; } }
.measurements { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 12px 0 0; }
.measurements div { border: 1px solid #35415a; border-radius: 8px; background: #151c2d; padding: 8px; overflow-wrap: anywhere; }
.measurements dt { color: var(--muted); font-size: .72rem; }
.measurements dd { margin: 3px 0 0; font-weight: 800; font-size: .9rem; }
.task h2 { font-size: clamp(1.18rem, 2.2vw, 1.55rem); line-height: 1.25; }
#controls { display: grid; gap: 11px; margin-block: 18px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend, .slider label { color: #d2dbee; font-weight: 730; font-size: .85rem; margin-bottom: 5px; }
.options { display: flex; flex-wrap: wrap; gap: 6px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice span { display: grid; place-items: center; min-height: 44px; padding: 5px 11px; border: 1px solid #53617b; border-radius: 7px; font-size: .86rem; }
.choice input:checked + span { background: var(--accent); border-color: var(--accent); color: #171b26; font-weight: 750; }
.choice input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }
.choice input:disabled { cursor: default; }
.slider > div { display: flex; justify-content: space-between; gap: 8px; }
.slider output { color: var(--accent); font-weight: 750; white-space: nowrap; }
input[type="range"] { width: 100%; min-height: 44px; margin: 0; accent-color: var(--accent); }
#feedback { color: var(--muted); margin: 11px 0 0; }
#feedback:empty, #profile-message:empty { display: none; }
#return-map { margin-top: 14px; }
@media (max-width: 800px) {
  .hero { min-height: 455px; }
  .hero::before { background-size: cover, auto 110%; background-position: center, 72% center; }
  .top-inner, .wrap, .hero-copy, footer { width: calc(100% - 36px); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mission-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .top-inner { display: grid; grid-template-columns: 1fr auto; gap: 5px; padding-block: 8px; }
  .xp { grid-column: 2; grid-row: 1; }
  nav { grid-row: 2; grid-column: 1 / -1; }
  .hero { min-height: 490px; align-items: end; }
  .hero-copy { margin-block: auto 0; padding: 120px 0 30px; }
  .hero::before { background-image: linear-gradient(0deg, #121827 4%, #121827f4 22%, #12182794 65%, #12182712 100%), url("./assets/atelier.webp"); background-size: cover, auto 75%; background-position: center, 78% top; }
  .hero h1 { font-size: clamp(3.35rem, 14vw, 4.6rem); }
  .hero h1 + p { margin-block: 16px; font-size: 1rem; }
  .section { padding-block: 32px 38px; }
  .section-head { align-items: start; flex-direction: column; gap: 3px; margin-bottom: 12px; }
  .cards, .profile-grid { grid-template-columns: 1fr; }
  .compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compact .world-card { padding: 11px; }
  .compact .world-icon { width: 32px; height: 32px; }
  .compact .world-icon svg { width: 19px; height: 19px; }
  .compact .status { padding-inline: 5px; font-size: .65rem; }
  .mission-title .world-icon { width: 45px; height: 45px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
}
