:root {
  color-scheme: dark;
  --ink: #151615;
  --panel: #20221f;
  --raised: #292b27;
  --line: #383b33;
  --text: #f9f7ee;
  --soft: #c5c5b7;
  --muted: #a6a697;
  --lime: #e3fb89;
  --brand: #cf2e2e;
  --brand-hover: #b52525;
  --brand-text: #ff9c95;
  --brand-on: #fff;
  --brand-shade: #392323;
  --brand-border: #794241;
  --orange: #ff835d;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --headline: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --body: "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--ink); color: var(--text); font: 1rem/1.5 var(--body); }
button, input { font: inherit; }
button { cursor: pointer; }
button, a, input, canvas { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 3px; }
button:disabled { opacity: .38; cursor: default; }
a { color: var(--brand-text); text-underline-offset: .24em; }
.shell { width: min(100% - 72px, 1420px); margin-inline: auto; }
.skip { position: fixed; top: -5rem; left: 1rem; background: var(--ink); padding: .65rem; z-index: 10; }
.skip:focus { top: 1rem; }
.masthead { background: #faf8f7; border-top: 3px solid var(--brand); border-bottom: 1px solid #ddd6d4; }
.masthead-inner { min-height: 65px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.masthead :focus-visible { outline-color: var(--brand); }
.seal { display: inline-flex; align-items: center; padding-block: 8px; }
.seal img { display: block; width: min(200px, 47vw); height: auto; }
.text-button { border: 0; padding: 0; background: transparent; color: var(--soft); font-size: .875rem; font-weight: 700; }
.text-button:hover:not(:disabled) { color: var(--brand-text); }
.help-button { display: flex; align-items: center; gap: 8px; color: #322928; }
.help-button:hover:not(:disabled) { color: #171312; text-decoration: underline; text-underline-offset: .2em; }
.help-button span { font: 700 .8rem/19px var(--mono); border: 1px solid #887675; width: 21px; height: 21px; border-radius: 50%; text-align: center; }

.intro { padding: 36px 0 27px; display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; }
.kicker { margin: 0 0 .45rem; display: flex; align-items: center; gap: .65rem; color: var(--brand-text); font: 700 .84rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: .1em; }
.kicker span { width: 8px; height: 8px; background: var(--brand); box-shadow: 4px 4px var(--brand-border); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .65rem; font: 900 clamp(2.6rem, 5.55vw, 5.6rem)/.99 var(--headline); letter-spacing: -.075em; max-width: 15ch; text-wrap: balance; }
.dek { margin: 0; color: var(--soft); font-size: clamp(1rem, 1.35vw, 1.17rem); }
.editions { display: flex; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }
.edition-tag { border: 1px solid #4b4d41; border-radius: 4px; padding: .45rem .7rem; color: #dddccb; font: 700 .8rem/1.2 var(--mono); }

.guide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(286px, 329px); gap: 16px; align-items: start; }
.map-card, .room-card { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.magazine-issue {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 69px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  background: var(--brand-shade);
  color: var(--text);
  text-decoration: none;
}
.magazine-issue:focus-visible { outline-offset: -3px; }
.magazine-cover { width: 40px; height: 56px; object-fit: contain; border-radius: 2px; }
.magazine-copy { display: grid; flex: 1 1 auto; gap: 1px; min-width: 0; }
.magazine-status { color: var(--brand-text); font: 700 .72rem/1.35 var(--mono); }
.magazine-name { font-size: 1.04rem; line-height: 1.2; }
.magazine-cta { font-size: .85rem; font-weight: 750; text-align: right; }
.magazine-issue:hover .magazine-cta { color: var(--brand-text); text-decoration: underline; text-underline-offset: .2em; }
.card-top, .map-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; }
.card-title, .map-buttons, .zoom-group, .room-search, .map-key, .search-group { display: flex; align-items: center; }
.card-title { gap: 10px; min-width: 0; }
.map-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; background: var(--brand-shade); color: var(--brand-text); font-size: 1.25rem; flex: 0 0 auto; }
.card-title h2 { margin: 0; font-size: 1.06rem; line-height: 1.15; letter-spacing: -.02em; }
.card-title p { margin: 3px 0 0; color: var(--muted); font: .76rem/1.15 var(--mono); }
.map-buttons { gap: 7px; flex-shrink: 0; }
.map-buttons button, .search-group button, .map-focus, .close-button, .reset-button {
  min-height: 38px;
  border: 1px solid #44473c;
  border-radius: 6px;
  color: var(--text);
  background: var(--raised);
  font-size: .84rem;
  font-weight: 700;
  padding: 0 11px;
}
.map-buttons button:hover:not(:disabled), .search-group button:hover, .map-focus:hover, .close-button:hover, .reset-button:hover { border-color: #79805d; background: #353a2c; }
.zoom-group { background: var(--raised); border: 1px solid #44473c; border-radius: 6px; }
.zoom-group button { padding: 0; width: 36px; min-height: 36px; border: 0; background: transparent; font-size: 1.2rem; }
#zoom-value { min-width: 50px; padding: 0 3px; text-align: center; color: var(--soft); font: .76rem/1.2 var(--mono); }
.map-window {
  position: relative;
  height: clamp(365px, calc(100dvh - 345px), 620px);
  overflow: hidden;
  background: radial-gradient(circle at 50% 70%, #22251f, #10120f 75%);
  border-block: 1px solid #3a3c32;
}
.map-window::before {
  position: absolute; inset: 0; content: ""; pointer-events: none;
  background-image: radial-gradient(#45483b 0.75px, transparent 0.75px);
  background-size: 18px 18px;
  opacity: .45;
}
#mapa { position: relative; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#mapa:focus-visible { outline-offset: -3px; }
#mapa.is-dragging { cursor: grabbing; }
#mapa.is-pointing { cursor: pointer; }
#map-loading { position: absolute; inset: 44% 0 auto; text-align: center; pointer-events: none; }
.map-label, .map-focus { position: absolute; z-index: 1; }
.map-label { bottom: 13px; left: 14px; color: #c1c7ac; background: #151713ed; border: 1px solid #444739; border-radius: 4px; padding: 5px 8px; font: .72rem/1.4 var(--mono); pointer-events: none; }
.map-focus { bottom: 13px; right: 14px; background: #20231deb; }
.map-focus span { color: var(--lime); margin-right: 3px; }
.map-footer { min-height: 67px; }
.map-key { color: var(--soft); font-size: .83rem; gap: 14px; flex-wrap: wrap; }
.map-key span { display: inline-flex; align-items: center; gap: 6px; }
.map-key i { display: inline-block; width: 13px; }
.legend-current { height: 13px; border: 2px solid var(--lime); border-radius: 50%; }
.legend-route { height: 3px; border-radius: 2px; background: var(--orange); }
.room-search { gap: 8px; color: var(--soft); font-size: .84rem; font-weight: 700; }
.search-group { gap: 4px; }
.search-group input { width: 61px; min-height: 38px; text-transform: uppercase; color: var(--text); background: #161815; border: 1px solid #4b4d41; border-radius: 6px; padding-inline: 6px; font: .9rem/1.4 var(--mono); }
.form-error { color: #ffb096; margin: 0 16px 14px; font-size: .875rem; }

.panel { display: grid; gap: 10px; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; border: 1px solid var(--line); border-radius: 10px; padding: 5px; background: var(--panel); }
.mode-switch button { min-height: 46px; padding: 5px 8px; border: 1px solid transparent; border-radius: 6px; font-weight: 800; color: var(--soft); background: transparent; }
.mode-switch button span { margin-right: 4px; }
.mode-switch button[aria-pressed="true"] { color: var(--brand-on); background: var(--brand); }
.mode-switch button:hover[aria-pressed="false"] { color: var(--text); background: var(--raised); }
.room-card { padding: 17px; }
.room-prefix { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--lime); text-transform: uppercase; font: 700 .73rem/1.25 var(--mono); letter-spacing: .07em; }
.reset-button { font-family: var(--body); letter-spacing: normal; text-transform: none; }
.room-card h2 { margin: 4px 0 11px; font: 900 2rem/1.1 var(--headline); letter-spacing: -.06em; }
.room-preview { position: relative; aspect-ratio: 15/7; border-radius: 7px; background: #000; overflow: hidden; border: 1px solid #414238; }
.room-preview canvas { display: block; width: 100%; height: 100%; }
.room-content { padding-top: 14px; }
.mode-copy { color: var(--soft); margin-bottom: .9rem; }
.hint-line { margin: 0 0 .7rem; background: var(--brand-shade); color: var(--text); border-left: 2px solid var(--brand); padding: .65rem .75rem; border-radius: 0 5px 5px 0; }
.hint-line p { margin: 0; font-size: .94rem; }
.hint-line strong { display: block; color: var(--brand-text); margin-bottom: .22rem; font: 700 .73rem/1.3 var(--mono); text-transform: uppercase; }
.primary { width: 100%; min-height: 44px; padding: .58rem .75rem; border-radius: 6px; border: 1px solid transparent; color: var(--brand-on); background: var(--brand); font-size: .94rem; font-weight: 900; }
.primary:hover { background: var(--brand-hover); }
.solve-label { color: #ffab90; font: 700 .75rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: .04em; }
#instruction-title { margin: .35rem 0 .35rem; line-height: 1.14; font-size: 1.4rem; letter-spacing: -.035em; }
#instruction-text { color: var(--soft); margin-bottom: .7rem; font-size: .97rem; }
.instruction-note { border-left: 2px solid var(--orange); padding-left: 9px; color: var(--soft); font-size: .89rem; margin-bottom: .84rem; }
.route-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 11px; }
.room-notice { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); margin: 0; }
.edition-footer { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; padding-block: 22px 29px; color: var(--muted); font-size: .875rem; }

dialog { background: var(--panel); color: var(--text); border: 1px solid #505344; border-radius: 12px; width: min(36rem, calc(100% - 24px)); max-height: calc(100dvh - 36px); padding: 0; }
dialog::backdrop { background: #0b0d09cb; }
.dialog-body { padding: 21px 24px 24px; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.dialog-heading h2 { margin: 0; font-size: 1.5rem; letter-spacing: -.045em; line-height: 1.15; }
.dialog-body p, .dialog-body li, .controls-table { color: var(--soft); }
.dialog-body p:last-child { margin-bottom: 0; }
.dialog-body li + li { margin-top: .45rem; }
.close-button { font-size: 1.35rem; }
.route-list { padding-left: 2rem; color: var(--orange); margin-bottom: 0; }
.route-list li::marker { font: 700 .82rem/1.3 var(--mono); }
.route-list button { min-height: 38px; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--raised); border-radius: 6px; padding: 5px 10px; color: var(--text); }
.route-list button:hover { border-color: #79805d; }
.controls-editions { display: flex; flex-wrap: wrap; gap: 7px; margin-block: 12px; }
.controls-editions button { padding: .5rem .75rem; border: 1px solid #575b4c; border-radius: 6px; color: var(--text); background: var(--raised); }
.controls-editions button[aria-pressed="true"] { background: var(--lime); color: #1c2315; font-weight: 800; }
.controls-table { display: grid; grid-template-columns: max-content 1fr; column-gap: 14px; }
.controls-table dt, .controls-table dd { border-bottom: 1px solid var(--line); padding-block: .35rem; margin: 0; }
.controls-table dt { color: var(--text); font-weight: 700; }

@media (max-width: 1060px) {
  .shell { width: min(100% - 44px, 1420px); }
  .guide { grid-template-columns: minmax(0, 1fr) 286px; gap: 11px; }
  .intro { align-items: flex-start; flex-direction: column; gap: 15px; }
  .card-top, .map-footer { padding-inline: 11px; }
}
@media (max-width: 760px) {
  .shell { width: calc(100% - 24px); }
  .masthead-inner { min-height: 54px; }
  .seal { gap: 6px; }
  .help-button { min-height: 38px; font-size: .75rem; }
  .help-button span { display: none; }
  .intro { padding: 24px 0 17px; gap: 11px; }
  h1 { font-size: clamp(2.4rem, 9vw, 4.2rem); }
  .guide { display: flex; flex-direction: column; gap: 10px; }
  .map-card, .panel { width: 100%; }
  .map-window { height: clamp(250px, 64vw, 420px); }
  .room-preview { max-width: 470px; }
  .card-title h2 { font-size: .9rem; }
  .map-icon { display: none; }
  .map-buttons button { padding-inline: 6px; font-size: .75rem; }
  .zoom-group button { width: 32px; font-size: 1.18rem; }
  #zoom-value { min-width: 43px; font-size: .7rem; }
  .map-label { left: 8px; bottom: 8px; }
  .map-focus { right: 8px; bottom: 8px; }
  .map-footer { min-height: 53px; padding-block: 7px; }
  .map-key { gap: 6px; font-size: .75rem; }
  .room-search { gap: 5px; font-size: .75rem; }
}

.objective-label { display: block; color: var(--soft); font-weight: 700; font-size: .85rem; margin-bottom: 4px; }
#objective {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 6px 8px;
  color: var(--text);
  background: var(--raised);
  border: 1px solid #595d4f;
  border-radius: 6px;
  font: 700 .9rem/1.25 var(--body);
}
.inventory-button { display: block; min-height: 38px; margin-bottom: 4px; }
.items-list { display: grid; gap: 5px; }
.items-list label { min-height: 42px; display: flex; align-items: center; gap: 9px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; }
.items-list input { width: 17px; height: 17px; accent-color: var(--lime); }
.route-list small { display: block; margin: 4px 0 6px; color: var(--soft); }
.room-preview { aspect-ratio: 2; }
.coverage { margin-top: 24px; padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.coverage h2 { margin: 0 0 11px; font-size: 1.18rem; letter-spacing: -.03em; }
.coverage-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.coverage-link { display: grid; grid-template-columns: 54px 1fr; align-items: start; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; text-decoration: none; }
.coverage-link:hover { border-color: #79805d; }
.coverage-link img { width: 100%; aspect-ratio: 3/4; object-fit: contain; object-position: center top; }
.coverage-link strong, .coverage-link span span, .coverage-link small { display: block; }
.coverage-link span span { color: var(--text); font-size: .9rem; line-height: 1.25; margin-block: 2px 4px; }
.coverage-link small { color: var(--soft); font-size: .75rem; line-height: 1.25; }
.physical-link { margin: 12px 0 0; font-size: .86rem; }
@media (max-width: 760px) {
  .coverage { margin-top: 16px; }
  .coverage-grid { grid-template-columns: 1fr; }
  .coverage-link { grid-template-columns: 43px 1fr; }
}
.physical-link a { display: inline-flex; align-items: center; gap: 8px; }
.physical-link img { width: 34px; height: 30px; object-fit: contain; }
.capture-button { min-height: 38px; padding-top: 5px; }
.capture-list { display: grid; gap: 15px; }
.capture-list figure { margin: 0; }
.capture-list img { display: block; width: min(100%, 480px); height: auto; image-rendering: pixelated; border-radius: 5px; }
.capture-list figcaption { margin-top: 4px; color: var(--soft); font-size: .86rem; }

.grid-toggle {
  min-height: 34px;
  padding: 2px 7px;
  color: var(--soft);
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 5px;
  font: inherit;
  font-weight: 700;
}
.grid-toggle[aria-pressed="true"] { color: var(--text); border-color: #808376; }
@media (max-width: 760px) {
  .magazine-issue { gap: 9px; padding-inline: 10px; }
  .magazine-cta { font-size: .76rem; }
  .map-footer { flex-wrap: wrap; gap: 5px 12px; }
}

.intro-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
