:root {
  --gta-yellow: #f5c518;
  --ink: #111;
  --paper: #fffdf6;
  --hud-bg: rgba(10, 12, 16, .62);
  --accent: #e4572e;
  --ok: #7bd389;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d0f12; color: #fff;
  font-family: Rubik, system-ui, sans-serif; -webkit-user-select: none; user-select: none; touch-action: none; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }

/* ---------- start ---------- */
#start { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 16px; text-align: center;
  background: radial-gradient(ellipse at 50% 30%, rgba(40,60,40,.55), rgba(5,6,8,.92)), url('../data/minimap_play.jpg') center/cover;
  z-index: 50; }
.logo { font-family: Bangers, Impact, sans-serif; line-height: .85; text-shadow: 4px 4px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000; }
.logo .l1 { font-size: clamp(34px, 8vw, 72px); letter-spacing: 2px; }
.logo .l2 { font-size: clamp(64px, 17vw, 150px); color: var(--gta-yellow); letter-spacing: 3px; }
.logo .l3 { font-family: Rubik; font-weight: 800; font-size: clamp(16px, 3.6vw, 26px); letter-spacing: 8px; text-transform: uppercase;
  text-shadow: 2px 2px 0 #000; margin-top: 8px; }
#load { width: min(360px, 80vw); height: 10px; border: 2px solid #000; background: rgba(0,0,0,.5); }
#loadbar { height: 100%; width: 0; background: var(--gta-yellow); transition: width .2s; }
#loadtxt { font-size: 14px; opacity: .85; min-height: 18px; }
#play { font-family: Bangers, Impact, sans-serif; font-size: 40px; letter-spacing: 3px; padding: 8px 46px; border: 3px solid #000;
  background: var(--gta-yellow); color: #000; cursor: pointer; box-shadow: 5px 5px 0 #000; }
#play:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 #000; }
.keys { font-size: 13px; opacity: .85; line-height: 1.7; }
.keys b { background: rgba(255,255,255,.14); padding: 1px 6px; border-radius: 3px; }
.attr { position: absolute; bottom: 10px; left: 16px; right: 16px; font-size: 11px; opacity: .6; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#stars { position: absolute; top: 14px; right: 16px; font-size: 26px; letter-spacing: 2px; text-shadow: 2px 2px 0 #000; }
#stars .on { color: var(--gta-yellow); }
#stars .off { color: rgba(255,255,255,.22); }
#minimap-wrap { position: absolute; left: 16px; bottom: 16px; width: 180px; height: 180px; border-radius: 50%; overflow: hidden;
  border: 4px solid #111; box-shadow: 0 0 0 2px rgba(255,255,255,.35); background: #1a1d22; }
#minimap { width: 100%; height: 100%; display: block; }
#missions { position: absolute; top: 14px; left: 16px; max-width: min(320px, 60vw); font-size: 13px; line-height: 1.5;
  background: var(--hud-bg); padding: 8px 12px; border-radius: 6px; }
#missions:empty { display: none; }
#status { position: absolute; top: 52px; right: 16px; text-align: right; font-size: 13px; text-shadow: 1px 1px 0 #000; line-height: 1.6; }
#prompt { position: absolute; left: 50%; bottom: 22%; transform: translateX(-50%); background: var(--hud-bg); padding: 8px 16px;
  border-radius: 6px; font-size: 16px; font-weight: 600; white-space: nowrap; }
#prompt kbd { background: var(--gta-yellow); color: #000; padding: 1px 8px; border-radius: 3px; font-family: Rubik; font-weight: 800; margin-right: 6px; }
#toasts { position: absolute; top: 30%; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; }
.toast { background: var(--hud-bg); padding: 8px 16px; border-radius: 6px; font-size: 16px; animation: tin .25s ease-out; max-width: 80vw; text-align: center; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }
#bigmsg { position: absolute; top: 38%; left: 0; right: 0; text-align: center; font-family: Bangers, Impact, sans-serif;
  font-size: clamp(44px, 9vw, 96px); color: var(--gta-yellow); letter-spacing: 3px;
  text-shadow: 4px 4px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000; }
#bigmsg small { display: block; font-family: Rubik; font-size: 18px; color: #fff; letter-spacing: 1px; text-shadow: 2px 2px 0 #000; }
#dialog { position: absolute; left: 50%; bottom: 12%; transform: translateX(-50%); width: min(560px, 92vw);
  background: rgba(12,14,18,.88); border: 2px solid #000; border-radius: 8px; padding: 14px 16px; pointer-events: auto; }
#dialog .who { font-family: Bangers, Impact, sans-serif; font-size: 22px; color: var(--gta-yellow); letter-spacing: 1px; }
#dialog .txt { font-size: 16px; margin: 6px 0 10px; line-height: 1.45; }
#dialog .opts { display: flex; flex-direction: column; gap: 6px; }
#dialog button { text-align: left; font: inherit; font-size: 15px; padding: 8px 10px; border-radius: 5px; border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.06); color: #fff; cursor: pointer; }
#dialog button:hover, #dialog button.sel { background: var(--gta-yellow); color: #000; }
#crosshair { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px #000; }

/* ---------- touch ---------- */
#touch { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
#stick { position: absolute; left: 24px; bottom: 24px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255,255,255,.12);
  border: 2px solid rgba(255,255,255,.3); pointer-events: auto; }
#knob { position: absolute; left: 40px; top: 40px; width: 50px; height: 50px; border-radius: 50%; background: rgba(255,255,255,.55); }
#tbtns { position: absolute; right: 18px; bottom: 24px; display: grid; grid-template-columns: repeat(3, 60px); gap: 8px; pointer-events: auto; }
.tb { width: 60px; height: 60px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); background: rgba(0,0,0,.35); color: #fff;
  font-size: 24px; font-weight: 800; }
.tb.big { background: rgba(245,197,24,.75); color: #000; }
.tb.on { background: rgba(123,211,137,.7); }
body.touch #minimap-wrap { left: auto; right: 16px; top: 70px; bottom: auto; width: 120px; height: 120px; }

@media (max-width: 640px) {
  #missions { font-size: 11px; max-width: 52vw; padding: 6px 8px; }
  #stars { font-size: 18px; letter-spacing: 0; top: 10px; right: 10px; }
  #status { top: 36px; right: 10px; font-size: 12px; }
}

/* ---------- plavání: kyslík ---------- */
#oxygen { position: absolute; left: 50%; bottom: 13%; transform: translateX(-50%); width: min(300px, 70vw); text-align: center;
  text-shadow: 2px 2px 0 #000; }
#oxygen .ox-label { font-family: Bangers, Impact, sans-serif; font-size: 22px; letter-spacing: 2px; color: #bfe9ff; }
#oxygen .ox-bar { height: 16px; border: 3px solid #000; background: rgba(0,0,0,.55); border-radius: 3px; overflow: hidden; margin-top: 2px; }
#oxygen .ox-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #3fa9f5, #9fe0ff); transition: width .12s linear; }
#oxygen .ox-hint { font-size: 14px; font-weight: 800; margin-top: 5px; color: #fff; opacity: 0; transition: opacity .2s; }
#oxygen.under .ox-hint { opacity: 1; animation: oxblink .5s steps(2) infinite; }
#oxygen.low .ox-fill { background: linear-gradient(90deg, #e4572e, #ff9a6a); }
#oxygen.low .ox-label { color: #ff8c6a; animation: oxblink .4s steps(2) infinite; }
@keyframes oxblink { 50% { opacity: .35; } }
