:root { --orange: #FF5E00; --black: #050505; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--orange); color: #000; font-family: "Barlow Condensed", "Arial Narrow", Impact, sans-serif; -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: 12px 10px 20px; touch-action: manipulation; }
.top { width: min(960px, 100%); display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.top a.back { font-weight: 800; text-transform: uppercase; letter-spacing: .1em; font-size: 15px; color: #000; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.top a.back:hover { color: #fff; }
.sticker { display: inline-block; padding: 5px 10px; background: #000; color: var(--orange); font-weight: 800; text-transform: uppercase; letter-spacing: .12em; font-size: 12px; border-radius: 6px; transform: rotate(-3deg); box-shadow: 0 0 0 3px #fff; }
.langs { display: inline-flex; gap: 2px; background: #0c0c0c; border: 2px solid #2a2a2a; border-radius: 999px; padding: 3px; }
.langs button { padding: 4px 10px; border-radius: 999px; border: 0; background: none; color: #9a938d; font: inherit; font-weight: 700; letter-spacing: .1em; font-size: 12px; cursor: pointer; }
.langs button.on { background: var(--orange); color: #000; }
/* portrait game (256 x 480): the device follows the window height on desktop, the width on phones */
.device { position: relative; width: min(100%, calc((100vh - 128px) * .5333 + 34px)); width: min(100%, calc((100dvh - 128px) * .5333 + 34px)); min-width: min(100%, 290px); border-radius: 26px; background: linear-gradient(180deg, #262626 0%, #141414 38%, #070707 100%); border: 3px solid #0b0b0b; box-shadow: 0 0 0 3px rgba(255, 150, 80, .55), 0 22px 46px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .16), inset 0 -5px 0 rgba(0, 0, 0, .75); padding: 14px; }
.screen { position: relative; width: 100%; background: #000; border-radius: 14px; overflow: hidden; border: 3px solid #000; box-shadow: inset 0 0 0 2px #1a1a1a, inset 0 0 40px rgba(0, 0, 0, .8); }
canvas { display: block; width: 100%; height: auto; aspect-ratio: 256 / 480; image-rendering: pixelated; image-rendering: crisp-edges; background: #0a0b0a; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.ov { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: flex-start; text-align: center; padding: 18px 12px 14px; color: #fff; background: rgba(0, 0, 0, .78); overflow-y: auto; z-index: 3; }
.ov.on { display: flex; }
.ov > :first-child { margin-top: auto; } .ov > :last-child { margin-bottom: auto; }
#ov-title > .gear:first-child { margin-top: 0; }
#ov-title > h1 { margin-top: auto; }
.ov h1, .ov h2 { font-family: "Press Start 2P", monospace; text-transform: uppercase; color: #fff; margin: 0 0 8px; line-height: 1.5; text-shadow: 3px 3px 0 #000; }
.ov h1 { font-size: clamp(14px, 4.2vw, 22px); } .ov h1 .o, .ov h2 { color: var(--orange); }
.ov h2 { font-size: clamp(12px, 3vw, 17px); }
.ov h3 { font-family: "Press Start 2P", monospace; font-size: 10px; color: var(--orange); margin: 12px 0 2px; text-transform: uppercase; }
.ov p { margin: 3px 0; font-size: clamp(13px, 1.8vw, 16px); color: #d8d2cc; font-weight: 600; letter-spacing: .03em; max-width: 440px; }
.ov .big { font-family: "Press Start 2P", monospace; font-size: clamp(13px, 3vw, 20px); color: #f2c14e; margin: 10px 0 6px; display: flex; align-items: center; gap: 8px; }
.ov .big img { image-rendering: pixelated; width: 21px; height: 21px; }
.ov .muted { color: #8C8580; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; margin-top: 8px; }
.ov .ctl { color: #b3aba5; line-height: 1.45; margin-top: 10px; text-transform: none; letter-spacing: .02em; font-size: 12.5px; }
.ov .tag { font-size: 14px; }
.ov .sub { font-size: 13px; color: #b3aba5; }
.glory { display: inline-flex; align-items: center; gap: 6px; font-family: "Press Start 2P", monospace; font-size: 10px !important; color: #f2c14e !important; margin: 6px 0 2px !important; }
.glory img { width: 14px; height: 14px; image-rendering: pixelated; }
.btn { display: inline-flex; align-items: center; justify-content: center; margin: 10px 4px 0; padding: 9px 22px 11px; border-radius: 999px; border: 0; cursor: pointer; background: linear-gradient(180deg, #FF9A55 0%, var(--orange) 50%, #D64D00 100%); color: #1B0A00; font-family: "Press Start 2P", monospace; font-size: clamp(9px, 2.2vw, 12px); text-transform: uppercase; box-shadow: inset 0 3px 0 rgba(255, 255, 255, .35), inset 0 -5px 0 rgba(0, 0, 0, .3), 0 10px 20px rgba(0, 0, 0, .35), 0 0 0 3px #0b0b0b; transition: transform .12s; }
.btn:hover { transform: translateY(-2px); } .btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .4; cursor: default; transform: none; }
.btn.ghost { background: linear-gradient(180deg, #303030 0%, #121212 45%, #030303 100%); color: var(--orange); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .2), inset 0 -5px 0 rgba(0, 0, 0, .85), 0 10px 20px rgba(0, 0, 0, .38), 0 0 0 3px rgba(255, 150, 80, .55); }
.tbtns { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.tbtns.col { flex-direction: column; align-items: center; }
.tbtns.col .btn { min-width: 210px; }
.opts { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.opts button { border: 2px solid #333; background: #0c0c0c; color: #b3aba5; border-radius: 999px; padding: 5px 12px; font: inherit; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; cursor: pointer; }
.opts button.on { background: var(--orange); color: #000; border-color: var(--orange); }
.opts button[disabled] { opacity: .35; cursor: default; }
/* map choice */
.maps { display: flex; flex-direction: column; gap: 6px; width: min(100%, 380px); margin-top: 4px; }
.tile.map { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 1px 8px; text-align: left; background: linear-gradient(180deg, #2a2a2a, #111); border: 3px solid #0b0b0b; border-radius: 12px; padding: 7px 10px; cursor: pointer; box-shadow: 0 0 0 2px rgba(255, 150, 80, .3), 0 8px 18px rgba(0, 0, 0, .5); color: #fff; font: inherit; transition: transform .12s; }
.tile.map:hover { transform: translateY(-1px); }
.tile.map.on { box-shadow: 0 0 0 3px var(--orange), 0 10px 22px rgba(0, 0, 0, .6); background: linear-gradient(180deg, #3a2210, #140a04); }
.tile.map.locked { opacity: .62; }
.tile.map b { font-family: "Press Start 2P", monospace; font-size: 10px; color: var(--orange); line-height: 1.6; }
.tile.map b em { font-style: normal; color: #7fd16b; font-size: 7px; margin-left: 6px; vertical-align: 2px; }
.tile.map i { font-style: normal; color: #f2c14e; font-size: 14px; letter-spacing: 1px; text-align: right; }
.tile.map span { grid-column: 1 / -1; font-size: 13px; color: #d8d2cc; font-weight: 600; line-height: 1.2; }
.tile.map small { grid-column: 1 / -1; font-size: 11px; color: #8c8580; text-transform: uppercase; letter-spacing: .08em; }
.tile.map u { grid-column: 1 / -1; justify-self: start; text-decoration: none; margin-top: 3px; padding: 3px 10px; border-radius: 999px; background: #f2c14e; color: #1b0a00; font-weight: 800; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
/* hall of the ancestors */
.metal { width: min(100%, 420px); text-align: left; }
.metal .gl { display: flex; align-items: center; gap: 8px; justify-content: center; font-family: "Press Start 2P", monospace; font-size: 11px; color: #f2c14e; margin: 4px 0 8px; max-width: none; }
.metal .gl img { width: 14px; height: 14px; image-rendering: pixelated; }
.mrow { display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .05); border: 1px solid #2a2a2a; border-radius: 10px; padding: 6px 8px 6px 10px; margin-bottom: 5px; }
.mrow .mt { flex: 1; min-width: 0; }
.mrow b { display: block; font-size: 15px; color: #e9e4dc; letter-spacing: .03em; }
.mrow span { display: block; font-size: 12.5px; color: #b3aba5; font-weight: 600; line-height: 1.2; }
.mrow .pips { display: flex; gap: 3px; margin-top: 4px; }
.mrow .pips i { width: 12px; height: 6px; border-radius: 2px; background: #2a2a2a; }
.mrow .pips i.on { background: var(--orange); }
.mrow em, .scell em { font-style: normal; font-family: "Press Start 2P", monospace; font-size: 8px; color: #7fd16b; }
.buy { min-width: 58px; padding: 7px 10px; border-radius: 999px; border: 0; cursor: pointer; font-family: "Press Start 2P", monospace; font-size: 9px; background: #f2c14e; color: #1b0a00; }
.buy[disabled] { background: #2a2a2a; color: #6a625c; cursor: default; }
.muted2 { font-size: 12.5px !important; color: #8c8580 !important; margin: 0 0 6px !important; }
.sgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.scell { display: flex; flex-direction: column; align-items: center; gap: 3px; background: rgba(255, 255, 255, .05); border: 1px solid #2a2a2a; border-radius: 10px; padding: 6px 4px; text-align: center; }
.scell img { width: 36px; height: 42px; image-rendering: pixelated; }
.scell b { font-size: 12.5px; color: #e9e4dc; line-height: 1.1; min-height: 28px; }
/* banner */
.banner { position: absolute; left: 0; right: 0; top: 24%; text-align: center; pointer-events: none; font-family: "Press Start 2P", monospace; color: var(--orange); font-size: clamp(12px, 4vw, 20px); text-shadow: 3px 3px 0 #000, 0 0 16px rgba(0, 0, 0, .8); opacity: 0; transition: opacity .25s; text-transform: uppercase; padding: 0 8px; z-index: 2; line-height: 1.4; }
.banner.on { opacity: 1; }
.banner small { display: block; font-size: 55%; color: #fff; margin-top: 8px; }
.hint { width: min(960px, 100%); margin-top: 10px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: 12px; color: #2a1200; }
.hint button { border: 0; background: none; font: inherit; font-weight: 800; cursor: pointer; color: #000; text-transform: uppercase; letter-spacing: .1em; padding: 0; }
.hint button:hover { color: #fff; }
.hint .legal a { color: #2a1200; text-decoration: none; } .hint .legal a:hover { color: #fff; }
.hint #btn-fs { margin-right: 14px; }
.hint #btn-fs.on { color: #fff; }
/* settings menu (gear on the title screen, button in the pause menu) */
.gear { position: absolute; top: 10px; left: 10px; z-index: 2; width: 38px; height: 38px; padding: 0; border-radius: 50%; border: 2px solid rgba(255, 150, 80, .55); background: rgba(0, 0, 0, .55); color: var(--orange); font-size: 21px; line-height: 1; cursor: pointer; }
.gear:hover, .gear:focus-visible { color: #fff; }
.setl { width: min(420px, 100%); display: flex; flex-direction: column; gap: 6px; margin: 6px 0 4px; }
.srow { display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, .05); border: 1px solid #2a2a2a; border-radius: 10px; padding: 5px 8px 5px 12px; }
.srow b { flex: 1; text-align: left; font-weight: 700; letter-spacing: .04em; font-size: clamp(13px, 1.7vw, 16px); color: #e9e4dc; }
.tog { min-width: 58px; padding: 7px 10px; border-radius: 999px; border: 0; cursor: pointer; font-family: "Press Start 2P", monospace; font-size: 9px; background: #2a2a2a; color: #8c8580; }
.tog.on { background: var(--orange); color: #1b0a00; }
.srow input[type=range] { width: 96px; accent-color: #FF5E00; cursor: pointer; }
.srow input[type=range]:disabled { opacity: .3; cursor: default; }
.segs { display: inline-flex; gap: 2px; background: #0c0c0c; border: 2px solid #2a2a2a; border-radius: 999px; padding: 3px; }
.segs button { padding: 4px 10px; border-radius: 999px; border: 0; background: none; color: #9a938d; font: inherit; font-weight: 700; cursor: pointer; }
.segs button.on { background: var(--orange); color: #000; }
@media (max-width: 600px) {
  body { padding: 8px 6px 14px; } .top { margin-bottom: 8px; } .device { padding: 8px; border-radius: 18px; } .screen { border-radius: 10px; }
  .top a.back span.t { display: none; }
  .ov { padding: 12px 8px 10px; }
  .srow input[type=range] { width: 64px; } .srow { gap: 6px; padding-left: 9px; }
  .ov .ctl { font-size: 11.5px; }
  .tile.map { padding: 5px 8px; } .tile.map span { font-size: 12px; }
  .btn { margin-top: 8px; padding: 9px 16px 11px; }
  .tbtns.col .btn { min-width: 190px; }
}
@media (max-height: 560px) and (orientation: landscape) {
  body { padding: 4px 6px 6px; } .top { margin-bottom: 4px; }
  .hint { margin-top: 6px; justify-content: center; font-size: 10px; }
}
/* desktop windows of 820 px and less: the title overlay fits without an inner scrollbar */
@media (max-height: 820px) and (min-width: 601px) {
  #ov-title { padding: 10px 10px 8px; } #ov-title .tag { font-size: 13px; }
  #ov-title .tile.map { padding: 5px 9px; } #ov-title .ctl { margin-top: 6px; font-size: 11.5px; }
}
/* windows that open on top of another overlay get a solid background */
#ov-meta, #ov-set { background: rgba(8, 7, 6, .97); z-index: 4; }
