/* Оформление «Рейса в Кукуево»: приборка, педали, путевой лист, деревенская табличка. */
body { background: #1e5aa0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; color: #fff; }
#scr-menu { background: #4da7f4; }
#scr-game { background: #8cc8ff; }
#cv3 { position: absolute; left: 0; top: 0; display: block; touch-action: none; }

/* HUD */
.hud { pointer-events: none; z-index: 5; }
.hud > * { pointer-events: none; }
.hud button { pointer-events: auto; }
.hud-cargo { position: absolute; left: 10px; top: 8px; display: flex; align-items: center; gap: 2px; height: 40px; padding: 0 10px 0 8px; border-radius: 12px;
  background: linear-gradient(#7a5230, #4a2e16); border: 2px solid #2a1606; box-shadow: inset 0 2px 0 rgba(255, 220, 160, .4), 0 3px 6px rgba(0, 0, 0, .4); }
.hud-cargo svg { width: 28px; height: 28px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .5)); }
.hud-cargo b { margin: 0 6px 0 4px; font-size: 18px; color: #ffe27a; text-shadow: 0 1px 2px #000; }
.pips { display: grid; grid-template-columns: repeat(5, 9px); gap: 3px; }
.pips i { width: 9px; height: 9px; border-radius: 50%; border: 1px solid #1a0c02; background: #7fd04a; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .5); transition: background .3s; }
.pips i.milk { background: #e4eaf2; } .pips i.melon { background: #2f9a3a; } .pips i.hay { background: #ffd45a; } .pips i.lost { background: #3a2410; box-shadow: none; }
.hud-integ { position: absolute; left: 10px; top: 54px; display: none; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 6px; border-radius: 10px;
  background: linear-gradient(#ffeef6, #f6c6dc); border: 2px solid #6a1a3a; box-shadow: inset 0 2px 0 #fff, 0 3px 6px rgba(0, 0, 0, .35); }
.hud-integ.show { display: flex; }
.hud-integ svg { width: 24px; height: 24px; }
.hud-integ .ib { width: 74px; height: 10px; border-radius: 5px; background: #4a1a2a; overflow: hidden; box-shadow: inset 0 2px 2px rgba(0, 0, 0, .5); }
.hud-integ .ib i { display: block; height: 100%; background: linear-gradient(90deg, #3fd06a, #b8f05a); transform-origin: 0 50%; transition: transform .25s; }
.hud-integ.low .ib i { background: linear-gradient(90deg, #ff3a1a, #ff9a3a); }
.hud-integ b { min-width: 40px; font-size: 15px; color: #6a1a3a; text-align: right; }
.hud-route { position: absolute; left: 50%; top: 8px; width: 232px; margin-left: -116px; display: grid; grid-template-columns: 1fr; padding: 5px 12px 4px; border-radius: 12px;
  background: rgba(16, 36, 58, .62); border: 2px solid rgba(255, 255, 255, .35); }
.hud-v { position: absolute; top: 4px; font-size: 11px; font-weight: 800; color: #dff1ff; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#hud-from { left: 12px; } .hud-v.to { right: 12px; color: #ffe27a; }
.hud-bar { position: relative; height: 8px; margin-top: 18px; border-radius: 4px; background: linear-gradient(#6b4424, #a0703e); box-shadow: inset 0 2px 2px rgba(0, 0, 0, .5); }
#hud-ticks i { position: absolute; top: -3px; width: 4px; height: 14px; margin-left: -2px; border-radius: 2px; background: repeating-linear-gradient(#ff3a1a 0 3px, #fff 3px 6px); }
.hud-bar::after { content: ""; position: absolute; right: -6px; top: -6px; width: 14px; height: 14px; border-radius: 50%; background: #ffd23f; border: 2px solid #7a3a00; }
.hud-truck { position: absolute; top: -20px; left: 0; width: 34px; height: 24px; margin-left: -17px; transition: left .2s linear; }
.hud-truck svg { width: 34px; height: 24px; filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .5)); }
#hud-left { display: block; text-align: center; font-style: normal; font-size: 11px; font-weight: 800; color: #fff; margin-top: 3px; }
.hud-rt { position: absolute; right: 10px; top: 8px; display: flex; align-items: center; gap: 6px; }
.hud-time, .hud-coin { height: 40px; min-width: 54px; padding: 0 8px; border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 4px;
  background: linear-gradient(#0b0d11, #1c2129); border: 2px solid #8a909a; box-shadow: inset 0 2px 4px #000; color: #ffe27a; font-size: 18px; font-weight: 900;
  font-variant-numeric: tabular-nums; text-shadow: 0 0 8px rgba(255, 190, 40, .6); }
.hud-time.late { color: #ff8a6a; text-shadow: 0 0 8px rgba(255, 80, 40, .6); }
.hud-coin svg { width: 24px; height: 24px; }
.bump { animation: bump .35s ease-out; }
@keyframes bump { 40% { transform: scale(1.18); } }
.btn-icon { width: 44px; height: 44px; border: 2px solid #0b2a52; border-radius: 12px; color: #fff; display: flex; align-items: center; justify-content: center; padding: 0;
  background: linear-gradient(#5aa8ff, #1f6fd6); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .5), 0 3px 0 #0b2a52; }
.btn-icon:active { transform: translateY(2px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .5), 0 1px 0 #0b2a52; }
.btn-icon.hud-tow { background: linear-gradient(#ff9a5a, #e0501c); border-color: #5a1a00; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .5), 0 3px 0 #5a1a00; }
.hud-hint { position: absolute; left: 50%; top: 66px; max-width: 440px; transform: translateX(-50%) scale(.8); padding: 8px 16px; border-radius: 12px; text-align: center;
  background: linear-gradient(#fff6c8, #ffd84a); color: #3a2200; border: 2px solid #8a5a00; font-size: 16px; font-weight: 900; white-space: nowrap;
  box-shadow: 0 4px 0 #8a5a00, 0 8px 14px rgba(0, 0, 0, .35); opacity: 0; transition: opacity .25s, transform .25s; }
.hud-hint.show { opacity: 1; transform: translateX(-50%) scale(1); }
.hud-speed { position: absolute; left: 16px; bottom: 124px; width: 84px; height: 84px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 40%, #2a313c, #0b0d11 70%); border: 3px solid #c5ccd6; box-shadow: inset 0 0 0 3px #4a525e, 0 4px 8px rgba(0, 0, 0, .5); }
.hud-speed::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: conic-gradient(from 240deg, #3fd06a 0 80deg, #ffd23f 80deg 160deg, #ff5a2a 160deg 240deg, transparent 240deg); -webkit-mask: radial-gradient(circle, transparent 60%, #000 62%); mask: radial-gradient(circle, transparent 60%, #000 62%); opacity: .85; }
#hud-needle { position: absolute; left: 50%; top: 50%; width: 3px; height: 32px; margin: -32px 0 0 -1.5px; border-radius: 2px; background: #ff3a1a; transform-origin: 50% 100%; transform: rotate(-120deg); transition: transform .15s; }
.hud-speed b { position: relative; margin-top: 18px; font-size: 20px; color: #fff; line-height: 1; }
.hud-speed small { position: relative; font-size: 10px; color: #b8c2d0; }

/* управление: руль слева, педали и кнопки справа */
.ctrl-group { position: absolute; bottom: 12px; display: flex; gap: 12px; z-index: 6; touch-action: none; }
.cg-left { left: 12px; transform-origin: 0 100%; }
.cg-right { right: 12px; transform-origin: 100% 100%; align-items: flex-end; }
.cg-col { display: flex; flex-direction: column; gap: 10px; }
.ctl { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; font-weight: 900; touch-action: none;
  border: 3px solid #0b1a2e; box-shadow: inset 0 3px 0 rgba(255, 255, 255, .45), inset 0 -5px 0 rgba(0, 0, 0, .28), 0 5px 0 #071322, 0 9px 12px rgba(0, 0, 0, .4); transition: transform .05s; }
.ctl * { pointer-events: none; }
.ctl.on { transform: translateY(4px); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .45), inset 0 -3px 0 rgba(0, 0, 0, .28), 0 1px 0 #071322, 0 3px 6px rgba(0, 0, 0, .4); filter: brightness(1.15); }
.ctl-steer { width: 88px; height: 88px; border-radius: 26px; background: radial-gradient(circle at 35% 25%, #8fd0ff, #1d6fd6 70%); }
.ctl-steer svg { width: 50px; height: 50px; }
.ctl-pedal { width: 78px; height: 102px; border-radius: 18px; }
.ctl-pedal svg { width: 40px; height: 50px; }
.ctl-pedal.gas { width: 90px; height: 124px; background: radial-gradient(circle at 35% 25%, #a8f58a, #1f9e2c 72%); }
.ctl-pedal.brake { background: radial-gradient(circle at 35% 25%, #ffaa8a, #d8301c 72%); }
.ctl small { margin-top: 3px; font-size: 11px; letter-spacing: .5px; text-shadow: 0 1px 2px #000; }
.ctl-round { width: 66px; height: 66px; border-radius: 50%; }
.ctl-round b { font-size: 17px; line-height: 1; }
.ctl-round small { font-size: 9px; }
.ctl-round svg { width: 30px; height: 30px; }
.ctl-round.low { background: radial-gradient(circle at 35% 25%, #ffe98a, #c98a00 70%); color: #3a2200; }
.ctl-round.low small { color: #fff; }
.ctl-round.low.lit { background: radial-gradient(circle at 35% 25%, #fffbe0, #ffcc00 70%); box-shadow: 0 0 0 3px #fff6a0, 0 0 20px 6px rgba(255, 220, 60, .85), 0 5px 0 #071322; }
.ctl-round.winch { background: radial-gradient(circle at 35% 25%, #d2b8ff, #6a3ad8 70%); }
.ctl-round.winch.lit { background: radial-gradient(circle at 35% 25%, #f0e6ff, #9a6aff 70%); box-shadow: 0 0 0 3px #e8dcff, 0 0 20px 6px rgba(170, 120, 255, .85), 0 5px 0 #071322; }
.ctl.pulse { animation: cpulse .7s ease-in-out infinite; }
@keyframes cpulse { 50% { box-shadow: 0 0 0 5px #fff, 0 0 24px 10px rgba(255, 230, 80, .95), 0 5px 0 #071322; } }

/* окна: путевой лист на бумаге */
.overlay { background: rgba(10, 25, 45, .55); }
.panel { width: 330px; padding: 16px 18px; border-radius: 14px; animation: pop .28s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes pop { from { opacity: 0; transform: scale(.7) rotate(-2deg); } }
.panel.paper { color: #3a2a14; border: 3px solid #6b4a24;
  background: repeating-linear-gradient(transparent 0 27px, rgba(70, 120, 200, .16) 27px 28px), linear-gradient(#fffaf0, #f2e3c2);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .6), 0 6px 0 #4a3010, 0 14px 30px rgba(0, 0, 0, .5); }
.panel-title { font-size: 26px; font-weight: 900; text-align: center; color: #b8361a; text-shadow: 0 2px 0 #fff; }
.btn { min-height: 48px; padding: 0 16px; border: 2px solid #0b2a52; border-radius: 14px; font: inherit; font-size: 17px; font-weight: 900; color: #fff;
  background: linear-gradient(#6ab4ff, #1f6fd6 52%, #1a5fc0); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), 0 4px 0 #0b2a52, 0 6px 8px rgba(0, 0, 0, .25); text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.btn:active { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), 0 1px 0 #0b2a52; }
.btn-play { min-height: 54px; font-size: 20px; border-color: #7a2a00; background: linear-gradient(#ffc233, #ff8a00 48%, #f25c00 52%, #ff7a00); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .6), 0 5px 0 #5a1e00, 0 8px 10px rgba(0, 0, 0, .3); }
.btn-tow { border-color: #5a3a00; color: #3a2200; text-shadow: none; background: linear-gradient(#fff2a0, #ffcc1a 55%, #f0a800); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .6), 0 4px 0 #5a3a00; font-size: 15px; }
.btn-share { border-color: #0d4a14; background: linear-gradient(#8ef07a, #1f9e2c 55%, #188a24); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), 0 4px 0 #0d4a14; }
.btn-sm { min-height: 42px; font-size: 14px; border-color: #2a3240; background: linear-gradient(#9aa6b6, #5c6878); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .5), 0 3px 0 #2a3240; }
.btn-pair { display: flex; gap: 10px; }
.btn-pair .btn { flex: 1; min-width: 0; }
.res-panel { flex-direction: row; width: 600px; gap: 18px; }
.res-col { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.res-doc { font-size: 12px; font-weight: 900; letter-spacing: 2px; text-transform: uppercase; color: #8a5a2a; text-align: center; }
.res-title { display: flex; justify-content: center; line-height: 0; min-height: 44px; }
.res-route { text-align: center; font-size: 16px; font-weight: 900; color: #2a5ab0; }
.res-stars { display: flex; justify-content: center; gap: 6px; }
.res-stars .st { width: 50px; height: 50px; opacity: .22; filter: grayscale(1); transform: scale(.85); transition: all .3s; }
.res-stars .st.on { opacity: 1; filter: none; transform: scale(1); animation: starpop .5s cubic-bezier(.2, 1.6, .4, 1) backwards; }
.res-stars .st.on:nth-child(2) { animation-delay: .15s; } .res-stars .st.on:nth-child(3) { animation-delay: .3s; }
@keyframes starpop { from { transform: scale(0) rotate(-90deg); } }
.res-reason { text-align: center; font-size: 14px; font-weight: 700; color: #6a4a2a; min-height: 18px; }
.res-table { display: flex; flex-direction: column; gap: 2px; }
.res-table div { display: flex; justify-content: space-between; align-items: baseline; padding: 3px 2px; border-bottom: 2px dotted rgba(107, 74, 36, .35); font-size: 15px; font-weight: 700; }
.res-table b { font-size: 17px; color: #1a3a6a; }
.res-stamp { align-self: center; margin: 2px 0 4px; padding: 2px 14px; border: 4px double #1f9e2c; border-radius: 8px; color: #1f9e2c; font-size: 22px; font-weight: 900; letter-spacing: 3px; transform: rotate(-8deg); opacity: .85; }
.res-stamp.bad { border-color: #d8301c; color: #d8301c; }
.lb-panel { width: 420px; }
#lb-list { max-height: 200px; }
.lb-row { border-radius: 10px; background: rgba(107, 74, 36, .12); color: #3a2a14; font-weight: 800; }
.lb-row.top-1 { background: linear-gradient(90deg, #ffe27a, #fff3c4); } .lb-row.top-2 { background: linear-gradient(90deg, #dfe6ef, #f4f7fb); } .lb-row.top-3 { background: linear-gradient(90deg, #f0b47a, #fbe0c6); }
.lb-row.me { outline: 3px solid #ff7a1a; }
.lb-medal { font-weight: 900; color: #6a4a2a; }
.lb-medal.gold, .lb-medal.silver, .lb-medal.bronze { height: 28px; line-height: 28px; border-radius: 50%; color: #fff; text-shadow: 0 1px 1px #000; }
.lb-medal.gold { background: radial-gradient(circle at 35% 30%, #fff3a0, #e0a000); } .lb-medal.silver { background: radial-gradient(circle at 35% 30%, #fff, #8d96a3); } .lb-medal.bronze { background: radial-gradient(circle at 35% 30%, #ffd0a0, #b0601e); }
.lb-avatar { background: #2f7fc1; color: #fff; }
.lb-score { color: #1a3a6a; }
.lb-empty { color: #6a4a2a; font-weight: 700; }
#toast { top: 104px; padding: 9px 16px; border-radius: 12px; background: rgba(30, 16, 4, .86); border: 2px solid #ffd23f; font-size: 15px; font-weight: 800; }
