/* FPV video OSD: white with a black outline, legible over any scene, as in real goggles. */
#osd { position: fixed; inset: 0; pointer-events: none; z-index: 10; color: #fff; font: 600 14px var(--mono); text-shadow: 0 0 2px #000, 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000; font-variant-numeric: tabular-nums; }
.osd-top, .osd-bottom { position: absolute; left: 18px; right: 18px; display: flex; justify-content: space-between; gap: 10px; }
.osd-top { top: 12px; align-items: flex-start; }
.osd-bottom { bottom: 12px; align-items: flex-end; }
.osd-block { flex: 1 1 0; min-width: 0; }
.osd-block.center { flex: 0 1 auto; text-align: center; }
.osd-block.right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.osd-small { font-size: 12px; opacity: .92; }
.osd-big { font-size: 20px; line-height: 1.15; }
.osd-big small { font-size: 13px; opacity: .85; }
.osd-timer { font-size: 40px; font-weight: 600; line-height: 1.05; letter-spacing: -.01em; }
.osd-row { display: flex; gap: 16px; justify-content: center; font-size: 12px; white-space: nowrap; }
.osd-row b { font-weight: 600; color: var(--mint); }
.osd-row em { font-style: normal; color: var(--red); }
.osd-speed { font-size: 46px; line-height: 1; }
.osd-speed small { font-size: 14px; margin-left: 4px; }
.osd-bat { width: 110px; height: 8px; border: 1px solid #fff; background: rgba(0,0,0,.35); box-shadow: 0 0 2px #000; }
.osd-bat i { display: block; height: 100%; width: 100%; background: var(--mint); }
.osd-bat i.low { background: var(--red); }
.osd-standings { font-size: 12.5px; margin-top: 3px; line-height: 1.45; }
.osd-standings .me { color: var(--amber); }
.osd-standings i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 0 1px #000; }
.osd-side { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.osd-thrtrack { width: 10px; height: 130px; border: 1px solid #fff; background: rgba(0,0,0,.3); display: flex; align-items: flex-end; box-shadow: 0 0 2px #000; }
.osd-thrtrack i { display: block; width: 100%; height: 0; background: var(--amber); }

.osd-cross { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; transform: translate(-50%, -50%); opacity: .7; }
.osd-cross::before, .osd-cross::after { content: ''; position: absolute; background: #fff; box-shadow: 0 0 2px #000; }
.osd-cross::before { left: 0; right: 0; top: 12px; height: 2px; }
.osd-cross::after { top: 0; bottom: 0; left: 12px; width: 2px; }
.osd-horizon { position: absolute; left: 50%; top: 50%; width: 190px; height: 2px; background: linear-gradient(90deg, #fff 0 32%, transparent 32% 68%, #fff 68% 100%); box-shadow: 0 0 2px #000; opacity: 0; transform: translate(-50%, 0); will-change: transform; }

/* Mouse reticle: the frame is the virtual stick's travel, per axis (half side = MOUSE_BOX in osd.js).
   Square on purpose: the corners mean full roll and pitch at the same time. */
.osd-mouse { position: absolute; left: 50%; top: 50%; width: 224px; height: 224px; margin: -112px 0 0 -112px; border: 1px dashed rgba(255,255,255,.22); border-radius: 16px; }
.osd-mouse i { position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border: 2px solid var(--amber); border-radius: 50%; box-shadow: 0 0 2px #000; will-change: transform; }
/* Dead zone: inside this little window the axis is neutral (4% of each axis's travel) */
.osd-mouse::after { content: ''; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border: 1px solid rgba(255,255,255,.4); border-radius: 2px; }
/* Aim: sits on the cursor, at the scene point the drone is heading to. Positioned in window px, hence left/top 0. */
.osd-aimpoint { position: absolute; left: 0; top: 0; width: 0; height: 0; will-change: transform; }
.osd-aimpoint::before, .osd-aimpoint::after { content: ''; position: absolute; }
.osd-aimpoint::before { left: -13px; top: -13px; width: 26px; height: 26px; border: 2px solid var(--amber); border-radius: 50%; box-shadow: 0 0 3px #000, inset 0 0 3px #000; }
.osd-aimpoint::after { left: -1.5px; top: -1.5px; width: 3px; height: 3px; background: var(--amber); border-radius: 50%; box-shadow: 0 0 3px #000; }
/* Flying by aim the reticle replaces the system cursor */
body.aim-fly #app, body.aim-fly #app canvas { cursor: none; }

.osd-mouse-hint { position: absolute; left: 50%; top: 74%; transform: translateX(-50%); padding: 6px 14px; background: rgba(0,0,0,.5); border-radius: 4px; font-size: 13px; text-shadow: none; white-space: nowrap; }

/* Batalha */
.osd-aim { position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 2px #000, inset 0 0 2px #000; opacity: 0; }
.osd-aim::after { content: ''; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; background: #fff; border-radius: 50%; box-shadow: 0 0 2px #000; }
.osd-aim.locked { border-color: var(--red); transform: scale(.72); }
.osd-aim.locked::after { background: var(--red); }
.osd-hitmark { position: absolute; width: 40px; height: 40px; margin: -20px 0 0 -20px; opacity: 0; background: linear-gradient(45deg, transparent 47%, #fff 47% 53%, transparent 53%), linear-gradient(-45deg, transparent 47%, #fff 47% 53%, transparent 53%); -webkit-mask: radial-gradient(circle, transparent 42%, #000 44%); mask: radial-gradient(circle, transparent 42%, #000 44%); }
.osd-hurt { position: absolute; inset: 0; opacity: 0; box-shadow: inset 0 0 160px 50px rgba(255,40,30,.75); }
.osd-enemy { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--c); }
.osd-enemy .frame { border: 2px solid var(--c); border-radius: 3px; opacity: .85; box-shadow: 0 0 3px #000; }
.osd-enemy.locked .frame { border-color: var(--red); border-width: 3px; opacity: 1; }
/* Auto-fire (touch): the aim turns amber while shooting from close and red when locked; the target blinks */
.osd-aim.auto:not(.locked) { border-color: var(--amber); }
.osd-aim.auto:not(.locked)::after { background: var(--amber); }
.osd-enemy.auto .frame { animation: osd-auto-fire .14s steps(2) infinite; }
@keyframes osd-auto-fire { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .osd-enemy.auto .frame { animation: none; outline: 2px solid var(--amber); outline-offset: 2px; } }
.osd-enemy.shielded .frame { border-style: dashed; border-color: #66e0ff; }
.osd-enemy span { white-space: nowrap; }
.osd-enemy .bar { width: 44px; height: 4px; background: rgba(0,0,0,.55); box-shadow: 0 0 1px #000; }
.osd-enemy .bar i { display: block; height: 100%; background: var(--c); }
.osd-feed { position: absolute; right: 18px; top: 84px; text-align: right; font-size: 12.5px; line-height: 1.5; font-weight: 500; }
.osd-feed b { font-weight: 600; }
.osd-shield { position: absolute; left: 50%; top: 66%; transform: translateX(-50%); color: #66e0ff; font-size: 14px; letter-spacing: .1em; }
.osd-combat { display: flex; flex-direction: column; gap: 3px; margin-bottom: 6px; align-items: center; }
.osd-combat-row { display: flex; align-items: center; gap: 8px; font-size: 12px; min-height: 14px; }
.osd-combat-row span { min-width: 92px; text-align: right; }
.osd-combat-row b { font-size: 15px; min-width: 30px; text-align: left; }
.osd-hpbar, .osd-heatbar { width: 200px; border: 1px solid #fff; background: rgba(0,0,0,.35); box-shadow: 0 0 2px #000; }
.osd-hpbar { height: 12px; }
.osd-heatbar { height: 6px; margin-right: 38px; }
.osd-hpbar i, .osd-heatbar i { display: block; height: 100%; width: 100%; }
.osd-hpbar i { background: var(--mint); }
.osd-hpbar i.low { background: var(--red); }
.osd-heatbar i { width: 0; background: var(--amber); }
.osd-heatbar i.hot { background: var(--red); }

.osd-marker { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border: 2px solid var(--mint); transform: rotate(45deg); box-shadow: 0 0 6px var(--mint), inset 0 0 2px #000; opacity: 0; }
.osd-arrow { position: absolute; font-size: 34px; color: var(--mint); opacity: 0; line-height: 1; text-shadow: 0 0 8px var(--mint), 1px 1px 0 #000, -1px -1px 0 #000; }

.osd-msg { position: absolute; left: 50%; top: 24%; transform: translate(-50%, 0); font: italic 700 36px var(--cond); letter-spacing: .05em; opacity: 0; white-space: nowrap; transition: opacity .15s; }
.osd-msg.show { opacity: 1; }
.osd-msg.bad { color: #ff7267; }
.osd-msg.good { color: var(--mint); }
.osd-msg.top { color: var(--amber); }

.map canvas { width: 190px; height: 130px; display: block; background: rgba(0,0,0,.28); border-radius: 3px; }

.osd-count { position: absolute; left: 50%; top: 34%; transform: translate(-50%, -50%); font: italic 700 130px var(--cond); line-height: 1; color: #fff; }
.osd-count.go { color: var(--mint); }
.osd-count-hint { position: absolute; left: 50%; bottom: 25%; transform: translateX(-50%); width: max-content; max-width: 92vw; text-align: center; font: 500 12.5px/2 var(--mono); padding: 6px 14px; background: rgba(0,0,0,.5); border-radius: 4px; text-shadow: none; }

.osd-black { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.osd-black b { font: italic 700 64px var(--cond); color: var(--red); }
.osd-black span { font-size: 14px; }

/* They only make sense looking from inside the drone */
body.cam-chase .osd-cross, body.cam-chase .osd-horizon { display: none; }
body.cam-level .osd-horizon { display: none; } /* the camera is already level: the scene horizon is the horizon */
body.cam-chase .osd-count-hint { bottom: 10%; } /* the drone sits just below the center of the screen */

#touch-sticks { position: fixed; inset: 0; pointer-events: none; z-index: 12; }
.stick { position: absolute; bottom: 18px; width: 150px; height: 150px; border-radius: 50%; border: 2px solid rgba(255,255,255,.45); background: rgba(0,0,0,.14); pointer-events: auto; touch-action: none; display: grid; place-items: center; }
#stick-l { left: 18px; }
#stick-r { right: 18px; }
.stick i { width: 54px; height: 54px; border-radius: 50%; background: rgba(255,255,255,.4); border: 2px solid #fff; display: block; pointer-events: none; }
/* What each analog stick does, above it; changes with the flight mode (only-assist / only-manual) */
.stick-label { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 6px; white-space: nowrap; font-size: 11px; font-weight: 700; letter-spacing: .08em; color: rgba(255,255,255,.8); text-shadow: 0 1px 3px #000; pointer-events: none; }
.touch-pause { position: absolute; right: 12px; top: 96px; pointer-events: auto; }
.touch-camera { position: absolute; right: 12px; top: 144px; pointer-events: auto; }
/* Sideways: pause and camera in the middle, between the two sticks, at the bottom, aligned with their base (18px), outside the gesture bar */
@media (min-aspect-ratio: 1/1) {
  .touch-pause, .touch-camera { top: auto; right: auto; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); min-width: 64px; min-height: var(--touch); }
  .touch-pause { transform: translateX(calc(-100% - 8px)); }
  .touch-camera { transform: translateX(8px); }
}
body.touching .osd-bottom .right, body.touching .osd-speed { display: none; }

@media (max-width: 760px), (max-height: 480px) {
  .osd-top, .osd-bottom { left: 8px; right: 8px; }
  .osd-timer { font-size: 26px; }
  .osd-row { font-size: 10.5px; gap: 8px; }
  .osd-speed { font-size: 30px; }
  .map canvas { width: 110px; height: 76px; }
  .osd-count { font-size: 90px; }
  .osd-msg { font-size: 24px; }
  .osd-standings { font-size: 11px; }
  .osd-count-hint { display: none; }
  .osd-side { left: 8px; }
  /* Short window: shrinks the whole frame (the dot is a child, so it follows the scale) */
  .osd-mouse { transform: scale(.68); }
  .osd-hpbar, .osd-heatbar { width: 110px; }
  .osd-combat-row span { min-width: 56px; font-size: 10px; }
  .osd-feed { top: 60px; right: 8px; font-size: 11px; }
  .osd-thrtrack { height: 80px; }
}
