* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; font-family: 'Segoe UI', Roboto, Arial, sans-serif; color: #fff; user-select: none; }
canvas#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
.k { display: inline-block; min-width: 18px; padding: 0 5px; margin: 1px; border: 1px solid #ffffff66; border-radius: 4px; background: #0008; font-size: 11px; font-weight: 700; text-align: center; }
:root { --gold: #ffc531; --green: #7ee07e; --red: #e8473c; --blue: #4fa3ff; --title: Impact, 'Arial Black', 'Haettenschweiler', sans-serif; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; }
#topright { position: absolute; top: 18px; right: 26px; text-align: right; font-family: var(--title); text-shadow: 2px 2px 0 #000, -1px -1px 0 #000; }
#clock { font-size: 20px; color: #fff; letter-spacing: 1px; }
#money { font-size: 40px; color: var(--green); letter-spacing: 1px; }
#rep { margin-top: 2px; font-size: 16px; color: var(--gold); letter-spacing: 2px; }
#rep .bar { width: 170px; height: 7px; margin: 4px 0 0 auto; background: #0009; border: 1px solid #000; }
#rep .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ff9d00, var(--gold)); transition: width .4s; }
#minimapWrap { position: absolute; left: 24px; bottom: 22px; width: 220px; }
#minimap { width: 220px; height: 220px; border-radius: 50%; border: 4px solid #000a; box-shadow: 0 0 0 2px #fff3, 0 6px 20px #0008; background: #223; }
#bars { margin-top: 6px; display: flex; gap: 4px; }
#hpbar { flex: 1; height: 10px; background: #2a0b0b; border: 2px solid #000a; }
#hpbar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #3bbf4a, #74e07a); transition: width .2s; }
#hpbar.low i { background: linear-gradient(90deg, #c22, #f55); }
#pname { margin-top: 3px; font-family: var(--title); font-size: 15px; letter-spacing: 2px; text-shadow: 2px 2px 0 #000; }
#chapterTag { position: absolute; top: 18px; left: 24px; font-family: var(--title); font-size: 14px; letter-spacing: 3px; color: #fffc; text-shadow: 2px 2px 0 #000; }
#objective { position: absolute; left: 50%; bottom: 64px; transform: translateX(-50%); max-width: 70%; text-align: center; font-size: 19px; font-weight: 600; text-shadow: 2px 2px 2px #000, 0 0 6px #000; }
#objective b { color: var(--gold); }
#notifs { position: absolute; top: 60px; left: 24px; width: 340px; display: flex; flex-direction: column; gap: 8px; }
.notif { background: #000c; border-left: 4px solid var(--gold); padding: 10px 14px; font-size: 14px; line-height: 1.4; animation: slideIn .3s ease-out; }
.notif.out { opacity: 0; transition: opacity .5s; }
@keyframes slideIn { from { transform: translateX(-30px); opacity: 0; } }
#prompt { position: absolute; left: 50%; top: 62%; transform: translateX(-50%); background: #000b; padding: 8px 16px; border-radius: 4px; font-size: 16px; font-weight: 600; display: none; }
#prompt .k { font-size: 14px; background: var(--gold); color: #000; border: none; }
#help { position: absolute; top: 50px; right: 26px; margin-top: 110px; background: #0007; padding: 10px 12px; font-size: 12px; line-height: 1.9; text-align: right; border-radius: 4px; }
#enemyBars { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; }
.ebar { width: 340px; font-family: var(--title); font-size: 15px; letter-spacing: 2px; text-shadow: 2px 2px 0 #000; }
.ebar div { height: 10px; background: #300; border: 2px solid #000; margin-top: 2px; }
.ebar i { display: block; height: 100%; background: linear-gradient(90deg, #d82020, #ff6a3a); transition: width .15s; }
#challenge { position: absolute; top: 90px; left: 50%; transform: translateX(-50%); font-family: var(--title); font-size: 34px; letter-spacing: 2px; text-align: center; text-shadow: 3px 3px 0 #000; }
#challenge small { display: block; font-size: 15px; color: var(--gold); }
#meter { position: absolute; left: 50%; top: 50%; transform: translate(80px, -60px); width: 18px; height: 140px; background: #000a; border: 2px solid #fff8; }
#meter .zone { position: absolute; left: 0; right: 0; bottom: 70%; height: 16%; background: #3c3c; }
#meter i { position: absolute; left: -4px; right: -4px; height: 4px; background: #fff; bottom: 0; box-shadow: 0 0 6px #fff; }
#labels { position: absolute; inset: 0; overflow: hidden; }
.label { position: absolute; transform: translate(-50%, -100%); font-family: var(--title); font-size: 15px; letter-spacing: 1px; text-shadow: 0 0 3px #000, 1px 1px 0 #000, -1px -1px 0 #000; white-space: nowrap; text-align: center; display: flex; flex-direction: column; align-items: center; }
.label .mk { display: block; font-size: 26px; color: var(--gold); line-height: 1; animation: bob 1s infinite alternate; }
.label .mk.blue { color: var(--blue); }
@keyframes bob { to { transform: translateY(-6px); } }
.float { position: absolute; transform: translate(-50%, -50%); font-family: var(--title); font-size: 22px; text-shadow: 2px 2px 0 #000; pointer-events: none; }
.bubble { position: relative; margin-bottom: 9px; background: rgba(255, 255, 255, 0.97); color: #1a1a1a; padding: 7px 12px; border-radius: 12px; font-family: 'Segoe UI', Roboto, Arial, sans-serif; font-size: 14px; font-weight: 600; line-height: 1.35; letter-spacing: 0; text-shadow: none; white-space: normal; overflow-wrap: break-word; width: max-content; max-width: 260px; text-align: center; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45); }
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); border: 7px solid transparent; border-top-color: rgba(255, 255, 255, 0.97); border-bottom: 0; }
#phone { position: absolute; right: 26px; bottom: 30px; width: 300px; background: linear-gradient(#1d2433, #101521); border-radius: 18px; border: 3px solid #333; padding: 14px; box-shadow: 0 10px 30px #000a; animation: phoneIn .35s ease-out; }
#phone .from { font-weight: 700; color: var(--green); font-size: 13px; margin-bottom: 6px; }
#phone .msg { background: #2b3448; padding: 10px; border-radius: 12px 12px 12px 2px; font-size: 14px; line-height: 1.4; }
@keyframes phoneIn { from { transform: translateY(60px); opacity: 0; } }

/* ---------- Dialogue ---------- */
#dialogue { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); width: min(820px, 92vw); max-height: 45vh; overflow-y: auto; background: linear-gradient(rgba(8, 10, 16, 0.94), rgba(4, 5, 8, 0.97)); border: 1px solid #ffffff22; border-top: 3px solid var(--gold); padding: 16px 22px 14px; border-radius: 4px; box-shadow: 0 10px 40px #000a; }
#dialogue .who { font-family: var(--title); font-size: 20px; letter-spacing: 2px; margin-bottom: 6px; }
#dialogue .text { font-size: 19px; line-height: 1.55; min-height: 58px; overflow-wrap: break-word; }
#dialogue .choices { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
#dialogue .choices button { text-align: left; background: #ffffff10; border: 1px solid #ffffff25; color: #fff; padding: 8px 12px; font-size: 16px; cursor: pointer; border-radius: 3px; }
#dialogue .choices button.sel, #dialogue .choices button:hover { background: var(--gold); color: #000; }
#dialogue .next { position: absolute; right: 14px; bottom: 8px; font-size: 12px; color: #fff8; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }

/* ---------- Bannières ---------- */
#banner { position: fixed; top: 32%; left: 0; right: 0; text-align: center; pointer-events: none; animation: bannerIn .5s ease-out; }
#banner h1 { margin: 0; font-family: var(--title); font-size: 74px; letter-spacing: 3px; color: var(--gold); text-shadow: 4px 4px 0 #000, -2px -2px 0 #000; font-style: italic; }
#banner.fail h1 { color: var(--red); }
#banner h2 { margin: 4px 0; font-size: 22px; text-shadow: 2px 2px 0 #000; }
#banner p { margin: 6px 0 0; font-family: var(--title); font-size: 26px; color: var(--green); text-shadow: 2px 2px 0 #000; letter-spacing: 1px; }
@keyframes bannerIn { from { transform: scale(1.6); opacity: 0; } }
#chapter { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(#000a, #000e); pointer-events: none; animation: fadeIn .8s; }
#chapter small { font-family: var(--title); letter-spacing: 8px; font-size: 22px; color: var(--gold); }
#chapter h1 { margin: 8px 0 0; font-family: var(--title); font-size: 80px; letter-spacing: 4px; text-shadow: 4px 4px 0 #000; }
@keyframes fadeIn { from { opacity: 0; } }
#fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .6s; }

/* ---------- Écran titre ---------- */
#title { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(90deg, #000c, #0003 60%, #0000); }
#title .logo { font-family: var(--title); font-size: 140px; line-height: .9; letter-spacing: 4px; text-shadow: 6px 6px 0 #000; transform: rotate(-4deg); }
#title .gz { color: var(--gold); margin-right: 18px; -webkit-text-stroke: 3px #000; }
#title .world { color: #fff; -webkit-text-stroke: 3px #000; }
#title .sub { margin-top: 18px; font-family: var(--title); letter-spacing: 9px; font-size: 22px; color: #ffe; text-shadow: 2px 2px 0 #000; }
#title .menu { margin-top: 50px; display: flex; flex-direction: column; gap: 12px; }
#title button, .big, #pause .tabs button, #shopClose, #note button { font-family: var(--title); font-size: 26px; letter-spacing: 2px; padding: 10px 40px; background: #000c; color: #fff; border: 2px solid #fff4; cursor: pointer; transition: all .15s; }
#title button:hover, .big:hover, #shopClose:hover, #note button:hover { background: var(--gold); color: #000; border-color: var(--gold); transform: scale(1.04); }
#title .foot { position: absolute; bottom: 20px; font-size: 13px; color: #fff9; }
#loading { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: #000; font-family: var(--title); font-size: 30px; letter-spacing: 3px; color: var(--gold); }

/* ---------- Créateur ---------- */
#creator { position: fixed; inset: 0; background: radial-gradient(circle at 35% 50%, #3b4a63, #0f1420 70%); }
#preview { position: absolute; left: 0; top: 0; width: 60%; height: 100%; cursor: grab; }
#creator .panel { position: absolute; right: 0; top: 0; bottom: 0; width: 40%; min-width: 380px; background: #000b; padding: 26px 30px; overflow-y: auto; border-left: 3px solid var(--gold); }
#creator h2 { font-family: var(--title); letter-spacing: 3px; font-size: 30px; margin: 0 0 16px; color: var(--gold); }
#creator .hint { position: absolute; bottom: 20px; left: 30%; transform: translateX(-50%); color: #fff8; font-size: 13px; }
.row { display: flex; align-items: center; justify-content: space-between; margin: 8px 0; gap: 10px; }
.row label { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: #fffb; width: 120px; flex-shrink: 0; }
.row .sel { display: flex; align-items: center; gap: 6px; flex: 1; justify-content: flex-end; }
.row .sel span { flex: 1; text-align: center; font-weight: 600; }
.row .sel button { width: 32px; height: 32px; background: #ffffff15; color: #fff; border: 1px solid #ffffff30; cursor: pointer; font-size: 16px; }
.row .sel button:hover { background: var(--gold); color: #000; }
.row input[type=text] { flex: 1; padding: 8px 10px; font-size: 18px; background: #ffffff12; border: 1px solid #ffffff40; color: #fff; font-weight: 700; }
.row input[type=range] { flex: 1; accent-color: var(--gold); }
.swatches { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; flex: 1; }
.sw { width: 24px; height: 24px; border-radius: 4px; cursor: pointer; border: 2px solid #0006; }
.sw.on { border-color: #fff; box-shadow: 0 0 0 2px var(--gold); }
.locked { opacity: .45; }
.big { width: 100%; margin-top: 18px; }

/* ---------- Pause ---------- */
#pause { position: fixed; inset: 0; background: linear-gradient(90deg, #000e 0, #000c 100%); display: flex; }
#pause .tabs { width: 270px; padding: 40px 20px; display: flex; flex-direction: column; gap: 8px; border-right: 2px solid #ffffff15; }
#pause .tabs button { font-size: 20px; padding: 8px 18px; text-align: left; }
#pause .tabs button.on, #pause .tabs button:hover { background: var(--gold); color: #000; border-color: var(--gold); }
#pause .content { flex: 1; padding: 40px 50px; overflow-y: auto; }
#pause h2 { font-family: var(--title); letter-spacing: 3px; font-size: 34px; margin: 0 0 18px; color: var(--gold); }
#pause h3 { font-family: var(--title); letter-spacing: 2px; margin: 18px 0 8px; }
.card { background: #ffffff0d; border-left: 3px solid #fff3; padding: 10px 14px; margin: 6px 0; font-size: 15px; line-height: 1.45; }
.card.done { border-color: var(--green); }
.card.active { border-color: var(--gold); background: #ffc53118; }
.card small { color: #fff9; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.stat { background: #ffffff0d; padding: 12px; }
.stat b { display: block; font-family: var(--title); font-size: 30px; color: var(--gold); letter-spacing: 1px; }
.btn { background: #ffffff15; color: #fff; border: 1px solid #fff4; padding: 5px 12px; cursor: pointer; font-weight: 600; }
.btn:hover { background: var(--gold); color: #000; }
#bigmap { width: min(640px, 100%); aspect-ratio: 1; border: 3px solid #fff3; }

/* ---------- Magasin ---------- */
#shop { position: fixed; inset: 0; background: #0009; display: flex; align-items: center; justify-content: center; }
.shopBox { width: min(720px, 94vw); max-height: 88vh; overflow-y: auto; background: linear-gradient(#183a22, #0e2415); border: 3px solid #e84a3c; padding: 22px 26px; border-radius: 6px; box-shadow: 0 20px 60px #000c; }
.shopBox h2 { margin: 0; font-family: var(--title); font-size: 44px; letter-spacing: 4px; color: #fff; text-shadow: 3px 3px 0 #e84a3c; }
.shopBox h2 small { font-size: 18px; letter-spacing: 2px; color: #fffa; text-shadow: none; }
.shopBox .cash { margin: 6px 0 14px; } .shopBox .cash b { color: var(--green); font-family: var(--title); font-size: 22px; }
.item { display: flex; align-items: center; gap: 14px; padding: 10px; border-bottom: 1px solid #ffffff15; }
.item .ico { font-size: 30px; width: 44px; text-align: center; }
.item .info { flex: 1; } .item .info b { font-size: 16px; } .item .info small { display: block; color: #fffa; font-size: 13px; }
.item .price { font-family: var(--title); font-size: 22px; color: var(--green); width: 70px; text-align: right; }
.item button { background: var(--gold); border: none; padding: 8px 14px; font-weight: 800; cursor: pointer; }
.item button:disabled { background: #555; color: #999; cursor: default; }
#shopClose { margin-top: 14px; font-size: 18px; padding: 6px 20px; }

/* ---------- Notes ---------- */
#note { position: fixed; inset: 0; background: #000a; display: flex; align-items: center; justify-content: center; }
#note .paper { width: min(520px, 90vw); background: #f3ead2; color: #2b2418; padding: 34px 38px; transform: rotate(-1.5deg); box-shadow: 0 20px 50px #000c; font-family: 'Segoe Print', 'Comic Sans MS', cursive; font-size: 18px; line-height: 1.6; }
#note .body h3 { margin: 0 0 12px; font-family: var(--title); letter-spacing: 2px; color: #8a3b12; }
#note button { margin-top: 18px; font-size: 18px; padding: 6px 22px; }
#clickToPlay { position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%); background: #0009; padding: 6px 14px; border-radius: 4px; font-size: 13px; color: #fffc; pointer-events: none; }

/* ---------- direction artistique de l'affiche : écran titre, chargement, notifications ---------- */
#title { background: url(assets/ui/affiche.webp) center 30% / cover no-repeat; justify-content: flex-end; padding-bottom: 6vh; }
#title .logo, #title .sub { display: none; }
#title .menu { margin-top: 0; flex-direction: row; gap: 18px; }
#title button { font-family: Impact, 'Arial Black', sans-serif; font-style: italic; font-size: 30px; letter-spacing: 1px; padding: 12px 38px; color: #fff;
  background: linear-gradient(100deg, #111 0%, #1b1b1b 100%); border: none; clip-path: polygon(3% 8%, 100% 0, 97% 92%, 0 100%); box-shadow: 0 6px 0 #f6a51a; text-shadow: 2px 2px 0 #000; }
#title button:hover { background: linear-gradient(100deg, #f6a51a, #ffd24d); color: #111; text-shadow: none; transform: scale(1.06) rotate(-1deg); }
#title .foot { background: #000a; padding: 4px 12px; border-radius: 3px; }
#loading { background: #000 url(assets/ui/affiche.webp) center 30% / cover no-repeat; align-items: flex-end; padding-bottom: 8vh; text-shadow: 3px 3px 0 #000; font-size: 26px; }
#notifs { top: 46px; width: 380px; gap: 10px; }
.notif { background: rgba(10, 12, 18, 0.93); border: 1px solid rgba(255, 255, 255, 0.18); border-left: 5px solid #f6a51a; border-radius: 6px; padding: 12px 16px; font-size: 16px; line-height: 1.45; color: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55); text-shadow: none; }
.notif b { color: #ffd24d; }

/* ---------- inventaire rapide (sans pause) ---------- */
#hotbar { position: absolute; right: 26px; bottom: 26px; display: flex; gap: 6px; }
.slot { position: relative; width: 58px; height: 58px; background: rgba(10, 12, 18, 0.88); border: 2px solid rgba(255, 255, 255, 0.18); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 30px; box-shadow: 0 4px 12px #0008; }
.slot .n { position: absolute; top: 2px; left: 5px; font-size: 12px; font-weight: 800; color: #ffd24d; }
.slot .q { position: absolute; bottom: 1px; right: 5px; font-size: 13px; font-weight: 800; color: #fff; text-shadow: 1px 1px 0 #000; }
.slot.empty { opacity: 0.35; }
#invPanel { position: absolute; right: 26px; bottom: 100px; width: 380px; max-height: 60vh; overflow-y: auto; background: rgba(10, 12, 18, 0.94); border: 1px solid rgba(255, 255, 255, 0.15); border-top: 4px solid #f6a51a; border-radius: 8px; padding: 14px 16px; pointer-events: none; }
#invPanel h3 { margin: 6px 0; font-family: var(--title); letter-spacing: 2px; color: #ffd24d; font-size: 18px; }
#invPanel .it { display: flex; gap: 10px; align-items: center; padding: 5px 0; border-bottom: 1px solid #ffffff12; font-size: 14px; }
#invPanel .it b { flex: 1; } #invPanel .k { background: #ffd24d; color: #000; border: none; }
/* ---------- ticket à gratter ---------- */
#scratch { position: fixed; inset: 0; background: #000a; display: flex; align-items: center; justify-content: center; z-index: 20; }
#scratch .card { width: 420px; padding: 18px 26px 22px; border-radius: 14px; background: linear-gradient(135deg, #ffd24d, #f6a51a 60%, #e8590c); color: #1a1a1a; text-align: center; box-shadow: 0 20px 50px #000c; transform: rotate(-2deg); }
#scratch h3 { margin: 0; font-family: Impact, sans-serif; font-size: 30px; letter-spacing: 1px; }
#scratch p { margin: 4px 0 12px; font-size: 13px; }
#scratch .zone { position: relative; width: 360px; height: 150px; margin: 0 auto; border-radius: 8px; overflow: hidden; background: #fff; }
#scratch canvas { position: absolute; inset: 0; } #scratchTop { cursor: crosshair; }
#scratch .res { min-height: 30px; margin-top: 10px; font-family: Impact, sans-serif; font-size: 24px; }
#scratch button { margin-top: 6px; padding: 6px 18px; font-weight: 800; border: none; border-radius: 6px; background: #1a1a1a; color: #fff; cursor: pointer; }
#hotbar { left: 50%; right: auto; transform: translateX(-50%); bottom: 12px; }
#objective { bottom: 86px; }

#wanted { margin-top: 6px; font-size: 26px; letter-spacing: 2px; transition: opacity .2s; }
#wanted span { color: #3a3a3a; text-shadow: 1px 1px 0 #000; }
#wanted span.on { color: #ffd34d; text-shadow: 0 0 6px #ff9f1a, 2px 2px 0 #000; }
