#hud { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
#hud button, #hud .overlay-panel, #hud .overlay { pointer-events: auto; }
.panel { position: absolute; background: var(--panel); border: 2px solid var(--panel-b); border-radius: 14px; padding: 8px 12px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3); }
.bar { position: relative; height: 16px; background: rgba(0, 0, 0, 0.55); border-radius: 9px; overflow: hidden; border: 2px solid var(--ink); min-width: 130px; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; border-radius: 7px; transition: width 0.2s ease-out; background: var(--green); }
.bar span { position: absolute; inset: 0; text-align: center; font-size: 11px; line-height: 12px; font-weight: 800; text-shadow: 0 1px 2px #000; }
.bar.hp i { background: linear-gradient(#ff8a8a, var(--red)); }
.bar.hull i { background: linear-gradient(#8bf59a, var(--green)); }
.bar.fuel i { background: linear-gradient(#ffe36b, var(--orange)); }
.bar.eng i { background: linear-gradient(#8fe9ff, #3a9bd9); }
.bar.low i { background: #ff3a3a !important; animation: flash 0.5s infinite; }
@keyframes flash { 50% { opacity: 0.45; } }

#route-bar { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: min(46vw, 560px); text-align: center; }
.route-title { font-size: 11px; letter-spacing: 2px; color: #fff; text-shadow: 0 2px 3px #000; font-weight: 800; }
.track { position: relative; height: 16px; margin: 3px 14px; background: rgba(0, 0, 0, 0.55); border: 2px solid var(--ink); border-radius: 9px; }
.track .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, #ffe36b, var(--orange)); border-radius: 7px; }
.track .train-ico { position: absolute; top: -9px; font-size: 22px; transform: translateX(-50%) scaleX(-1); transition: left 0.3s linear; filter: drop-shadow(0 2px 0 #000); }
.track .goal { position: absolute; right: -14px; top: -8px; font-size: 20px; }
#route-marks span { position: absolute; top: -4px; bottom: -4px; width: 4px; background: #fff; border-radius: 2px; transform: translateX(-2px); }
#route-marks span.final { background: var(--red); }
#route-marks span.done { opacity: 0.35; }
.route-sub { font-size: 12px; text-shadow: 0 2px 3px #000; font-weight: 700; }

#panel-player { top: 10px; left: 10px; min-width: 190px; }
.p-name { font-weight: 800; font-size: 15px; margin-bottom: 4px; }
#panel-train { top: 10px; right: 10px; width: 260px; display: flex; flex-direction: column; gap: 5px; }
.row-s { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; }
.stats-line { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; }

#alerts { position: absolute; top: 84px; left: 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; max-width: 330px; }
.alert { padding: 3px 14px; border-radius: 99px; background: rgba(210, 40, 45, 0.9); border: 2px solid var(--ink); font-weight: 800; font-size: 13px; letter-spacing: 0.3px; box-shadow: 0 3px 0 var(--ink); animation: alertIn 0.4s cubic-bezier(.2, 1.6, .4, 1), pulse 1.2s ease-in-out infinite 0.4s; }
.alert.warn { background: rgba(220, 140, 20, 0.92); }
.alert.info { background: rgba(50, 110, 190, 0.92); animation: alertIn 0.4s cubic-bezier(.2, 1.6, .4, 1); }
.alert.out { animation: alertOut 0.3s forwards; }
@keyframes alertIn { from { transform: scale(0.3) translateY(-20px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes alertOut { to { transform: scale(0.6); opacity: 0; } }
@keyframes pulse { 50% { box-shadow: 0 3px 0 var(--ink), 0 0 14px rgba(255,255,255,0.45); } }

#toasts { position: absolute; right: 10px; top: 170px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; max-width: 300px; }
.toast { padding: 6px 12px; border-radius: 10px; background: var(--panel); border-right: 5px solid #8aa0d0; font-size: 13px; font-weight: 700; animation: slideIn 0.3s ease-out, fadeOut 0.5s 3.6s forwards; }
.toast.good { border-color: var(--green); }
.toast.warn { border-color: var(--orange); }
.toast.alert { border-color: var(--red); }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-8px); } }

#prompt { position: absolute; bottom: 128px; left: 50%; transform: translateX(-50%); padding: 7px 18px; border-radius: 12px; background: rgba(255, 255, 255, 0.95); color: var(--ink); border: 3px solid var(--ink); font-weight: 800; font-size: 15px; box-shadow: 0 4px 0 var(--ink); white-space: nowrap; }
#prompt.bad { background: rgba(200, 200, 210, 0.92); color: #55556a; }
#prompt b { background: var(--ink); color: #fff; padding: 0 7px; border-radius: 5px; margin-right: 6px; }

#inventory { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; align-items: flex-end; }
#slot-name { position: absolute; bottom: 82px; width: 100%; text-align: center; font-size: 12px; font-weight: 700; text-shadow: 0 2px 3px #000; }
.slot { position: relative; width: 66px; height: 66px; border-radius: 14px; background: var(--panel); border: 3px solid var(--panel-b); display: flex; align-items: center; justify-content: center; transition: transform 0.12s, border-color 0.12s; }
.slot.sel { border-color: var(--yellow); transform: translateY(-8px) scale(1.08); box-shadow: 0 0 18px rgba(255, 210, 63, 0.5); }
.slot kbd { position: absolute; top: 3px; left: 5px; }
.slot .ico { font-size: 32px; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.5)); }
.slot .qty { position: absolute; right: 6px; bottom: 2px; font-weight: 800; font-size: 14px; text-shadow: 0 2px 2px #000; }
.slot.pop { animation: slotPop 0.3s; }
@keyframes slotPop { 50% { transform: scale(1.25); } }

#hint { position: absolute; bottom: 14px; left: 14px; font-size: 12px; color: #dfe6f5; text-shadow: 0 2px 3px #000; line-height: 1.5; max-width: 260px; transition: opacity 1s; }
#fps { position: absolute; bottom: 4px; right: 8px; font-size: 11px; opacity: 0.7; }

.overlay-panel { position: absolute; background: rgba(20, 22, 38, 0.92); border: 3px solid var(--ink); border-radius: 18px; padding: 14px 18px; box-shadow: 0 6px 0 var(--ink), 0 20px 40px rgba(0, 0, 0, 0.4); animation: pop 0.3s cubic-bezier(.2, 1.5, .4, 1); }
.overlay-panel h2 { margin: 0 0 6px; text-align: center; color: var(--yellow); text-shadow: 0 3px 0 var(--ink); }
#team { top: 50%; left: 50%; transform: translate(-50%, -50%); min-width: 420px; pointer-events: none; }
#team table { width: 100%; border-collapse: collapse; font-size: 14px; }
#team th { text-align: left; color: #9fb0d8; font-size: 12px; }
#team td, #team th { padding: 3px 8px; }
#team .dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); margin-right: 6px; vertical-align: middle; }
#team .evs { margin-top: 8px; font-size: 13px; color: #ffd9a0; }

#station { top: 100px; left: 12px; width: min(520px, calc(100vw - 420px)); min-width: 320px; }
.routes { display: flex; gap: 10px; margin-top: 8px; }
.route { flex: 1; padding: 10px; border-radius: 14px; border: 3px solid var(--ink); background: rgba(255, 255, 255, 0.07); display: flex; flex-direction: column; gap: 6px; }
.route.A { background: rgba(255, 120, 60, 0.15); }
.route.B { background: rgba(80, 200, 120, 0.15); }
.route.chosen { outline: 4px solid var(--yellow); }
.route h3 { margin: 0; font-size: 14px; }
.route ul { margin: 0; padding-left: 18px; font-size: 12px; flex: 1; }
.route .votes { font-size: 12px; color: #ffd9a0; }
#station.mini { top: 100px; left: 12px; transform: none; width: 280px; }

#upgrades { top: 150px; right: 12px; width: 380px; max-width: calc(100vw - 24px); max-height: calc(100vh - 270px); overflow-y: auto; }
.up-head { display: flex; justify-content: space-between; align-items: center; }
.up-head h2 { margin: 0; }
.up-scrap { margin: 4px 0 8px; font-size: 15px; font-weight: 800; }
.upg { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; padding: 4px 0; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.upg .ic { font-size: 26px; text-align: center; }
.upg .nm { font-weight: 800; font-size: 14px; }
.upg .ds { font-size: 11px; color: #aab6d0; }
.pips { display: flex; gap: 3px; margin-top: 2px; }
.pips i { width: 14px; height: 6px; border-radius: 3px; background: #3a4058; }
.pips i.on { background: var(--yellow); }

.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(8, 10, 20, 0.6); z-index: 20; }
.end-stats { display: grid; grid-template-columns: 1fr auto; gap: 4px 20px; font-size: 16px; padding: 8px 14px; background: rgba(255, 255, 255, 0.07); border-radius: 12px; }
.end-stats b { text-align: right; color: var(--yellow); }
#end-title { margin: 0; text-align: center; font-size: 46px; text-shadow: 0 4px 0 var(--ink); animation: bob 2s infinite; }
#end-card.win #end-title { color: var(--green); }
#end-card.lose #end-title { color: var(--red); }
@media (max-width: 900px) {
  #panel-train { width: 200px; } .row-s { grid-template-columns: 70px 1fr; }
  #route-bar { width: 40vw; } #hint { display: none; }
}
@media (max-height: 640px) { #alerts { top: 70px; } .slot { width: 54px; height: 54px; } .slot .ico { font-size: 26px; } #slot-name { bottom: 66px; } #prompt { bottom: 100px; } }

.up-sec { margin: 8px 0 2px; font-size: 13px; color: var(--yellow); letter-spacing: 0.5px; }
#tip { position: absolute; top: 104px; left: 50%; transform: translateX(-50%); max-width: min(460px, 90vw); padding: 6px 16px 6px 12px; border-radius: 99px; background: rgba(255, 248, 214, 0.97); color: var(--ink); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); font-weight: 800; font-size: 14px; display: flex; gap: 8px; align-items: center; animation: alertIn 0.4s cubic-bezier(.2, 1.6, .4, 1); }
#tip .ti { font-size: 20px; }
#tip b { background: var(--ink); color: #fff; padding: 0 6px; border-radius: 5px; font-size: 12px; margin: 0 1px; }

.alert { display: flex; align-items: center; gap: 7px; font-size: 14px; padding: 4px 14px 4px 10px; }
.alert .svg-ic { width: 18px; height: 18px; }
.toast { display: flex; align-items: center; gap: 8px; }
.toast .svg-ic { flex: none; }
.slot .ico .svg-ic { width: 38px; height: 38px; filter: drop-shadow(0 2px 0 rgba(0,0,0,.5)); }
.upg .ic .svg-ic { width: 30px; height: 30px; }
.up-sec { display: flex; align-items: center; gap: 6px; }
.btn .svg-ic { width: 16px; height: 16px; vertical-align: -3px; }
.bar { height: 20px; } .bar span { font-size: 12px; line-height: 16px; }
.row-s { font-size: 13px; } .row-s span { display: flex; align-items: center; gap: 5px; }
.stats-line span { display: inline-flex; align-items: center; gap: 5px; }
.track .train-ico .svg-ic, .track .goal .svg-ic { width: 26px; height: 26px; filter: drop-shadow(0 2px 0 rgba(0,0,0,.6)); }
.track .train-ico { top: -10px; transform: translateX(-50%); }
.track .goal { right: -16px; top: -10px; }
#tip .ti .svg-ic { width: 24px; height: 24px; }
#hint { background: rgba(20, 22, 38, 0.7); padding: 8px 12px; border-radius: 12px; font-size: 13px; }
#prompt { font-size: 18px; padding: 9px 22px; bottom: 132px; }
#slot-name { font-size: 14px; }
.hy { }
#banner { position: absolute; top: 28%; left: 50%; transform: translateX(-50%); padding: 18px 34px; border-radius: 20px; background: rgba(255, 210, 63, 0.97); color: var(--ink); border: 4px solid var(--ink); box-shadow: 0 8px 0 var(--ink), 0 0 40px rgba(255, 210, 63, 0.6); text-align: center; animation: bannerIn 0.5s cubic-bezier(.2, 1.7, .4, 1); z-index: 8; }
#banner .bn-title { font-size: 30px; font-weight: 900; letter-spacing: 1px; display: flex; align-items: center; gap: 10px; justify-content: center; }
#banner .bn-title .svg-ic { width: 34px; height: 34px; }
#banner .bn-line { font-size: 24px; font-weight: 800; margin-top: 6px; display: flex; align-items: center; gap: 8px; justify-content: center; }
#banner .bn-line .svg-ic { width: 26px; height: 26px; }
@keyframes bannerIn { from { transform: translateX(-50%) scale(0.4); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
#hud-hp-fill.hit { animation: hpHit 0.4s; }
.svg-ic.mono { object-fit: initial; }
.upg .ic .svg-ic.mono { color: var(--yellow); }
.up-sec .svg-ic.mono { color: var(--yellow); }
.toast.good .svg-ic.mono { color: var(--green); }
#tip .ti .svg-ic.mono { color: var(--ink); }
.btn .svg-ic.mono { width: 16px; height: 16px; vertical-align: -3px; }
.stats-line .svg-ic.mono { color: #cfe0ff; }
#toasts { top: auto; bottom: 18px; right: 10px; flex-direction: column-reverse; }
#mates { top: 150px; right: 10px; width: 260px; display: flex; flex-direction: column; gap: 5px; padding: 8px 10px; }
.mate { display: grid; grid-template-columns: 14px 1fr 112px; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.mate .dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); }
.mate .mn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mbar { position: relative; height: 16px; background: rgba(0, 0, 0, 0.6); border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; }
.mbar i { position: absolute; left: 0; top: 0; bottom: 0; transition: width 0.2s; }
.mbar b { position: absolute; inset: 0; text-align: center; font-size: 11px; line-height: 12px; text-shadow: 0 1px 2px #000; }
.up-head2 { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; font-weight: 800; font-size: 14px; color: var(--yellow); }
.cards { display: flex; gap: 8px; margin-top: 8px; }
.card { flex: 1; cursor: pointer; padding: 8px 6px 10px; border-radius: 14px; border: 3px solid var(--ink); background: #2a3050; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 3px; font-family: inherit; transition: transform 0.12s; }
.card:hover { transform: translateY(-4px) scale(1.03); filter: brightness(1.12); }
.card.perso { background: #44305e; } .card.train { background: #2c4a5a; }
.card .tag { font-size: 10px; letter-spacing: 1px; font-weight: 800; opacity: 0.85; }
.card .ci .svg-ic { width: 34px; height: 34px; } .card .ci .svg-ic.mono { color: var(--yellow); }
.card .cn { font-weight: 800; font-size: 13px; text-align: center; } .card .cd { font-size: 11px; opacity: 0.8; text-align: center; min-height: 28px; } .card .cl { font-size: 12px; color: var(--yellow); font-weight: 800; }
#chat { position: absolute; left: 14px; bottom: 140px; width: min(380px, 40vw); pointer-events: none; }
#chat-log { max-height: 150px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; }
.cmsg { padding: 3px 9px; border-radius: 8px; background: rgba(20, 22, 38, 0.72); font-size: 13px; line-height: 1.3; word-break: break-word; transition: opacity 1s; }
.cmsg.old { opacity: 0; }
#chat.typing { pointer-events: auto; }
#chat.typing .cmsg.old { opacity: 1; }
#chat.typing #chat-log { overflow-y: auto; max-height: 220px; }
#chat-input { width: 100%; margin-top: 6px; padding: 8px 12px; border-radius: 10px; border: 3px solid var(--ink); background: #fff; color: var(--ink); font-size: 14px; outline: none; pointer-events: auto; }
#upgrades { top: 150px; right: 12px; width: 380px; max-width: calc(100vw - 24px); max-height: calc(100vh - 270px); overflow-y: auto; }
.up-head { display: flex; justify-content: space-between; align-items: center; }
.up-head h2 { margin: 0; }
.up-scrap { margin: 4px 0 8px; font-size: 15px; font-weight: 800; }
#banner .bn-line.sm { font-size: 16px; font-weight: 700; text-align: left; }
#banner .bn-title { font-size: 24px; }

.card.mine { outline: 3px solid var(--yellow); }
.card.chosen { outline: 4px solid var(--green); }
.card:disabled { cursor: default; }
.card:disabled:hover { transform: none; filter: none; }

#rm-chips { display: flex; gap: 6px; justify-content: center; margin-top: 3px; flex-wrap: wrap; }
.chip { font-size: 11px; font-weight: 800; padding: 1px 9px; border-radius: 99px; background: rgba(120, 90, 200, 0.85); border: 2px solid var(--ink); text-shadow: 0 1px 2px #000; pointer-events: auto; cursor: help; }
#banner.intro { top: 18%; max-width: min(720px, 92vw); text-align: left; }
#banner.intro .bn-title { font-size: 22px; justify-content: center; margin-bottom: 8px; }
.rm { margin-top: 8px; padding-top: 6px; border-top: 2px solid rgba(20, 20, 28, 0.25); }
.rm .rn { font-size: 19px; font-weight: 900; }
.rm .ru { font-size: 14px; font-weight: 700; color: #0d5a1f; }
.rm .rd { font-size: 14px; font-weight: 700; color: #8a1a1a; }

.p-score { font-size: 13px; font-weight: 800; color: var(--yellow); margin-bottom: 3px; }
#route-title b { color: var(--yellow); }

#boss-bar { position: absolute; top: 96px; left: 50%; transform: translateX(-50%); width: min(520px, 44vw); text-align: center; }
#boss-bar .bn { font-weight: 900; letter-spacing: 1px; font-size: 15px; color: #ffb0b0; text-shadow: 0 2px 3px #000; }
#boss-bar .bbar { height: 16px; border: 3px solid var(--ink); border-radius: 10px; background: rgba(0,0,0,0.7); overflow: hidden; margin-top: 2px; }
#boss-bar .bbar i { display: block; height: 100%; background: linear-gradient(#ff8a8a, #d02a3a); transition: width 0.2s; }
#tip { top: 140px; }

.chip.pact { background: rgba(190, 50, 60, 0.9); }
.chip.relic { background: rgba(200, 150, 20, 0.92); color: #1a1204; text-shadow: none; }
.up-head2.pact { color: #ff9a9a; }
.card.pact { background: #4a2a30; } .card .cd.good { color: #8bf59a; } .card .cd.bad { color: #ff9a9a; }
.pips { flex-wrap: wrap; max-width: 150px; }

.end-stats .rec { color: var(--yellow); font-weight: 800; padding-top: 4px; } .end-stats .rec.unl { color: #8bf59a; }
#station { max-height: calc(100vh - 120px); overflow-y: auto; }

#shop { top: 150px; right: 12px; width: 400px; max-width: calc(100vw - 24px); max-height: calc(100vh - 270px); overflow-y: auto; }
.shop-sec { margin: 8px 0 2px; font-size: 13px; color: var(--yellow); display: flex; align-items: center; gap: 6px; font-weight: 800; }
.shi { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; padding: 4px 0; border-top: 1px solid rgba(255,255,255,0.1); }
.shi .ic .svg-ic { width: 30px; height: 30px; }
.shi .nm { font-weight: 800; font-size: 14px; } .shi .ds { font-size: 11px; color: #aab6d0; }
.shi.owned .nm { color: #8bf59a; }
#minimap { position: absolute; bottom: 14px; right: 12px; width: 260px; height: 70px; background: rgba(20,22,38,0.8); border: 2px solid var(--panel-b); border-radius: 12px; }
#hud-shield { color: #8fe9ff; }
#minimap { left: 14px; right: auto; bottom: 150px; }
#chat { bottom: 232px; }

/* ===== colonnes : plus aucun panneau ne se chevauche, la hauteur s'adapte au contenu ===== */
.col { position: absolute; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.col > * { pointer-events: auto; }
#col-left { top: 10px; left: 10px; width: 330px; max-height: calc(100vh - 20px); }
#col-right { top: 10px; right: 10px; width: 270px; align-items: stretch; }
#col-center { top: 10px; left: 50%; transform: translateX(-50%); width: min(46vw, 560px); align-items: center; }
#col-bl { bottom: 14px; left: 14px; width: min(380px, 40vw); flex-direction: column; align-items: flex-start; justify-content: flex-end; }
#col-left > *, #col-right > *, #col-center > *, #col-bl > * { position: relative !important; top: auto !important; left: auto !important; right: auto !important; bottom: auto !important; transform: none !important; }
#col-left #panel-player { width: 100%; min-width: 0; }
#col-left #alerts { max-width: 100%; }
#col-right #panel-train, #col-right #mates { width: 100%; }
#col-center #route-bar { width: 100%; }
#col-center #boss-bar { width: 100%; }
#col-center #tip { max-width: 100%; }
#col-bl #chat { width: 100%; }
#col-bl #minimap { align-self: flex-start; }
#col-bl #hint { max-width: 100%; }
#toasts { bottom: 18px; top: auto; right: 10px; max-width: 280px; }
#upgrades, #shop { top: var(--rtop, 150px) !important; right: 12px; max-height: calc(100vh - var(--rtop, 150px) - 250px); }
#station { top: var(--ltop, 100px) !important; left: 12px; max-height: calc(100vh - var(--ltop, 100px) - 130px); }
#banner.intro { top: 24%; }
@media (max-width: 1000px) { #col-left { width: 250px; } #col-right { width: 220px; } }

.chip.threat { background: rgba(214, 64, 47, 0.95); }
#boss-bar .bbar + .bn { margin-top: 6px; }

/* ===== v2.6 : HUD aux couleurs du jeu (contours épais, ombres dures, dégradés pastel, autocollants) ===== */
:root { --card-a: #2b3568; --card-b: #1b2142; --card-edge: rgba(255, 255, 255, 0.2); }
#hud { font-weight: 700; }
.panel, #route-bar, #hint, #mates, #minimap, .overlay-panel {
  background: linear-gradient(180deg, var(--card-a), var(--card-b));
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 5px 0 var(--ink), inset 0 2px 0 var(--card-edge), inset 0 -10px 18px rgba(0, 0, 0, 0.18);
}
.panel { padding: 9px 12px; }
#route-bar { padding: 6px 14px 7px; border-radius: 18px; }
.route-title { font-size: 12px; letter-spacing: 2px; text-shadow: 0 2px 0 var(--ink); }
.route-title b { font-size: 16px; padding: 0 7px; margin: 0 3px; border-radius: 8px; background: var(--yellow); color: var(--ink); text-shadow: none; border: 2px solid var(--ink); }
.track { height: 20px; border: 3px solid var(--ink); background: #0f1226; box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.4); }
.track .fill { box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2), inset 0 3px 0 rgba(255, 255, 255, 0.35); }
.route-sub { text-shadow: 0 2px 0 var(--ink); }
.p-name { font-size: 16px; text-shadow: 0 2px 0 var(--ink); margin-bottom: 5px; }
.p-score { text-shadow: 0 2px 0 var(--ink); }
.bar { height: 22px; border: 3px solid var(--ink); border-radius: 12px; background: #0f1226; box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.4); min-width: 120px; }
.bar i { border-radius: 7px; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.22); }
.bar i::after { content: ''; position: absolute; left: 5px; right: 5px; top: 2px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.42); }
.bar span { font-size: 12px; font-weight: 900; line-height: 16px; letter-spacing: 0.3px; text-shadow: 0 0 3px #000, 1px 1px 0 #000, -1px 1px 0 #000; }
.row-s { font-size: 13px; text-shadow: 0 2px 0 var(--ink); }
.stats-line { text-shadow: 0 2px 0 var(--ink); font-weight: 900; }
.slot { width: 70px; height: 70px; border: 3px solid var(--ink); border-radius: 16px; background: linear-gradient(180deg, var(--card-a), var(--card-b)); box-shadow: 0 5px 0 var(--ink), inset 0 2px 0 var(--card-edge); }
.slot.sel { border-color: var(--ink); background: linear-gradient(180deg, #5a4a1a, #3a3010); box-shadow: 0 5px 0 var(--ink), 0 0 0 4px var(--yellow), 0 0 22px rgba(255, 210, 63, 0.6); transform: translateY(-9px) scale(1.06); }
.slot kbd { background: var(--yellow); color: var(--ink); border: 2px solid var(--ink); border-radius: 6px; font-weight: 900; top: -6px; left: -6px; padding: 0 6px; font-size: 12px; }
.slot .qty { font-size: 15px; font-weight: 900; text-shadow: 0 2px 0 var(--ink), 0 0 4px #000; color: #fff; }
#slot-name { font-weight: 900; text-shadow: 0 2px 0 var(--ink), 0 0 4px #000; font-size: 14px; }
#prompt { border-width: 3px; border-radius: 14px; box-shadow: 0 5px 0 var(--ink), inset 0 -4px 0 rgba(0, 0, 0, 0.1); }
#prompt b { background: var(--yellow); color: var(--ink); border: 2px solid var(--ink); border-radius: 7px; padding: 0 8px; box-shadow: 0 2px 0 var(--ink); }
.alert { border-width: 3px; box-shadow: 0 4px 0 var(--ink), inset 0 2px 0 rgba(255, 255, 255, 0.25); font-weight: 900; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45); }
.toast { background: linear-gradient(180deg, var(--card-a), var(--card-b)); border: 3px solid var(--ink); border-right-width: 8px; border-radius: 12px; box-shadow: 0 4px 0 var(--ink); text-shadow: 0 2px 0 var(--ink); font-weight: 800; }
.cmsg { background: linear-gradient(180deg, var(--card-a), var(--card-b)); border: 2px solid var(--ink); border-radius: 10px; box-shadow: 0 3px 0 var(--ink); text-shadow: 0 1px 0 var(--ink); }
#chat-input { border-width: 3px; border-radius: 12px; box-shadow: 0 4px 0 var(--ink); }
#hint { padding: 9px 13px; text-shadow: 0 2px 0 var(--ink); font-weight: 800; font-size: 13px; background: linear-gradient(180deg, rgba(43,53,104,0.9), rgba(27,33,66,0.9)); }
#hint b { color: var(--yellow); }
#tip { border-width: 3px; box-shadow: 0 5px 0 var(--ink), inset 0 -4px 0 rgba(0, 0, 0, 0.08); font-weight: 900; }
#minimap { border-radius: 14px; padding: 0; }
.mate { text-shadow: 0 2px 0 var(--ink); }
.mbar { border: 3px solid var(--ink); border-radius: 9px; height: 18px; background: #0f1226; box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.4); }
.mbar b { font-weight: 900; text-shadow: 0 0 3px #000, 1px 1px 0 #000; line-height: 14px; }
.mate .dot { border-width: 3px; }
.chip { border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink); font-weight: 900; font-size: 12px; padding: 0 10px; }
.overlay-panel h2, .up-head h2 { text-shadow: 0 3px 0 var(--ink); letter-spacing: 1px; }
.card { border-width: 3px; box-shadow: 0 5px 0 var(--ink), inset 0 2px 0 rgba(255, 255, 255, 0.18); }
.card:hover:not(:disabled) { transform: translateY(-5px); }
.route { border-width: 3px; box-shadow: 0 5px 0 var(--ink), inset 0 2px 0 rgba(255, 255, 255, 0.15); }
.upg, .shi { border-top: 2px dashed rgba(255, 255, 255, 0.14); }
#boss-bar .bn { text-shadow: 0 2px 0 var(--ink); font-size: 16px; letter-spacing: 1.5px; }
#boss-bar .bbar { height: 20px; border-width: 3px; box-shadow: 0 4px 0 var(--ink), inset 0 3px 0 rgba(0, 0, 0, 0.4); background: #0f1226; }
#boss-bar .bbar i { box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.22), inset 0 3px 0 rgba(255, 255, 255, 0.3); }
#banner { border-width: 4px; }
#route-title b { color: var(--ink) !important; }

/* ===== panneau des ressources (haut gauche) : gros chiffres lisibles ===== */
#panel-res { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 8px 8px; }
.res { position: relative; display: flex; align-items: center; gap: 7px; padding: 4px 8px 4px 5px; border-radius: 12px; background: rgba(0, 0, 0, 0.28); border: 2px solid var(--ink); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.1); transition: background 0.25s; min-width: 0; }
.res .svg-ic { width: 30px; height: 30px; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.5)); }
.res .rv { display: flex; flex-direction: column; line-height: 1; min-width: 0; }
.res b { font-size: 22px; font-weight: 900; text-shadow: 0 2px 0 var(--ink); font-variant-numeric: tabular-nums; }
.res small { font-size: 9px; letter-spacing: 1px; color: #aebbe0; font-weight: 800; margin-top: 2px; text-shadow: 0 1px 0 var(--ink); }
.res.up { animation: resUp 0.7s ease-out; } .res.down { animation: resDown 0.7s ease-out; }
@keyframes resUp { 0% { background: rgba(76, 217, 100, 0.65); transform: scale(1.08); } 100% { background: rgba(0, 0, 0, 0.28); transform: none; } }
@keyframes resDown { 0% { background: rgba(255, 90, 95, 0.65); } 100% { background: rgba(0, 0, 0, 0.28); } }
.rdelta { position: absolute; right: 4px; top: -10px; font-size: 14px; font-weight: 900; text-shadow: 0 2px 0 var(--ink), 0 0 4px #000; animation: rdFloat 0.9s ease-out forwards; pointer-events: none; }
.rdelta.up { color: #8bf59a; } .rdelta.down { color: #ff8a8a; }
@keyframes rdFloat { from { opacity: 1; transform: translateY(8px); } to { opacity: 0; transform: translateY(-14px); } }

.res b { font-size: 24px; }
.res .rv { justify-content: center; }

/* écran de fin : cartes */
#end-card { width: min(94vw, 860px); max-height: 94vh; overflow-y: auto; }
.end-hero { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 8px 0 12px; }
.hc { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px 10px; border: 3px solid var(--ink); border-radius: 16px; box-shadow: 0 5px 0 var(--ink); animation: cardIn 0.5s cubic-bezier(.2,1.4,.3,1) both; animation-delay: calc(var(--n) * 0.09s); }
.hc.a { background: linear-gradient(#4a78e8, #2f55b8); } .hc.b { background: linear-gradient(#e8a93a, #b57a14); } .hc.c { background: linear-gradient(#3fb36b, #25804a); }
.hc .svg-ic { width: 30px; height: 30px; margin-bottom: 2px; filter: drop-shadow(0 2px 0 rgba(0,0,0,.35)); }
.hc b { font-size: 32px; line-height: 1.1; color: #fff; text-shadow: 0 3px 0 var(--ink); }
.hc span { font-size: 12px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: rgba(255,255,255,.85); }
.end-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
@media (max-width: 760px) { .end-cols { grid-template-columns: 1fr; } .end-hero b { font-size: 24px; } }
.ecard { background: rgba(255,255,255,.07); border: 3px solid var(--ink); border-radius: 16px; padding: 10px 14px 12px; box-shadow: 0 4px 0 var(--ink); animation: cardIn 0.5s 0.3s cubic-bezier(.2,1.4,.3,1) both; }
.ecard h3 { margin: 0 0 8px; font-size: 12px; letter-spacing: 2px; color: #aab6d0; }
.ecard p { margin: 3px 0; font-size: 14px; font-weight: 700; } .ecard p.good { color: #8bf59a; } .ecard p.dim, .dim { color: #aab6d0; }
.end-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0; background: none; }
.st { display: flex; flex-direction: column; align-items: center; gap: 1px; background: #232b4a; border: 2px solid var(--ink); border-radius: 12px; padding: 8px 4px; animation: cardIn 0.4s cubic-bezier(.2,1.4,.3,1) both; animation-delay: calc(0.35s + var(--n) * 0.06s); }
.st .svg-ic { width: 22px; height: 22px; } .st b { font-size: 20px; color: var(--yellow); text-shadow: 0 2px 0 var(--ink); } .st span { font-size: 10px; font-weight: 800; color: #aab6d0; text-align: center; line-height: 1.1; }
.end-rew { display: flex; flex-direction: column; gap: 12px; }
.ecard.rew { background: linear-gradient(160deg, rgba(255,210,63,.16), rgba(255,255,255,.05)); border-color: #7a5d12; box-shadow: 0 4px 0 var(--ink), 0 0 24px rgba(255,210,63,.18); }
.rew-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rtile { position: relative; display: flex; flex-direction: column; align-items: center; padding: 8px 4px 6px; border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 4px 0 var(--ink); overflow: hidden; }
.rtile.xp { background: linear-gradient(#5a8cff, #2f55b8); } .rtile.cr { background: linear-gradient(#ffd23f, #c8901a); }
.rtile::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.35) 50%, transparent 65%); transform: translateX(-120%); animation: shine 2.6s 1s infinite; }
.rtile .rl { font-size: 10px; font-weight: 900; letter-spacing: 2px; color: rgba(255,255,255,.85); } .rtile.cr .rl { color: rgba(40,25,0,.75); }
.rtile b { font-size: 34px; line-height: 1.1; color: #fff; text-shadow: 0 3px 0 var(--ink); } .rtile.cr b { color: #fff8d6; }
.rtile .ru { font-weight: 900; font-size: 13px; color: #fff; display: flex; align-items: center; gap: 4px; } .rtile .ru .svg-ic { width: 18px; height: 18px; }
@keyframes shine { to { transform: translateX(120%); } }
.lv-row { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
.lv-badge { flex: none; width: 54px; height: 54px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #8bf59a, #2f9a4a); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.lv-badge small { font-size: 9px; font-weight: 900; letter-spacing: 1px; color: rgba(0,0,0,.55); } .lv-badge b { font-size: 22px; color: #fff; text-shadow: 0 2px 0 var(--ink); }
.lv-badge.up { animation: bob 1s infinite; box-shadow: 0 4px 0 var(--ink), 0 0 18px #8bf59a; }
.lv-main { flex: 1; display: flex; flex-direction: column; gap: 4px; } .lv-main span { font-size: 12px; font-weight: 700; color: #aab6d0; }
.lvbar { display: block; margin: 0; } .lvbar > div { height: 14px; background: #121830; border: 3px solid var(--ink); border-radius: 8px; overflow: hidden; }
.lvbar i { display: block; height: 100%; background: linear-gradient(90deg, #4cd964, #b6f06a); transition: width 1.1s cubic-bezier(.2,.8,.2,1) 0.5s; }
.lvup { margin: 10px 0 0; padding: 6px 10px; border-radius: 10px; background: rgba(139,245,154,.15); color: #8bf59a !important; font-size: 13px !important; font-weight: 900 !important; text-align: center; }
.ecard.rec p { display: flex; align-items: center; gap: 6px; }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px) scale(.94); } to { opacity: 1; transform: none; } }
#end { background: rgba(6, 8, 16, 0.86); }
#end-card { background: #1b2238; }

/* liste d'amis (ouverte depuis le menu pause) */
#ig-friends { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 400px; max-width: calc(100vw - 28px); max-height: 70vh; overflow-y: auto; padding: 12px 16px 14px; border-radius: 18px; background: rgba(20, 24, 48, 0.98); border: 3px solid var(--ink); box-shadow: 0 6px 0 var(--ink), 0 0 0 100vmax rgba(0,0,0,.35); z-index: 40; }
#ig-friends .fr-head { display: flex; justify-content: space-between; align-items: center; } #ig-friends h3 { margin: 0; letter-spacing: 2px; }
#ig-friends .fr-msg { margin: 4px 0; font-size: 12px; color: #ffd9a0; min-height: 14px; }
