:root {
  --yellow: #ffc61a;
  --yellow-2: #f2a900;
  --navy: #0b1522;
  --panel: rgba(9, 18, 30, 0.62);
  --panel-solid: #101d2e;
  --line: rgba(255, 255, 255, 0.12);
  --white: #ffffff;
  --muted: #a9b6c6;
  --red: #ff4d3d;
  --green: #3ee37f;
  --cyan: #45f2ff;
  --orange: #ff9a1f;
  --font: "Bahnschrift", "DIN Alternate", "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--navy); color: var(--white); font-family: var(--font); user-select: none; -webkit-user-select: none; touch-action: none; overscroll-behavior: none; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
#ui { position: fixed; inset: 0; pointer-events: none; }
.hidden { display: none !important; }
button { font-family: var(--font); cursor: pointer; pointer-events: auto; border: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; }
#hud-mission { position: absolute; left: calc(14px + var(--safe-l)); top: 12px; padding: 9px 14px 10px; max-width: min(38cqw, 420px); }
#hud-mission .loc { font-size: 12px; letter-spacing: 0.14em; color: var(--yellow); font-weight: 700; }
#hud-mission .task { font-size: 19px; font-weight: 800; line-height: 1.1; margin-top: 2px; text-transform: uppercase; letter-spacing: 0.02em; }
#hud-mission .lifts { display: flex; gap: 5px; margin-top: 6px; }
#hud-mission .lifts i { width: 18px; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.18); }
#hud-mission .lifts i.done { background: var(--green); }
#hud-mission .lifts i.cur { background: var(--yellow); }
#hud-mission .lifts:empty { display: none; }

#hud-timer { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); text-align: center; text-shadow: 0 2px 8px rgba(0,0,0,0.5); }
#hud-timer .t { font-size: 38px; font-weight: 800; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
#hud-timer .sub { display: block; font-size: 12px; letter-spacing: 0.16em; color: var(--muted); font-weight: 700; margin-top: -4px; }
#hud-timer.warn .t { color: var(--red); animation: pulse 0.5s infinite alternate; }

#hud-right { position: absolute; right: calc(14px + var(--safe-r)); top: 12px; display: flex; gap: 8px; align-items: center; }
#hud-money { padding: 8px 14px; font-size: 24px; font-weight: 800; color: var(--yellow); font-variant-numeric: tabular-nums; min-width: 110px; text-align: right; transition: transform 0.15s; }
#hud-money.bump { transform: scale(1.12); color: #fff3b0; }
.icon-btn { width: 46px; height: 46px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; gap: 6px; }
.icon-btn span { width: 6px; height: 18px; background: #fff; border-radius: 2px; }
.icon-btn:active { transform: scale(0.94); }

#hud-meters { position: absolute; right: calc(14px + var(--safe-r)); top: 70px; display: flex; flex-direction: column; gap: 6px; width: 190px; }
.meter { padding: 7px 10px 8px; }
.meter .row { display: flex; align-items: center; gap: 8px; }
.meter .lbl { font-size: 11px; letter-spacing: 0.12em; color: var(--muted); font-weight: 700; flex: 1; }
.meter .val { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.meter .bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,0.12); margin-top: 5px; overflow: hidden; }
.meter .bar i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--orange), var(--red)); transition: width 0.25s; }
.meter .bar.glass i { background: linear-gradient(90deg, #8fe9ff, #45c3ff); }
#meter-damage.hit { animation: shakeX 0.35s; }
#meter-damage.hit .val { color: var(--red); }
.wind-dial { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.35); position: relative; flex: none; }
.wind-dial i { position: absolute; left: 50%; top: 50%; width: 4px; height: 18px; margin: -9px 0 0 -2px; background: linear-gradient(var(--cyan), rgba(69,242,255,0.1)); border-radius: 2px; transform-origin: 50% 50%; }
.wind-dial i::after { content: ""; position: absolute; left: -4px; top: -4px; border: 6px solid transparent; border-bottom: 7px solid var(--cyan); border-top: 0; }
#meter-wind.gust { border-color: var(--cyan); box-shadow: 0 0 18px rgba(69,242,255,0.45); }
#meter-wind.gust .val { color: var(--cyan); }

#hud-combo { position: absolute; left: calc(14px + var(--safe-l)); top: 104px; padding: 6px 12px; border-radius: 10px; background: linear-gradient(90deg, rgba(255,198,26,0.95), rgba(255,154,31,0.9)); color: #1a1205; font-weight: 900; font-size: 16px; letter-spacing: 0.06em; font-style: italic; box-shadow: 0 6px 20px rgba(255,170,0,0.35); }

#prompt { position: absolute; left: 50%; top: 21%; transform: translateX(-50%); text-align: center; pointer-events: none; transition: opacity 0.3s; }
#prompt .main { font-size: clamp(26px, 4.6cqw, 48px); font-weight: 900; font-style: italic; letter-spacing: 0.04em; text-shadow: 0 3px 0 rgba(0,0,0,0.35), 0 0 30px rgba(0,0,0,0.35); white-space: nowrap; }
#prompt .sub { font-size: clamp(14px, 1.8cqw, 18px); font-weight: 700; color: #e7eef7; margin-top: 4px; text-shadow: 0 2px 6px rgba(0,0,0,0.6); letter-spacing: 0.04em; }
#prompt.show .main { animation: popIn 0.35s cubic-bezier(.2,1.6,.4,1); }
#prompt.fade { opacity: 0; }

#alert { position: absolute; left: 50%; top: 84px; transform: translateX(-50%); font-size: 26px; font-weight: 900; font-style: italic; letter-spacing: 0.06em; padding: 8px 20px; border-radius: 10px; background: rgba(255, 60, 40, 0.92); color: #fff; box-shadow: 0 0 30px rgba(255,60,40,0.6); opacity: 0; pointer-events: none; white-space: nowrap; }
#alert.show { animation: alertIn 2.6s ease forwards; }
#alert.info { background: rgba(30, 140, 255, 0.92); box-shadow: 0 0 30px rgba(30,140,255,0.6); }

#precision { position: absolute; left: 50%; bottom: calc(150px + var(--safe-b)); transform: translateX(-50%); display: flex; align-items: baseline; gap: 10px; padding: 8px 18px; border-radius: 14px; background: var(--panel); border: 2px solid rgba(255,255,255,0.18); }
#precision .lbl { font-size: 12px; letter-spacing: 0.16em; color: var(--muted); font-weight: 800; }
#precision .val { font-size: 34px; font-weight: 900; font-variant-numeric: tabular-nums; }
#precision .h { font-size: 15px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
#precision.perfect { border-color: var(--green); } #precision.perfect .val { color: var(--green); }
#precision.great .val { color: #a6f04d; } #precision.good .val { color: var(--yellow); } #precision.bad .val { color: var(--red); }
body.touch #precision { bottom: calc(176px + var(--safe-b)); }

#pops { position: absolute; left: 50%; top: 36%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none; }
.pop { font-weight: 900; font-style: italic; text-align: center; white-space: nowrap; text-shadow: 0 3px 0 rgba(0,0,0,0.35), 0 0 24px rgba(0,0,0,0.3); animation: popUp 2.2s ease forwards; }
.pop.big { font-size: clamp(40px, 7cqw, 78px); letter-spacing: 0.03em; color: var(--yellow); }
.pop.big.perfect { background: linear-gradient(180deg, #fff6b0, #ffc61a 55%, #ff9a1f); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 0 rgba(0,0,0,0.35)); }
.pop.big.great { color: #a6f04d; } .pop.big.good { color: #ffe066; } .pop.big.bad { color: #ff8a7a; }
.pop.money { font-size: clamp(28px, 4.5cqw, 46px); color: #fff; }
.pop.small { font-size: clamp(16px, 2.2cqw, 22px); color: #ffe9a8; }
.pop.combo { font-size: clamp(18px, 2.6cqw, 26px); color: #1a1205; background: linear-gradient(90deg, #ffd54a, #ff9a1f); padding: 2px 12px; border-radius: 8px; text-shadow: none; }
.pop.warn { font-size: clamp(26px, 4cqw, 40px); color: #ff8a3d; }
.pop.good2 { font-size: clamp(26px, 4cqw, 40px); color: var(--green); }

#labels { position: absolute; inset: 0; pointer-events: none; }
.wlabel { position: absolute; transform: translate(-50%, -100%); white-space: nowrap; font-weight: 800; pointer-events: none; }
.wlabel.target { font-size: 14px; letter-spacing: 0.08em; padding: 4px 9px; border-radius: 8px; background: rgba(10, 40, 50, 0.65); border: 1px solid rgba(69,242,255,0.6); color: var(--cyan); }
.wlabel.target.ok { border-color: var(--green); color: var(--green); }
.wlabel.pick { font-size: 14px; letter-spacing: 0.08em; padding: 4px 9px; border-radius: 8px; background: rgba(50, 35, 5, 0.7); border: 1px solid var(--yellow); color: var(--yellow); }
.wlabel.dmg { font-size: 20px; color: var(--red); font-style: italic; text-shadow: 0 2px 0 rgba(0,0,0,0.5); animation: floatUp 1.4s ease-out forwards; }
.wlabel.bonus { font-size: 20px; color: var(--green); font-style: italic; text-shadow: 0 2px 0 rgba(0,0,0,0.5); animation: floatUp 1.4s ease-out forwards; }
.bubble { position: absolute; transform: translate(-50%, -100%); background: #fff; color: #10151c; font-weight: 800; font-size: 15px; padding: 7px 12px; border-radius: 14px; white-space: nowrap; box-shadow: 0 6px 18px rgba(0,0,0,0.3); animation: bubbleIn 0.3s cubic-bezier(.2,1.6,.4,1); }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -8px; margin-left: -8px; border: 8px solid transparent; border-top-color: #fff; border-bottom: 0; }
.bubble.alarm { background: #ffd23f; font-size: 20px; padding: 4px 11px; }

#target-arrow { position: absolute; width: 54px; height: 54px; margin: -27px 0 0 -27px; pointer-events: none; }
#target-arrow i { position: absolute; inset: 0; border-radius: 50%; background: rgba(10,40,50,0.7); border: 2px solid var(--cyan); }
#target-arrow i::after { content: ""; position: absolute; left: 50%; top: 50%; margin: -9px 0 0 -6px; border: 9px solid transparent; border-left: 14px solid var(--cyan); border-right: 0; }

#keys { position: absolute; left: 50%; bottom: calc(14px + var(--safe-b)); transform: translateX(-50%); display: flex; gap: 16px; padding: 8px 14px; border-radius: 12px; background: rgba(9,18,30,0.5); }
.kgroup { display: flex; align-items: center; gap: 4px; }
.kgroup em { font-style: normal; font-size: 11px; letter-spacing: 0.12em; color: var(--muted); font-weight: 700; margin-left: 4px; }
.kc { min-width: 28px; height: 28px; padding: 0 6px; border-radius: 6px; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.25); border-bottom-width: 3px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; transition: all 0.15s; }
.kc.wide { min-width: 62px; }
.kc.hint { background: var(--yellow); color: #1a1205; border-color: #fff3b0; box-shadow: 0 0 18px rgba(255,198,26,0.8); animation: keyPulse 0.7s infinite alternate; }
.kc.on { background: rgba(255,255,255,0.4); transform: translateY(2px); border-bottom-width: 1px; }

/* ---------- touch ---------- */
#touch { position: absolute; inset: 0; pointer-events: none; }
.tc-left { position: absolute; left: calc(18px + var(--safe-l)); bottom: calc(18px + var(--safe-b)); display: flex; gap: 14px; align-items: flex-end; }
.tc-right { position: absolute; right: calc(18px + var(--safe-r)); bottom: calc(18px + var(--safe-b)); display: flex; gap: 14px; }
.tcol { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.tlabel { position: absolute; bottom: -2px; font-size: 11px; letter-spacing: 0.16em; font-weight: 800; color: rgba(255,255,255,0.7); }
.tc-left .tlabel { left: 50%; transform: translate(-50%, 100%); bottom: 2px; }
.tcol .tlabel { position: static; margin-top: -4px; }
.tbtn { width: 92px; height: 92px; border-radius: 50%; background: rgba(12, 22, 36, 0.55); border: 3px solid rgba(255,255,255,0.4); display: flex; align-items: center; justify-content: center; touch-action: none; }
.tbtn.sm { width: 74px; height: 74px; border-radius: 22px; }
.tbtn.hook { border-color: rgba(255,198,26,0.7); }
.tbtn svg { width: 46%; height: 46%; fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.tbtn.on { background: rgba(255,198,26,0.85); border-color: #fff3b0; transform: scale(0.95); }
.tbtn.on svg { stroke: #1a1205; }
.tbtn.hint { animation: btnPulse 0.8s infinite alternate; border-color: var(--yellow); }
#btn-release { position: absolute; left: 50%; bottom: calc(22px + var(--safe-b)); transform: translateX(-50%); padding: 16px 38px; border-radius: 40px; font-size: 24px; font-weight: 900; font-style: italic; letter-spacing: 0.08em; color: #0d1a10; background: linear-gradient(180deg, #7dffaf, #2fd06f); box-shadow: 0 8px 26px rgba(62,227,127,0.55); animation: btnPulse 0.7s infinite alternate; }
#btn-release.hook { background: linear-gradient(180deg, #ffe27a, #ffc61a); box-shadow: 0 8px 26px rgba(255,198,26,0.55); color: #1a1205; }
body:not(.touch) #btn-release { bottom: calc(64px + var(--safe-b)); padding: 12px 30px; font-size: 20px; }

/* ---------- screens ---------- */
.screen { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: auto; }
.screen.dim { background: radial-gradient(ellipse at center, rgba(5,10,18,0.55), rgba(5,10,18,0.82)); animation: fadeIn 0.25s; }
.card { background: linear-gradient(180deg, rgba(20,34,52,0.97), rgba(12,22,36,0.97)); border: 1px solid rgba(255,255,255,0.14); border-radius: 22px; padding: 22px 26px; box-shadow: 0 30px 80px rgba(0,0,0,0.5); text-align: center; max-height: calc(100cqh - 20px); overflow-y: auto; animation: cardIn 0.35s cubic-bezier(.2,1.3,.4,1); }
.btn { display: inline-flex; align-items: center; justify-content: center; border-radius: 14px; font-weight: 900; letter-spacing: 0.06em; padding: 12px 22px; font-size: 16px; color: #fff; transition: transform 0.1s, filter 0.15s; }
.btn:active { transform: scale(0.96); }
.btn.primary { background: linear-gradient(180deg, #ffd84d, #ffb800); color: #1d1404; box-shadow: 0 10px 28px rgba(255,184,0,0.32); font-style: italic; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.primary:active { box-shadow: 0 4px 14px rgba(255,184,0,0.3); transform: scale(0.96); }
.btn.huge { font-size: clamp(24px, 3.4cqw, 34px); padding: 16px 46px; border-radius: 18px; min-width: 260px; }
.btn.ghost { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.22); }
.btn.ghost:hover { background: rgba(255,255,255,0.16); }
.btn.link { background: none; color: var(--muted); font-weight: 700; padding: 6px; }
.btn.tog { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.2); font-size: 13px; padding: 9px 12px; }
.btn[disabled] { opacity: 0.4; pointer-events: none; }

#screen-boot { background: radial-gradient(ellipse at 50% 40%, #16304f, #070d16 70%); flex-direction: column; gap: 22px; }
.boot-logo { width: min(440px, 62cqw, 58cqh); height: auto; margin: 0 0 4px; filter: drop-shadow(0 8px 20px rgba(0,0,0,0.5)); animation: studioIn 1.1s cubic-bezier(.2,1,.3,1); pointer-events: none; }
.loadbar { width: min(340px, 70cqw); height: 8px; border-radius: 4px; background: rgba(255,255,255,0.1); overflow: hidden; }
.loadbar i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--yellow-2), var(--yellow)); transition: width 0.25s; }
.loadtxt { font-size: 13px; color: var(--muted); letter-spacing: 0.12em; font-weight: 700; margin-top: -12px; }

#screen-title { background: linear-gradient(180deg, rgba(5,12,22,0.55) 0%, rgba(5,12,22,0.05) 45%, rgba(5,12,22,0.6) 100%); }
.title-wrap { text-align: center; animation: cardIn 0.6s cubic-bezier(.2,1.3,.4,1); }
.title-kicker { font-size: 13px; letter-spacing: 0.4em; color: var(--yellow); font-weight: 800; }
.title { margin: 6px 0 4px; line-height: 0.88; font-style: italic; text-shadow: 0 6px 0 rgba(0,0,0,0.35), 0 0 60px rgba(0,0,0,0.4); }
.title span { display: block; font-size: clamp(30px, 5cqw, 54px); font-weight: 900; letter-spacing: 0.32em; color: #fff; }
.title .big { font-size: clamp(48px, 9.5cqw, 116px); letter-spacing: 0.01em; background: linear-gradient(180deg, #fff7c2 0%, #ffd23f 45%, #ff9f1a 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 6px 0 rgba(90,50,0,0.55)); }
.title-tag { font-size: clamp(15px, 2cqw, 20px); font-weight: 700; color: #e9f0f8; letter-spacing: 0.08em; margin-bottom: 26px; text-shadow: 0 2px 8px rgba(0,0,0,0.6); }
.title-row { display: flex; gap: 12px; justify-content: center; margin-top: 22px; }
#btn-play { animation: playPulse 1.1s ease-in-out infinite alternate; }

#screen-intro { position: absolute; left: 0; right: 0; top: 30%; text-align: center; pointer-events: none; animation: introAnim 2.4s ease forwards; }
.intro-loc { font-size: 15px; letter-spacing: 0.4em; color: var(--yellow); font-weight: 800; text-shadow: 0 2px 8px rgba(0,0,0,0.6); }
.intro-title { font-size: clamp(38px, 6.5cqw, 72px); font-weight: 900; font-style: italic; letter-spacing: 0.03em; text-shadow: 0 4px 0 rgba(0,0,0,0.35), 0 0 40px rgba(0,0,0,0.4); }
.intro-task { font-size: clamp(16px, 2.2cqw, 22px); font-weight: 700; color: #e9f0f8; text-shadow: 0 2px 8px rgba(0,0,0,0.7); }

.results { width: min(440px, 94cqw); }
.res-head { font-size: 30px; font-weight: 900; font-style: italic; letter-spacing: 0.06em; color: var(--yellow); }
.stars { display: flex; justify-content: center; gap: 10px; margin: 8px 0 6px; }
.stars i { width: 54px; height: 54px; background: rgba(255,255,255,0.12); clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); transform: scale(0.85); }
.stars i:nth-child(2) { width: 64px; height: 64px; margin-top: -8px; }
.stars i.on { background: linear-gradient(180deg, #fff3a0, #ffc61a 60%, #ff9a1f); animation: starPop 0.45s cubic-bezier(.2,1.8,.4,1) forwards; }
.res-bonus { font-size: 18px; font-weight: 900; font-style: italic; color: #1a1205; background: linear-gradient(90deg, #ffd54a, #ff9a1f); display: inline-block; padding: 4px 14px; border-radius: 8px; margin-bottom: 8px; animation: popIn 0.5s cubic-bezier(.2,1.6,.4,1); }
.res-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 12px; }
.res-stats div { background: rgba(255,255,255,0.06); border-radius: 12px; padding: 8px 4px; }
.res-stats span { display: block; font-size: 11px; letter-spacing: 0.16em; color: var(--muted); font-weight: 800; }
.res-stats b { font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; }
.res-lines { text-align: left; font-size: 15px; font-weight: 700; }
.res-lines div { display: flex; justify-content: space-between; padding: 4px 6px; border-bottom: 1px dashed rgba(255,255,255,0.1); opacity: 0; animation: lineIn 0.3s forwards; }
.res-lines div b { font-variant-numeric: tabular-nums; }
.res-lines .neg b { color: var(--red); } .res-lines .pos b { color: var(--green); }
.res-total { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 6px 14px; font-weight: 900; }
.res-total span { letter-spacing: 0.16em; color: var(--muted); font-size: 14px; }
.res-total b { font-size: 36px; color: var(--yellow); font-variant-numeric: tabular-nums; }
.res-row { display: flex; gap: 10px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }

.fail { width: min(420px, 94cqw); border-color: rgba(255,77,61,0.45); }
.fail-head { font-size: clamp(38px, 6cqw, 56px); font-weight: 900; font-style: italic; color: var(--red); letter-spacing: 0.03em; text-shadow: 0 4px 0 rgba(0,0,0,0.3); animation: popIn 0.45s cubic-bezier(.2,1.6,.4,1); }
.fail-sub { color: var(--muted); font-weight: 700; font-size: 16px; margin: 2px 0 18px; }

.pause { width: min(400px, 94cqw); }
.menu-col { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.help { margin-top: 14px; font-size: 13px; color: var(--muted); line-height: 1.4; font-weight: 600; }

.garage, .jobs { width: min(680px, 96cqw); text-align: left; }
.g-head { display: flex; align-items: center; gap: 12px; font-size: 26px; font-weight: 900; font-style: italic; letter-spacing: 0.05em; }
.g-head b { margin-left: auto; color: var(--yellow); font-size: 24px; font-style: normal; font-variant-numeric: tabular-nums; }
.g-head .x { width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,0.1); color: #fff; font-size: 18px; }
.tabs { display: flex; gap: 8px; margin: 12px 0; }
.tab { flex: 1; padding: 10px; border-radius: 12px; background: rgba(255,255,255,0.06); color: var(--muted); font-weight: 900; letter-spacing: 0.1em; font-size: 14px; }
.tab.on { background: var(--yellow); color: #1a1205; }
.g-body { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.upg, .crn { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.upg h4, .crn h4 { margin: 0; font-size: 16px; font-weight: 900; letter-spacing: 0.06em; }
.upg p, .crn p { margin: 0; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.pips { display: flex; gap: 4px; }
.pips i { flex: 1; height: 7px; border-radius: 3px; background: rgba(255,255,255,0.14); }
.pips i.on { background: linear-gradient(90deg, #ffd84d, #ff9a1f); }
.upg .btn, .crn .btn { padding: 9px 12px; font-size: 14px; margin-top: 2px; }
.crn .cstats { display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; align-items: center; font-size: 11px; color: var(--muted); font-weight: 800; letter-spacing: 0.1em; }
.crn .cstats .pips i { height: 5px; }
.crn.owned { border-color: rgba(62,227,127,0.45); }
.tagline { font-size: 11px; letter-spacing: 0.14em; font-weight: 900; color: var(--green); }

.j-list { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.job { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); text-align: left; color: #fff; width: 100%; }
.job:hover { background: rgba(255,255,255,0.1); }
.job .num { width: 38px; height: 38px; border-radius: 10px; background: rgba(255,198,26,0.16); color: var(--yellow); display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 15px; flex: none; }
.job.ch .num { background: rgba(69,242,255,0.14); color: var(--cyan); }
.job .info { flex: 1; min-width: 0; }
.job .info b { display: block; font-size: 16px; font-weight: 900; letter-spacing: 0.04em; }
.job .info span { font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: 0.08em; }
.job .jst { color: var(--yellow); letter-spacing: 2px; font-size: 16px; }
.job .jst .off { color: rgba(255,255,255,0.18); }
.job.locked { opacity: 0.45; pointer-events: none; }
.job .crane { font-size: 10.5px; color: var(--muted); font-weight: 800; letter-spacing: 0.08em; text-align: right; max-width: 120px; }

.craneoffer { width: min(420px, 94cqw); display: flex; flex-direction: column; gap: 10px; align-items: center; }
.co-kicker { font-size: 13px; letter-spacing: 0.3em; color: var(--yellow); font-weight: 900; }
.co-name { font-size: 32px; font-weight: 900; font-style: italic; line-height: 1; }
.co-desc { color: var(--muted); font-weight: 700; }
.co-stats { width: 100%; }
.co-stats .cstats { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; font-size: 12px; font-weight: 800; letter-spacing: 0.12em; color: var(--muted); text-align: left; }

#rotate-hint { position: absolute; inset: 0; background: #0b1522; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; font-weight: 800; font-size: 18px; pointer-events: auto; z-index: 10; }
#rotate-hint .phone { width: 46px; height: 76px; border: 4px solid #fff; border-radius: 10px; animation: rot 1.6s ease-in-out infinite; }

/* ---------- animations ---------- */
@keyframes pulse { from { opacity: 1; } to { opacity: 0.55; } }
@keyframes popIn { 0% { transform: scale(0.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes popUp { 0% { transform: scale(0.3) translateY(10px); opacity: 0; } 12% { transform: scale(1.12); opacity: 1; } 20% { transform: scale(1); } 78% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-30px); } }
@keyframes alertIn { 0% { opacity: 0; transform: translateX(-50%) scale(1.6); } 10% { opacity: 1; transform: translateX(-50%) scale(1); } 20%, 40%, 60% { filter: brightness(1.35); } 30%, 50% { filter: brightness(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) scale(0.95); } }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, -60%) scale(0.6); } 15% { opacity: 1; transform: translate(-50%, -100%) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -260%) scale(1); } }
@keyframes bubbleIn { from { transform: translate(-50%, -80%) scale(0.4); opacity: 0; } to { transform: translate(-50%, -100%) scale(1); opacity: 1; } }
@keyframes keyPulse { from { transform: translateY(0); } to { transform: translateY(-3px); } }
@keyframes btnPulse { from { box-shadow: 0 0 0 0 rgba(255,198,26,0.0); } to { box-shadow: 0 0 0 10px rgba(255,198,26,0.25); } }
@keyframes shakeX { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes cardIn { from { transform: scale(0.85) translateY(20px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
@keyframes studioIn { from { transform: scale(0.7); opacity: 0; filter: blur(8px); } to { transform: scale(1); opacity: 1; filter: blur(0); } }
@keyframes playPulse { from { transform: scale(1); } to { transform: scale(1.05); } }
@keyframes introAnim { 0% { opacity: 0; transform: translateY(20px); } 15% { opacity: 1; transform: translateY(0); } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-12px); } }
@keyframes starPop { 0% { transform: scale(0.2) rotate(-40deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes lineIn { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: translateX(0); } }
@keyframes rot { 0%, 20% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }

@media (max-height: 520px) {
  #hud-mission .task { font-size: 15px; }
  #hud-money { font-size: 19px; padding: 6px 10px; min-width: 90px; }
  .icon-btn { width: 40px; height: 40px; }
  #hud-meters { top: 58px; width: 160px; }
  .meter .val { font-size: 14px; }
  .tbtn { width: 78px; height: 78px; }
  .tbtn.sm { width: 60px; height: 60px; border-radius: 18px; }
  .card { padding: 14px 18px; }
  .btn.huge { padding: 12px 34px; min-width: 220px; }
  .stars i { width: 40px; height: 40px; } .stars i:nth-child(2) { width: 48px; height: 48px; }
  .res-stats b { font-size: 19px; }
  .res-lines { font-size: 13px; }
  .res-total b { font-size: 28px; }
  #hud-timer .t { font-size: 30px; }
  #precision { bottom: calc(118px + var(--safe-b)); } body.touch #precision { bottom: calc(150px + var(--safe-b)); }
  #precision .val { font-size: 26px; }
  #prompt { top: 18%; }
}
@media (max-width: 700px) { .g-body { grid-template-columns: 1fr; } }

/* ================= v2 polish ================= */
.icon-btn.cam svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 3.5; stroke-linejoin: round; }
#hud-rule { position: absolute; left: calc(14px + var(--safe-l)); top: 92px; padding: 6px 12px; border-radius: 10px; background: rgba(69, 242, 255, 0.92); color: #06222a; font-weight: 900; font-size: 15px; letter-spacing: 0.08em; box-shadow: 0 6px 20px rgba(69,242,255,0.35); }
#hud-combo { top: 136px; }
#tut { position: absolute; left: calc(14px + var(--safe-l)); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
#tut .tl { padding: 9px 14px; border-radius: 12px; background: rgba(9,18,30,0.72); border: 2px solid rgba(255,255,255,0.14); font-weight: 900; font-size: 17px; letter-spacing: 0.06em; color: #dfe8f2; transition: all 0.25s; }
#tut .tl.on { background: rgba(255,198,26,0.95); color: #1a1205; border-color: #fff3b0; transform: scale(1.06); box-shadow: 0 0 24px rgba(255,198,26,0.55); }
#tut .tl.done { opacity: 0.45; }
#tut .tl.done .tk::after { content: "  ✓"; color: var(--green); }
#countdown { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); font-size: clamp(70px, 14cqw, 150px); font-weight: 900; font-style: italic; color: #fff; text-shadow: 0 6px 0 rgba(0,0,0,0.35), 0 0 50px rgba(69,242,255,0.7); pointer-events: none; }
#countdown.tick { animation: cdPop 0.9s ease-out; }
#toast { position: absolute; left: 50%; bottom: calc(66px + var(--safe-b)); transform: translateX(-50%); padding: 8px 18px; border-radius: 30px; background: rgba(9,18,30,0.82); border: 1px solid rgba(255,255,255,0.25); font-weight: 900; letter-spacing: 0.12em; font-size: 15px; pointer-events: none; animation: toastIn 1.6s ease forwards; }
body.touch #toast { bottom: auto; top: 70px; }

#precision { flex-direction: column; align-items: stretch; gap: 5px; min-width: 260px; padding: 9px 14px 10px; bottom: calc(76px + var(--safe-b)); left: auto; right: calc(14px + var(--safe-r)); transform: none; transition: border-color 0.2s, box-shadow 0.2s; }
#precision .pm { display: none; font-size: 11px; font-weight: 900; letter-spacing: 0.18em; color: var(--cyan); text-align: center; margin-top: -2px; }
#precision.mode .pm { display: block; }
#precision .ptop { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
#precision .val { font-size: 36px; line-height: 1; }
#precision .pbar { position: relative; height: 8px; border-radius: 4px; background: rgba(255,255,255,0.12); overflow: hidden; }
#precision .pbar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, #ff6b4a, #ffc61a 60%, #3ee37f); transition: width 0.12s; }
#precision .pbar b { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,0.6); }
#precision .pbar .m95 { left: 95%; } #precision .pbar .m80 { left: 80%; }
#precision .prow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
#precision .pi { display: flex; flex-direction: column; align-items: center; padding: 4px 2px; border-radius: 8px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); }
#precision .pi .k { font-size: 10px; letter-spacing: 0.12em; font-weight: 800; color: var(--muted); white-space: nowrap; }
#precision .pi b { font-size: 15px; font-weight: 900; font-variant-numeric: tabular-nums; }
#precision .pi.ok { border-color: rgba(62,227,127,0.7); background: rgba(62,227,127,0.16); } #precision .pi.ok b { color: var(--green); }
#precision .pi.mid b { color: var(--yellow); } #precision .pi.far b { color: #ff8a7a; }
#precision.perfect { box-shadow: 0 0 26px rgba(62,227,127,0.45); }
body.touch #precision { bottom: auto; top: 124px; right: auto; left: calc(14px + var(--safe-l)); min-width: 210px; }
body.touch #precision .val { font-size: 28px; }
#precision .h { display: none; }

#btn-reset { position: absolute; left: 50%; top: 30%; transform: translateX(-50%); padding: 12px 26px; border-radius: 30px; font-size: 18px; font-weight: 900; letter-spacing: 0.08em; color: #fff; background: linear-gradient(180deg, #ff7a5c, #e04a2e); box-shadow: 0 8px 24px rgba(224,74,46,0.5); pointer-events: auto; }
#vignette { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.25s; background: radial-gradient(ellipse at center, rgba(0,0,0,0) 55%, rgba(255,40,20,0.38) 100%); }
#vignette.on { opacity: 1; animation: vigPulse 0.6s ease-in-out infinite alternate; }
#vignette.green { opacity: 1; background: radial-gradient(ellipse at center, rgba(0,0,0,0) 55%, rgba(62,227,127,0.32) 100%); animation: none; }

.lang-btn { position: absolute; right: calc(16px + var(--safe-r)); top: 14px; display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px; background: rgba(9,18,30,0.6); border: 1px solid rgba(255,255,255,0.25); color: #fff; font-weight: 800; font-size: 14px; letter-spacing: 0.04em; }
.lang-btn svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 3; }
.langs { width: min(560px, 94cqw); text-align: left; }
.lang-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 14px; }
.lang-grid button { padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); color: #fff; font-weight: 800; font-size: 17px; text-align: start; }
.lang-grid button.on { background: var(--yellow); color: #1a1205; border-color: #fff3b0; }
.res-nextjob { margin-top: 8px; font-size: 13px; letter-spacing: 0.1em; font-weight: 800; color: var(--muted); }
.intro-rule { display: inline-block; margin-top: 10px; padding: 6px 16px; border-radius: 10px; background: rgba(69,242,255,0.92); color: #06222a; font-weight: 900; font-size: clamp(16px, 2.4cqw, 24px); letter-spacing: 0.08em; }
.pop.pct { font-size: clamp(24px, 3.6cqw, 36px); color: #c9ffe0; }
.pop.master { font-size: clamp(30px, 5cqw, 54px); background: linear-gradient(180deg, #fff, #ffd23f 50%, #ff7a1a); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 0 rgba(0,0,0,0.35)); }
.pop.saved { font-size: clamp(44px, 8cqw, 86px); color: #3ee37f; text-shadow: 0 4px 0 rgba(0,0,0,0.35), 0 0 40px rgba(62,227,127,0.6); }
.pop.event { font-size: clamp(30px, 5cqw, 54px); color: #fff; text-shadow: 0 4px 0 rgba(0,0,0,0.35), 0 0 30px rgba(69,242,255,0.6); }
.bubble.good { background: #3ee37f; color: #062312; }
.bubble.warn { background: #ffd23f; }
#prompt.flash .main { color: #ffd23f; }
.kc[data-k="C"] { min-width: 28px; }

/* touch polish */
.tbtn { width: 96px; height: 96px; }
.tbtn.sm { width: 78px; height: 78px; }
.tc-left { gap: 18px; }
.tc-right { gap: 16px; }
.tcol { gap: 12px; }
body.touch #btn-release { bottom: calc(24px + var(--safe-b)); padding: 22px 52px; font-size: 30px; border: 3px solid #fff; }
body.touch.precise .tbtn:not(.hook) { border-color: rgba(69,242,255,0.8); }
body.touch .icon-btn { width: 50px; height: 50px; }

/* RTL & CJK */
body.rtl #prompt, body.rtl #pops, body.rtl .card, body.rtl .bubble, body.rtl #hud-mission, body.rtl #hud-rule, body.rtl #alert, body.rtl #screen-intro, body.rtl .title-tag, body.rtl #toast, body.rtl .meter .lbl, body.rtl #precision .k { direction: rtl; unicode-bidi: plaintext; }
body.rtl .res-lines div, body.rtl .res-total { flex-direction: row-reverse; }
body.cjk .title-tag, body.cjk #prompt .main, body.cjk .pop { letter-spacing: 0.02em; font-style: normal; }

@keyframes cdPop { 0% { transform: translate(-50%, -50%) scale(1.8); opacity: 0; } 25% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(0.9); opacity: 0; } }
@keyframes toastIn { 0% { opacity: 0; transform: translateX(-50%) translateY(10px); } 15%, 75% { opacity: 1; transform: translateX(-50%) translateY(0); } 100% { opacity: 0; } }
@keyframes vigPulse { from { opacity: 0.55; } to { opacity: 1; } }
@media (max-height: 520px) {
  .tbtn { width: 82px; height: 82px; } .tbtn.sm { width: 64px; height: 64px; }
  #tut .tl { font-size: 14px; padding: 6px 10px; }
  #hud-rule { top: 76px; font-size: 13px; }
  body.touch #precision { top: 104px; min-width: 180px; padding: 6px 10px; }
  body.touch #precision .prow { display: none; }
  body.touch #btn-release { padding: 16px 40px; font-size: 24px; }
}
#alert.good { background: rgba(40, 200, 110, 0.94); box-shadow: 0 0 30px rgba(40,200,110,0.6); color: #04210f; }
body.rtl .pop, body.rtl #prompt .main, body.rtl .intro-title, body.rtl .fail-head, body.rtl .res-head, body.rtl .btn, body.rtl #alert, body.rtl #btn-release, body.rtl .g-head, body.rtl .co-name, body.rtl #hud-combo { font-style: normal; letter-spacing: 0; }
body.cjk #btn-release, body.cjk .btn, body.cjk .intro-title, body.cjk .fail-head, body.cjk .res-head, body.cjk #alert { font-style: normal; letter-spacing: 0.02em; }
.g-head .x { margin-left: auto; }
.g-head b + .x { margin-left: 0; }
body.rtl .g-head .x { margin-left: 0; margin-right: auto; }

/* ================= v3 gameplay excitement ================= */
.title-logo { margin: 0 auto 2px; width: min(780px, 88cqw, 118cqh); line-height: 0; animation: logoIn 0.9s cubic-bezier(.2,1.25,.35,1); }
.title-logo img { width: 100%; height: auto; display: block; filter: drop-shadow(0 14px 30px rgba(0,0,0,0.55)); pointer-events: none; }
@keyframes logoIn { from { transform: scale(0.82) translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-height: 520px) { .title-logo { width: min(520px, 70cqw, 92cqh); } .title-tag { margin-bottom: 14px; } }

#foreman { position: absolute; left: calc(14px + var(--safe-l)); top: 176px; display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 12px; background: rgba(12, 20, 14, 0.86); border: 2px solid rgba(255,198,26,0.75); box-shadow: 0 8px 24px rgba(0,0,0,0.35); max-width: min(380px, 44cqw); pointer-events: none; }
#foreman.show { animation: fmIn 0.3s cubic-bezier(.2,1.5,.4,1); }
#foreman.urgent { border-color: #ff6b4a; box-shadow: 0 0 22px rgba(255,107,74,0.45); }
#foreman .fm-ico { width: 34px; height: 34px; border-radius: 9px; background: var(--yellow); display: flex; align-items: center; justify-content: center; flex: none; }
#foreman.urgent .fm-ico { background: #ff6b4a; animation: pulse 0.35s infinite alternate; }
#foreman .fm-ico svg { width: 24px; height: 24px; fill: none; stroke: #1a1205; stroke-width: 4; stroke-linecap: round; }
#foreman .fm-head { font-size: 10.5px; letter-spacing: 0.22em; font-weight: 900; color: var(--yellow); }
#foreman.urgent .fm-head { color: #ff8a7a; }
#foreman .fm-txt { font-size: 18px; font-weight: 900; font-style: italic; letter-spacing: 0.02em; color: #fff; line-height: 1.1; }
@keyframes fmIn { from { transform: translateX(-30px); opacity: 0; } to { transform: none; opacity: 1; } }

#hud-bonus { position: absolute; left: calc(14px + var(--safe-l)); top: 92px; display: flex; flex-direction: column; padding: 5px 11px 6px; border-radius: 10px; background: rgba(9,18,30,0.72); border: 1px solid rgba(255,198,26,0.6); }
#hud-bonus .bk { font-size: 9.5px; letter-spacing: 0.2em; font-weight: 900; color: var(--yellow); }
#hud-bonus .bt { font-size: 14px; font-weight: 900; letter-spacing: 0.04em; }
#hud-bonus.ok { border-color: var(--green); } #hud-bonus.ok .bt::after { content: "  ✓"; color: var(--green); }
#hud-bonus.lost { opacity: 0.5; } #hud-bonus.lost .bt { text-decoration: line-through; }

.meter .bar.stab i { background: linear-gradient(90deg, #3ee37f, #a6f04d); transition: width 0.15s; }
#meter-stab.mid .bar i { background: linear-gradient(90deg, #ffc61a, #ffdc5a); } #meter-stab.mid .val { color: var(--yellow); }
#meter-stab.low { border-color: var(--red); animation: shakeX 0.4s infinite; } #meter-stab.low .bar i { background: linear-gradient(90deg, #ff4d3d, #ff8a3d); } #meter-stab.low .val { color: var(--red); }
.meter .bar.cable { position: relative; }
.meter .bar.cable i { background: linear-gradient(90deg, #45f2ff, #8fe9ff); transition: width 0.1s; }
.meter .bar.cable b { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,0.5); }
.meter .bar.cable .m1 { left: 55%; } .meter .bar.cable .m2 { left: 80%; }
#meter-cable .val { font-size: 13px; letter-spacing: 0.1em; color: var(--green); }
#meter-cable.high .val { color: var(--yellow); } #meter-cable.high .bar i { background: linear-gradient(90deg, #ffc61a, #ff9a1f); }
#meter-cable.danger { border-color: var(--red); animation: shakeX 0.35s infinite; } #meter-cable.danger .val { color: var(--red); } #meter-cable.danger .bar i { background: linear-gradient(90deg, #ff6b4a, #ff2a2a); }

#btn-outriggers { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; padding: 16px 34px 12px; border-radius: 18px; font-size: 26px; font-weight: 900; font-style: italic; letter-spacing: 0.06em; color: #1a1205; background: linear-gradient(180deg, #ffe27a, #ffc61a); border: 3px solid #fff3b0; box-shadow: 0 10px 30px rgba(255,198,26,0.55); pointer-events: auto; animation: btnPulse 0.7s infinite alternate; }
#btn-outriggers small { font-size: 12px; letter-spacing: 0.2em; font-style: normal; opacity: 0.7; margin-top: 2px; }
body.touch #btn-outriggers small { display: none; }

.tc-rot { position: absolute; left: calc(18px + var(--safe-l)); bottom: calc(150px + var(--safe-b)); display: flex; gap: 10px; align-items: center; pointer-events: none; }
.tc-rot .tlabel { position: absolute; left: 50%; bottom: -16px; transform: translateX(-50%); white-space: nowrap; }
.tbtn.xs { width: 58px; height: 58px; border-radius: 50%; pointer-events: auto; border-color: rgba(69,242,255,0.75); }
.tbtn.xs svg { width: 56%; height: 56%; stroke-width: 4.5; }
@media (max-height: 520px) { .tc-rot { bottom: calc(118px + var(--safe-b)); } .tbtn.xs { width: 50px; height: 50px; } }

.mastery { display: flex; justify-content: center; gap: 8px; margin: -2px 0 10px; flex-wrap: wrap; }
.mastery span { display: flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 20px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); font-size: 11px; font-weight: 900; letter-spacing: 0.1em; color: var(--muted); }
.mastery span i { font-style: normal; color: rgba(255,255,255,0.2); font-size: 14px; }
.mastery span em { font-style: normal; }
.mastery span.on { border-color: rgba(255,198,26,0.7); color: #fff; background: rgba(255,198,26,0.14); }
.mastery span.on i { color: var(--yellow); }
.job .jst { white-space: nowrap; }
.j-sec { margin: 12px 2px 2px; font-size: 12px; letter-spacing: 0.22em; font-weight: 900; color: var(--yellow); text-align: start; }
.j-tools { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.j-tools .btn { flex: 1; padding: 10px 12px; font-size: 14px; min-width: 150px; }
.j-tools .btn.on { background: rgba(255,198,26,0.14); color: var(--yellow); border: 1px solid rgba(255,198,26,0.75); box-shadow: none; }
.job.sk .num { background: rgba(166,240,77,0.16); color: #a6f04d; }
.job.master .num { background: rgba(255,90,60,0.18); color: #ff8a6a; }
.job .mtag { font-size: 10px; font-weight: 900; letter-spacing: 0.12em; color: #ff8a6a; margin-left: 6px; }
.pop.flawless { font-size: clamp(30px, 5cqw, 54px); color: #bff4ff; text-shadow: 0 4px 0 rgba(0,0,0,0.35), 0 0 30px rgba(143,233,255,0.8); }
.pop.risk { font-size: clamp(22px, 3.4cqw, 34px); color: #ffd23f; }
.pop.good2 { font-size: clamp(24px, 3.8cqw, 40px); color: #3ee37f; }
body.rtl #foreman, body.rtl #hud-bonus, body.rtl .mastery { direction: rtl; }
body.rtl #foreman .fm-txt, body.cjk #foreman .fm-txt, body.rtl #btn-outriggers, body.cjk #btn-outriggers { font-style: normal; }
@media (max-height: 520px) {
  #foreman { top: 150px; padding: 6px 10px 6px 6px; } #foreman .fm-txt { font-size: 15px; } #foreman .fm-ico { width: 28px; height: 28px; }
  #btn-outriggers { font-size: 20px; padding: 12px 24px 10px; }
}

#hud-left { position: absolute; left: calc(14px + var(--safe-l)); top: 92px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; pointer-events: none; }
#hud-left > div { position: static !important; }
#hud-left #foreman { margin-top: 4px; }
body.touch.pshow #hud-left > :not(#foreman) { display: none !important; }
@media (max-height: 520px) { #hud-left { top: 76px; } }
#hud-left { top: calc(var(--mis-b, 82px) + 8px); transition: top 0.3s; }
body.touch #hud-left #foreman { position: fixed !important; left: 50%; top: auto !important; bottom: calc(122px + var(--safe-b)); transform: translateX(-50%); max-width: 46cqw; margin: 0; }
body.touch #foreman.show { animation: fmInT 0.3s ease-out; }
@keyframes fmInT { from { opacity: 0; } to { opacity: 1; } }
@media (max-height: 520px) { body.touch #hud-left #foreman { bottom: calc(100px + var(--safe-b)); } }
/* compact meters on short touch screens: 2-column grid so they never reach the trolley / hook buttons */
@media (max-height: 520px) {
  body.touch #hud-meters { display: grid; grid-template-columns: repeat(2, 132px); gap: 4px; width: auto; top: 56px; }
  body.touch .meter { padding: 4px 8px 5px; }
  body.touch .meter .lbl { font-size: 9px; letter-spacing: 0.06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.touch .meter .val { font-size: 12px; }
  body.touch #meter-cable .val { font-size: 10px; }
  body.touch .meter .bar { height: 4px; margin-top: 3px; }
  body.touch .wind-dial { width: 18px; height: 18px; } body.touch .wind-dial i { height: 12px; margin-top: -6px; }
}
.title-tag { margin-top: 2px; }
body.touch #btn-outriggers { top: auto; bottom: calc(22px + var(--safe-b)); }
@media (max-height: 520px) {
  #screen-boot { gap: 14px; }
  .boot-logo { width: min(330px, 44cqw, 56cqh); margin: 0; }
  .loadtxt { margin-top: -6px; }
}

/* short (phone landscape) screens: results in two columns, NEXT JOB always on screen */
@media (max-height: 520px) {
  .results { width: min(780px, 96cqw); display: flex; gap: 18px; align-items: center; padding: 12px 16px; }
  .results .res-l, .results .res-r { flex: 1; min-width: 0; }
  .results .res-head { font-size: 22px; }
  .results .stars { margin: 4px 0 2px; }
  .results .stars i { width: 34px; height: 34px; } .results .stars i:nth-child(2) { width: 42px; height: 42px; margin-top: -6px; }
  .results .mastery { margin: 0 0 6px; gap: 4px; } .results .mastery span { padding: 2px 7px; font-size: 9.5px; }
  .results .res-bonus { font-size: 14px; margin-bottom: 4px; }
  .results .res-stats { margin: 4px 0 0; gap: 6px; } .results .res-stats div { padding: 5px 2px; } .results .res-stats b { font-size: 17px; }
  .results .res-lines { font-size: 12px; max-height: 32cqh; overflow-y: auto; } .results .res-lines div { padding: 2px 4px; }
  .results .res-total { padding: 6px 4px 8px; } .results .res-total b { font-size: 24px; }
  .results .btn.huge { padding: 10px 20px; min-width: 0; width: 100%; font-size: 22px; }
  .results .res-nextjob { margin-top: 4px; font-size: 11px; }
  .results .res-row { margin-top: 8px; gap: 6px; } .results .res-row .btn { padding: 8px 12px; font-size: 13px; }
}

/* =====================================================================
   v4 — responsive UI system (mobile landscape first)
   ===================================================================== */
:root { --safe-t: env(safe-area-inset-top, 0px); --app-h: 100dvh; }
html, body { position: fixed; inset: 0; width: 100%; overflow: hidden; }
#ui { bottom: auto; height: 100vh; height: var(--app-h, 100dvh); overflow: hidden; }
.screen { box-sizing: border-box; padding: calc(8px + var(--safe-t)) calc(8px + var(--safe-r)) calc(8px + var(--safe-b)) calc(8px + var(--safe-l)); }
.card { max-height: calc(100cqh - 16px - var(--safe-t) - var(--safe-b)); overscroll-behavior: contain; scrollbar-width: none; }
.card::-webkit-scrollbar { display: none; }

/* ---- one primary (yellow) button component; secondary = dark ---- */
.btn.primary { background: linear-gradient(180deg, #ffe37a 0%, #ffc61a 52%, #f5ad00 100%); color: #1d1404; border: 1px solid rgba(255, 236, 160, 0.9);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55), 0 4px 14px rgba(255,170,0,0.26); font-style: italic; transition: transform 0.1s, filter 0.15s, box-shadow 0.15s; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.primary:active { transform: translateY(1px) scale(0.98); box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 2px 8px rgba(255,170,0,0.22); }
.btn.primary[disabled] { opacity: 0.45; filter: grayscale(0.4); }
.btn.huge { font-size: clamp(20px, 3cqw, 30px); padding: 13px 40px; min-width: 230px; border-radius: 16px; }
.btn.buy { background: rgba(255,198,26,0.1); border: 1px solid rgba(255,198,26,0.7); color: #ffd84d; }
.btn.buy:hover { background: rgba(255,198,26,0.18); }
.btn.ghost:active, .btn.buy:active { transform: translateY(1px) scale(0.98); }
#btn-play { animation: playPulse2 1.2s ease-in-out infinite alternate; }
@keyframes playPulse2 { from { transform: scale(1); } to { transform: scale(1.03); } }
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { flex: 1 1 0; min-width: 0; }
.settings-btn { gap: 8px; }
.settings-btn svg { width: 18px; height: 18px; fill: currentColor; flex: none; }

/* contextual HOOK / RELEASE: compact pill, same family as the primary button */
#btn-release, body.touch #btn-release { padding: 10px 30px; border-radius: 14px; font-size: 20px; border: 1px solid rgba(214, 255, 228, 0.85); background: linear-gradient(180deg, #8dffb9, #2fd06f); color: #06200f;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), 0 4px 16px rgba(62,227,127,0.4); animation: ctxPulse 0.8s ease-in-out infinite alternate; bottom: calc(16px + var(--safe-b)); }
#btn-release.hook, body.touch #btn-release.hook { background: linear-gradient(180deg, #ffe37a 0%, #ffc61a 52%, #f5ad00 100%); border-color: rgba(255, 236, 160, 0.9); color: #1d1404; box-shadow: inset 0 1px 0 rgba(255,255,255,0.55), 0 4px 16px rgba(255,170,0,0.4); }
body:not(.touch) #btn-release { bottom: calc(80px + var(--safe-b)); padding: 0 26px; min-height: 44px; display: flex; align-items: center; font-size: 18px; }
@keyframes ctxPulse { from { transform: translateX(-50%) scale(1); } to { transform: translateX(-50%) scale(1.05); } }

/* ---- pause + settings ---- */
.pause, .settings { width: min(400px, 94cqw); }
.set-rows { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 12px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); color: #fff; font-weight: 800; font-size: 15px; letter-spacing: 0.08em; }
.set-row span { color: var(--muted); }
.set-row b { color: var(--yellow); font-weight: 900; }
.set-row b::after { content: "  ›"; color: rgba(255,255,255,0.35); }
.set-row:active { background: rgba(255,255,255,0.12); }
#btn-settings-back { text-transform: uppercase; min-width: 150px; min-height: 44px; }

/* celebration pops never show through a results / fail card */
#ui:has(#screen-results:not(.hidden), #screen-fail:not(.hidden)) #pops { visibility: hidden; }

/* ---- lists scroll inside their card; header + close always visible ---- */
.card.jobs, .card.garage, .card.langs { display: flex; flex-direction: column; overflow: hidden; }
.j-list, .g-body, .lang-grid { overflow-y: auto; min-height: 0; flex: 1 1 auto; overscroll-behavior: contain; touch-action: pan-y; scrollbar-width: none; }
.j-list::-webkit-scrollbar, .g-body::-webkit-scrollbar, .lang-grid::-webkit-scrollbar { display: none; }
.g-body, .lang-grid { align-content: start; }
.g-head, .tabs { flex: none; }

/* ---- rotate overlay ---- */
#rotate-hint { height: 100cqh; gap: 16px; padding: calc(16px + var(--safe-t)) 20px calc(16px + var(--safe-b)); text-align: center; box-sizing: border-box; }
.rot-logo { width: min(44cqw, 210px); height: auto; object-fit: contain; filter: drop-shadow(0 8px 20px rgba(0,0,0,0.5)); }
.rot-title { font-size: 20px; font-weight: 900; letter-spacing: 0.12em; color: var(--yellow); }
.rot-sub { font-size: 14px; color: var(--muted); font-weight: 700; max-width: 80cqw; }

/* ---- title / logo (logo swap = just replace the asset) ---- */
.title-logo { width: min(640px, 62cqw, 82cqh); }
.title-logo img, .boot-logo { object-fit: contain; }

/* ---- gameplay: one compact instruction pill, upper centre ---- */
#prompt { top: calc(72px + var(--safe-t)); max-width: min(560px, 64cqw); padding: 7px 18px 8px; border-radius: 14px; background: rgba(9,18,30,0.74); border: 1px solid rgba(255,198,26,0.55); box-shadow: 0 6px 18px rgba(0,0,0,0.3); }
#prompt .main { font-size: clamp(16px, 2.1cqw, 24px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: none; letter-spacing: 0.03em; }
#prompt .sub { font-size: clamp(11px, 1.3cqw, 14px); margin-top: 1px; text-shadow: none; }
#prompt .sub:empty { display: none; }
#alert { top: calc(122px + var(--safe-t)); font-size: 22px; }
.wlabel.target, .wlabel.pick { display: none !important; }   /* the 3D target + ring already say it */

/* compact HUD states */
#hud-bonus .bm { display: none; font-size: 13px; font-weight: 900; letter-spacing: 0.04em; color: var(--yellow); }
#hud-bonus.mini { padding: 4px 9px; }
#hud-bonus.mini .bk, #hud-bonus.mini .bt { display: none; }
#hud-bonus.mini .bm { display: block; }
#hud-bonus.mini.ok .bm::after { content: " ✓"; color: var(--green); }
#hud-bonus.mini.lost { opacity: 0.45; }
#hud-mission .task { transition: font-size 0.3s; }
#hud-mission.compact .task { font-size: 15px; }
#hud-mission.compact .loc { display: none; }
#meter-damage.zero .bar { display: none; }
#meter-damage.zero { padding-top: 5px; padding-bottom: 5px; }
.icon-btn { position: relative; }
.icon-btn::after { content: ""; position: absolute; inset: -5px; }   /* ≥ 46 px touch target */

/* =====================================================================
   SHORT LANDSCAPE (phones): 844×390 · 852×393 · 896×414 · 932×430 …
   ===================================================================== */
@media (orientation: landscape) and (max-height: 500px) {
  /* --- menus --- */
  .screen { padding: calc(6px + var(--safe-t)) calc(8px + var(--safe-r)) calc(6px + var(--safe-b)) calc(8px + var(--safe-l)); }
  .card { padding: 12px 16px; border-radius: 16px; max-height: calc(100cqh - 12px - var(--safe-t) - var(--safe-b)); }
  .btn { padding: 8px 14px; font-size: 14px; border-radius: 11px; min-height: 40px; }
  .btn.huge { font-size: clamp(18px, 5.4cqh, 23px); padding: 8px 28px; min-width: 190px; border-radius: 13px; }
  .res-head { font-size: clamp(18px, 6cqh, 24px); }
  .g-head { font-size: 19px; } .g-head b { font-size: 17px; } .g-head .x { width: 34px; height: 34px; }
  /* main menu: logo ~30 % smaller, tagline, PLAY NOW, JOBS | GARAGE on one row */
  .title-kicker { font-size: 9.5px; letter-spacing: 0.34em; }
  .title-logo { width: min(380px, 46cqw, 64cqh); margin: 0 auto; }
  .title-tag { font-size: 12px; margin: 0 0 9px; }
  .title-row { margin-top: 9px; gap: 10px; }
  .title-row .btn { min-width: 112px; }
  .lang-btn { top: calc(8px + var(--safe-t)); right: calc(10px + var(--safe-r)); padding: 6px 10px; font-size: 12px; border-radius: 10px; }
  .lang-btn svg { width: 16px; height: 16px; }
  /* pause / settings */
  .pause, .settings { width: clamp(320px, 60cqw, 500px); }
  .menu-col { gap: 6px; margin-top: 10px; }
  .help { display: none; }
  .set-rows { gap: 5px; margin: 8px 0; }
  .set-row { min-height: 40px; padding: 7px 12px; font-size: 13.5px; }
  /* jobs / garage / languages: fixed header, inner scroll */
  .card.jobs, .card.garage { height: calc(100cqh - 12px - var(--safe-t) - var(--safe-b)); width: min(760px, 94cqw); }
  .card.langs { width: min(640px, 90cqw); }
  .j-list { margin-top: 8px; gap: 5px; }
  .j-sec { margin: 6px 2px 0; font-size: 10.5px; }
  .j-tools { margin-top: 0; } .j-tools .btn { min-width: 0; padding: 7px 10px; font-size: 12.5px; }
  .job { padding: 6px 10px; gap: 10px; border-radius: 10px; }
  .job .num { width: 30px; height: 30px; font-size: 13px; border-radius: 8px; }
  .job .info b { font-size: 14px; } .job .info span { font-size: 11px; }
  .job .crane { font-size: 9.5px; max-width: 96px; } .job .jst { font-size: 13px; }
  .tabs { margin: 8px 0; } .tab { padding: 7px; font-size: 12.5px; }
  .g-body { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .upg, .crn { padding: 8px 10px; gap: 4px; border-radius: 12px; }
  .upg h4, .crn h4 { font-size: 13px; }
  .upg p, .crn p { font-size: 10.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .upg .btn, .crn .btn { padding: 4px 8px; font-size: 12px; min-height: 40px; }
  .crn p { -webkit-line-clamp: 1; }
  .crn .cstats { font-size: 9px; gap: 0 6px; line-height: 1.15; }
  .lang-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
  .lang-grid button { padding: 0 10px; font-size: 14px; min-height: 46px; text-align: center; }
  .fail-head { font-size: clamp(26px, 9cqh, 40px); } .fail-sub { font-size: 13px; margin: 2px 0 10px; }
  .co-name { font-size: 22px; } .craneoffer { gap: 6px; } .co-kicker { font-size: 11px; }
  /* intro briefing: small and quick */
  #screen-intro { top: 22%; }
  .intro-loc { font-size: 11px; letter-spacing: 0.3em; }
  .intro-title { font-size: clamp(24px, 9cqh, 40px); }
  .intro-task { font-size: 13px; }
  .intro-rule { font-size: 12px; padding: 3px 10px; margin-top: 6px; }

  /* --- HUD: small, at the edges --- */
  #hud-mission { top: calc(6px + var(--safe-t)); left: calc(8px + var(--safe-l)); padding: 5px 10px 6px; max-width: 34cqw; border-radius: 10px; }
  #hud-mission .loc { font-size: 9.5px; letter-spacing: 0.12em; }
  #hud-mission .task, #hud-mission.compact .task { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #hud-mission.compact .task { font-size: 11px; opacity: 0.85; }
  #hud-mission .lifts { margin-top: 3px; gap: 4px; } #hud-mission .lifts i { width: 12px; height: 4px; }
  #hud-left { top: calc(var(--mis-b, 44px) + 5px); left: calc(8px + var(--safe-l)); gap: 4px; }
  #hud-rule { font-size: 10.5px; padding: 3px 8px; letter-spacing: 0.06em; border-radius: 8px; }
  #hud-bonus { padding: 3px 8px 4px; border-radius: 8px; } #hud-bonus .bk { font-size: 8px; } #hud-bonus .bt { font-size: 11px; }
  #hud-bonus.mini { padding: 3px 8px; } #hud-bonus .bm { font-size: 11px; }
  #hud-combo { font-size: 11.5px; padding: 3px 8px; border-radius: 8px; }
  #foreman { padding: 4px 9px 4px 4px; gap: 6px; max-width: 36cqw; border-radius: 10px; border-width: 1.5px; }
  #foreman .fm-ico { width: 22px; height: 22px; border-radius: 6px; } #foreman .fm-ico svg { width: 15px; height: 15px; }
  #foreman .fm-head { font-size: 7.5px; } #foreman .fm-txt { font-size: 12px; }
  #hud-right { top: calc(6px + var(--safe-t)); right: calc(8px + var(--safe-r)); gap: 6px; }
  #hud-money { font-size: 15px; padding: 7px 10px; min-width: 0; border-radius: 11px; }
  .icon-btn, body.touch .icon-btn { width: 40px; height: 40px; border-radius: 11px; }
  .icon-btn::after { inset: -4px; } /* 48 px touch target */
  .icon-btn span { width: 5px; height: 15px; } .icon-btn.cam svg { width: 22px; height: 22px; }
  #hud-meters, body.touch #hud-meters { top: calc(52px + var(--safe-t)); right: calc(8px + var(--safe-r)); width: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
  .meter, body.touch .meter { padding: 3px 8px 4px; border-radius: 9px; min-width: 118px; }
  .meter .row { gap: 6px; } .meter .lbl, body.touch .meter .lbl { font-size: 8.5px; letter-spacing: 0.08em; white-space: nowrap; }
  .meter .val, body.touch .meter .val { font-size: 12px; } #meter-cable .val { font-size: 10px; }
  .meter .bar, body.touch .meter .bar { height: 3px; margin-top: 2px; }
  .wind-dial, body.touch .wind-dial { width: 14px; height: 14px; border-width: 1.5px; } .wind-dial i, body.touch .wind-dial i { height: 10px; margin-top: -5px; width: 3px; margin-left: -1.5px; }
  #meter-damage.zero { padding-top: 3px; padding-bottom: 3px; }
  #hud-timer { top: calc(4px + var(--safe-t)); } #hud-timer .t { font-size: 22px; } #hud-timer .sub { font-size: 8.5px; margin-top: -2px; }
  #prompt { top: calc(44px + var(--safe-t)); padding: 4px 14px 5px; max-width: 46cqw; border-radius: 11px; }
  #prompt .main { font-size: clamp(13px, 4.3cqh, 19px); }
  #prompt .sub { font-size: 10.5px; }
  #alert { top: calc(80px + var(--safe-t)); font-size: 15px; padding: 5px 12px; border-radius: 9px; }
  #toast { top: calc(80px + var(--safe-t)); bottom: auto; font-size: 12px; padding: 5px 12px; }
  #pops { top: 27%; }
  .pop.big { font-size: clamp(30px, 11cqh, 50px); }
  .pop.saved { font-size: clamp(30px, 11.5cqh, 54px); }
  .pop.master, .pop.event, .pop.flawless { font-size: clamp(20px, 7.5cqh, 34px); }
  .pop.money { font-size: clamp(18px, 6.5cqh, 30px); }
  .pop.warn, .pop.good2 { font-size: clamp(17px, 6cqh, 26px); }
  .pop.pct { font-size: clamp(15px, 5.5cqh, 24px); } .pop.risk { font-size: clamp(14px, 5cqh, 22px); }
  .pop.small { font-size: clamp(11px, 3.6cqh, 15px); } .pop.combo { font-size: clamp(12px, 4cqh, 17px); }
  #countdown { font-size: clamp(56px, 22cqh, 104px); }
  #btn-reset { font-size: 14px; padding: 8px 18px; }
  #btn-outriggers { font-size: 17px; padding: 9px 22px 7px; }
  #btn-release, body.touch #btn-release { padding: 0 28px; min-height: 46px; display: flex; align-items: center; font-size: 19px; border-radius: 13px; bottom: calc(10px + var(--safe-b)); }
  body:not(.touch) #btn-release { bottom: calc(54px + var(--safe-b)); }
  #keys { bottom: calc(8px + var(--safe-b)); gap: 12px; padding: 5px 10px; }
  .kc { min-width: 24px; height: 24px; font-size: 11.5px; } .kc.wide { min-width: 52px; } .kgroup em { font-size: 9.5px; }
  #precision { min-width: 210px; padding: 6px 10px 7px; gap: 4px; bottom: calc(50px + var(--safe-b)); right: calc(8px + var(--safe-r)); }
  #precision .val { font-size: 24px; } #precision .lbl { font-size: 10px; } #precision .pm { font-size: 9px; }
  #precision .pi { padding: 2px; } #precision .pi .k { font-size: 8px; } #precision .pi b { font-size: 12px; }
  #precision .pbar { height: 6px; }

  /* --- touch controls: sized from the available height, never under 48 px --- */
  body.touch { --tb: clamp(54px, 18.5cqh, 84px); --tbs: clamp(48px, 15cqh, 68px); --tgap: clamp(8px, 2.4cqh, 14px); }
  body.touch .tbtn { width: var(--tb); height: var(--tb); border-width: 2.5px; }
  body.touch .tbtn.sm { width: var(--tbs); height: var(--tbs); border-radius: 16px; }
  body.touch .tc-left { left: calc(12px + var(--safe-l)); bottom: calc(16px + var(--safe-b)); gap: var(--tgap); }
  body.touch .tc-right { right: calc(12px + var(--safe-r)); bottom: calc(8px + var(--safe-b)); gap: var(--tgap); }
  body.touch .tcol { gap: 7px; }
  body.touch .tlabel { font-size: 9px; letter-spacing: 0.12em; }
  body.touch .tc-rot { left: calc(12px + var(--safe-l)); bottom: calc(var(--tb) + 30px + var(--safe-b)); gap: 8px; }
  body.touch .tbtn.xs { width: 48px; height: 48px; }
  /* precision on phones: right side, above trolley/hook, alignment + bar only */
  body.touch #precision { top: auto; left: auto; right: calc(10px + var(--safe-r)); bottom: calc(var(--tbs) * 2 + 40px + var(--safe-b)); min-width: 176px; }
  body.touch #precision .prow { display: none; }
  /* foreman radio: small card bottom-centre, above the HOOK / RELEASE button */
  body.touch #hud-left #foreman { position: fixed !important; left: 50%; top: auto !important; bottom: calc(64px + var(--safe-b)); transform: translateX(-50%); max-width: 40cqw; }
}

/* =====================================================================
   v1.1 — career (XP, rank, achievements, daily), construction projects, stability screens
   ===================================================================== */
/* level-up / achievement banner: top centre, never blocks input */
#notice { position: absolute; left: 50%; top: calc(64px + var(--safe-t)); transform: translateX(-50%); z-index: 6; pointer-events: none; text-align: center; padding: 8px 22px 9px; border-radius: 16px; min-width: 240px; background: rgba(9,18,30,0.9); border: 1px solid rgba(255,255,255,0.18); box-shadow: 0 10px 30px rgba(0,0,0,0.45); }
#notice.show { animation: noticeIn 2.4s ease forwards; }
#notice .nk { font-size: 11px; letter-spacing: 0.24em; font-weight: 900; color: var(--muted); }
#notice .nb { font-size: clamp(20px, 2.6cqw, 28px); font-weight: 900; font-style: italic; letter-spacing: 0.03em; line-height: 1.1; }
#notice .ns { font-size: 13px; font-weight: 800; color: var(--yellow); margin-top: 2px; }
#notice.lvl { background: linear-gradient(180deg, rgba(255,214,77,0.97), rgba(245,173,0,0.97)); border-color: #fff3b0; color: #1d1404; }
#notice.lvl .nk { color: rgba(29,20,4,0.7); } #notice.lvl .ns { color: #1d1404; }
#notice.ach { border-color: rgba(69,242,255,0.6); box-shadow: 0 0 26px rgba(69,242,255,0.35), 0 10px 30px rgba(0,0,0,0.45); }
#notice.ach .nk { color: var(--cyan); }
@keyframes noticeIn { 0% { opacity: 0; transform: translateX(-50%) translateY(-14px) scale(0.9); } 10% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1.04); } 16% { transform: translateX(-50%) scale(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-8px); } }
body.touch #notice { top: calc(60px + var(--safe-t)); }

/* construction progress chip (left column, under the job panel) */
#hud-build { padding: 6px 11px 7px; border-radius: 11px; background: var(--panel); border: 1px solid rgba(69,242,255,0.5); min-width: 170px; }
#hud-build .row { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
#hud-build .bl { font-size: 10px; letter-spacing: 0.18em; font-weight: 900; color: var(--cyan); }
#hud-build .bv { font-size: 15px; font-weight: 900; font-variant-numeric: tabular-nums; }
#hud-build .bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,0.12); margin-top: 4px; overflow: hidden; }
#hud-build .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #45f2ff, #3ee37f); transition: width 0.6s cubic-bezier(.2,1.2,.4,1); }
#hud-build.bump { animation: buildBump 0.45s ease; }
@keyframes buildBump { 0% { transform: scale(1); } 35% { transform: scale(1.08); border-color: #3ee37f; } 100% { transform: scale(1); } }
.pop.xp { font-size: clamp(16px, 2.2cqw, 22px); color: #8fe9ff; }
.pop.build { font-size: clamp(26px, 4cqw, 40px); color: #8fe9ff; text-shadow: 0 3px 0 rgba(0,0,0,0.35), 0 0 26px rgba(69,242,255,0.6); }

/* tutorial checklist (job 1): a compact objective tracker in the left HUD column */
#hud-left #tut { transform: none; display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
#hud-left #tut.hidden { display: none !important; }
#tut .tl { font-size: 12.5px; padding: 4px 10px; border-radius: 9px; border-width: 1px; letter-spacing: 0.06em; }
#tut .tl.on { transform: none; box-shadow: 0 0 14px rgba(255,198,26,0.45); }
#tut .tl.on .tk::before { content: "▶ "; }
#tut .tl.done { opacity: 0.55; }
body.touch.pshow #tut { display: none !important; }
@media (max-height: 520px) { #tut .tl { font-size: 11px; padding: 3px 8px; } }

/* operator rank strip (results + jobs) */
.rk-top { display: flex; align-items: baseline; gap: 8px; font-weight: 900; }
.rk-top b { color: #1d1404; background: var(--yellow); border-radius: 7px; padding: 1px 7px; font-size: 13px; letter-spacing: 0.06em; }
.rk-top span { font-size: 13px; letter-spacing: 0.12em; }
.rk-top em { margin-left: auto; font-style: normal; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rk-bar { height: 7px; border-radius: 4px; background: rgba(255,255,255,0.12); margin-top: 5px; overflow: hidden; }
.rk-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #45f2ff, #8fe9ff); transition: width 0.6s ease-out; }
.res-xp { text-align: left; background: rgba(255,255,255,0.05); border: 1px solid rgba(69,242,255,0.25); border-radius: 12px; padding: 7px 10px 8px; margin: 0 0 10px; position: relative; }
.res-xp .rx-gain { position: absolute; right: 10px; top: -10px; font-size: 13px; font-weight: 900; color: #04121a; background: #8fe9ff; border-radius: 8px; padding: 1px 8px; }
.res-xp .rx-up { margin-top: 5px; text-align: center; font-size: 14px; font-weight: 900; font-style: italic; letter-spacing: 0.08em; color: var(--yellow); animation: popIn 0.35s cubic-bezier(.2,1.6,.4,1); }
.res-best { margin: -6px 6px 6px; text-align: right; font-size: 12px; letter-spacing: 0.14em; font-weight: 900; color: var(--muted); }
.res-best.new { color: #1a1205; display: inline-block; float: right; background: linear-gradient(90deg, #ffd54a, #ff9a1f); border-radius: 8px; padding: 2px 9px; margin: -8px 6px 6px; animation: popIn 0.4s cubic-bezier(.2,1.6,.4,1) 1.2s both; }
.res-r::after { content: ""; display: block; clear: both; }
.daily-btn { border-color: rgba(69,242,255,0.6) !important; color: var(--cyan); }

/* landscape desktops / tablets: results in two columns so NEXT JOB is always on screen */
@media (min-width: 760px) and (min-aspect-ratio: 1/1) and (min-height: 521px) {
  .results { width: min(860px, 94cqw); display: flex; gap: 22px; align-items: center; }
  .results .res-l, .results .res-r { flex: 1; min-width: 0; }
}

/* jobs screen: rank strip, tabs, daily contract, achievements */
.j-rank { margin-top: 10px; padding: 8px 10px 9px; border-radius: 12px; background: rgba(255,255,255,0.05); border: 1px solid rgba(69,242,255,0.22); flex: none; }
.j-rank:empty { display: none; }
.card.jobs .tabs { margin: 10px 0 0; }
.daily { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 14px; background: linear-gradient(90deg, rgba(69,242,255,0.14), rgba(69,242,255,0.04)); border: 1px solid rgba(69,242,255,0.55); margin-top: 4px; }
.daily .dl-l { flex: 1; min-width: 0; }
.daily .dl-k { font-size: 11px; letter-spacing: 0.22em; font-weight: 900; color: var(--cyan); display: flex; gap: 10px; align-items: center; }
.daily .dl-k .streak { letter-spacing: 0.1em; color: #ffb35a; }
.daily b { display: block; font-size: 16px; font-weight: 900; letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.daily span { font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: 0.06em; }
.daily .btn { padding: 10px 18px; font-size: 16px; flex: none; }
.daily.done { border-color: rgba(62,227,127,0.55); background: rgba(62,227,127,0.08); }
.daily.done .dl-k { color: var(--green); }
.daily.locked { opacity: 0.55; }
.job.pj .num { background: rgba(69,242,255,0.16); color: var(--cyan); font-size: 15px; }
.job .ptag { font-size: 10px; font-weight: 900; letter-spacing: 0.12em; color: var(--cyan); margin-left: 6px; }
.j-ach { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; align-content: start; }
.achv { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); opacity: 0.6; }
.achv.on { opacity: 1; border-color: rgba(255,198,26,0.55); background: rgba(255,198,26,0.08); }
.achv i { font-style: normal; font-size: 20px; }
.achv div { flex: 1; min-width: 0; }
.achv b { display: block; font-size: 14px; font-weight: 900; letter-spacing: 0.03em; }
.achv span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 700; }
.achv em { font-style: normal; font-size: 11px; font-weight: 900; color: #8fe9ff; white-space: nowrap; }
@media (max-width: 700px) { .j-ach { grid-template-columns: 1fr; } }

/* garage: paint */
.g-body.paints { grid-template-columns: repeat(3, 1fr); }
.g-note { grid-column: 1 / -1; margin: 0 0 2px; font-size: 12.5px; color: var(--muted); font-weight: 700; }
.paint { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; border-radius: 14px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); text-align: center; }
.paint i { width: 46px; height: 46px; border-radius: 12px; border: 2px solid rgba(255,255,255,0.4); box-shadow: inset 0 -8px 0 rgba(0,0,0,0.18); }
.paint b { font-size: 13px; font-weight: 900; letter-spacing: 0.06em; }
.paint em { font-style: normal; font-size: 11px; font-weight: 900; letter-spacing: 0.1em; color: var(--muted); }
.paint em.ok { color: var(--green); }
.paint .btn { padding: 7px 14px; font-size: 13px; }
.paint.on { border-color: rgba(62,227,127,0.6); }
.paint.locked { opacity: 0.5; }
@media (max-width: 700px) { .g-body.paints { grid-template-columns: repeat(2, 1fr); } }

/* graphics unavailable / paused */
.card.gl { width: min(460px, 92cqw); text-align: center; }
.gl-h { font-size: 26px; font-weight: 900; font-style: italic; color: var(--yellow); letter-spacing: 0.04em; }
.gl-s { margin-top: 8px; font-size: 15px; font-weight: 700; color: var(--muted); line-height: 1.4; }
#screen-gl { z-index: 20; }
.ver { margin-top: 10px; font-size: 11px; color: rgba(255,255,255,0.3); letter-spacing: 0.12em; }
body.rtl #notice, body.rtl .daily, body.rtl .achv, body.rtl .rk-top { direction: rtl; }
body.cjk #notice .nb, body.rtl #notice .nb { font-style: normal; }
/* short phone-landscape screens: keep the job list / paints in view under the new header blocks */
@media (max-height: 520px) {
  .j-rank { padding: 5px 9px 6px; margin-top: 6px; }
  .rk-top b, .rk-top span { font-size: 11.5px; } .rk-top em { font-size: 10px; } .rk-bar { height: 5px; margin-top: 3px; }
  .card.jobs .tabs, .card.garage .tabs { margin: 6px 0 0; } .card .tab { padding: 7px; font-size: 13px; }
  .daily { padding: 6px 10px; gap: 8px; } .daily .dl-k { font-size: 10px; } .daily b { font-size: 14px; } .daily span { font-size: 11px; }
  .daily .btn { padding: 7px 14px; font-size: 14px; }
  .j-ach { gap: 6px; margin-top: 8px; } .achv { padding: 6px 9px; gap: 8px; } .achv b { font-size: 13px; } .achv span { font-size: 10.5px; }
  .g-body.paints { grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 8px; }
  .paint { padding: 7px 6px; gap: 4px; } .paint i { width: 32px; height: 32px; border-radius: 9px; } .paint b { font-size: 11px; } .paint .btn { padding: 5px 10px; font-size: 12px; }
  .g-note { font-size: 11px; }
  .res-xp { padding: 5px 9px 6px; margin-bottom: 6px; } .res-xp .rx-up { margin-top: 2px; font-size: 12px; }
}
body.rtl #tut .tl.on .tk::before { content: "◀ "; }
@media (max-height: 520px) { #hud-build { min-width: 128px; padding: 4px 9px 5px; } #hud-build .bv { font-size: 13px; } #hud-build .bl { font-size: 9px; } #hud-build .bar { height: 4px; margin-top: 3px; } }

/* =====================================================================
   v1.2 — START screen, clearer touch controls (ROTATE · TROLLEY · HOOK), tutorial spotlight, EASY badge
   ===================================================================== */
body { -webkit-touch-callout: none; }
#touch, #touch * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* START screen: the scene orbits behind a compact card */
#screen-start { background: radial-gradient(ellipse at center, rgba(5,10,18,0.25), rgba(5,10,18,0.7)); }
.card.start { width: min(560px, 94cqw); display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 16px 22px 16px; animation: cardIn 0.45s cubic-bezier(.2,1.3,.4,1); }
.st-logo { width: min(250px, 46cqw); height: auto; filter: drop-shadow(0 8px 18px rgba(0,0,0,0.5)); }
.st-kicker { display: block; font-size: 12px; letter-spacing: 0.22em; color: var(--yellow); font-weight: 900; }
.st-task { display: block; font-size: 20px; font-weight: 900; letter-spacing: 0.04em; text-transform: uppercase; }
#btn-start { min-width: min(320px, 80cqw); animation: playPulse2 1.1s ease-in-out infinite alternate; }
.st-hint { font-size: 12.5px; color: var(--muted); font-weight: 700; letter-spacing: 0.03em; }
.st-ctl { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px; }
.st-ctl > span { display: flex; align-items: center; gap: 4px; }
.st-ctl .kc { font-style: normal; display: inline-flex; align-items: center; justify-content: center; }
.st-ctl em { font-style: normal; font-size: 11px; font-weight: 800; letter-spacing: 0.1em; color: var(--muted); margin-left: 3px; }
.st-tch { display: none; }
.st-tch > span { flex-direction: column; gap: 1px; padding: 5px 12px; border-radius: 12px; border: 2px solid rgba(255,255,255,0.5); background: rgba(255,255,255,0.05); }
.st-tch b { font-size: 12px; letter-spacing: 0.14em; } .st-tch em { margin: 0; font-size: 10.5px; letter-spacing: 0.04em; }
.st-tch .c-trol { border-color: rgba(69,242,255,0.8); } .st-tch .c-trol b { color: var(--cyan); }
.st-tch .c-hook { border-color: rgba(255,198,26,0.85); } .st-tch .c-hook b { color: var(--yellow); }
#screen-start.touch .st-desk { display: none; }
#screen-start.touch .st-tch { display: flex; }
.st-mode { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 4px 8px; padding: 7px 14px; border-radius: 12px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.22); color: #fff; font-weight: 900; letter-spacing: 0.08em; font-size: 13px; }
.st-mode .sm-v { color: var(--muted); }
.st-mode.on { border-color: rgba(69,242,255,0.8); background: rgba(69,242,255,0.1); } .st-mode.on .sm-v { color: var(--cyan); }
.st-mode em { flex-basis: 100%; font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; color: var(--muted); }
@media (max-height: 520px) {
  .card.start { gap: 6px; padding: 10px 16px 10px; }
  .st-logo { width: min(150px, 30cqw); }
  .st-task { font-size: 16px; } .st-kicker { font-size: 10px; }
  #btn-start { padding: 9px 26px; font-size: 22px; }
  .st-mode { padding: 5px 10px; font-size: 11.5px; }
}

/* touch pad: three clearly different groups. White = ROTATE, cyan = TROLLEY, yellow = HOOK */
body.touch #touch { --rb: clamp(58px, 17.5cqh, 90px); --sb: clamp(50px, 14.5cqh, 74px); }
#touch .tgrp { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; transition: opacity 0.2s; }
#touch .g-rot { position: absolute; left: calc(14px + var(--safe-l)); bottom: calc(10px + var(--safe-b)); }
#touch .tc-right { right: calc(12px + var(--safe-r)); bottom: calc(8px + var(--safe-b)); gap: clamp(16px, 4.5cqh, 26px); align-items: flex-end; }
#touch .tg-h { line-height: 1.05; text-align: center; text-shadow: 0 1px 3px rgba(0,0,0,0.7); }
#touch .tg-h b { display: block; font-size: 11.5px; font-weight: 900; letter-spacing: 0.16em; color: #fff; }
#touch .tg-h span { display: block; font-size: 9.5px; font-weight: 800; letter-spacing: 0.04em; color: rgba(255,255,255,0.75); }
#touch .tg-b { display: flex; gap: clamp(10px, 3cqh, 18px); }
#touch .tg-b.col { flex-direction: column; gap: clamp(6px, 2cqh, 10px); }
#touch .tbtn { pointer-events: auto; width: var(--rb, 88px); height: var(--rb, 88px); }
#touch .tbtn.sq { width: var(--sb, 72px); height: var(--sb, 72px); border-radius: 18px; flex-direction: column; gap: 0; }
#touch .tbtn.sq svg { width: 48%; height: 48%; }
#touch .tbtn em { font-style: normal; font-size: 10px; font-weight: 900; letter-spacing: 0.1em; color: #fff; margin-top: -2px; }
#touch .tbtn.on em { color: #1a1205; }
#touch .g-trol .tbtn { border-color: rgba(69,242,255,0.85); background: rgba(8,40,52,0.6); }
#touch .g-trol .tg-h b { color: var(--cyan); }
#touch .g-trol .tbtn svg { stroke: #bff8ff; }
#touch .g-hook .tbtn { border-color: rgba(255,198,26,0.9); background: rgba(52,38,8,0.55); }
#touch .g-hook .tg-h b { color: var(--yellow); }
#touch .g-hook .tbtn svg { stroke: #ffe9a8; }
#touch .g-trol .tbtn.on { background: rgba(69,242,255,0.85); } #touch .g-trol .tbtn.on svg { stroke: #04121a; }
body.touch .tc-rot { bottom: calc(var(--rb, 88px) + 44px + var(--safe-b)); }
body.touch #precision { bottom: calc(var(--sb, 72px) * 2 + 62px + var(--safe-b)); }
/* EASY controls: the hook runs itself (still usable by hand) */
#touch .auto-badge { display: none; }
body.easy #touch .auto-badge { display: block; position: absolute; top: -17px; left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 1px 6px; border-radius: 6px; background: var(--cyan); color: #04121a; font-size: 9px; font-weight: 900; font-style: normal; letter-spacing: 0.08em; }
body.easy #touch .g-hook { opacity: 0.72; }
/* tutorial spotlight: only the group that matters now is bright */
#touch.spot .tgrp { opacity: 0.28; }
#touch.spot[data-focus="rot"] .g-rot, #touch.spot[data-focus="trol"] .g-trol, #touch.spot[data-focus="hook"] .g-hook { opacity: 1; }
#keys.spot .kgroup { opacity: 0.3; transition: opacity 0.2s; }
#keys.spot[data-focus="rot"] .kg-rot, #keys.spot[data-focus="trol"] .kg-trol, #keys.spot[data-focus="hook"] .kg-hook { opacity: 1; }
/* "ALIGNED — LOWER THE LOAD": green, with a nudging arrow */
#prompt.ok { border-color: rgba(62,227,127,0.9); box-shadow: 0 0 22px rgba(62,227,127,0.35); }
#prompt.ok .main { color: #8dffb9; }
#prompt.ok .main::after { content: " ▼"; display: inline-block; animation: lowerNudge 0.7s ease-in-out infinite alternate; }
@keyframes lowerNudge { from { transform: translateY(-2px); } to { transform: translateY(3px); } }
.res-stay { margin: 2px auto 0; display: block; font-size: 12px; letter-spacing: 0.12em; }

/* ---- v1.3: instant start focus hint, come-back-tomorrow line, daily bonus banner ---- */
#focus-hint { position: absolute; left: 50%; top: 66%; transform: translate(-50%, -50%); z-index: 7; pointer-events: none; display: flex; align-items: center; gap: 10px; padding: 11px 22px; border-radius: 999px; background: rgba(9,18,30,0.88); border: 1.5px solid rgba(255,214,77,0.9); color: #fff; font-weight: 900; font-size: clamp(14px, 1.7cqw, 18px); letter-spacing: 0.08em; white-space: nowrap; animation: focusPulse 1.1s ease-in-out infinite alternate; }
#focus-hint svg { width: 22px; height: 22px; fill: none; stroke: var(--yellow); stroke-width: 2; stroke-linecap: round; flex: none; }
@keyframes focusPulse { from { box-shadow: 0 0 0 rgba(255,214,77,0), 0 10px 30px rgba(0,0,0,0.45); } to { box-shadow: 0 0 28px rgba(255,214,77,0.5), 0 10px 30px rgba(0,0,0,0.45); } }
.tomorrow { margin: 8px auto 0; padding: 5px 12px; border-radius: 10px; background: rgba(255,214,77,0.1); border: 1px dashed rgba(255,214,77,0.6); color: var(--yellow); font-size: 12px; font-weight: 800; letter-spacing: 0.05em; text-align: center; max-width: 100%; box-sizing: border-box; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tomorrow::before { content: "🎁 "; }
.tomorrow:empty, .tomorrow.hidden { display: none; }
#notice.daily .nb { font-style: normal; }
@media (orientation: landscape) and (max-height: 500px) { .tomorrow { margin-top: 5px; padding: 3px 10px; font-size: 10.5px; } }
@media (orientation: landscape) and (max-height: 360px) { .tomorrow { margin-top: 3px; padding: 1px 8px; font-size: 10px; line-height: 1.35; } }

/* =====================================================================================
   v1.4 — PORTRAIT PLAY (phones / tablets held upright). body.portrait is set by the game.
   Layout, top to bottom, with no two text blocks sharing space:
     row 1  job panel (left) · money / camera / pause (right)
     row 2  left column: bonus, rule, build, combo, tutorial steps, foreman · centre: timer · right column: meters
     middle the 3D view; transient banners stack at fixed heights (notice 20%, alert 29%, pops 38%, countdown 48%)
     bottom prompt pill, then the action slot (precision / outriggers / reset / hook), then the thumb controls
   ===================================================================================== */
body.portrait { --mid0: max(30%, calc(244px + var(--safe-t))); --col: calc(50cqw - 48px); --rb: clamp(54px, 16cqw, 74px); --sb: clamp(48px, 13.6cqw, 64px);
  --ctrl-h: calc(var(--sb) * 2 + 50px + var(--safe-b)); --slot1: calc(var(--ctrl-h) + 10px); --slot2: calc(var(--ctrl-h) + 66px); }
/* row 1 */
body.portrait #hud-right { top: calc(8px + var(--safe-t)); right: calc(8px + var(--safe-r)); gap: 6px; }
body.portrait #hud-money { font-size: 15px; padding: 7px 10px; min-width: 0; border-radius: 11px; }
body.portrait .icon-btn, body.portrait.touch .icon-btn { width: 40px; height: 40px; border-radius: 11px; }
body.portrait .icon-btn::after { inset: -4px; }
body.portrait #hud-mission { top: calc(8px + var(--safe-t)); left: calc(8px + var(--safe-l)); max-width: calc(100cqw - 196px - var(--safe-l) - var(--safe-r)); padding: 5px 10px 6px; border-radius: 10px; box-sizing: border-box; }
body.portrait #hud-mission .loc { font-size: 9.5px; letter-spacing: 0.1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.portrait #hud-mission .task, body.portrait #hud-mission.compact .task { font-size: 12px; line-height: 1.15; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
body.portrait #hud-mission.compact .task { font-size: 11px; -webkit-line-clamp: 1; }
body.portrait #hud-mission .lifts { margin-top: 3px; gap: 4px; } body.portrait #hud-mission .lifts i { width: 12px; height: 4px; }
/* row 2: two narrow columns + the timer between them */
body.portrait #hud-left { left: calc(8px + var(--safe-l)); top: calc(max(var(--mis-b, 56px), 52px + var(--safe-t)) + 6px); max-width: var(--col); gap: 4px; }
body.portrait #hud-left > div { max-width: 100%; box-sizing: border-box; }
body.portrait #hud-bonus .bt, body.portrait #hud-rule { white-space: normal; }
body.portrait #hud-rule { font-size: 10.5px; padding: 3px 8px; border-radius: 8px; }
body.portrait #hud-combo { font-size: 11.5px; padding: 3px 8px; }
body.portrait #hud-left #tut .tl { font-size: 10.5px; padding: 4px 8px; border-radius: 9px; letter-spacing: 0.04em; }
body.portrait #hud-left #tut .tl.on { transform: none; }
body.portrait #hud-meters, body.portrait.touch #hud-meters { top: calc(56px + var(--safe-t)); right: calc(8px + var(--safe-r)); width: var(--col); display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
body.portrait .meter, body.portrait.touch .meter { min-width: 0; padding: 3px 8px 4px; border-radius: 9px; }
body.portrait .meter .lbl, body.portrait.touch .meter .lbl { font-size: 8.5px; letter-spacing: 0.06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.portrait .meter .val, body.portrait.touch .meter .val { font-size: 12px; } body.portrait #meter-cable .val { font-size: 10px; }
body.portrait .meter .bar { height: 3px; margin-top: 2px; }
/* timed jobs: the clock heads the right column and the meters move down under it */
body.portrait #hud-timer { top: calc(56px + var(--safe-t)); left: auto; right: calc(8px + var(--safe-r)); transform: none; width: var(--col); box-sizing: border-box; padding: 2px 8px 3px; border-radius: 9px; background: rgba(9,18,30,0.72); }
body.portrait #hud-timer .t { font-size: 20px; display: block; line-height: 1.1; } body.portrait #hud-timer .sub { font-size: 8.5px; margin-top: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.portrait #hud-timer:not(.hidden) ~ #hud-meters { top: calc(110px + var(--safe-t)); }
/* foreman radio: a line in the left column (the thumbs own the bottom of the screen) */
body.portrait.touch #hud-left #foreman, body.portrait #hud-left #foreman { position: static !important; transform: none; left: auto; bottom: auto; max-width: 100%; margin: 2px 0 0; padding: 4px 8px 4px 4px; gap: 6px; border-radius: 10px; }
body.portrait #foreman .fm-ico { width: 22px; height: 22px; border-radius: 6px; } body.portrait #foreman .fm-ico svg { width: 15px; height: 15px; }
body.portrait #foreman .fm-head { font-size: 7.5px; } body.portrait #foreman .fm-txt { font-size: 11.5px; white-space: normal; }
/* middle: transient banners at fixed, separate heights */
body.portrait #notice { top: var(--mid0); min-width: 0; width: max-content; max-width: 86cqw; padding: 6px 16px 7px; }
body.portrait #notice .nb { font-size: 19px; } body.portrait #notice .nk { font-size: 9.5px; } body.portrait #notice .ns { font-size: 11.5px; }
body.portrait #alert { top: calc(var(--mid0) + 62px); font-size: 16px; padding: 6px 14px; width: max-content; max-width: 90cqw; white-space: normal; text-align: center; box-sizing: border-box; }
body.portrait #pops { top: calc(var(--mid0) + 104px); width: 92cqw; }
/* one celebration at a time, three lines at most (the full breakdown is on the results card) */
body.portrait #pops > *:not(:last-child) { display: none !important; }
body.portrait #pops > * > .pop:nth-child(n+4) { display: none !important; }
body.portrait .pop { white-space: normal; text-align: center; }
body.portrait .pop.big { font-size: clamp(30px, 10cqw, 46px); } body.portrait .pop.money { font-size: clamp(22px, 7cqw, 32px); }
body.portrait .pop.small { font-size: 14px; } body.portrait .pop.combo { font-size: 15px; } body.portrait .pop.warn, body.portrait .pop.good2 { font-size: 22px; }
body.portrait .pop.master, body.portrait .pop.event, body.portrait .pop.flawless { font-size: 26px; } body.portrait .pop.saved { font-size: 34px; } body.portrait .pop.pct { font-size: 20px; }
body.portrait #countdown { top: var(--mid0); transform: translateX(-50%); font-size: 48px; line-height: 1; }
body.portrait #toast { top: calc(var(--mid0) + 62px); bottom: auto; width: max-content; max-width: 86cqw; white-space: normal; text-align: center; }
/* bottom: prompt, action slot, thumb controls */
body.portrait #prompt { top: auto; bottom: var(--slot1); width: max-content; max-width: calc(100cqw - 24px); padding: 5px 14px 6px; border-radius: 12px; box-sizing: border-box; }
body.portrait #prompt .main { font-size: clamp(14px, 4.4cqw, 19px); white-space: normal; line-height: 1.15; }
body.portrait #prompt .sub { font-size: 11.5px; margin-top: 2px; }
body.portrait #precision, body.portrait.touch #precision { top: auto; left: 50%; right: auto; transform: translateX(-50%); bottom: var(--slot2); min-width: 0; width: max-content; max-width: calc(100cqw - 24px); padding: 4px 12px; gap: 8px; }
body.portrait #precision .val { font-size: 22px; } body.portrait #precision .pm { font-size: 9px; } body.portrait #precision .prow { display: none; }
body.portrait #btn-outriggers, body.portrait #btn-reset { left: 50%; right: auto; top: auto; transform: translateX(-50%); bottom: var(--slot2); max-width: calc(100cqw - 24px); }
body.portrait #btn-release, body.portrait.touch #btn-release { bottom: var(--slot2); }
body.portrait.touch .tc-rot { left: calc(10px + var(--safe-l)); bottom: calc(var(--rb) + 40px + var(--safe-b)); }
body.portrait #touch .g-rot { left: calc(10px + var(--safe-l)); bottom: calc(8px + var(--safe-b)); }
body.portrait #touch .tc-right { right: calc(10px + var(--safe-r)); bottom: calc(8px + var(--safe-b)); gap: 12px; }
body.portrait #touch .tg-b { gap: 10px; } body.portrait #touch .tg-b.col { gap: 8px; }
body.portrait #touch .tg-h b { font-size: 10.5px; letter-spacing: 0.1em; } body.portrait #touch .tg-h span { font-size: 8.5px; }
body.portrait #touch .tbtn em { font-size: 9px; }
body.portrait.touch #touch { --rb: clamp(54px, 16cqw, 74px); --sb: clamp(48px, 13.6cqw, 64px); }
@keyframes cdPopP { 0% { transform: translateX(-50%) scale(1.6); opacity: 0; } 25% { transform: translateX(-50%) scale(1); opacity: 1; } 100% { transform: translateX(-50%) scale(0.9); opacity: 0; } }
body.portrait #countdown.tick { animation-name: cdPopP; }
/* short portrait phones (iPhone SE / 8, small Androids): a tighter middle band, two celebration lines */
@media (orientation: portrait) and (max-height: 760px) {
  body.portrait { --mid0: max(30%, calc(234px + var(--safe-t))); }
  body.portrait #notice { padding: 4px 14px 5px; } body.portrait #notice .nb { font-size: 16px; } body.portrait #notice .nk { font-size: 9px; } body.portrait #notice .ns { font-size: 11px; margin-top: 0; }
  body.portrait #alert { top: calc(var(--mid0) + 50px); font-size: 14px; padding: 5px 12px; }
  body.portrait #toast { top: calc(var(--mid0) + 50px); }
  body.portrait #pops { top: calc(var(--mid0) + 88px); }
  body.portrait #pops > * > .pop:nth-child(n+3) { display: none !important; }
  body.portrait .pop.big { font-size: 26px; } body.portrait .pop.money { font-size: 20px; } body.portrait .pop.master, body.portrait .pop.event, body.portrait .pop.flawless { font-size: 21px; } body.portrait .pop.saved { font-size: 28px; }
  body.portrait #countdown { font-size: 40px; }
}
body.portrait #prompt .main { padding: 0 4px 0 2px; }
/* portrait tablets: same layout, larger type and narrower side columns */
@media (orientation: portrait) and (min-width: 600px) {
  body.portrait { --col: min(calc(50cqw - 48px), 250px); --rb: 84px; --sb: 72px; }
  body.portrait.touch #touch { --rb: 84px; --sb: 72px; }
  body.portrait #hud-mission { max-width: min(calc(100cqw - 236px), 420px); padding: 8px 14px 9px; }
  body.portrait #hud-mission .loc { font-size: 11.5px; } body.portrait #hud-mission .task, body.portrait #hud-mission.compact .task { font-size: 16px; }
  body.portrait #hud-money { font-size: 19px; padding: 9px 13px; } body.portrait .icon-btn, body.portrait.touch .icon-btn { width: 48px; height: 48px; }
  body.portrait #hud-meters, body.portrait.touch #hud-meters, body.portrait #hud-timer { top: calc(66px + var(--safe-t)); }
  body.portrait #hud-timer:not(.hidden) ~ #hud-meters { top: calc(126px + var(--safe-t)); }
  body.portrait .meter .lbl, body.portrait.touch .meter .lbl { font-size: 10.5px; } body.portrait .meter .val, body.portrait.touch .meter .val { font-size: 15px; }
  body.portrait #hud-left #tut .tl { font-size: 13px; padding: 6px 10px; } body.portrait #hud-bonus .bt { font-size: 14px; } body.portrait #foreman .fm-txt { font-size: 14px; }
  body.portrait #prompt .main { font-size: 24px; } body.portrait #prompt .sub { font-size: 14px; }
  body.portrait #touch .tg-h b { font-size: 13px; } body.portrait #touch .tg-h span { font-size: 10.5px; }
}
/* short landscape phones: same no-overlap rules — newest celebration only (3 lines), and the precision
   readout moves to the free bottom-centre gap so a tall meter column (glass + cable + wind) never meets it */
@media (orientation: landscape) and (max-height: 500px) {
  body.touch #pops > *:not(:last-child) { display: none !important; }
  body.touch #pops > * > .pop:nth-child(n+4) { display: none !important; }
  body.touch:not(.portrait) #precision { top: auto; left: 50%; right: auto; transform: translateX(-50%); bottom: calc(64px + var(--safe-b)); min-width: 0; width: max-content; max-width: 40cqw; }
}
/* short landscape phones: the centre column (between the job panel / left column and the meters) gets
   fixed bands — prompt 44, notice + countdown 84, alert + toast 134, pops 172 — each no wider than the gap */
@media (orientation: landscape) and (max-height: 500px) {
  body.touch:not(.portrait) { --cw: calc(40cqw - 32px); }
  body.touch:not(.portrait) #hud-mission { max-width: 30cqw; }
  body.touch:not(.portrait) #prompt { max-width: var(--cw); width: max-content; box-sizing: border-box; }
  body.touch:not(.portrait) #prompt .main { white-space: normal; line-height: 1.15; }
  body.touch:not(.portrait) #hud-left #foreman { position: static !important; transform: none; left: auto; bottom: auto; max-width: 100%; margin: 2px 0 0; }
  body.touch:not(.portrait) #hud-left { max-width: 30cqw; }
  body.touch:not(.portrait) #notice { top: calc(84px + var(--safe-t)); min-width: 0; width: max-content; max-width: var(--cw); padding: 4px 14px 5px; }
  body.touch:not(.portrait) #notice .nb { font-size: 16px; } body.touch:not(.portrait) #notice .nk { font-size: 9px; } body.touch:not(.portrait) #notice .ns { font-size: 11px; margin-top: 0; }
  body.touch:not(.portrait) #countdown { top: calc(84px + var(--safe-t)); transform: translateX(-50%); font-size: 42px; line-height: 1; }
  body.touch:not(.portrait) #countdown.tick { animation-name: cdPopP; }
  body.touch:not(.portrait) #alert, body.touch:not(.portrait) #toast { top: calc(134px + var(--safe-t)); width: max-content; max-width: var(--cw); white-space: normal; text-align: center; box-sizing: border-box; font-size: 14px; padding: 5px 12px; }
  body.touch:not(.portrait) #pops { top: calc(172px + var(--safe-t)); width: var(--cw); }
  body.touch:not(.portrait) .pop { white-space: normal; }
  body.touch:not(.portrait) .pop.big, body.touch:not(.portrait) .pop.saved { font-size: 23px; } body.touch:not(.portrait) .pop.money { font-size: 18px; }
  body.touch:not(.portrait) .pop.master, body.touch:not(.portrait) .pop.event, body.touch:not(.portrait) .pop.flawless { font-size: 20px; }
  body.touch:not(.portrait) .pop.warn, body.touch:not(.portrait) .pop.good2, body.touch:not(.portrait) .pop.pct, body.touch:not(.portrait) .pop.risk { font-size: 17px; }
  body.touch:not(.portrait) .pop.small, body.touch:not(.portrait) .pop.combo { font-size: 13px; }
}
@media (orientation: landscape) and (max-height: 360px) {
  body.touch:not(.portrait) #notice, body.touch:not(.portrait) #countdown { top: calc(76px + var(--safe-t)); }
  body.touch:not(.portrait) #alert, body.touch:not(.portrait) #toast { top: calc(120px + var(--safe-t)); }
  body.touch:not(.portrait) #pops { top: calc(154px + var(--safe-t)); }
  body.touch #pops > * > .pop:nth-child(n+3) { display: none !important; }
  body.touch:not(.portrait) .pop.big, body.touch:not(.portrait) .pop.saved { font-size: 18px; } body.touch:not(.portrait) .pop.money { font-size: 16px; }
  body.touch:not(.portrait) #precision { padding: 3px 10px; gap: 6px; } body.touch:not(.portrait) #precision .pm, body.touch:not(.portrait) #precision .prow { display: none; }
  body.touch:not(.portrait) #precision .val { font-size: 18px; } body.touch:not(.portrait) #precision .lbl { font-size: 10px; }
}
/* everywhere: a new celebration replaces the previous one instead of stacking under it (4 lines at most) */
#pops > *:not(:last-child) { display: none !important; }
#pops > * > .pop:nth-child(n+5) { display: none !important; }
/* while the "click to take control" chip shows, nothing else shares the centre of the screen */
body.needfocus #pops, body.needfocus #precision { visibility: hidden; }

/* =====================================================================================
   v1.5 — the UI scales with big windows / fullscreen. #ui is a size container, so every former vw/vh
   is now cqw/cqh (identical at scale 1); above 1280×720 the whole layer is drawn at --uis (×1.5 at 1080p).
   ===================================================================================== */
#ui { container-type: size; }
#ui.scaled { right: auto; width: calc(100vw / var(--uis, 1)); height: calc(var(--app-h, 100dvh) / var(--uis, 1)); transform: scale(var(--uis, 1)); transform-origin: 0 0; }
/* midgame ad requested / playing: nothing in the game can be clicked */
#ad-shield { position: absolute; inset: 0; z-index: 60; pointer-events: auto; background: transparent; }
/* portrait bands, roomier: a two-line alert never reaches the notice above or the celebration below */
body.portrait #alert, body.portrait #toast { top: calc(var(--mid0) + 70px); font-size: 15px; line-height: 1.2; max-height: calc(2.4em + 12px); overflow: hidden; }
body.portrait #pops { top: calc(var(--mid0) + 128px); }
@media (orientation: portrait) and (max-height: 760px) {
  body.portrait #alert, body.portrait #toast { top: calc(var(--mid0) + 54px); font-size: 13.5px; }
  body.portrait #pops { top: calc(var(--mid0) + 104px); }
}
@media (orientation: portrait) and (max-height: 760px) {
  body.portrait #precision .pm { display: none; } body.portrait #precision { padding: 3px 10px; } body.portrait #precision .val { font-size: 19px; }
}

/* =====================================================================
   v1.5.1 — CrazyGames full-launch review fixes
   ===================================================================== */
/* italic text in a clipping box: room for the slant of the last letter (the "T" of HOOK THE HVAC UNIT was cut off) */
#prompt .main { padding: 0 0.22em 0 0.08em; }
/* garage: the level pips and the button of every card sit on the same line, however long the description is */
.upg > .pips, .crn > .cstats { margin-top: auto; }
/* custom scrollbar on every pop-up that scrolls (drawn by ui.js; the native bars stay hidden) */
.sbar { position: absolute; width: 8px; border-radius: 4px; background: rgba(255,255,255,0.13); pointer-events: auto; touch-action: none; z-index: 4; animation: sbIn 0.35s ease 0.25s both; }
.sbar::before { content: ""; position: absolute; top: 0; bottom: 0; left: -8px; right: -5px; }
.sbar i { position: absolute; left: 0; top: 0; width: 100%; border-radius: 4px; background: linear-gradient(180deg, #ffe37a, #ffc61a 55%, #f5ad00); box-shadow: 0 0 0 1px rgba(0,0,0,0.3); cursor: grab; }
.sbar i.drag { cursor: grabbing; filter: brightness(1.12); }
@keyframes sbIn { from { opacity: 0; } to { opacity: 1; } }
.j-list.sb-on, .g-body.sb-on, .lang-grid.sb-on, .res-lines.sb-on { padding-right: 16px; }
/* top-centre messages stack (ui.js UI.stack): the shift is animated, never a jump */
#notice, #prompt, #alert, #toast { transition: margin-top 0.18s ease, opacity 0.3s; }
/* garage CRANES tab: OWNED is a badge the same size as a BUY button, so every card in a row lines up */
.crn .tagline { display: flex; align-items: center; justify-content: center; margin-top: 2px; padding: 9px 12px; border-radius: 14px; border: 1px solid rgba(62,227,127,0.55); background: rgba(62,227,127,0.1); font-size: 14px; letter-spacing: 0.06em; line-height: normal; }
@media (orientation: landscape) and (max-height: 500px) { .crn .tagline { padding: 4px 8px; font-size: 12px; min-height: 40px; } }
/* small screens: the job task wraps onto a second line instead of being cut with "…" */
@media (orientation: landscape) and (max-height: 500px) {
  #hud-mission .task, #hud-mission.compact .task { white-space: normal; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
body.portrait #hud-mission.compact .task { -webkit-line-clamp: 2; }
#hud-mission.snap, #hud-mission.snap *, #hud-left.snap { transition: none !important; }
#countdown { transition: margin-top 0.18s ease; }
/* portrait: a long job location wraps instead of being cut with "…" */
body.portrait #hud-mission .loc { white-space: normal; line-height: 1.2; }
/* small landscape screens: crane descriptions get two lines like the upgrades (one line cut them off with "…") */
@media (orientation: landscape) and (max-height: 500px) { .crn p { -webkit-line-clamp: 2; } }
/* gust countdown: a softer pop-in zoom, so the number never flashes over the alert above it */
@keyframes cdPop { 0% { transform: translate(-50%, -50%) scale(1.3); opacity: 0; } 25% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(0.9); opacity: 0; } }
@keyframes cdPopP { 0% { transform: translateX(-50%) scale(1.3); opacity: 0; } 25% { transform: translateX(-50%) scale(1); opacity: 1; } 100% { transform: translateX(-50%) scale(0.9); opacity: 0; } }
@keyframes alertIn { 0% { opacity: 0; transform: translateX(-50%) scale(1.25); } 10% { opacity: 1; transform: translateX(-50%) scale(1); } 20%, 40%, 60% { filter: brightness(1.35); } 30%, 50% { filter: brightness(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) scale(0.95); } }

/* =====================================================================
   v1.5.3: 2× PAY (optional rewarded ad) on the results card. A video icon marks it as an ad.
   v1.5.7: out of the TOTAL row into a filled green button under NEXT JOB that shows the amount, like DOUBLE IT in
   Black Cab (the small chip got ~0.01 ads per play, Black Cab's button 0.14-0.22).
   ===================================================================== */
.results .x2 { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 46px; margin-top: 10px; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(120,240,170,0.65); background: linear-gradient(180deg, #23a866, #13804a); color: #fff; font-weight: 900; font-size: 17px; letter-spacing: 0.05em; line-height: 1.1; white-space: nowrap; }
.results .x2.hidden { display: none; }
.results .x2 svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; }
.results .x2 svg path { fill: currentColor; stroke: none; }
.results .x2 i, .results .x2 em { font-style: normal; }
.results .x2 .x2-k { font-size: 20px; }
.results .x2 .x2-a { font-size: 20px; color: #ffe37a; font-variant-numeric: tabular-nums; }
.results .x2 .x2-k:empty, .results .x2 .x2-a:empty { display: none; }
.results .x2.offer { animation: x2Pulse 1.8s ease-in-out infinite; }
.results .x2:hover { filter: brightness(1.1); }
.results .x2:active { animation: none; transform: translateY(1px) scale(0.98); }
.results .x2:disabled { cursor: default; transform: none; filter: none; }
.results .x2.wait { opacity: 0.55; }
.results .x2.later { border-color: rgba(255,255,255,0.22); background: rgba(255,255,255,0.06); color: var(--muted); }
.results .x2.done { border-color: rgba(62,227,127,0.6); background: rgba(62,227,127,0.12); color: var(--green); }
.results .x2.done svg { display: none; }
.results .x2.done .x2-k { color: var(--green); }
@keyframes x2Pulse { 0%, 100% { opacity: 0.82; transform: scale(0.975); } 50% { opacity: 1; transform: scale(1); } }
/* narrow portrait phones: a smaller TOTAL row */
@media (max-width: 480px) and (min-height: 521px) {
  .res-total span { letter-spacing: 0.1em; font-size: 13px; }
  .res-total b { font-size: 30px; }
}

/* =====================================================================
   v1.5.5 — TUTORIAL: the mission panel becomes "TUTORIAL · n/N" with a SKIP button, SHOW ME sits under the
   instruction (only when the player has been stuck for a while), and a TUTORIAL COMPLETE card ends it.
   ===================================================================== */
.tt-row { display: flex; margin-top: 7px; }
.tt-row.hidden { display: none; }
.tt-skip { padding: 5px 11px; border-radius: 14px; font-size: 12px; font-weight: 800; letter-spacing: 0.06em; color: #dfe8f2;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.3); white-space: nowrap; }
.tt-skip:hover { background: rgba(255,255,255,0.18); }
.tt-skip:active { transform: scale(0.97); }
body.tt-on #hud-mission .loc { font-size: 13px; letter-spacing: 0.12em; }
#prompt .tt-show { margin-top: 12px; padding: 10px 24px; border-radius: 26px; font-size: 17px; font-weight: 900; letter-spacing: 0.08em; color: #1d1404;
  background: linear-gradient(180deg, #ffe37a 0%, #ffc61a 55%, #f5ad00 100%); border: 1px solid rgba(255,236,160,0.9);
  box-shadow: 0 8px 22px rgba(0,0,0,0.35), 0 0 22px rgba(255,198,26,0.5); animation: ttPulse 0.9s ease-in-out infinite alternate; }
#prompt .tt-show.hidden { display: none; }
#prompt .tt-show.busy { color: #fff; background: rgba(10,20,34,0.75); border-color: rgba(255,255,255,0.35); box-shadow: none; animation: none; }
@keyframes ttPulse { from { transform: scale(1); } to { transform: scale(1.07); } }
#prompt.fade .tt-show { pointer-events: none; }

.card.tutdone { width: min(480px, calc(100cqw - 28px)); text-align: center; }
.td-kicker { font-size: 13px; letter-spacing: 0.32em; color: var(--yellow); font-weight: 800; }
.td-head { font-size: clamp(28px, 4.2cqw, 38px); font-weight: 900; font-style: italic; letter-spacing: 0.04em; color: #fff; margin-top: 4px; line-height: 1.05; }
.td-sub { font-size: 15px; font-weight: 700; color: #c9d6e4; margin-top: 6px; }
.td-pay { margin: 10px auto 0; display: inline-flex; align-items: baseline; gap: 8px; padding: 5px 14px; border-radius: 12px; background: rgba(62,227,127,0.12); border: 1px solid rgba(62,227,127,0.45); }
.td-pay span { font-size: 13px; font-weight: 800; letter-spacing: 0.14em; color: #bff5d4; }
.td-pay b { font-size: 24px; color: var(--green); font-variant-numeric: tabular-nums; }
.td-pay.hidden { display: none; }
.td-list { list-style: none; margin: 14px 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.td-list li { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); font-size: 15px; font-weight: 700; line-height: 1.25; color: #e7eef7; }
.td-list i { flex: none; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 17px; font-weight: 900; }
.td-list .ic-aim { background: rgba(62,227,127,0.18); color: var(--green); }
.td-list .ic-aim::before { content: "◎"; }
.td-list .ic-warn { background: rgba(255,90,70,0.18); color: #ff7a66; }
.td-list .ic-warn::before { content: "!"; }
.td-list .ic-star { background: rgba(255,198,26,0.18); color: var(--yellow); }
.td-list .ic-star::before { content: "★"; }
.tutdone .btn.huge { width: 100%; }
body.rtl .td-list { text-align: right; }
body.cjk .td-head { font-style: normal; letter-spacing: 0.02em; }
@media (max-height: 520px) {
  .card.tutdone { padding: 12px 16px; }
  .td-head { font-size: 26px; }
  .td-sub { font-size: 13px; margin-top: 3px; }
  .td-pay { margin-top: 6px; padding: 3px 12px; } .td-pay b { font-size: 20px; }
  .td-list { margin: 8px 0 10px; gap: 5px; }
  .td-list li { padding: 5px 10px; font-size: 13px; gap: 10px; }
  .td-list i { width: 24px; height: 24px; font-size: 14px; }
  #prompt .tt-show { margin-top: 8px; padding: 7px 18px; font-size: 15px; }
}
@media (max-height: 360px) {
  .td-sub { display: none; }
  .td-kicker { font-size: 12px; letter-spacing: 0.2em; }
  .td-head { font-size: 22px; }
  .td-list li { font-size: 12px; padding: 4px 9px; }
  .tutdone .btn.huge { padding: 8px 16px; font-size: 20px; }
}
/* tutorial instructions: never cut off (they wrap), and the how-to line is never under 12 px */
body.tt-on #prompt .main { white-space: normal; text-overflow: clip; line-height: 1.12; }
body.tt-on #prompt .sub { font-size: clamp(12px, 1.35cqw, 15px); line-height: 1.25; }
/* the tutorial keeps its step counter when the panel goes compact (the task line goes instead) */
body.tt-on #hud-mission.compact .loc { display: block; }
body.tt-on #hud-mission.compact .task { display: none; }
/* SHOW ME: under the instruction, except on upright phones (there the instruction sits low, above the controls) */
.tt-row .tt-show { margin-left: 6px; padding: 5px 12px; border-radius: 14px; font-size: 13px; font-weight: 900; letter-spacing: 0.06em; color: #1d1404;
  background: linear-gradient(180deg, #ffe37a 0%, #ffc61a 55%, #f5ad00 100%); border: 1px solid rgba(255,236,160,0.9); white-space: nowrap;
  box-shadow: 0 0 16px rgba(255,198,26,0.5); animation: ttPulse 0.9s ease-in-out infinite alternate; }
.tt-row .tt-show.busy { color: #fff; background: rgba(10,20,34,0.75); border-color: rgba(255,255,255,0.35); box-shadow: none; animation: none; }
.tt-row .tt-show.hidden, body:not(.portrait) .tt-row .tt-show { display: none; }
body.portrait #prompt .tt-show { display: none; }
body.portrait .tt-row { flex-wrap: wrap; gap: 6px; } body.portrait .tt-row .tt-show { margin-left: 0; }
body.tt-on #hud-mission .task { font-size: clamp(12px, 1.6cqw, 19px); }
/* v1.5.5: the tutorial names these buttons ("Hold DOWN"), so their labels are readable (12 px) on every phone */
#touch .tbtn em, body.portrait #touch .tbtn em { font-size: 12px; letter-spacing: 0.06em; }
#touch .tg-h b, body.portrait #touch .tg-h b { font-size: 12px; letter-spacing: 0.1em; }
#touch .tg-h span, body.portrait #touch .tg-h span { font-size: 12px; letter-spacing: 0.02em; }
body.easy #touch .auto-badge { font-size: 12px; }
body.portrait.tt-on #hud-mission .loc { white-space: nowrap; font-size: 12px; letter-spacing: 0.08em; }
/* nothing from the last landing (pop-ups, alerts, toasts) stays over the TUTORIAL COMPLETE card */
#ui:has(#screen-tutdone:not(.hidden)) #pops, #ui:has(#screen-tutdone:not(.hidden)) #alert, #ui:has(#screen-tutdone:not(.hidden)) #toast { visibility: hidden; }
/* iPhone landscape with Safari bars (~280-330 px tall): the whole TUTORIAL COMPLETE card fits without scrolling */
@media (max-height: 330px) {
  .card.tutdone { padding: 8px 14px 10px; }
  .td-kicker { display: none; }
  .td-head { font-size: 20px; margin-top: 0; }
  .td-pay { margin-top: 4px; padding: 2px 10px; } .td-pay span { font-size: 12px; } .td-pay b { font-size: 17px; }
  .td-list { margin: 6px 0 7px; gap: 4px; }
  .td-list li { padding: 3px 8px; font-size: 12px; line-height: 1.18; gap: 8px; }
  .td-list i { width: 20px; height: 20px; font-size: 12px; }
  .tutdone .btn.huge { padding: 6px 14px; font-size: 18px; border-radius: 13px; }
}
/* small upright phones (320×568 and up): the whole TUTORIAL COMPLETE card fits the screen, no scrolling */
@media (orientation: portrait) and (max-height: 760px), (orientation: portrait) and (max-width: 360px) {
  .card.tutdone { padding: 12px 14px 14px; width: calc(100cqw - 20px); }
  .td-kicker { display: none; }
  .td-head { font-size: 24px; margin-top: 0; }
  .td-sub { font-size: 13px; margin-top: 3px; }
  .td-pay { margin-top: 6px; padding: 3px 12px; } .td-pay b { font-size: 19px; }
  .td-list { margin: 9px 0 10px; gap: 5px; }
  .td-list li { padding: 6px 9px; font-size: 13px; line-height: 1.2; gap: 9px; }
  .td-list i { width: 24px; height: 24px; font-size: 14px; }
  .tutdone .btn.huge { padding: 10px 14px; font-size: 21px; }
}
@media (orientation: portrait) and (max-height: 600px) {
  .td-sub { display: none; }
  .td-list li { font-size: 12px; padding: 5px 8px; }
}
/* v1.5.5 small screens: everything fits */
body.portrait { --slot2: max(calc(var(--ctrl-h) + 66px), calc(var(--ctrl-h) + 18px + var(--pr-h, 46px))); }
body.portrait.tt-on #hud-mission { max-width: calc(100cqw - 170px); }
body.portrait.tt-on #hud-mission .task { display: none; }
body.portrait.tt-on #hud-mission .loc { letter-spacing: 0.04em; }
@media (orientation: portrait) and (max-width: 360px) {
  #touch .tg-h span, body.portrait #touch .tg-h span { display: none; }
  #touch .tg-h b, body.portrait #touch .tg-h b { letter-spacing: 0.03em; }
}
@media (orientation: landscape) and (max-height: 360px) {
  #touch .tg-h span { display: none; }
}
/* short landscape screens (phones on their side, Chromebook frames): SETTINGS in two columns, so all six rows fit without scrolling */
@media (orientation: landscape) and (max-height: 430px) {
  .card.settings { width: min(640px, 94cqw); }
  .card.settings .set-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; margin: 8px 0; }
  .card.settings .set-row { min-height: 38px; padding: 6px 11px; font-size: 13px; gap: 8px; }
  .card.settings .set-row span, .card.settings .set-row b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .card.settings .set-row b { flex: none; max-width: 55%; }
}
@media (orientation: landscape) and (max-height: 330px) {
  .card.settings { padding: 8px 14px 10px; }
  .card.settings .res-head { font-size: 22px; }
  .card.settings .set-rows { margin: 6px 0; gap: 5px 8px; }
  .card.settings .set-row { min-height: 34px; padding: 5px 10px; }
  .card.settings #btn-settings-back { padding: 6px 18px; }
  .card.settings .ver { margin-top: 2px; }
}
/* v1.5.5 upright phones: the job RESULTS card fits the screen (NEXT JOB always visible, no page scroll);
   the pay lines keep their own short scroll box, everything else is compact */
@media (orientation: portrait) and (max-height: 900px) {
  body.portrait .card.results { padding: 10px 12px 12px; width: calc(100cqw - 16px); }
  body.portrait .results .res-head { font-size: 23px; line-height: 1.05; }
  body.portrait .results .stars { margin: 2px 0 0; }
  body.portrait .results .stars i { width: 30px; height: 30px; } body.portrait .results .stars i:nth-child(2) { width: 38px; height: 38px; margin-top: -4px; }
  body.portrait .results .mastery { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin: 2px 0 4px; }
  body.portrait .results .mastery span { padding: 2px 8px; font-size: 12px; margin: 0; }
  body.portrait .results .res-bonus { font-size: 14px; margin: 0 0 4px; padding: 2px 10px; }
  body.portrait .results .res-xp { padding: 4px 9px 5px; margin-bottom: 5px; } body.portrait .results .res-xp .rx-up { margin-top: 2px; font-size: 12px; }
  body.portrait .results .res-stats { margin: 2px 0 4px; gap: 5px; } body.portrait .results .res-stats div { padding: 3px 2px; }
  body.portrait .results .res-stats span { font-size: 12px; letter-spacing: 0.06em; } body.portrait .results .res-stats b { font-size: 17px; }
  body.portrait .results .tomorrow { margin: 0 0 4px; padding: 2px 8px; font-size: 12px; }
  body.portrait .results .res-lines { font-size: 13px; max-height: 17cqh; overflow-y: auto; } body.portrait .results .res-lines div { padding: 2px 4px; }
  body.portrait .results .res-total { padding: 4px 4px 4px; } body.portrait .results .res-total b { font-size: 25px; }
  body.portrait .results .res-best { margin: -2px 4px 4px; font-size: 12px; }
  body.portrait .results .btn.huge { padding: 9px 16px; min-width: 0; width: 100%; font-size: 21px; }
  body.portrait .results .res-nextjob { margin-top: 3px; font-size: 12px; }
  body.portrait .results .res-row { margin-top: 6px; gap: 5px; display: grid; grid-template-columns: 1fr 1fr; }
  body.portrait .results .res-row .btn { padding: 7px 8px; font-size: 13px; min-width: 0; }
}
@media (orientation: portrait) and (max-height: 620px) {
  body.portrait .results .tomorrow { display: none; }
  body.portrait .results .res-lines { max-height: 12cqh; }
}
@media (orientation: portrait) and (max-height: 900px) {
  body.portrait .results .res-xp em { font-size: 12px; }
}
@media (orientation: portrait) and (max-height: 660px) {
  body.portrait .results .res-head { font-size: 21px; }
  body.portrait .results .res-lines { max-height: 10.5cqh; }
  body.portrait .results .btn.huge { padding: 8px 14px; font-size: 20px; }
  body.portrait .results .res-row .btn { padding: 6px 8px; }
}

/* =====================================================================
   v1.5.6 — more ads, never in play:
   - display banner (CrazyGames SDK) under the menu cards: real CSS px outside the scaled #ui layer, flush with the
     bottom edge; game.js (AB) moves the card up and only shows it where the whole card still fits above it
   - ▶ CONTINUE (rewarded) on the fail card, ▶ FREE CASH (rewarded) in the GARAGE head: the same video-icon pill as
     2× PAY, quieter than the main button
   ===================================================================== */
.cg-banner { position: fixed; z-index: 5; overflow: hidden; pointer-events: auto; background: transparent; }
.adbtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 5px 12px 5px 8px; border-radius: 10px; border: 1px solid rgba(69,242,255,0.6); background: rgba(69,242,255,0.10); color: var(--cyan); font-weight: 900; font-size: 13px; letter-spacing: 0.06em; line-height: 1.1; white-space: nowrap; transition: background 0.15s; cursor: pointer; }
.adbtn svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; }
.adbtn svg path { fill: currentColor; stroke: none; }
.adbtn i, .adbtn em { font-style: normal; }
.adbtn .ad-k { font-size: 16px; color: #fff; font-variant-numeric: tabular-nums; }
.adbtn .ad-k:empty, .adbtn .ad-t:empty { display: none; }
.adbtn:hover { background: rgba(69,242,255,0.2); }
.adbtn:active { transform: translateY(1px) scale(0.98); }
.adbtn:disabled { cursor: default; transform: none; }
.adbtn.wait { opacity: 0.55; }
.adbtn.later { border-color: rgba(255,255,255,0.22); background: rgba(255,255,255,0.06); color: var(--muted); }
.adbtn.done { border-color: rgba(62,227,127,0.6); background: rgba(62,227,127,0.12); color: var(--green); padding-left: 10px; }
.adbtn.done svg { display: none; }
.adbtn.done .ad-k { color: var(--green); }
body.rtl .adbtn { letter-spacing: 0; }
/* fail card: CONTINUE above RETRY (RETRY stays the big yellow button and keeps Enter) */
.card.fail .adbtn.cont { display: flex; margin: 0 auto 12px; padding: 9px 22px 9px 16px; font-size: 18px; gap: 9px; border-radius: 12px; }
.card.fail .adbtn.cont.hidden { display: none; }
.card.fail .adbtn.cont svg { width: 24px; height: 24px; }
@media (orientation: landscape) and (max-height: 500px) {
  .card.fail .adbtn.cont { margin-bottom: 8px; padding: 6px 16px 6px 12px; font-size: 15px; }
  .card.fail .adbtn.cont svg { width: 20px; height: 20px; }
}
/* garage head: FREE CASH sits next to the money it adds to; on narrow cards it takes its own line under the title */
.g-head .gfree { margin-left: auto; font-style: normal; flex: none; }
.g-head .gfree:not(.hidden) + b { margin-left: 0; }
body.rtl .g-head .gfree { margin-left: 0; margin-right: auto; }
@media (max-width: 480px) {
  .card.garage .g-head { flex-wrap: wrap; row-gap: 8px; }
  .card.garage .g-head .gfree { order: 9; flex: 1 0 100%; margin: 0; padding: 7px 12px; }
  .card.garage .g-head .gfree:not(.hidden) + b { margin-left: auto; }
}

/* =====================================================================
   v1.5.7 short screens: NEXT JOB and 2× PAY share a row, so the results card keeps its v1.5.6 height and the display
   banner under it keeps its room (stacked, the card grew 48 px and phones lost the banner). The word PAY goes, the amount stays.
   v1.5.8: up to 640 px tall, else a 5-line card at 1096x570 had no room for the 468x60 banner (12 px short).
   ===================================================================== */
@media (max-height: 640px), (orientation: portrait) and (max-height: 760px) {
  .results .res-r { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); column-gap: 6px; }
  .results .res-r > * { grid-column: 1 / -1; }
  .results .res-lines { grid-row: 1; }
  .results .res-total { grid-row: 2; }
  .results .res-best { grid-row: 3; justify-self: end; }
  .results #btn-next { grid-row: 4; }
  .results .res-nextjob { grid-row: 5; }
  .results .res-row { grid-row: 6; }
  .results #btn-next.with-x2 { grid-column: 1; min-width: 0; width: 100%; padding: 6px 8px; font-size: 20px; line-height: 1.05; }
  .results #btn-next.with-x2.long { font-size: 15px; }
  .results #btn-res-x2 { grid-column: 2; grid-row: 4; margin-top: 0; min-height: 44px; padding: 0 6px; gap: 6px; font-size: 15px; }
  .results #btn-res-x2 svg { width: 20px; height: 20px; }
  .results #btn-res-x2 .x2-k, .results #btn-res-x2 .x2-a { font-size: 17px; }
  .results #btn-res-x2.offer .x2-t, .results #btn-res-x2.wait .x2-t { display: none; }
  .results #btn-res-x2.later { font-size: 12px; white-space: normal; }
}

/* v1.5.8: a card that ends a job keeps its buttons hidden until its animation is over (UI.hold); the space stays, so nothing jumps */
.card.held .btn, .card.held .x2, .card.held .adbtn { visibility: hidden; }

/* v1.5.9 CrazyGames only: a small link on the pause menu */
.pause-discord { display: inline-block; padding: 6px 12px 0; font-size: 13px; font-weight: 700; letter-spacing: .06em; color: rgba(255,255,255,.75); text-decoration: none; }
.pause-discord:hover { color: #fff; text-decoration: underline; }

/* v1.5.10 phones and tablets (body.touch): the logo shows only on the loading screen, not on the start card, title or rotate screen */
body.touch .st-logo, body.touch .title-logo, body.touch .rot-logo { display: none; }
/* while the start card flies in (cardIn, 0.45 s) its transform makes the card the language chip's frame, so the chip rides over
   the job title until the card lands and it moves to the screen corner. With no logo above the title, keep it hidden until then. */
@keyframes stLangLate { from, 99% { visibility: hidden; } to { visibility: visible; } }
body.touch #btn-st-lang { animation: stLangLate 0.5s; }

/* v1.5.10 phones held sideways: the pause card's TOMORROW chip keeps the size and room it has upright (12 px, 5 px padding, 10 px
   under SETTINGS). The v1.3 short-screen rules had squeezed it to 10 px with 1 px padding, stuck to the button above. */
@media (orientation: landscape) and (max-height: 500px) {
  .pause .tomorrow { margin-top: 10px; padding: 5px 12px; font-size: 12px; line-height: 1.3; }
}
/* under 320 px tall (Android with the address bar, 800x286 …) that chip would push the Discord link out of the card: the menu
   buttons give back the room (40 → 36 px, smaller gaps), so the whole card still fits without scrolling */
@media (orientation: landscape) and (max-height: 320px) {
  .pause .menu-col { gap: 5px; margin-top: 8px; }
  .pause .menu-col .btn { min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
  .pause .tomorrow { margin-top: 8px; padding: 4px 12px; }
}

/* v1.5.10: while a video ad is loading, the blocked screen dims and shows a small spinner. Both wait 0.8 s, so the instant
   answers (cooldown, adblock) never flash them, and the ad itself covers them once it starts. The dim keeps the spinner
   from reading as something stuck on the card's text. */
#ad-shield { animation: adWaitDim 0.25s ease-out 0.8s forwards; }
@keyframes adWaitDim { to { background-color: rgba(0,0,0,0.45); } }
#ad-shield::after { content: ""; position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; box-sizing: border-box; border-radius: 50%; border: 3px solid rgba(255,255,255,0.25); border-top-color: var(--yellow); opacity: 0; animation: adWaitSpin 0.9s linear infinite, adWaitIn 0.25s ease-out 0.8s forwards; }
@keyframes adWaitSpin { to { transform: rotate(360deg); } }
@keyframes adWaitIn { to { opacity: 1; } }
