:root { --bg: #16241c; --panel: rgba(20, 32, 26, 0.94); --ink: #f4efe2; --muted: #b9c4b4; --acc: #f2a93b; --good: #5cc26a; --warn: #f2b33b; --bad: #ec5a4a; --blue: #4aa8e8; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif; touch-action: none; overscroll-behavior: none; }
.hidden { display: none !important; }
#app { position: fixed; inset: 0; }
.screen { position: absolute; inset: 0; display: none; }
.screen.active { display: block; }
button { font-family: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
.btn { border: 0; border-radius: 16px; padding: 14px 22px; font-size: 20px; font-weight: 700; background: rgba(255,255,255,0.14); color: var(--ink); min-height: 56px; }
.btn.primary { background: linear-gradient(#f6b74a, #e08a1e); color: #2a1a06; box-shadow: 0 4px 0 #9a5a10; }
.btn.huge { font-size: 28px; padding: 20px 34px; min-height: 76px; }
.btn.ghost { background: rgba(255,255,255,0.12); border: 2px solid rgba(255,255,255,0.25); }
.btn.green { background: linear-gradient(#6fd07a, #3fa04c); color: #08260d; box-shadow: 0 4px 0 #1f6a2a; }
.btn.red { background: linear-gradient(#f07a6a, #c8402e); color: #fff; }
.btn:disabled { opacity: 0.45; }
.btn:active { transform: translateY(2px); }
/* ---------- title ---------- */
#scr-title { background: linear-gradient(#5b8fc8 0%, #a8c8e4 45%, #e8d8b8 62%, #3a5a2e 62.5%, #22361e 100%); }
.title-bg { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(rgba(10,25,40,0.45), rgba(10,25,40,0.05) 45%, rgba(10,20,10,0.55)), url(assets/title.jpg) center / cover no-repeat, linear-gradient(#5b8fc9, #a9c9e0 55%, #3a5a2a 56%, #24391f); }
.mtn { position: absolute; bottom: 37%; width: 0; height: 0; border-style: solid; border-color: transparent; }
.mtn::after { content: ''; position: absolute; left: 0; top: 0; }
.m1 { left: -5%; border-width: 0 340px 380px 340px; border-bottom-color: #5a6a7a; }
.m2 { left: 30%; border-width: 0 420px 470px 420px; border-bottom-color: #4a5868; }
.m3 { right: -8%; border-width: 0 330px 340px 330px; border-bottom-color: #637282; }
.mtn::before { content: ''; position: absolute; width: 0; height: 0; border-style: solid; border-color: transparent; }
.m1::before { left: -90px; top: 0; border-width: 0 90px 100px 90px; border-bottom-color: #f2f5f8; }
.m2::before { left: -110px; top: 0; border-width: 0 110px 120px 110px; border-bottom-color: #f2f5f8; }
.m3::before { left: -80px; top: 0; border-width: 0 80px 85px 80px; border-bottom-color: #f2f5f8; }
.pines { position: absolute; left: 0; right: 0; bottom: 30%; height: 120px; background: repeating-linear-gradient(90deg, transparent 0 8px, #1f3a22 8px 9px, transparent 9px 24px);
  -webkit-mask: repeating-conic-gradient(from 160deg at 50% 0, #000 0 40deg, transparent 40deg 360deg); }
.pines { background: none; }
.pines::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 100%, #2a4a2a 0 60%, transparent 61%) 0 0 / 46px 120px repeat-x; }
.title-wrap { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; padding-top: 5vh; gap: 18px; }
h1 { margin: 0; font-size: 64px; color: #fff; text-shadow: 0 4px 0 #2a3a4a, 0 8px 24px rgba(0,0,0,0.5); letter-spacing: 1px; text-align: center; line-height: 1; }
h1 span { display: block; font-size: 84px; color: #ffd36a; }
.sub { margin: 0; font-size: 22px; font-weight: 700; color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,0.6); }
.title-actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; justify-content: center; }
.continue { background: rgba(15, 30, 20, 0.88); border: 3px solid var(--good); border-radius: 22px; padding: 16px 22px; display: flex; gap: 20px; align-items: center; box-shadow: 0 8px 30px rgba(0,0,0,0.4); }
.continue .ci { font-size: 18px; color: var(--muted); line-height: 1.35; }
.continue .ci b { color: #fff; font-size: 22px; }
.fine { color: #fff; font-size: 16px; text-shadow: 0 1px 3px #000; margin: 0; }
/* ---------- game ---------- */
#c3d, #cmap { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#cmap { z-index: 3; touch-action: none; }
#look { position: absolute; left: 0; top: 0; right: 0; bottom: 0; z-index: 4; }
#joyzone { position: absolute; left: 0; bottom: 0; width: 42%; height: 62%; z-index: 6; }
#joybase { position: absolute; left: 150px; top: calc(100% - 150px); width: 160px; height: 160px; margin: -80px 0 0 -80px; border-radius: 50%; background: rgba(255,255,255,0.12); border: 3px solid rgba(255,255,255,0.35); opacity: 0.55; transition: opacity .15s; }
#joybase.on { opacity: 1; }
#joyknob { position: absolute; left: 50%; top: 50%; width: 74px; height: 74px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, #c9d3c4); transform: translate(-50%,-50%); box-shadow: 0 3px 10px rgba(0,0,0,0.4); }
#joyhint { position: absolute; left: 70px; bottom: 30px; font-size: 16px; font-weight: 700; color: rgba(255,255,255,0.75); text-shadow: 0 1px 3px #000; pointer-events: none; }
#cross { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); font-size: 40px; color: #fff; text-shadow: 0 0 4px #000, 0 0 2px #000; z-index: 5; pointer-events: none; }
#cross.aim { color: #ffcc33; }
#hurt { position: absolute; inset: 0; z-index: 5; pointer-events: none; box-shadow: inset 0 0 160px 60px rgba(255, 140, 40, 0); transition: box-shadow .2s; }
#hurt.on { box-shadow: inset 0 0 160px 60px rgba(255, 120, 40, 0.55); }
#cold { position: absolute; inset: 0; z-index: 5; pointer-events: none; box-shadow: inset 0 0 200px 40px rgba(170, 220, 255, 0); transition: box-shadow 1s; }
#hud-meters { position: absolute; left: 14px; top: 12px; z-index: 7; display: flex; flex-direction: column; gap: 6px; background: rgba(10, 20, 14, 0.55); padding: 10px 12px; border-radius: 16px; pointer-events: none; }
.meter { display: flex; align-items: center; gap: 8px; }
.meter .mi { font-size: 26px; width: 32px; text-align: center; }
.meter .bar { width: 170px; height: 20px; background: rgba(0,0,0,0.5); border-radius: 10px; overflow: hidden; border: 2px solid rgba(255,255,255,0.3); }
.meter .fill { height: 100%; border-radius: 8px; transition: width .3s; }
.meter .ml { font-size: 15px; font-weight: 700; width: 92px; color: #fff; text-shadow: 0 1px 2px #000; }
.meter.low .ml { color: #ffcc55; } .meter.empty .ml { color: #ff7a6a; }
.meter.low .bar { animation: pulse 1s infinite; }
@keyframes pulse { 50% { border-color: #ffcc55; } }
#hud-top { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 7; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
#clock { background: rgba(10, 20, 14, 0.6); padding: 6px 16px; border-radius: 14px; font-size: 18px; font-weight: 700; white-space: nowrap; text-shadow: 0 1px 2px #000; }
#compass { position: relative; width: 360px; height: 30px; overflow: hidden; background: rgba(10, 20, 14, 0.5); border-radius: 12px; }
#compass-strip { position: absolute; top: 0; left: 0; height: 30px; white-space: nowrap; }
#compass-strip span { position: absolute; top: 3px; transform: translateX(-50%); font-weight: 800; font-size: 16px; }
#compass .cmark { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: #ffcc33; }
#arrow { background: rgba(10, 20, 14, 0.7); border: 2px solid #ffcc33; padding: 4px 14px; border-radius: 14px; font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
#arrow .ar { display: inline-block; font-size: 26px; color: #ffcc33; transition: transform .2s; }
#hud-btns { position: absolute; right: 12px; top: 12px; z-index: 7; display: flex; gap: 8px; }
.hbtn { width: 76px; height: 76px; border-radius: 18px; border: 2px solid rgba(255,255,255,0.3); background: rgba(10, 20, 14, 0.65); font-size: 30px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.hbtn span { font-size: 13px; font-weight: 700; margin-top: 4px; }
.hbtn.glow { border-color: #ffcc33; box-shadow: 0 0 16px #ffcc33; animation: glow 1.2s infinite; }
@keyframes glow { 50% { box-shadow: 0 0 4px #ffcc33; } }
#tip { position: absolute; left: 50%; top: 134px; transform: translateX(-50%); z-index: 7; max-width: 56%; background: rgba(20, 40, 28, 0.85); border: 2px solid rgba(255, 210, 110, 0.7); border-radius: 16px; padding: 8px 16px; font-size: 18px; font-weight: 700; text-align: center; pointer-events: auto; }
#tip:empty { display: none; }
#tip.danger { border-color: var(--bad); background: rgba(70, 20, 14, 0.88); }
#tip.warn { border-color: var(--warn); }
#tip .tsk { display: inline-block; margin-left: 10px; font-size: 15px; padding: 4px 10px; border-radius: 10px; background: rgba(255,255,255,0.15); border: 0; }
#toasts { position: absolute; left: 14px; top: 190px; z-index: 7; display: flex; flex-direction: column; gap: 6px; width: 36%; pointer-events: none; }
.toast { background: rgba(10, 20, 14, 0.78); border-left: 6px solid var(--blue); padding: 8px 12px; border-radius: 10px; font-size: 17px; font-weight: 600; animation: tin .25s; text-shadow: 0 1px 2px #000; }
.toast.good { border-color: var(--good); } .toast.warn { border-color: var(--warn); } .toast.danger { border-color: var(--bad); background: rgba(60, 14, 10, 0.85); }
@keyframes tin { from { transform: translateX(-30px); opacity: 0; } }
#actions { position: absolute; right: 16px; bottom: 16px; z-index: 7; display: flex; flex-direction: column-reverse; align-items: flex-end; gap: 10px; }
.abtn { border: 3px solid rgba(255,255,255,0.5); background: rgba(20, 40, 28, 0.85); border-radius: 22px; font-size: 22px; font-weight: 800; padding: 10px 18px; min-height: 72px; min-width: 200px; display: flex; align-items: center; gap: 10px; color: #fff; text-shadow: 0 1px 2px #000; }
.abtn .ai { font-size: 34px; }
.abtn.big { min-height: 96px; min-width: 250px; font-size: 26px; background: linear-gradient(rgba(242,169,59,0.95), rgba(200,120,20,0.95)); border-color: #ffe0a0; }
.abtn.hot { animation: hot .4s infinite alternate; background: linear-gradient(#6fd07a, #2f9a3c); }
@keyframes hot { to { transform: scale(1.08); } }
#fixed-actions { position: absolute; right: 300px; bottom: 16px; z-index: 7; display: flex; gap: 10px; align-items: flex-end; }
.abtn.round { min-width: 86px; width: 86px; height: 86px; border-radius: 50%; flex-direction: column; justify-content: center; gap: 0; padding: 0; font-size: 34px; }
.abtn.round span { font-size: 13px; }
.abtn.round.on { border-color: #ffcc33; box-shadow: 0 0 14px #ffaa33; }
#map-ui { position: absolute; right: 12px; top: 104px; z-index: 8; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
#map-ui .btn { width: 76px; font-size: 26px; padding: 8px; background: rgba(10,20,14,0.85); border: 2px solid rgba(255,255,255,0.35); }
#map-info { max-width: 300px; background: var(--panel); border-radius: 14px; padding: 10px 14px; font-size: 17px; }
#map-info:empty { display: none; }
/* ---------- overlay panels ---------- */
#ov { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; }
#ov-card { position: relative; background: var(--panel); border: 2px solid rgba(255,255,255,0.18); border-radius: 24px; padding: 22px 26px; width: min(900px, 92vw); max-height: 90vh; overflow-y: auto; touch-action: pan-y; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
#ov-card h2 { margin: 0 60px 10px 0; font-size: 32px; }
#ov-card h3 { margin: 14px 0 8px; font-size: 22px; color: var(--acc); }
#ov-card p { font-size: 19px; line-height: 1.4; margin: 8px 0; }
.ov-x { position: absolute; right: 14px; top: 14px; width: 64px; height: 64px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.35); background: rgba(255,255,255,0.12); font-size: 30px; font-weight: 800; }
.ov-actions { display: flex; gap: 14px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tab { border: 0; border-radius: 14px; padding: 12px 20px; font-size: 20px; font-weight: 800; background: rgba(255,255,255,0.1); min-height: 56px; }
.tab.on { background: var(--acc); color: #2a1a06; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.card { background: rgba(255,255,255,0.07); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; border: 2px solid transparent; }
.card.ready { border-color: var(--good); }
.card .ct { font-size: 21px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.card .ct .ic { font-size: 34px; }
.card .cd { font-size: 16px; color: var(--muted); }
.need { display: flex; gap: 8px; flex-wrap: wrap; font-size: 17px; font-weight: 700; }
.need span { background: rgba(0,0,0,0.3); border-radius: 10px; padding: 3px 9px; }
.need .ok { color: #8ef09a; } .need .no { color: #ffa08a; }
.card .btn { min-height: 52px; font-size: 19px; padding: 8px 14px; }
.item-row { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,0.07); border-radius: 14px; padding: 8px 12px; }
.item-row .ic { font-size: 34px; } .item-row .nm { flex: 1; font-size: 20px; font-weight: 700; } .item-row .ct2 { font-size: 22px; font-weight: 800; min-width: 44px; text-align: right; }
.item-row .btn { min-height: 52px; padding: 8px 16px; font-size: 18px; }
.steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.steps li { font-size: 18px; padding: 8px 12px; border-radius: 12px; background: rgba(255,255,255,0.05); }
.steps li.done { color: #8ef09a; } .steps li.cur { background: rgba(242,169,59,0.25); border: 2px solid var(--acc); font-weight: 800; }
.rosa { display: flex; gap: 14px; align-items: flex-start; background: rgba(255,255,255,0.07); border-radius: 16px; padding: 12px; }
.rosa .av { font-size: 54px; line-height: 1; }
.rosa .say { font-size: 19px; line-height: 1.4; }
.urgent { padding: 10px 14px; border-radius: 12px; margin: 6px 0; font-size: 18px; font-weight: 700; background: rgba(242,179,59,0.2); border-left: 6px solid var(--warn); }
.urgent.danger { background: rgba(236,90,74,0.22); border-color: var(--bad); } .urgent.good { background: rgba(92,194,106,0.2); border-color: var(--good); } .urgent.info { background: rgba(74,168,232,0.18); border-color: var(--blue); }
.cond { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cond div { background: rgba(255,255,255,0.07); border-radius: 12px; padding: 8px; text-align: center; font-size: 16px; } .cond b { display: block; font-size: 22px; }
.setrow { display: flex; align-items: center; gap: 12px; margin: 10px 0; font-size: 19px; flex-wrap: wrap; } .setrow label { min-width: 190px; font-weight: 700; }
.seg { display: flex; gap: 6px; } .seg button { border: 0; border-radius: 12px; padding: 10px 16px; font-size: 18px; font-weight: 700; background: rgba(255,255,255,0.12); min-height: 50px; } .seg button.on { background: var(--acc); color: #2a1a06; }
.big-emoji { font-size: 90px; text-align: center; line-height: 1.1; }
.statgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; } .statgrid div { background: rgba(255,255,255,0.07); border-radius: 12px; padding: 10px; text-align: center; font-size: 15px; } .statgrid b { display: block; font-size: 26px; }
#coach { position: absolute; left: 50%; bottom: 130px; transform: translateX(-50%); z-index: 9; background: rgba(255, 246, 220, 0.97); color: #2a2010; border-radius: 20px; padding: 14px 20px; font-size: 21px; font-weight: 700; max-width: 52%; display: flex; gap: 14px; align-items: center; box-shadow: 0 8px 30px rgba(0,0,0,0.45); border: 3px solid #f2a93b; }
#coach .cs { font-size: 15px; color: #7a6040; } #coach .btn { min-height: 48px; padding: 8px 14px; font-size: 16px; background: rgba(0,0,0,0.1); color: #2a2010; }
#coach .ce { font-size: 44px; }
.loadbar { width: 360px; height: 14px; background: rgba(0,0,0,0.4); border-radius: 8px; overflow: hidden; } .loadbar div { height: 100%; background: var(--acc); width: 0; transition: width .2s; }
