/* ---------- screens ---------- */
.modal { position: fixed; inset: 0; z-index: 40; background: #05060acc; display: grid; place-items: center; padding: 16px; }
.modal-in { background: #11141c; border-radius: 6px; padding: 22px 22px 18px; width: min(420px, 100%); display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 60px #000; }
.modal-in h2 { margin: 0; font-family: 'Playfair Display', serif; font-style: italic; color: var(--torch); font-size: 30px; }
.set { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 18px; font-weight: 600; }
.set input[type=range] { flex: 1; max-width: 200px; accent-color: var(--torch); height: 30px; }
.tog { min-width: 64px; min-height: 36px; border: 0; border-radius: 18px; background: #262a35; font-weight: 700; }
.tog.on { background: var(--torch); color: #1b1408; }
.seg3 { display: inline-flex; border-radius: 4px; overflow: hidden; box-shadow: inset 0 0 0 1px #ffffff22; }
.seg3 button { border: 0; background: transparent; padding: 8px 10px; font-weight: 600; font-size: 15px; }
.seg3 button.on { background: var(--torch); color: #1b1408; }
.set-note { margin: 0; color: var(--dim); font-size: 14px; }
.sub-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(14px, env(safe-area-inset-top)) 16px 10px; max-width: 1180px; margin: 0 auto; }
.sub-top h2 { margin: 0; font-family: 'Playfair Display', serif; font-style: italic; font-size: 32px; color: var(--ink); }
.sub-top > div { text-align: center; }
.sub-top .btn { min-height: 40px; padding: 8px 14px; font-size: 15px; }
.cash { font-family: var(--hud); font-weight: 700; font-size: 24px; color: var(--torch); }

/* title */
#title { background: var(--night); }
.title-art { position: absolute; inset: 0; overflow: hidden; }
.title-art img { position: absolute; right: 7vw; top: 50%; height: min(74vh, 700px); transform: translateY(-50%); filter: brightness(.8); box-shadow: 0 0 0 14px #2b2214, 0 0 0 16px #6e5220; }
@property --bx { syntax: '<percentage>'; inherits: false; initial-value: 72%; }
@property --by { syntax: '<percentage>'; inherits: false; initial-value: 46%; }
.title-beam { position: absolute; inset: 0; background: radial-gradient(circle at var(--bx) var(--by), transparent 0 110px, #07080cd0 230px, #07080c 430px); animation: beam 14s ease-in-out infinite alternate; }
@keyframes beam { 0% { --bx: 66%; --by: 40%; } 50% { --bx: 80%; --by: 58%; } 100% { --bx: 70%; --by: 34%; } }
.reduced .title-beam { animation: none; }
.title-in { position: relative; padding: max(8vh, 40px) 7vw 40px; max-width: 640px; min-height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.title-in h1 { font-family: 'Playfair Display', serif; font-weight: 900; font-style: italic; font-size: clamp(54px, 9vw, 112px); line-height: .92; margin: 0; color: var(--ink); text-shadow: 0 4px 30px #000; }
.title-sub { font-family: var(--serif); font-size: 18px; line-height: 1.5; color: #cfc8b8; margin: 4px 0 8px; max-width: 460px; text-shadow: 0 2px 8px #000; }
.title-btns { display: flex; flex-direction: column; gap: 10px; max-width: 320px; }
.title-row { display: flex; gap: 10px; }
.title-row .btn { flex: 1; }
.title-foot { font-size: 14px; color: var(--dim); max-width: 420px; line-height: 1.4; margin-top: 16px; text-shadow: 0 1px 4px #000; }

/* hub */
#hub { background: radial-gradient(ellipse at 30% 0%, #241d14, #0c0b09 70%); }
.hub, .gar { max-width: 1180px; margin: 0 auto; padding-bottom: 40px; }
.hub-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding: max(18px, env(safe-area-inset-top)) 20px 12px; flex-wrap: wrap; }
.hub-top h2 { margin: 2px 0 0; font-family: 'Playfair Display', serif; font-style: italic; font-size: 38px; }
.hub-stats { display: flex; gap: 22px; align-items: center; }
.hub-stats > div { display: flex; flex-direction: column; }
.hub-stats small { color: var(--dim); font-size: 13px; max-width: 150px; }
.heat { font-size: 18px; letter-spacing: 3px; color: #6c7a95; }
.heat.h2, .heat.h3 { color: var(--torch2); }
.heat.h4 { color: var(--alert); }
.hub-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; padding: 10px 20px; align-items: start; }
.hub-note { display: flex; flex-direction: column; gap: 14px; }
.hub-note .note { transform: rotate(-1deg); font-size: 16px; }
.note .hint { margin-top: 10px; font-family: var(--hand); color: #7a2a12; font-size: 15px; }
.reply { transform: rotate(1.5deg); align-self: flex-end; width: 78%; }
.note.small { font-size: 14px; padding: 12px 16px; }
.note.small::before { display: none; }
.hub-actions { display: flex; flex-direction: column; gap: 10px; }
.btn.big { font-size: 24px; min-height: 70px; }
.go-sub { color: var(--dim); font-size: 15px; text-align: center; margin-bottom: 8px; }
.hub-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { text-align: left; padding: 14px 16px; min-height: 84px; border: 0; border-radius: 4px; background: #ffffff0a; box-shadow: inset 0 0 0 1px #ffffff18; display: flex; flex-direction: column; gap: 4px; }
.tile:hover:not(:disabled) { background: #ffffff14; }
.tile:disabled { opacity: .45; cursor: default; }
.tile b { font-size: 20px; letter-spacing: .02em; }
.tile span { color: var(--dim); font-size: 14px; font-weight: 500; }
.linkbtn { background: none; border: 0; color: var(--torch); text-decoration: underline; font-size: 16px; padding: 10px; align-self: center; }

/* garage */
.tier { padding: 8px 20px 14px; }
.tier-h { font-weight: 700; font-size: 15px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); margin: 8px 0; }
.tier-h span { color: var(--dim); letter-spacing: .04em; text-transform: none; font-weight: 500; }
.tier.locked .kit { opacity: .45; }
.tier-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.kit { background: #ffffff0a; border-radius: 4px; padding: 14px; display: flex; flex-direction: column; gap: 6px; box-shadow: inset 0 0 0 1px #ffffff14; }
.kit.own { box-shadow: inset 0 0 0 1.5px var(--torch); }
.kit-ico { width: 48px; height: 44px; color: var(--torch); }
.kit b { font-size: 20px; }
.kit p { margin: 0; color: #bdb7aa; font-size: 15px; line-height: 1.3; flex: 1; font-weight: 500; }
.kit .btn { margin-top: 6px; min-height: 42px; padding: 8px; }
.kit-grid { height: calc(var(--r) * 6px); width: calc(var(--c) * 6px); background-image: linear-gradient(#0000 5px, #00000060 0), linear-gradient(90deg, #0000 5px, #00000060 0); background-size: 6px 6px; background-color: #6e5536; }

/* blueprint */
#blueprint { background: #0b1a33; }
.bp-scroll { overflow-x: auto; padding: 16px; margin: 0 auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.bp { display: block; background: var(--blue); border-radius: 4px; }
.bp .room { fill: #16305a; stroke: var(--line); stroke-width: 1; }
.bp .room.seen { fill: #1a3870; }
.bp .wall { fill: var(--line); opacity: .8; }
.bp .floor { stroke: var(--line); stroke-width: 2; }
.bp .duct { fill: none; stroke: #9cc0ff88; stroke-dasharray: 6 4; }
.bp .grate { fill: var(--torch); }
.bp .wk { fill: #9cc0ff33; stroke: #9cc0ffaa; stroke-width: .8; }
.bp .wk.tgt { fill: #ffcf7a66; stroke: var(--torch); stroke-width: 1.5; }
.bp .wk.gone { fill: none; stroke-dasharray: 2 2; }
.bp .tgt-m { fill: var(--torch); }
.bp .route { stroke: var(--guard); stroke-width: 2; stroke-dasharray: 4 4; }
.bp .gstep { fill: var(--blue); stroke: var(--guard); stroke-width: 1.5; }
.bp .gstep-t { fill: var(--ink); font: 700 11px var(--hud); text-anchor: middle; dominant-baseline: central; }
.bp-l { fill: var(--line); font: 700 16px var(--hud); letter-spacing: .06em; }
.bp-s { fill: #9cc0ffbb; font: 500 12px var(--hud); }
.bp-q { fill: #5f7bb0; font: italic 13px var(--serif); }
.bp-notes { max-width: 820px; margin: 0 auto; padding: 4px 20px 30px; color: #c6d6f5; font-size: 16px; line-height: 1.45; font-weight: 500; }
.bp-foot { color: #7f97c4; font-family: var(--serif); font-style: italic; font-size: 14px; border-top: 1px solid #9cc0ff33; padding-top: 10px; }

/* the paper */
#paper { background: #1b1915; }
.paperw { padding: max(18px, env(safe-area-inset-top)) 14px 40px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.paper { background: #ece6d6; color: #1a1814; width: min(880px, 100%); padding: 18px 26px 22px; font-family: var(--serif); box-shadow: 0 20px 50px #000a; }
.mast { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; border-bottom: 3px double #1a1814; padding-bottom: 6px; font-family: var(--hud); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.mast span:last-child { text-align: right; }
.mast h1 { font-family: 'UnifrakturCook', serif; font-weight: 700; font-size: clamp(30px, 6vw, 58px); margin: 0 12px; text-transform: none; letter-spacing: 0; line-height: 1; }
.head { font-family: 'Playfair Display', serif; font-weight: 900; font-size: clamp(28px, 5vw, 46px); line-height: 1.02; margin: 14px 0 6px; }
.dek { font-style: italic; font-size: 18px; margin: 0 0 14px; }
.cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; border-top: 1px solid #1a181444; padding-top: 12px; }
.cols p { margin: 0 0 10px; font-size: 15px; line-height: 1.5; }
.cols figure { margin: 0 0 10px; }
.cols figure img { max-width: 100%; max-height: 320px; display: block; margin: 0 auto; }
.cols figcaption { font-size: 12px; font-style: italic; margin-top: 4px; color: #4a453c; }
.col-list h3 { font-family: var(--hud); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: 14px; margin: 0 0 8px; border-bottom: 1px solid #1a1814; padding-bottom: 4px; }
.took { font-size: 14px; line-height: 1.4; margin-bottom: 10px; }
.took span { display: block; color: #5a5348; font-size: 13px; }
.brief { border-top: 1px solid #1a181444; padding-top: 8px; font-size: 14px; margin: 8px 0 0; }
.paper-reply { width: min(420px, 100%); }
.final { text-align: center; max-width: 560px; }
.final-q { font-family: var(--serif); font-size: 18px; line-height: 1.5; color: #e6dfcf; }
.final-btns, .end-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* wall */
#wall { background: #15120f; }
.wall-sub { text-align: center; color: var(--dim); margin: 0 16px 10px; font-size: 15px; }
.wall-scroll { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.wall { position: relative; background: linear-gradient(#6b5446, #5a4539); margin: 0 auto; }
.wall .skirting { position: absolute; left: 0; right: 0; bottom: 0; height: 3%; background: #2b201a; }
.wall .wk { position: absolute; border: 0; padding: 0; background: #211b14; box-shadow: 0 10px 18px #0007; }
.wall .wk.fr { background: linear-gradient(135deg, #6e5220, #c9a24e 35%, #8a6a2a 60%, #5a4218); }
.wall .wk.fr.wood, .wall .wk.fr.mounted_rigid { background: linear-gradient(135deg, #5b4127, #8d6a42 40%, #5b4127); }
.wall .wk .art { display: block; width: 100%; height: 100%; }
.wall .wk img { width: 100%; height: 100%; object-fit: contain; display: block; background: #211b14; }
.wall .chair { position: absolute; bottom: 3%; }
.wall-label { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(420px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 10px; background: #0b0d14f2; padding: 14px; border-radius: 6px; box-shadow: 0 10px 40px #000; z-index: 3; }
.wl-btns { display: flex; gap: 10px; }
.wl-btns .btn { flex: 1; font-size: 15px; padding: 10px; }
.wl-why { margin: 0; color: var(--dim); font-size: 14px; }
.ending-txt { max-width: 640px; margin: 18px auto 40px; padding: 0 20px; font-family: var(--serif); font-size: 17px; line-height: 1.55; color: #e6dfcf; text-align: center; }
.end-real { font-style: italic; color: var(--torch); }

/* credits */
#credits { background: var(--night); }
.cred section { max-width: 720px; margin: 0 auto; padding: 4px 20px 6px; }
.cred h3 { font-family: var(--hud); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: 15px; color: var(--torch); margin: 16px 0 6px; }
.cred p { font-family: var(--serif); font-size: 16px; line-height: 1.55; color: #d6d0c3; margin: 0 0 10px; }

@media (max-width: 760px) {
  .hub-grid, .cols { grid-template-columns: 1fr; }
  .hub-top h2 { font-size: 30px; }
  .hub-stats { gap: 14px; }
  .title-art img { right: -30vw; height: 70vh; opacity: .55; }
  .title-in { padding: 40px 22px; }
  .sub-top h2 { font-size: 24px; }
  .paper { padding: 14px 16px; }
  .mast { grid-template-columns: 1fr; text-align: center; }
  .mast span { display: none; }
}
