:root {
  color-scheme: light;
  --ink: #10142d;
  --muted: #65708f;
  --violet: #7158ff;
  --blue: #31b7ff;
  --cyan: #49e4cf;
  --pink: #ff4f92;
  --yellow: #ffd45c;
  --danger: #ff416c;
  --surface: rgba(255, 255, 255, .9);
  font-family: Inter, ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body {
  color: var(--ink);
  background: linear-gradient(145deg, #0e1431, #34236d 48%, #8f3c85);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
button:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.hidden { display: none !important; }
.ambient { position: fixed; border-radius: 50%; filter: blur(18px); opacity: .42; pointer-events: none; }
.ambient-one { width: 34vw; height: 34vw; left: -8vw; top: -12vw; background: #32d4ff; }
.ambient-two { width: 42vw; height: 42vw; right: -12vw; bottom: -16vw; background: #ff4f92; }

.app-shell {
  position: relative;
  isolation: isolate;
  width: min(100%, 520px);
  height: 100dvh;
  margin: 0 auto;
  padding: max(8px, env(safe-area-inset-top)) 9px max(8px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 7px;
  background: linear-gradient(180deg, rgba(12,16,40,.55), rgba(12,16,40,.18));
}

.glass {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.74);
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(5, 8, 28, .22), inset 0 1px 0 #fff;
  backdrop-filter: blur(16px);
}

.topbar { min-height: 58px; padding: 7px 9px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand-mark { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border-radius: 13px; color: #fff; background: linear-gradient(145deg, var(--violet), var(--pink)); box-shadow: 0 6px 14px rgba(113,88,255,.35); font-size: 22px; font-weight: 1000; transform: rotate(-4deg); }
.brand small, .revenue-card small, .statusbar small, .truck-copy small { display: block; font-size: 8px; font-weight: 900; letter-spacing: .12em; color: var(--muted); }
.brand h1 { margin: 1px 0 0; font-size: clamp(18px, 5.4vw, 25px); line-height: .9; letter-spacing: -.055em; }
.brand h1 em { color: var(--pink); font-style: normal; }
.revenue-card { min-width: 101px; padding: 6px 9px; border-radius: 12px; text-align: right; background: linear-gradient(145deg, #e9fff9, #c8f9ec); border: 1px solid rgba(73,228,207,.5); }
.revenue-card strong { display: block; font-size: 19px; line-height: 1.05; color: #087f70; }

.objective { position: relative; min-height: 43px; padding: 6px 8px; display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 4px; align-items: center; }
.objective > div { display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 9px; }
.step-dot { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 9px; background: #e9e6ff; color: var(--violet); font-size: 13px; font-weight: 1000; }
.step-dot.hot { background: #ffe2ee; color: var(--pink); }
.step-dot.done { background: #d8fff5; color: #078e7c; }
.flow-arrow { color: #9aa1b7; font-size: 22px; }
.objective p { position: absolute; right: 10px; top: -10px; margin: 0; padding: 2px 7px; border-radius: 20px; background: var(--ink); color: #fff; font-size: 7px; font-weight: 900; }
.objective p span { color: var(--pink); }

.truck-card { min-height: 158px; padding: 7px 9px 5px; overflow: hidden; transition: filter .2s, transform .2s, box-shadow .2s; }
.warehouse-stage { color: #edf5ff; border: 1px solid rgba(126,191,255,.22); border-radius: 20px; background: linear-gradient(160deg, #151c37, #0b1024 62%, #171832); box-shadow: 0 16px 34px rgba(4,7,21,.42), inset 0 1px 0 rgba(255,255,255,.08); }
.truck-copy { position: relative; z-index: 15; display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.truck-copy small { color: #91a1c4; }
.truck-copy strong { display: block; color: #fff; font-size: 10px; }
.truck-copy strong b { color: var(--cyan); font-size: 16px; }
.truck-copy strong span { color: var(--yellow); }
.pace-badge { padding: 4px 8px; border-radius: 20px; background: #e9e6ff; color: var(--violet); font-size: 8px; font-weight: 1000; letter-spacing: .06em; }
.pace-badge[data-tier="2"] { background: #d8fff5; color: #087f70; }
.pace-badge[data-tier="3"] { background: #fff2c7; color: #9d6500; }
.pace-badge[data-tier="4"] { background: #ffe2ee; color: #c52263; animation: pace-pulse .8s ease infinite alternate; }
@keyframes pace-pulse { to { transform: scale(1.06); } }

.warehouse-world { position: relative; height: 112px; overflow: hidden; border-radius: 13px; background: linear-gradient(180deg, #273154 0 9%, #151d39 10% 68%, #252847 69% 100%); box-shadow: inset 0 0 28px rgba(0,0,0,.55); perspective: 500px; }
.warehouse-world::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 12%, rgba(119,151,209,.09) 12.4% 12.9%), linear-gradient(145deg, transparent 40%, rgba(73,228,207,.08)); pointer-events: none; }
.warehouse-light { position: absolute; top: 2px; width: 28%; height: 5px; border-radius: 0 0 8px 8px; background: #dffbff; box-shadow: 0 0 16px 5px rgba(179,244,255,.25); }
.light-a { left: 15%; } .light-b { left: 55%; }

.office-bay { position: absolute; z-index: 4; left: 2%; bottom: 16px; width: 22%; height: 74px; border: 2px solid #42547f; border-bottom: 0; background: linear-gradient(180deg, rgba(29,43,74,.95), rgba(14,23,48,.95)); box-shadow: 8px 0 18px rgba(0,0,0,.28); }
.office-sign { position: absolute; left: 8%; top: 4px; width: 84%; padding: 2px; text-align: center; border-radius: 3px; color: #bdfdf3; background: #172843; box-shadow: 0 0 8px rgba(73,228,207,.25); font-size: 6px; font-weight: 1000; letter-spacing: .15em; }
.clerk { position: absolute; left: 37%; bottom: 18px; width: 25px; height: 34px; }
.clerk i { position: absolute; left: 5px; width: 15px; height: 15px; border-radius: 50%; background: #efbd91; box-shadow: 0 2px 0 #292746; }
.clerk span { position: absolute; left: 1px; bottom: 0; width: 23px; height: 22px; border-radius: 8px 8px 2px 2px; background: linear-gradient(145deg, #6f75ff, #384a9e); }
.office-counter { position: absolute; left: -5%; right: -5%; bottom: 0; height: 20px; border-top: 4px solid #d4a15f; background: linear-gradient(#82552f, #4b311f); }
.office-counter span { position: absolute; left: 8%; top: -14px; padding: 2px 4px; transform: rotate(-3deg); color: #202743; background: #fff6cb; box-shadow: 0 2px 4px rgba(0,0,0,.3); font-size: 5px; font-weight: 900; }
.office-bay.receiving .office-ticket { animation: ticket-in .55s cubic-bezier(.2,1.4,.4,1); }
@keyframes ticket-in { from { transform: translateX(-35px) rotate(-14deg); opacity: 0; } }

.conveyor { position: absolute; z-index: 5; left: 21%; right: 33%; bottom: 25px; height: 25px; transform: perspective(180px) rotateX(5deg); }
.belt-surface { height: 14px; padding: 2px 3px; display: flex; align-items: center; justify-content: space-around; overflow: hidden; border: 2px solid #46547c; border-radius: 3px; background: #11182d; box-shadow: 0 7px 0 #303957, 0 10px 8px rgba(0,0,0,.35); }
.belt-surface i { flex: 0 0 10px; height: 8px; border-radius: 50%; background: linear-gradient(90deg, #6b789e, #c7d1e6, #596585); animation: roller .7s linear infinite; }
@keyframes roller { to { transform: rotate(360deg); } }
.scanner-arch { position: absolute; z-index: 7; right: 18%; bottom: 5px; width: 28px; height: 42px; border: 5px solid #565f91; border-bottom: 0; border-radius: 9px 9px 0 0; box-shadow: inset 0 0 0 2px #8b94ca, 0 0 12px rgba(113,88,255,.35); }
.scanner-arch::after { content: ""; position: absolute; left: 2px; right: 2px; top: 10px; height: 2px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); opacity: .45; }
.scanner-arch span { position: absolute; left: 1px; right: 1px; top: -5px; text-align: center; color: #fff; font-size: 4px; font-weight: 1000; }
.scanner-arch.scanning::after { animation: scanner-beam .35s ease 2 alternate; }
@keyframes scanner-beam { to { top: 30px; opacity: 1; } }

.dock-parcel-layer { position: absolute; inset: 0; z-index: 10; pointer-events: none; }
.dock-parcel { position: absolute; left: 21%; bottom: 41px; width: 23px; height: 21px; display: grid; place-items: center; border: 2px solid #ffe1a6; border-radius: 4px; color: #684117; background: linear-gradient(145deg, #ffd17b, #d78a35); box-shadow: 0 4px 8px rgba(0,0,0,.36); font-size: 11px; animation: dock-route 1.15s cubic-bezier(.25,.05,.2,1) forwards; }
.dock-parcel::after { content: ""; position: absolute; width: 3px; height: 100%; background: rgba(255,255,255,.6); }
@keyframes dock-route { 0% { transform: translateX(0) translateY(-18px) scale(.75) rotate(-8deg); opacity: 0; } 12% { opacity: 1; } 60% { transform: translateX(170px) translateY(0) scale(1); } 78% { transform: translateX(215px) translateY(0) scale(.88); } 100% { transform: translateX(255px) translateY(-8px) scale(.35); opacity: .18; } }

.truck-rig { position: absolute; z-index: 8; right: 2%; bottom: 16px; width: 34%; height: 81px; transform-origin: center bottom; }
.truck-box { position: absolute; left: 0; top: 3px; width: 72%; height: 62px; border: 3px solid #e5edff; border-radius: 5px 2px 3px 3px; background: #d8e1f2; box-shadow: 0 7px 14px rgba(0,0,0,.42); }
.truck-interior { position: absolute; inset: 5px; overflow: hidden; border: 2px solid #59647c; background: linear-gradient(135deg, #0b0e18, #222b40); box-shadow: inset 0 0 16px #000; }
.truck-interior::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 48%, rgba(255,255,255,.06) 50%, transparent 52%), repeating-linear-gradient(0deg, transparent 0 14px, rgba(255,255,255,.05) 15px 16px); }
.cargo-depth { position: absolute; inset: auto 0 0; height: 7px; background: #4b5366; transform: skewX(-25deg); opacity: .8; }
.truck-cargo { position: absolute; z-index: 3; left: 5px; right: 5px; bottom: 5px; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 17px; gap: 2px; align-content: end; }
.cargo-slot { position: relative; min-width: 0; border: 1px dashed rgba(255,255,255,.18); border-radius: 2px; }
.cargo-slot.filled { border: 1px solid #ffe2a9; background: linear-gradient(145deg, #ffc965, #d7822e); box-shadow: 0 0 7px rgba(255,193,80,.45); animation: cargo-in .38s cubic-bezier(.2,1.5,.4,1); }
.cargo-slot.filled::after { content: ""; position: absolute; left: 45%; top: 0; width: 2px; height: 100%; background: rgba(255,255,255,.48); }
.truck-door { position: absolute; z-index: 7; top: 4px; width: 44%; height: 55px; display: grid; place-items: center; border: 2px solid #eef4ff; color: #34436b; background: linear-gradient(145deg, #edf4ff, #aab9d8); box-shadow: 0 5px 10px rgba(0,0,0,.38); font-size: 5px; font-weight: 1000; transition: transform .38s cubic-bezier(.3,.1,.2,1); backface-visibility: hidden; }
.door-left { left: -34%; transform: perspective(80px) rotateY(-52deg); transform-origin: right; }
.door-right { right: -34%; transform: perspective(80px) rotateY(52deg); transform-origin: left; }
.truck-rig.sealing .door-left { left: 5px; transform: rotateY(0); }
.truck-rig.sealing .door-right { right: 5px; transform: rotateY(0); }
.truck-cab { position: absolute; right: 0; bottom: 16px; width: 30%; height: 45px; border: 2px solid #9bd8ff; border-radius: 4px 10px 3px 2px; background: linear-gradient(145deg, #2ec8e3, #4b63d9); box-shadow: 0 7px 12px rgba(0,0,0,.4); }
.windshield { position: absolute; left: 4px; top: 5px; width: 65%; height: 15px; border-radius: 2px 6px 2px 2px; background: linear-gradient(145deg, #d7f7ff, #7396c5); box-shadow: inset 0 0 0 1px #23375f; }
.headlamp { position: absolute; right: -3px; bottom: 8px; width: 6px; height: 6px; border-radius: 50%; background: #fff6a2; box-shadow: 0 0 9px 4px rgba(255,235,103,.75); }
.truck-wheel { position: absolute; bottom: 5px; width: 19px; height: 19px; border: 4px solid #080b14; border-radius: 50%; background: #8d9bbb; box-shadow: inset 0 0 0 3px #263047; }
.wheel-a { left: 12%; } .wheel-b { right: 8%; }
.truck-rig.departing { animation: truck-depart 1.05s cubic-bezier(.45,.02,.7,.35) forwards; }
.truck-rig.departing .truck-wheel { animation: wheel-spin .18s linear infinite; }
.truck-rig.arriving { animation: truck-arrive .75s cubic-bezier(.2,.8,.3,1) both; }
@keyframes truck-depart { 0%, 18% { transform: translateX(0); } 35% { transform: translateX(-8px); } 100% { transform: translateX(190%); } }
@keyframes truck-arrive { from { transform: translateX(190%); } to { transform: translateX(0); } }
@keyframes wheel-spin { to { transform: rotate(360deg); } }

.dock-floor { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; height: 20px; display: flex; align-items: center; gap: 8px; padding: 0 7px; color: #687292; background: repeating-linear-gradient(135deg, #20253b 0 8px, #2d334e 8px 16px); font-size: 5px; font-weight: 1000; }
.dock-floor i { width: 25px; height: 3px; transform: skewX(-35deg); background: #ffc93f; opacity: .7; }
.dock-status { position: absolute; z-index: 16; left: 25%; top: 8px; padding: 3px 7px; border: 1px solid rgba(73,228,207,.5); border-radius: 12px; color: #bffdf4; background: rgba(7,15,31,.76); box-shadow: 0 0 12px rgba(73,228,207,.16); font-size: 5px; font-weight: 1000; letter-spacing: .08em; }
.dispatch-strip { height: 17px; display: grid; grid-template-columns: 92px 1fr auto; gap: 7px; align-items: center; color: #93a0bd; font-size: 5px; font-weight: 1000; }
.dispatch-strip > div { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
.dispatch-strip i { height: 4px; border-radius: 4px; background: #2a3555; }
.dispatch-strip i.done { background: linear-gradient(90deg, var(--cyan), var(--blue)); box-shadow: 0 0 6px rgba(73,228,207,.5); }
.dispatch-strip strong { color: #f8d977; }
.truck-flash { filter: brightness(1.25); box-shadow: 0 0 0 2px var(--cyan), 0 0 30px rgba(73,228,207,.5); }
@keyframes cargo-in { from { transform: translateY(-16px) scale(.2) rotate(12deg); opacity: 0; } }

main { min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 7px; }
.order-card { min-height: 0; padding: 8px; display: grid; grid-template-rows: auto auto auto auto minmax(76px, 1fr) auto; gap: 5px; overflow: hidden; }
.round-line { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .04em; }
.round-line strong { padding: 4px 10px; border-radius: 20px; color: #fff; background: linear-gradient(135deg, var(--violet), #4f94ff); box-shadow: 0 4px 10px rgba(80,100,255,.28); }
.timer-track { height: 7px; overflow: hidden; border-radius: 8px; background: #e7eaf2; }
.timer-track span { display: block; width: 100%; height: 100%; border-radius: inherit; transform-origin: left; background: linear-gradient(90deg, var(--cyan), var(--blue), var(--violet)); will-change: transform; }
.timer-fill.p0 { transform: scaleX(0); } .timer-fill.p1 { transform: scaleX(.05); } .timer-fill.p2 { transform: scaleX(.1); } .timer-fill.p3 { transform: scaleX(.15); } .timer-fill.p4 { transform: scaleX(.2); }
.timer-fill.p5 { transform: scaleX(.25); } .timer-fill.p6 { transform: scaleX(.3); } .timer-fill.p7 { transform: scaleX(.35); } .timer-fill.p8 { transform: scaleX(.4); } .timer-fill.p9 { transform: scaleX(.45); }
.timer-fill.p10 { transform: scaleX(.5); } .timer-fill.p11 { transform: scaleX(.55); } .timer-fill.p12 { transform: scaleX(.6); } .timer-fill.p13 { transform: scaleX(.65); } .timer-fill.p14 { transform: scaleX(.7); }
.timer-fill.p15 { transform: scaleX(.75); } .timer-fill.p16 { transform: scaleX(.8); } .timer-fill.p17 { transform: scaleX(.85); } .timer-fill.p18 { transform: scaleX(.9); } .timer-fill.p19 { transform: scaleX(.95); } .timer-fill.p20 { transform: scaleX(1); }
.timer-track span.danger { background: linear-gradient(90deg, #ffb04a, var(--danger)); }
.money-live { min-height: 27px; padding: 3px 8px; display: flex; justify-content: space-between; align-items: center; border-radius: 10px; color: #087f70; background: linear-gradient(90deg, #e9fff9, #f6fffd); font-size: 8px; font-weight: 900; }
.money-live strong { font-size: 15px; transition: color .2s; }
.money-live strong.urgent { color: var(--danger); animation: money-tick .5s ease infinite alternate; }
@keyframes money-tick { to { transform: scale(1.06); } }

.target-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.target { min-height: 35px; padding: 3px; display: flex; align-items: center; justify-content: center; gap: 3px; border-radius: 11px; border: 1px solid #d9ddea; background: linear-gradient(145deg, #fff, #f4f5fa); transition: transform .18s, opacity .18s, background .18s; }
.target .emoji { font-size: clamp(18px, 6vw, 27px); }
.target span:last-child { max-width: 54px; overflow: hidden; text-overflow: ellipsis; font-size: 7px; font-weight: 900; text-transform: uppercase; }
.target.packed { opacity: .42; transform: scale(.93); background: #d8fff5; }
.target.packed::after { content: "✓"; color: #087f70; font-weight: 1000; }

.pack-zone { position: relative; min-height: 0; display: grid; place-items: center; overflow: visible; border-radius: 15px; background: radial-gradient(circle at 50% 110%, rgba(113,88,255,.18), transparent 55%); }
.package-data { position: absolute; z-index: 4; left: 6px; top: 4px; display: flex; gap: 5px; }
.package-data > span { padding: 3px 6px; border-radius: 7px; background: rgba(16,20,45,.78); color: #fff; font-size: 7px; font-weight: 800; }
.box-lid { position: absolute; z-index: 1; top: 20%; width: 68%; height: 12px; border-radius: 5px; background: linear-gradient(#efbd76, #d99039); box-shadow: 0 4px 9px rgba(88,50,7,.22); transform: perspective(60px) rotateX(15deg); transition: width .35s cubic-bezier(.2,1.3,.4,1); }
.parcel-box { position: relative; z-index: 2; height: 66%; min-height: 66px; margin-top: 18px; padding: 10px 8px 5px; display: grid; grid-template-rows: 1fr auto; text-align: center; border-radius: 8px 8px 13px 13px; background: linear-gradient(145deg, #f1c17a, #d9943f); box-shadow: inset 0 0 0 2px rgba(255,255,255,.28), 0 12px 20px rgba(117,69,11,.23); transition: width .35s cubic-bezier(.2,1.3,.4,1), height .35s; }
.parcel-box.size-s { width: 52%; }
.parcel-box.size-m { width: 68%; }
.parcel-box.size-l { width: 86%; }
.parcel-box > strong { font-size: 7px; letter-spacing: .12em; color: #76501f; }
.packed-items { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 6px; }
.packed-item { font-size: clamp(21px, 7vw, 36px); line-height: .9; animation: drop .3s cubic-bezier(.2,1.5,.5,1); filter: drop-shadow(0 4px 3px rgba(67,41,8,.18)); }
@keyframes drop { from { opacity: 0; transform: translateY(-22px) scale(.45) rotate(-12deg); } }
.resize-pop .parcel-box, .resize-pop .box-lid { filter: brightness(1.18); }

.bubble-wrap { position: absolute; left: 0; right: 0; top: -48px; bottom: 0; z-index: 18; padding: 12px 13%; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: minmax(0, 1fr); gap: 7px; place-content: center; background: rgba(18,24,57,.46); backdrop-filter: blur(6px); }
.bubble { position: relative; height: 100%; width: auto; max-width: 86px; aspect-ratio: 1; min-width: 0; justify-self: center; border: 0; border-radius: 50%; cursor: pointer; color: #fff; background: transparent; font-size: clamp(9px, 3vw, 14px); font-weight: 1000; }
.bubble::before { content: ""; position: absolute; inset: 4%; border: 1px solid rgba(255,255,255,.9); border-radius: 50%; background: radial-gradient(circle at 31% 25%, #fff 0 6%, #8ae7ff 7% 23%, #538dff 52%, #6849dd 78%); box-shadow: inset -7px -9px 15px rgba(24,15,93,.28), 0 8px 18px rgba(37,35,110,.38), 0 0 0 2px rgba(255,255,255,.32); animation: bubble-float 1.25s ease-in-out infinite alternate; will-change: transform; transition: transform .08s, opacity .12s; }
.bubble span { position: relative; z-index: 2; }
.bubble:nth-child(2n)::before { animation-duration: 1.55s; animation-delay: -.6s; }
.bubble:nth-child(3n)::before { animation-duration: 1.1s; animation-delay: -.3s; }
.bubble:active::before { transform: translateY(4px) scale(.72,.9); }
.bubble.popped::before { transform: scale(.25); opacity: .08; }
.bubble.popped { opacity: .08; pointer-events: none; }
@keyframes bubble-float { from { transform: translate(-3px, 4px) rotate(-2deg) scale(.96); } to { transform: translate(4px, -7px) rotate(3deg) scale(1.04); } }
.coach { margin: 0; text-align: center; color: var(--violet); font-size: 9px; font-weight: 1000; letter-spacing: .08em; }
.perfect-stamp { position: absolute; z-index: 12; right: 7%; top: 42%; padding: 5px 9px; border: 3px solid var(--pink); border-radius: 8px; color: var(--pink); background: rgba(255,255,255,.92); font-size: clamp(20px, 7vw, 32px); font-weight: 1000; transform: rotate(-8deg); animation: stamp .3s cubic-bezier(.2,1.6,.4,1); }
@keyframes stamp { from { transform: rotate(-8deg) scale(2); opacity: 0; } }

.belt-card { padding: 6px 8px 8px; background: rgba(245,247,255,.94); }
.belt-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; color: var(--muted); font-size: 8px; }
.belt-heading strong { color: var(--ink); }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.choice { min-width: 0; height: 44px; padding: 3px 5px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 3px; border: 1px solid #dfe3ef; border-radius: 12px; background: #fff; box-shadow: 0 4px 9px rgba(23,28,65,.1); transition: transform .08s, opacity .16s, box-shadow .08s; }
.choice .emoji { font-size: clamp(21px, 6vw, 29px); line-height: 1; }
.choice span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 7px; font-weight: 900; text-transform: uppercase; }
.choice:active { transform: translateY(2px) scale(.97); box-shadow: 0 1px 3px rgba(23,28,65,.12); }
.choice.packed { opacity: .18; pointer-events: none; transform: scale(.9); }
.choices.locked { opacity: .26; pointer-events: none; }

.statusbar { min-height: 44px; padding: 4px 5px; display: grid; grid-template-columns: 1.25fr repeat(4, 1fr) 34px 34px; align-items: center; text-align: center; }
.statusbar > div { border-right: 1px solid #e0e3ed; }
.statusbar strong { display: block; font-size: 13px; line-height: 1; }
.hearts { display: flex; justify-content: center; gap: 2px; }
.heart { color: var(--pink); font-size: 17px; filter: drop-shadow(0 2px 2px rgba(255,79,146,.3)); }
.heart.lost { color: #d5d9e5; filter: none; }
#collection-button, #sound-button { position: relative; width: 29px; height: 29px; margin: auto; padding: 0; border: 0; border-radius: 10px; font-weight: 1000; }
#collection-button { background: #fff0c7; }
#sound-button { color: #fff; background: linear-gradient(145deg, var(--blue), var(--violet)); }
#collection-button small { position: absolute; right: -5px; top: -6px; min-width: 14px; height: 14px; border-radius: 8px; color: #fff; background: var(--pink); font-size: 7px; line-height: 14px; }

.toast { position: fixed; z-index: 60; left: 50%; bottom: 69px; max-width: calc(100% - 28px); padding: 8px 14px; border-radius: 12px; color: #fff; background: rgba(16,20,45,.92); box-shadow: 0 9px 22px rgba(0,0,0,.28); transform: translate(-50%, 18px); opacity: 0; pointer-events: none; text-align: center; white-space: nowrap; font-size: 10px; font-weight: 900; transition: .22s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.shake { animation: shake .28s linear; }
@keyframes shake { 25% { transform: translateX(-7px); } 50% { transform: translateX(7px); } 75% { transform: translateX(-4px); } }

.flying-parcel { position: absolute; z-index: 120; left: calc(50% - 24px); top: 56%; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(145deg, #ffd992, #e79a41); box-shadow: 0 0 0 3px rgba(255,255,255,.9), 0 10px 28px rgba(0,0,0,.36), 0 0 28px var(--yellow); font-size: 28px; animation: parcel-flight .7s cubic-bezier(.3,.1,.2,1) forwards; pointer-events: none; }
@keyframes parcel-flight { to { transform: translate(180px, -36vh) rotate(540deg) scale(.35); opacity: .32; } }
.celebration-layer { position: absolute; inset: 0; z-index: 45; overflow: hidden; display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .15s; }
.celebration-layer.show { opacity: 1; }
.celebration-layer::before { content: ""; position: absolute; inset: 25% 4%; border-radius: 30px; background: radial-gradient(circle, rgba(113,88,255,.35), transparent 70%); }
.celebration-layer > div { position: relative; padding: 12px 18px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.7); border-radius: 18px; color: #fff; background: rgba(16,20,45,.88); box-shadow: 0 15px 40px rgba(0,0,0,.35), 0 0 36px rgba(73,228,207,.35); backdrop-filter: blur(12px); animation: celebrate-in .36s cubic-bezier(.2,1.5,.4,1); }
.celebration-layer strong { font-size: 17px; }
.celebration-layer span { color: var(--cyan); font-size: 24px; font-weight: 1000; }
.celebration-layer small { color: var(--yellow); font-size: 8px; font-weight: 900; }
.celebration-layer i { position: absolute; left: 50%; top: 54%; color: var(--cyan); font-size: 22px; font-style: normal; animation: particle .9s ease-out both; }
.celebration-layer .delay0 { animation-delay: 0ms; } .celebration-layer .delay1 { animation-delay: 35ms; } .celebration-layer .delay2 { animation-delay: 70ms; } .celebration-layer .delay3 { animation-delay: 105ms; } .celebration-layer .delay4 { animation-delay: 140ms; }
.celebration-layer .d0 { --x: -150px; --y: -130px; --r: -220deg; } .celebration-layer .d1 { --x: -105px; --y: -190px; --r: 180deg; }
.celebration-layer .d2 { --x: -48px; --y: -230px; --r: -140deg; } .celebration-layer .d3 { --x: 30px; --y: -220px; --r: 240deg; }
.celebration-layer .d4 { --x: 92px; --y: -185px; --r: -200deg; } .celebration-layer .d5 { --x: 148px; --y: -125px; --r: 160deg; }
.celebration-layer .d6 { --x: -125px; --y: -75px; --r: -110deg; } .celebration-layer .d7 { --x: 125px; --y: -75px; --r: 120deg; }
@keyframes celebrate-in { from { transform: scale(.45); opacity: 0; } }
@keyframes particle { to { transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(.3); opacity: 0; } }

.modal { position: fixed; inset: 0; z-index: 200; padding: 14px; display: grid; place-items: center; overflow-y: auto; background: rgba(8,10,28,.76); backdrop-filter: blur(15px); }
.modal-card { width: min(100%, 430px); padding: 22px; text-align: center; border: 1px solid rgba(255,255,255,.8); border-radius: 28px; background: rgba(255,255,255,.96); box-shadow: 0 30px 70px rgba(0,0,0,.42); }
.logo-orbit { width: 74px; height: 74px; margin: -57px auto 12px; display: grid; place-items: center; border: 6px solid rgba(255,255,255,.85); border-radius: 24px; background: linear-gradient(145deg, var(--violet), var(--pink)); box-shadow: 0 12px 25px rgba(113,88,255,.38); transform: rotate(-5deg); }
.logo-orbit span { font-size: 38px; transform: rotate(5deg); }
.kicker { margin: 0 0 6px; color: var(--violet); font-size: 9px; font-weight: 1000; letter-spacing: .14em; }
.modal h2 { margin: 0 0 15px; font-size: clamp(30px, 9vw, 45px); line-height: .93; letter-spacing: -.055em; }
.modal h2 span, .victory-card h2 { color: var(--pink); }
.quick-rules { display: grid; gap: 6px; text-align: left; }
.quick-rules div { min-height: 45px; padding: 7px 10px; display: flex; align-items: center; gap: 9px; border-radius: 14px; background: #f4f2ff; }
.quick-rules b { flex: 0 0 29px; width: 29px; height: 29px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--violet); }
.quick-rules span { font-size: 11px; font-weight: 700; }
.last-run { margin-top: 8px; padding: 8px 10px; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; border: 1px solid #d8e7f3; border-radius: 13px; text-align: left; background: #eef9ff; }
.last-run small { grid-row: 1 / span 2; color: #62809a; font-size: 7px; font-weight: 950; letter-spacing: .09em; }
.last-run strong { font-size: 12px; }
.last-run span { color: #477084; font-size: 8px; font-weight: 800; }
.economy-rule { margin: 8px 0; padding: 8px 10px; display: grid; grid-template-columns: auto 1fr; gap: 9px; align-items: center; border-radius: 14px; text-align: left; color: #087f70; background: #dcfff6; }
.economy-rule strong { font-size: 17px; }
.economy-rule span { font-size: 9px; font-weight: 800; }
.lose-rule { margin: 8px 0; padding: 7px; border-radius: 10px; color: #fff; background: var(--ink); font-size: 9px; font-weight: 800; }
.play-button, .secondary-button { width: 100%; min-height: 49px; border: 0; border-radius: 14px; cursor: pointer; font-weight: 1000; }
.play-button { padding: 0 16px; display: flex; align-items: center; justify-content: space-between; color: #fff; background: linear-gradient(135deg, var(--violet), var(--pink)); box-shadow: 0 9px 20px rgba(113,88,255,.3); }
.play-button:active { transform: translateY(2px); box-shadow: 0 4px 9px rgba(113,88,255,.25); }
.secondary-button { margin-top: 8px; background: #edf0f8; }
.result-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 7px; margin: 10px 0; }
.result-grid > div { padding: 11px 6px; border-radius: 15px; background: #edf0f8; }
.result-grid small { display: block; color: var(--muted); font-size: 7px; font-weight: 900; }
.result-grid strong { font-size: 22px; }
.medal { width: 104px; height: 104px; margin: 0 auto 8px; display: grid; place-items: center; border-radius: 34px; background: linear-gradient(145deg, #fff4b0, var(--yellow)); box-shadow: 0 12px 24px rgba(183,125,0,.22); font-size: 45px; transform: rotate(-3deg); }
.medal strong { margin-top: -15px; font-size: 13px; }
.victory-summary { font-size: 11px; font-weight: 900; }
.reward-box { min-height: 100px; margin: 10px 0; padding: 9px; display: grid; place-items: center; border-radius: 18px; background: linear-gradient(145deg, #e4f7ff, #e8e4ff); }
.gift-icon, .reward-reveal { font-size: 40px; animation: reward .6s ease; }
.reward-box strong { font-size: 13px; }
.reward-box small { color: var(--muted); font-size: 8px; font-weight: 900; }
.victory-card .play-button + .play-button { margin-top: 8px; background: linear-gradient(135deg, #17c7ac, #31b7ff); }
@keyframes reward { 50% { transform: scale(1.3) rotate(8deg); } }
.collection-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.collectible { min-height: 88px; padding: 6px; display: grid; place-items: center; border-radius: 15px; background: #f4f5fa; }
.collectible span { font-size: 29px; }
.collectible strong { font-size: 9px; }
.collectible small { color: var(--pink); font-size: 7px; font-weight: 900; }
.collectible.locked { filter: grayscale(1); opacity: .42; }

@media (max-width: 390px) {
  .app-shell { padding-left: 6px; padding-right: 6px; gap: 5px; }
  .record-data { display: none; }
  .statusbar { grid-template-columns: 1.25fr repeat(3, 1fr) 34px 34px; }
  .target span:last-child, .choice span:last-child { display: none; }
  .choice .emoji { font-size: 26px; }
  .revenue-card { min-width: 92px; }
}

@media (max-height: 700px) {
  .app-shell { grid-template-rows: auto auto minmax(0, 1fr) auto; gap: 4px; padding-top: 4px; padding-bottom: 4px; }
  .topbar { min-height: 48px; }
  .brand-mark { width: 34px; height: 34px; flex-basis: 34px; font-size: 18px; }
  .revenue-card { padding-top: 4px; padding-bottom: 4px; }
  .revenue-card strong { font-size: 16px; }
  .objective { display: none; }
  .truck-card { min-height: 102px; padding-top: 4px; }
  .truck-copy { margin-bottom: 1px; }
  .truck-copy small { display: none; }
  .warehouse-world { height: 70px; }
  .warehouse-light { display: none; }
  .office-bay { bottom: 8px; transform: scale(.72); transform-origin: left bottom; }
  .conveyor { bottom: 13px; }
  .scanner-arch { transform: scale(.72); transform-origin: center bottom; }
  .truck-rig { right: -1%; bottom: 7px; transform: scale(.72); transform-origin: right bottom; }
  .dock-floor { height: 13px; }
  .dock-status { top: 3px; }
  .dispatch-strip { height: 12px; }
  .order-card { padding: 5px; gap: 3px; grid-template-rows: auto auto auto auto minmax(58px, 1fr) auto; }
  .target { min-height: 28px; }
  .target .emoji { font-size: 19px; }
  .money-live { min-height: 21px; }
  .money-live strong { font-size: 12px; }
  .package-data { top: 1px; }
  .parcel-box { min-height: 48px; margin-top: 12px; }
  .packed-item { font-size: 20px; }
  .box-lid { top: 17%; height: 8px; }
  .choice { height: 35px; }
  .belt-card { padding: 4px 6px; }
  .statusbar { min-height: 36px; }
  .statusbar strong { font-size: 11px; }
  .heart { font-size: 14px; }
  #collection-button, #sound-button { width: 25px; height: 25px; }
  .modal { padding: 7px; place-items: start center; }
  .modal-card { padding: 14px; margin: auto 0; border-radius: 22px; }
  .logo-orbit { width: 55px; height: 55px; margin: 0 auto 7px; border-width: 3px; }
  .logo-orbit span { font-size: 29px; }
  .modal h2 { font-size: 29px; margin-bottom: 8px; }
  .quick-rules div { min-height: 34px; padding: 4px 7px; }
  .quick-rules b { width: 24px; height: 24px; flex-basis: 24px; }
  .quick-rules span { font-size: 9px; }
  .economy-rule, .lose-rule { margin: 5px 0; padding: 5px; }
  .play-button { min-height: 40px; }
  .collection-grid { grid-template-columns: repeat(4, 1fr); }
  .collectible { min-height: 68px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* v7 — vraie scène WebGL. Le décor CSS v6 reste uniquement comme repli logique. */
.truck-card { min-height: 202px; padding: 8px 10px 6px; background: linear-gradient(145deg, rgba(17,25,51,.97), rgba(24,14,53,.98)); }
.legacy-world { display: none !important; }
.world3d-shell { position: relative; height: 150px; overflow: hidden; border: 1px solid rgba(115,223,255,.28); border-radius: 17px; background: #071526; box-shadow: inset 0 0 45px rgba(0,0,0,.48), 0 18px 40px rgba(4,8,27,.24); touch-action: manipulation; }
#world-canvas { display: block; width: 100%; height: 100%; cursor: crosshair; touch-action: manipulation; }
.world3d-vignette { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(2,8,20,.34), transparent 24% 72%, rgba(2,8,20,.28)), linear-gradient(0deg, rgba(2,8,20,.48), transparent 35%); }
.world3d-hud { position: absolute; z-index: 3; inset: 8px 9px auto; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; pointer-events: none; }
.render-badge { padding: 5px 8px; display: inline-flex; align-items: center; gap: 5px; border: 1px solid rgba(107,235,255,.35); border-radius: 999px; color: #c8f8ff; background: rgba(5,17,35,.75); backdrop-filter: blur(8px); font-size: 7px; font-weight: 950; letter-spacing: .1em; }
.render-badge i { width: 6px; height: 6px; border-radius: 50%; background: #58f1c1; box-shadow: 0 0 10px #58f1c1; animation: live-pulse 1.3s ease-in-out infinite; }
.score-race { padding: 5px 7px; display: grid; grid-template-columns: repeat(3, auto); gap: 9px; border: 1px solid rgba(255,255,255,.11); border-radius: 11px; color: white; background: rgba(4,11,27,.76); backdrop-filter: blur(9px); }
.score-race span { display: grid; gap: 1px; min-width: 45px; }
.score-race small { color: #8199b7; font-size: 5px; font-weight: 950; letter-spacing: .06em; }
.score-race strong { color: #f7fbff; font-size: 12px; line-height: 1; }
.score-race span:nth-child(2) strong { color: #ffcf6b; }
.world3d-instruction { position: absolute; z-index: 4; left: 50%; bottom: 9px; transform: translateX(-50%); padding: 6px 11px; border-radius: 999px; color: #071526; background: #f8fbff; box-shadow: 0 7px 18px rgba(0,0,0,.28); font-size: 8px; font-weight: 1000; letter-spacing: .08em; white-space: nowrap; pointer-events: none; }
.world3d-instruction.pop { color: #071526; background: linear-gradient(90deg, #65ebff, #a2ffca); animation: instruction-pop .82s ease-in-out infinite alternate; }
.score-flash { position: absolute; z-index: 5; left: 50%; top: 52%; opacity: 0; transform: translate(-50%,-50%) scale(.7); color: #fff; font-size: 25px; font-weight: 1000; text-shadow: 0 3px 20px rgba(58,226,255,.9); pointer-events: none; }
.score-flash.show { animation: score-fly .85s cubic-bezier(.2,.8,.2,1); }
.bubble-wrap { position: fixed !important; width: 1px !important; height: 1px !important; inset: auto !important; padding: 0 !important; overflow: hidden !important; clip-path: inset(50%) !important; opacity: .001 !important; pointer-events: none !important; }
.intro-card { max-width: 390px; }
.intro-command { margin: -3px 0 12px; color: #4b5770; font-size: 18px; font-weight: 850; }
.intro-card .quick-rules { grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 8px 0 11px; }
.intro-card .quick-rules div { min-height: 70px; padding: 8px 5px; display: grid; place-items: center; align-content: center; gap: 5px; text-align: center; }
.intro-card .quick-rules b { flex: none; }
.intro-card .quick-rules span { font-size: 9px; letter-spacing: .06em; }
.intro-card .lose-rule strong { display: inline-block; margin-right: 5px; color: #ff5679; font-size: 14px; letter-spacing: 2px; }
.result-comparison { margin: 6px 0; color: #4f5970; font-weight: 850; }
.virtual-money { display: block; margin: 6px 0 12px; color: #738098; font-size: 8px; font-weight: 900; letter-spacing: .05em; }
.virtual-money strong { color: #168b75; }

@keyframes live-pulse { 50% { opacity: .45; transform: scale(.72); } }
@keyframes instruction-pop { to { box-shadow: 0 0 22px rgba(85,235,255,.72); transform: translateX(-50%) scale(1.035); } }
@keyframes score-fly { 0% { opacity: 0; transform: translate(-50%,-35%) scale(.7); } 20%,65% { opacity: 1; transform: translate(-50%,-50%) scale(1.12); } 100% { opacity: 0; transform: translate(-50%,-100%) scale(.9); } }

@media (max-width: 430px) {
  .world3d-shell { height: 132px; }
  .truck-card { min-height: 184px; }
  .score-race { gap: 6px; }
  .score-race span { min-width: 38px; }
  .score-race strong { font-size: 10px; }
  .render-badge { font-size: 6px; }
}

@media (max-height: 700px) {
  .truck-card { min-height: 131px; }
  .world3d-shell { height: 86px; border-radius: 12px; }
  .world3d-hud { inset: 4px 5px auto; }
  .render-badge { padding: 3px 5px; }
  .score-race { padding: 3px 5px; gap: 4px; }
  .score-race small { display: none; }
  .world3d-instruction { bottom: 4px; padding: 4px 8px; font-size: 7px; }
  .intro-command { margin-bottom: 5px; font-size: 14px; }
  .intro-card .quick-rules div { min-height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  .render-badge i, .world3d-instruction.pop { animation: none; }
}

/* v8 — le monde 3D devient le jeu, le DOM restant sert au HUD et à l'accessibilité. */
.app-shell {
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 7px;
  width: min(100%, 560px);
  padding-left: 7px;
  padding-right: 7px;
}
.objective,
.truck-copy,
.dispatch-strip { display: none !important; }
.accessible-game-controls {
  position: fixed !important;
  width: 1px !important;
  height: 1px !important;
  left: -10000px !important;
  top: auto !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
}
.truck-card {
  position: relative;
  min-height: 0;
  padding: 0;
  border-radius: 24px;
}
.world3d-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 23px;
}
.world3d-hud { inset: 10px 10px auto; }
.render-badge { color: #ecfcff; background: rgba(4,13,28,.84); }
.world3d-mission {
  position: absolute;
  z-index: 4;
  left: 10px;
  top: 48px;
  display: flex;
  gap: 6px;
  pointer-events: none;
}
.world3d-mission span {
  min-width: 92px;
  padding: 5px 8px;
  display: grid;
  border: 1px solid rgba(101,234,255,.34);
  border-radius: 10px;
  color: #f6fbff;
  background: rgba(4,13,28,.82);
  box-shadow: 0 6px 18px rgba(0,0,0,.28);
}
.world3d-mission span.danger { border-color: rgba(255,84,126,.4); }
.world3d-mission span.timer { border-color: rgba(255,205,92,.45); }
.world3d-mission small { color: #86a1ba; font-size: 5px; font-weight: 950; letter-spacing: .12em; }
.world3d-mission strong { font-size: 9px; letter-spacing: .04em; }
.world3d-mission b { color: #69f4c0; }
.world3d-mission .timer b { color: #ffd36e; }
.world3d-mission .timer.urgent { border-color: rgba(255,84,126,.8); animation: timer-alert .5s ease-in-out infinite alternate; }
.world3d-mission .timer.urgent b { color: #ff6487; }
.world3d-mission .danger b { color: #ff6487; }
@keyframes timer-alert { to { transform: scale(1.045); box-shadow: 0 0 18px rgba(255,84,126,.35); } }
.world3d-instruction {
  bottom: 14px;
  min-width: 188px;
  padding: 9px 14px;
  text-align: center;
  color: #f8fbff;
  background: rgba(4,13,28,.88);
  font-size: 9px;
  box-shadow: 0 9px 28px rgba(0,0,0,.42), 0 0 0 1px rgba(101,234,255,.42);
  transition: opacity .16s, transform .16s;
}
.world3d-instruction.quiet { opacity: 0; transform: translateX(-50%) translateY(8px); }
.celebration-layer { inset: 70px 7px 55px; border-radius: 23px; }
.statusbar { min-height: 48px; }

@media (max-width: 430px) {
  .world3d-shell,
  .truck-card { height: 100%; min-height: 0; }
  .score-race { grid-template-columns: repeat(3, auto); gap: 5px; }
  .score-race span { min-width: 34px; }
  .score-race strong { font-size: 9px; }
}

@media (max-height: 700px) {
  .app-shell { grid-template-rows: auto minmax(0, 1fr) auto; }
  .truck-card,
  .world3d-shell { height: 100%; min-height: 0; border-radius: 16px; }
  .topbar { min-height: 44px; }
  .brand-mark { width: 34px; height: 34px; flex-basis: 34px; }
  .brand h1 { font-size: 17px; }
  .revenue-card strong { font-size: 15px; }
  .world3d-instruction { bottom: 7px; }
  .world3d-mission { top: 38px; left: 6px; }
  .world3d-mission { gap: 3px; }
  .world3d-mission span { min-width: 69px; padding: 3px 4px; }
  .world3d-mission strong { font-size: 8px; }
  .score-race { padding: 3px 4px; gap: 3px; }
  .score-race small { display: none; }
}
