* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0e1717; color: #efe6d2; font-family: Georgia, 'Times New Roman', serif; user-select: none; -webkit-user-select: none; touch-action: none; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui > * { pointer-events: auto; }
.pass { pointer-events: none !important; }

/* ---------- hunt HUD ---------- */
.hud { position: absolute; inset: 0; pointer-events: none; }
.hud button { font-family: inherit; color: inherit; }
.hud-top { position: absolute; top: calc(8px + env(safe-area-inset-top)); left: 10px; right: 10px; display: flex; justify-content: space-between; align-items: flex-start; }
.beast { pointer-events: none; text-shadow: 0 1px 3px #000; }
.bname { font-variant: small-caps; letter-spacing: .08em; font-size: 15px; color: #f2e8d0; }
.bstate { font-size: 12px; font-style: italic; color: #e9c58a; height: 14px; }
.bar { position: relative; width: 150px; height: 7px; background: rgba(10,16,16,.55); border: 1px solid rgba(240,225,190,.35); border-radius: 4px; overflow: hidden; margin-top: 4px; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(#c2392b, #7d1d14); transition: width .25s; }
.bar.spirit { height: 4px; width: 120px; }
.bar.spirit i { background: linear-gradient(#e7e1cf, #9fa8a2); }
.menu-btn { pointer-events: auto; background: rgba(12,20,20,.5); border: 1px solid rgba(240,225,190,.3); border-radius: 8px; width: 40px; height: 36px; font-size: 18px; }
.hud-bot { position: absolute; left: 0; right: 0; bottom: calc(6px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tools { width: min(100%, 520px); padding: 0 10px; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.cut { pointer-events: auto; position: relative; width: 58px; height: 58px; border-radius: 50%; background: radial-gradient(#5a2a22, #2b1411); border: 2px solid #c9a76b; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 10px; letter-spacing: .12em; overflow: hidden; --p: 0; }
.cut svg { width: 28px; height: 28px; }
.cut b { position: absolute; inset: 0; background: conic-gradient(rgba(255,120,80,.55) calc(var(--p) * 360deg), transparent 0); pointer-events: none; }
.cut.off { opacity: .3; filter: grayscale(1); }
.gauges { flex: 1; display: flex; flex-direction: column; gap: 5px; padding-bottom: 4px; pointer-events: none; }
.gauge { display: flex; align-items: center; gap: 6px; font-size: 10px; letter-spacing: .1em; color: #d9ceb4; text-shadow: 0 1px 2px #000; }
.gauge label { width: 34px; }
.gauge .bar { flex: 1; width: auto; height: 9px; margin: 0; }
.gauge.line .bar i { background: linear-gradient(#e3d3a8, #a8916a); }
.gauge.line .bar em { position: absolute; left: 0; bottom: 0; height: 3px; background: #ff7b4a; transition: width .1s; }
.gauge.line.off { opacity: .35; }
.gauge.line.running .bar { box-shadow: 0 0 6px #ffb070; }
.gauge.boat .bar i { background: linear-gradient(#a9784a, #6b4426); }
.gauge.boat .bar em { position: absolute; right: 0; left: auto; top: 0; bottom: 0; background: rgba(70,140,170,.85); transition: width .3s; }
.gauge.warn { animation: warn .5s infinite alternate; }
@keyframes warn { to { color: #ff8a6a; } }
.weap { width: 58px; text-align: center; pointer-events: none; text-shadow: 0 1px 2px #000; }
.weap .irons { display: flex; justify-content: center; gap: 3px; min-height: 18px; }
.weap .ic.iron { width: 6px; height: 18px; background: linear-gradient(#cfd2d0, #7d7f7d); clip-path: polygon(50% 0, 100% 22%, 65% 22%, 65% 100%, 35% 100%, 35% 22%, 0 22%); }
.weap .wl { font-size: 11px; letter-spacing: .12em; margin-top: 3px; padding: 3px 0; border-radius: 4px; background: rgba(12,20,20,.5); border: 1px solid rgba(240,225,190,.4); }
.weap .wl.lance, .weap .wl.iron { border-color: #ffd28a; color: #ffe2b0; box-shadow: 0 0 8px rgba(255,190,110,.4); }
.weap .wl.lance-wait, .weap .wl.iron-wait, .weap .wl.none { opacity: .45; }
.crewbar { display: flex; gap: 4px; justify-content: center; width: 100%; padding: 0 4px; }
.card { pointer-events: auto; position: relative; width: 68px; max-width: 19vw; padding: 4px 2px 3px; border-radius: 10px; background: rgba(14,22,22,.62); border: 1px solid rgba(240,225,190,.25); display: flex; flex-direction: column; align-items: center; gap: 1px; --u: 1; }
.card canvas { width: 44px; height: 44px; }
.card .nm { font-size: 12px; line-height: 1.1; color: #f1e6cc; }
.card .st { font-size: 9px; line-height: 1.1; color: #b9b29e; letter-spacing: .04em; text-transform: uppercase; height: 20px; text-align: center; overflow: hidden; }
.card .hp { display: flex; gap: 2px; height: 5px; }
.card .hp i, .card .hp s { width: 9px; height: 4px; border-radius: 2px; background: #c9584a; }
.card .hp s { background: rgba(255,255,255,.15); }
.card.crisis { border-color: #ff6a4a; background: rgba(90,22,14,.78); animation: pulse .45s infinite alternate; }
.card.crisis::after { content: ''; position: absolute; left: 6px; right: 6px; bottom: 1px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, #ffb070 calc(var(--u) * 100%), transparent 0); }
.card.crisis .st { color: #ffd6a0; font-weight: bold; }
.card.ok { border-color: #8fd0a0; }
.card.gone { opacity: .4; filter: grayscale(1); }
.card.tapped { transform: scale(.94); }
@keyframes pulse { to { box-shadow: 0 0 14px #ff6a4a; transform: translateY(-2px); } }
.bubbles { position: absolute; left: 0; right: 0; bottom: calc(190px + env(safe-area-inset-bottom)); height: 0; }
.bubble { position: absolute; bottom: 0; left: 0; max-width: min(84vw, 300px); width: max-content; background: #f3ead6; color: #2a2118; padding: 6px 10px; border-radius: 12px; font-size: 14px; line-height: 1.25; box-shadow: 0 3px 10px rgba(0,0,0,.4); animation: pop .18s ease-out; }
.bubble.up { bottom: 50px; transition: bottom .2s; }
.bubble::after { content: ''; position: absolute; left: var(--tail, 50%); bottom: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: #f3ead6; transform: translateX(-50%); }
.bubble b { color: #7a3a22; margin-right: 3px; font-size: 12px; }
.bubble.out { opacity: 0; transition: opacity .4s; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.banner { position: absolute; left: 0; right: 0; top: 34%; text-align: center; font-size: 34px; font-variant: small-caps; letter-spacing: .12em; color: #fff4dc; text-shadow: 0 2px 10px #000, 0 0 30px rgba(255,180,100,.35); opacity: 0; transform: scale(.85); transition: opacity .25s, transform .25s; }
.banner.show { opacity: 1; transform: scale(1); }
.banner.bad { color: #ffb0a0; }
.hint { position: absolute; left: 50%; bottom: calc(176px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: 90vw; width: max-content; font-size: 14px; font-style: italic; color: #f7efd9; background: rgba(10,18,18,.55); padding: 6px 12px; border-radius: 16px; opacity: 0; transition: opacity .3s; text-align: center; }
.hint.show { opacity: 1; }

/* ---------- voyage screens ---------- */
.screens { position: absolute; inset: 0; overflow-y: auto; pointer-events: none; }
.screens > * { pointer-events: auto; }
.screens:empty { display: none; }
.btn { font-family: inherit; font-size: 16px; color: #2a2016; background: linear-gradient(#efe2c2, #d6c398); border: 1px solid #8a7550; border-radius: 10px; padding: 11px 18px; margin: 6px 4px 0; box-shadow: 0 2px 0 #6e5c3c, 0 4px 10px rgba(0,0,0,.35); cursor: pointer; }
.btn.main { background: linear-gradient(#ffd99a, #e0a85a); font-weight: bold; font-size: 17px; }
.btn.small { font-size: 13px; padding: 7px 12px; }
.btn.off { opacity: .45; filter: grayscale(.6); }
.btn small { font-weight: normal; opacity: .8; }
.btn:active { transform: translateY(2px); box-shadow: 0 0 0 #6e5c3c; }
.panel { width: min(94vw, 520px); margin: calc(18px + env(safe-area-inset-top)) auto 24px; padding: 18px 18px 16px; background: rgba(28,24,18,.88); border: 1px solid rgba(230,210,170,.35); border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.5); line-height: 1.45; font-size: 16px; }
.panel h2 { margin: 0 0 4px; font-variant: small-caps; letter-spacing: .06em; font-weight: normal; font-size: 28px; color: #f6e7c4; }
.panel h2.good { color: #ffe0a0; } .panel h2.bad { color: #f0b0a0; }
.panel h3 { margin: 16px 0 6px; font-weight: normal; font-variant: small-caps; letter-spacing: .08em; color: #d8c49a; border-bottom: 1px solid rgba(230,210,170,.2); }
.panel .sub { color: #c9b996; font-style: italic; margin-bottom: 8px; }
.panel p { margin: 8px 0; }
.panel .note { color: #c9b996; font-size: 14px; }
.panel .fate { color: #d8e0d0; font-size: 15px; margin: 4px 0; }
.panel .lost, .panel p.lost { color: #f0a090; }
.panel .stats { display: flex; flex-wrap: wrap; gap: 6px 14px; color: #bfb08e; font-size: 13px; margin: 10px 0; }
.panel .opts { display: flex; flex-direction: column; align-items: stretch; margin-top: 8px; }
.title { background: #0e1717 url(art/title.jpg) center/cover no-repeat; display: flex; align-items: flex-end; justify-content: center; }
@media (max-aspect-ratio: 4/5) { .title { background-image: url(art/title-tall.jpg); } }
.title-card { width: min(94vw, 520px); margin-bottom: calc(28px + env(safe-area-inset-bottom)); text-align: center; background: linear-gradient(rgba(14,18,18,0), rgba(14,18,18,.8) 30%); padding: 40px 16px 14px; border-radius: 16px; }
.title-card h1 { margin: 0; font-size: 54px; font-weight: normal; font-variant: small-caps; letter-spacing: .1em; color: #fff3d6; text-shadow: 0 3px 16px #000, 0 0 40px rgba(255,200,120,.3); }
.title-card .sub { margin: 4px 0 14px; font-style: italic; color: #e8dcc0; text-shadow: 0 1px 4px #000; }
.title-card .row { display: flex; flex-direction: column; align-items: center; }
.title-card .btn { min-width: 220px; }
.title-card .credit { font-size: 12px; color: #b8ab8c; margin-top: 14px; }
.chart { background: linear-gradient(rgba(10,16,16,.25), rgba(10,16,16,.65)); padding-bottom: 20px; }
.chart-top { width: min(94vw, 520px); margin: calc(14px + env(safe-area-inset-top)) auto 0; padding: 14px 16px; background: linear-gradient(#e7d8b3, #d2bf92); color: #3a2c1c; border-radius: 6px; box-shadow: 0 6px 24px rgba(0,0,0,.5); }
.ch-title { font-size: 24px; font-variant: small-caps; letter-spacing: .06em; }
.ch-sub { font-size: 13px; font-style: italic; color: #5a4a32; }
.route { display: flex; gap: 6px; margin-top: 10px; }
.route .seg { flex: 1; font-size: 10px; color: #7a6a4e; }
.route .seg.now { color: #3a2c1c; font-weight: bold; }
.route .sname { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route .dots { display: flex; gap: 3px; margin-top: 3px; align-items: center; }
.route .dots i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid #7a6a4e; }
.route .dots i.big { width: 13px; height: 13px; border-color: #8a2e22; }
.route .dots i.done { background: #7a6a4e; }
.route .dots i.here { background: #c4462e; border-color: #c4462e; box-shadow: 0 0 6px #c4462e; }
.choices { width: min(94vw, 520px); margin: 10px auto; display: flex; flex-direction: column; gap: 10px; }
.ch-ask { text-align: center; font-style: italic; color: #f0e4c8; text-shadow: 0 1px 4px #000; }
.choice { display: flex; gap: 12px; align-items: center; text-align: left; font-family: inherit; color: #f2e8d0; background: rgba(24,22,18,.85); border: 1px solid rgba(230,210,170,.35); border-radius: 12px; padding: 10px 12px; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.choice:active { transform: scale(.98); }
.choice.big { border-color: #e0a85a; box-shadow: 0 0 18px rgba(224,168,90,.35); }
.choice.nem { border-color: #d0604a; }
.choice .cic { flex: none; width: 72px; height: 72px; display: flex; align-items: center; justify-content: center; }
.choice .cic svg { width: 60px; height: 60px; }
.choice .ctx b { display: block; font-size: 17px; font-weight: normal; color: #fff1d0; }
.choice .ctx span { display: block; font-size: 14px; color: #cfc3a6; font-style: italic; }
.choice .ctx em { display: block; font-size: 12px; color: #a99c7e; font-style: normal; margin-top: 3px; letter-spacing: .03em; }
.foot { display: flex; justify-content: center; gap: 8px; }
.crewlist { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.crewrow { display: flex; gap: 10px; align-items: center; text-align: left; font-family: inherit; color: inherit; background: rgba(255,255,255,.04); border: 1px solid rgba(230,210,170,.15); border-radius: 10px; padding: 6px 8px; }
button.crewrow { cursor: pointer; }
.crewrow canvas { flex: none; }
.hx b { font-weight: normal; color: #fff1d0; } .hx i { font-size: 12px; color: #a99c7e; }
.hx span { display: block; font-size: 13px; color: #cbbf9f; }
.hx em { display: block; font-size: 12px; color: #d97a62; font-style: normal; letter-spacing: 1px; }
.shop .item { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid rgba(230,210,170,.1); }
.shop .item > b, .shop .item > span { display: none; }
.shop .item { flex-wrap: wrap; }
.shop .item:not(.hire) { display: grid; grid-template-columns: 1fr auto; }
.shop .item:not(.hire) > b { display: block; grid-column: 1; color: #fff1d0; font-weight: normal; }
.shop .item:not(.hire) > span { display: block; grid-column: 1; font-size: 13px; color: #cbbf9f; }
.shop .item:not(.hire) > .btn { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.shop .item.hire .hx { flex: 1; }
.shop .item .btn { font-size: 13px; padding: 7px 10px; margin: 0; white-space: nowrap; }
.shop .item.owned { opacity: .55; }
.menu { position: absolute; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 10; }
.menu .panel { display: flex; flex-direction: column; margin: 0; }
.fatal { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 30px; font-size: 18px; }

.pop { position: absolute; transform: translate(-50%, -50%); font-size: 20px; font-weight: bold; color: #fff2dc; text-shadow: 0 2px 6px #000, 0 0 2px #000; pointer-events: none; animation: popup 1.1s ease-out forwards; }
.pop.weak { color: #ffcf7a; font-size: 24px; }
.pop.life { color: #ff8a6a; font-size: 30px; }
.pop.armor { color: #b8c2c6; font-size: 16px; }
@keyframes popup { 0% { opacity: 0; margin-top: 10px; transform: translate(-50%, -50%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); } 100% { opacity: 0; margin-top: -50px; transform: translate(-50%, -50%) scale(1); } }

.fosle { margin: 12px 0 6px; padding: 8px 12px; border-left: 2px solid rgba(230,210,170,.35); background: rgba(255,255,255,.03); border-radius: 0 8px 8px 0; }
.fosle .fh { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #a99c7e; margin-bottom: 2px; }
.fosle p { margin: 4px 0; font-size: 15px; }
.fosle b { color: #e9c58a; font-weight: normal; margin-right: 4px; }

.howto { margin: 12px 0 4px; padding: 10px 12px; border-radius: 10px; background: rgba(255,220,160,.08); border: 1px solid rgba(255,220,160,.25); font-size: 15px; line-height: 1.6; color: #efe2c4; }
.howto b { color: #ffd99a; font-weight: normal; }
