/* «Белое пятно»: HUD в духе полевого снаряжения — латунь, кожа, бумага карты. */
body { background: #2a1a0e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; color: #3a2410; }
#scr-game { background: #9cd6ff; }
.hud { pointer-events: none; }
.hud > * { pointer-events: none; }
.hud button { pointer-events: auto; }

.mm-wrap { position: absolute; left: 10px; top: 8px; width: 104px; height: 124px; }
#minimap { width: 100px; height: 100px; border-radius: 50%; display: block; box-shadow: 0 0 0 3px #e0a83a, 0 0 0 5px #5a3410, 0 5px 10px rgba(0, 0, 0, .5); }
.mm-pct { position: absolute; left: 14px; top: 104px; height: 20px; padding: 0 8px 0 5px; border-radius: 10px; display: flex; align-items: center; gap: 4px;
  background: linear-gradient(#3a2410, #1e1206); color: #ffe27a; font-size: 13px; font-weight: 900; box-shadow: 0 2px 4px rgba(0, 0, 0, .5); }
#compass { position: absolute; left: 50%; top: 6px; width: 320px; height: 28px; margin-left: -160px; }
.hud-score { position: absolute; left: 50%; top: 36px; transform: translateX(-50%); display: flex; align-items: baseline; gap: 4px;
  color: #fff; font-size: 16px; font-weight: 900; text-shadow: 0 1px 2px #000, 0 0 4px rgba(0, 0, 0, .6); }
.hud-score small { font-size: 10px; font-weight: 700; opacity: .9; }
.hud-btns { position: absolute; right: 8px; top: 8px; display: flex; gap: 7px; }
.hb { width: 44px; height: 44px; border-radius: 12px; border: 2px solid #2a1406; display: flex; align-items: center; justify-content: center; color: #fff;
  background: linear-gradient(#b8783a, #6e3a16 60%, #4a2208); box-shadow: inset 0 2px 0 rgba(255, 220, 170, .5), 0 3px 0 #1a0a02, 0 5px 7px rgba(0, 0, 0, .4); }
.hb:active { transform: translateY(2px); }
.hb * { pointer-events: none; }
.hint { position: absolute; left: 50%; top: 58px; transform: translateX(-50%) translateY(-6px); white-space: nowrap; padding: 7px 14px; border-radius: 12px; opacity: 0;
  background: rgba(255, 248, 228, .94); color: #4a2a10; font-size: 13px; font-weight: 800; text-align: center; box-shadow: 0 4px 10px rgba(0, 0, 0, .35); border: 2px solid #e0a83a;
  transition: opacity .3s, transform .3s; }
.hint.show { opacity: 1; transform: translateX(-50%); }
.banner { position: absolute; left: 50%; top: 96px; width: 330px; margin-left: -165px; height: 62px; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 8px;
  border-radius: 14px; background: linear-gradient(#fffaf0, #f2e3c0); border: 3px solid #5a3410; box-shadow: 0 6px 16px rgba(0, 0, 0, .45); opacity: 0; transform: translateY(-14px) scale(.9); }
.banner.show { animation: bnin 3.4s ease-out forwards; }
@keyframes bnin { 0% { opacity: 0; transform: translateY(-14px) scale(.9); } 8% { opacity: 1; transform: translateY(2px) scale(1.04); } 14% { transform: none; } 86% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-10px); } }
.bn-ico { width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border: 3px solid #fff; box-shadow: 0 0 0 2px #5a3410, inset 0 -4px 0 rgba(0, 0, 0, .2); }
.bn-txt { flex: 1; min-width: 0; }
.bn-kind { font-size: 11px; font-weight: 800; color: #9a6a3a; text-transform: uppercase; letter-spacing: .5px; }
.bn-name { font-size: 17px; font-weight: 900; color: #3a1a08; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bn-right { text-align: right; }
.bn-pts { font-size: 22px; font-weight: 900; color: #1f9e2c; text-shadow: 0 1px 0 #fff; }
.bn-map { font-size: 11px; font-weight: 800; color: #1877d8; white-space: nowrap; }
.speedo { position: absolute; left: 50%; bottom: 10px; width: 112px; margin-left: -56px; height: 50px; border-radius: 26px 26px 12px 12px; display: flex; align-items: center; justify-content: center; gap: 4px;
  background: linear-gradient(#2e2212, #120a04); border: 3px solid #e0a83a; box-shadow: 0 0 0 2px #3a2410, 0 5px 10px rgba(0, 0, 0, .5); color: #ffe27a; }
.sp-v { font-size: 26px; font-weight: 900; font-variant-numeric: tabular-nums; text-shadow: 0 0 8px rgba(255, 190, 40, .6); min-width: 38px; text-align: right; }
.sp-u { font-size: 10px; font-weight: 700; color: #c8a878; white-space: nowrap; line-height: 1; }
.sp-g { width: 22px; height: 22px; border-radius: 6px; background: #e0a83a; color: #2a1406; font-size: 14px; font-weight: 900; display: flex; align-items: center; justify-content: center; }
.carname { position: absolute; left: 50%; bottom: 64px; transform: translateX(-50%); color: #fff; font-size: 11px; font-weight: 800; text-shadow: 0 1px 2px #000; white-space: nowrap; opacity: .85; }
.unstuck { position: absolute; left: 50%; top: 172px; transform: translateX(-50%); height: 46px; padding: 0 18px 0 12px; border-radius: 23px; display: none; align-items: center; gap: 8px;
  border: 3px solid #2a1406; background: linear-gradient(#ffc233, #f25c00); color: #fff; font: inherit; font-size: 16px; font-weight: 900; text-shadow: 0 1px 2px #7a2a00;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .5), 0 4px 0 #3a1200, 0 7px 10px rgba(0, 0, 0, .4); animation: m3pulse 1.2s infinite; }
.unstuck.show { display: flex; }
.unstuck * { pointer-events: none; }

/* управление: руль слева, педали справа */
.ctrl-group { position: absolute; bottom: 10px; display: flex; gap: 12px; align-items: flex-end; z-index: 5; touch-action: none; }
.cg-left { left: 12px; transform-origin: 0 100%; }
.cg-right { right: 12px; transform-origin: 100% 100%; }
.ctl { touch-action: none; display: flex; align-items: center; justify-content: center; flex-direction: column; user-select: none; }
.ctl * { pointer-events: none; }
.steer { width: 76px; height: 76px; border-radius: 50%; border: 3px solid #2a1406;
  background: radial-gradient(circle at 35% 25%, rgba(255, 255, 255, .55), rgba(255, 255, 255, .18) 60%), rgba(60, 36, 16, .45);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .35), 0 4px 0 rgba(26, 10, 2, .7), 0 7px 10px rgba(0, 0, 0, .35); }
.pedal { border: 3px solid #2a1406; color: #fff; font-weight: 900; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .45), 0 5px 0 rgba(26, 10, 2, .8), 0 8px 10px rgba(0, 0, 0, .35); }
.pedal.gas { width: 84px; height: 112px; border-radius: 18px; font-size: 19px; background: repeating-linear-gradient(0deg, transparent 0 13px, rgba(0, 0, 0, .14) 13px 16px), linear-gradient(#7df067, #1f9e2c); }
.pedal.brake { width: 74px; height: 84px; border-radius: 16px; font-size: 14px; background: repeating-linear-gradient(0deg, transparent 0 11px, rgba(0, 0, 0, .14) 11px 14px), linear-gradient(#ff8a7a, #c8231a); }
.pedal small { font-size: 10px; font-weight: 700; opacity: .9; }
.ctl.on { transform: translateY(4px) scale(.96); filter: brightness(1.15); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .3), 0 1px 0 rgba(26, 10, 2, .8); }

/* окна: бумага карты с латунной кромкой */
.overlay { background: rgba(26, 14, 4, .55); }
.panel.paper { width: 340px; padding: 16px 18px 16px; border-radius: 16px; color: #3a2410;
  background: repeating-linear-gradient(0deg, transparent 0 23px, rgba(60, 110, 170, .1) 23px 24px), repeating-linear-gradient(90deg, transparent 0 23px, rgba(60, 110, 170, .1) 23px 24px), linear-gradient(#fffaf0, #f3e6c4);
  border: 3px solid #5a3410; box-shadow: 0 0 0 3px #e0a83a, 0 0 0 5px #3a2410, 0 14px 30px rgba(0, 0, 0, .55); animation: pin .22s ease-out; }
@keyframes pin { from { opacity: 0; transform: scale(.88); } to { opacity: 1; transform: none; } }
.panel-title { font-size: 24px; font-weight: 900; text-align: center; color: #7a3a10; text-shadow: 0 1px 0 #fff; line-height: 1.1; }
#res-title { line-height: 0; min-height: 34px; }
.res-line { font-size: 15px; text-align: center; font-weight: 700; }
.res-reason { font-size: 15px; font-weight: 900; text-align: center; color: #c8231a; }
.res-reason:empty { display: none; }
.res-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.res-grid > div { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 10px; background: rgba(255, 255, 255, .7); border: 1px solid rgba(90, 52, 16, .25); font-size: 12px; font-weight: 700; }
.res-grid span { flex: 1; color: #8a6a40; white-space: nowrap; }
.res-grid b { font-size: 15px; font-weight: 900; color: #3a1a08; white-space: nowrap; }
.res-total { font-size: 13px; text-align: center; font-weight: 700; color: #6a4a28; }
.res-total b { color: #1877d8; }
.panel.paper.ticket { width: 410px; border-style: dashed; }
#ov-garage .panel.paper { width: 420px; }
.btn { min-height: 46px; padding: 0 14px; border: 2px solid #2a1406; border-radius: 13px; font: inherit; font-size: 17px; font-weight: 900; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .45), 0 4px 0 #2a1406, 0 6px 8px rgba(0, 0, 0, .3); background: linear-gradient(#5aa0e8, #1f62b8); }
.btn:active { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .45), 0 1px 0 #2a1406; }
.btn-go { background: linear-gradient(#ffc233, #ff8a00 50%, #f25c00); min-height: 52px; font-size: 20px; }
.btn-map { background: linear-gradient(#5ac8a0, #1f8a62); }
.btn-fin { background: linear-gradient(#8a7ae8, #4a38b8); }
.btn-share { background: linear-gradient(#5aa0e8, #1f62b8); }
.btn-sm { min-height: 40px; font-size: 14px; background: linear-gradient(#a08a70, #6a5440); }
.btn-pair { display: flex; gap: 8px; }
.btn-pair .btn { flex: 1; }

.panel.paper.mappanel { width: auto; flex-direction: row; align-items: stretch; gap: 14px; padding: 12px; }
#bigmap { width: 300px; height: 300px; border-radius: 8px; border: 2px solid #5a3410; display: block; }
.map-side { width: 170px; display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.ms-row { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 5px 8px; border-radius: 10px; background: rgba(255, 255, 255, .7); }
.ms-row span { flex: 1; color: #8a6a40; }
.ms-row b { font-size: 15px; font-weight: 900; }
.ms-legend { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: #6a4a28; flex-wrap: wrap; }
.ms-legend i { width: 16px; height: 16px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 11px; font-weight: 900; }
.lg-q { background: #fff6e0; border: 2px solid #e2402f; color: #e2402f; }
.lg-ok { background: #1f9e2c; border: 2px solid #fff; box-shadow: 0 0 0 1px #5a3410; margin-left: 6px; }

#garage-list { max-height: 200px; display: flex; flex-direction: column; gap: 8px; }
.gcar { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .75); border: 2px solid rgba(90, 52, 16, .3); }
.gcar.sel { border-color: #f08a1c; box-shadow: 0 0 0 2px #ffd060; }
.gcar.locked { background: rgba(90, 70, 50, .15); }
.gico { width: 86px; height: 40px; flex-shrink: 0; filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .3)); }
.ginfo { flex: 1; min-width: 0; }
.gname { font-size: 14px; font-weight: 900; color: #3a1a08; line-height: 1.15; margin-bottom: 2px; }
.gname em { font-style: normal; color: #c8231a; }
.ghint { font-size: 11px; font-weight: 700; color: #8a6a40; }
.gs { display: flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 700; color: #8a6a40; }
.gs span { width: 64px; }
.gs i { display: flex; gap: 2px; }
.gs b, .gs u { width: 12px; height: 7px; border-radius: 2px; background: #f08a1c; }
.gs u { background: rgba(90, 52, 16, .2); }
.gbtn { min-width: 76px; height: 36px; padding: 0 8px; border-radius: 10px; border: 2px solid #2a1406; font: inherit; font-size: 13px; font-weight: 900; color: #fff;
  background: linear-gradient(#7df067, #1f9e2c); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .4), 0 3px 0 #2a1406; }
.gbtn.on { background: linear-gradient(#ffd060, #e0a100); color: #3a1a08; text-shadow: none; }
.glock { width: 40px; display: flex; justify-content: center; }

#lb-list { max-height: 210px; }
.lb-row { border-radius: 10px; background: rgba(255, 255, 255, .72); font-weight: 700; color: #3a1a08; }
.lb-row.top-1 { background: linear-gradient(#fff3a0, #ffc233); } .lb-row.top-2 { background: linear-gradient(#f4f6f8, #c0c8d0); } .lb-row.top-3 { background: linear-gradient(#ffd0a0, #d8884a); }
.lb-row.me { outline: 3px solid #1f9e2c; }
.lb-avatar { background: #f08a1c; color: #fff; font-weight: 900; }
.lb-score { font-weight: 900; color: #1877d8; }
#toast { bottom: 140px; padding: 9px 16px; border-radius: 12px; background: rgba(40, 20, 6, .88); color: #ffe9b0; font-size: 14px; font-weight: 700; }
