/* =====================================================================
   SUITS — Charte graphique : pixel, orange → bleu nuit
   ===================================================================== */
:root {
  --ink: #0b0e1f; --n1: #121a33; --n2: #1b2747; --n3: #24365e; --n4: #2f4a7a; --b1: #3d6296; --b2: #5a83b5; --b3: #86a9cf; --b4: #b9d0e6;
  --o2: #8a3b22; --o3: #b8532a; --o4: #e07a32; --o5: #f2a046; --o6: #f7c46c; --o7: #fbe3a1; --o8: #fff4d6;
  --g1: #3e3546; --g3: #7d6e78; --g5: #cdbfc0; --g6: #efe6df;
  --red: #c8364a; --red2: #7a1f30; --grn: #3f8f6b; --grn2: #7cc68f; --gold: #e8b63a; --blue: #3d7ad6;
  --font: 'Pixelify Sans', system-ui, sans-serif; --title: 'Silkscreen', 'Pixelify Sans', monospace; --mono: 'VT323', monospace;
  --px: 2px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--g6); font-family: var(--font); font-size: 15px; overflow: hidden; -webkit-font-smoothing: none; }
body { background: radial-gradient(ellipse at center, #121a33 0%, #05070f 75%); display: flex; align-items: center; justify-content: center; }
button { font-family: inherit; font-size: inherit; color: inherit; }
input, select, textarea { font-family: var(--font); font-size: 15px; background: var(--n1); color: var(--o8); border: var(--px) solid var(--b1); padding: 6px 8px; border-radius: 0; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--o5); }
textarea { width: 100%; resize: vertical; }

#stage { position: relative; width: min(100vw, calc(100vh * 16 / 9)); height: min(100vh, calc(100vw * 9 / 16)); background: #000; box-shadow: 0 0 0 4px var(--n2), 0 0 60px #000; overflow: hidden; }
#ui { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; transform-origin: 0 0; pointer-events: none; }
#ui > * { pointer-events: auto; }
#ui > #tip, #ui > #toasts, #ui > #hud, #ui > #create.side { pointer-events: none; }
#scr { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; }
#tip { position: absolute; display: none; pointer-events: none; z-index: 40; background: var(--ink); color: var(--o7); border: var(--px) solid var(--o4); padding: 3px 8px; font-size: 14px; max-width: 320px; box-shadow: 3px 3px 0 #000; }

/* ---------- Boutons ---------- */
.btn { background: var(--n3); color: var(--o8); border: var(--px) solid var(--b1); padding: 6px 12px; cursor: pointer; box-shadow: inset -2px -2px 0 rgba(0,0,0,.35), inset 2px 2px 0 rgba(255,255,255,.08), 2px 2px 0 #000; transition: transform .05s; line-height: 1.15; }
.btn:hover:not(:disabled) { background: var(--n4); border-color: var(--b2); }
.btn:active:not(:disabled) { transform: translate(1px, 1px); box-shadow: inset 2px 2px 0 rgba(0,0,0,.35); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--o4); border-color: var(--o6); color: var(--ink); font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: var(--o5); }
.btn.red { background: var(--red2); border-color: var(--red); color: #ffe2e6; }
.btn.red:hover:not(:disabled) { background: var(--red); }
.btn.gold { background: var(--gold); color: var(--ink); border-color: var(--o7); font-weight: 700; }
.btn.small { padding: 4px 9px; font-size: 14px; }
.btn.tiny { padding: 2px 7px; font-size: 13px; }
.btn.big { padding: 11px 22px; font-size: 18px; }
.btn.block { display: block; width: 100%; text-align: left; margin: 4px 0; }
.btn.hint { outline: 2px dashed var(--o6); }
.chip { background: var(--n2); border: var(--px) solid var(--n4); color: var(--b4); padding: 3px 8px; cursor: pointer; font-size: 13px; margin: 2px; }
.chip:hover { border-color: var(--o5); color: var(--o7); }
.chip.on { background: var(--o4); color: var(--ink); border-color: var(--o6); }
.tag { display: inline-block; font-size: 12px; padding: 1px 6px; background: var(--n3); color: var(--b4); margin: 2px 3px 0 0; border: 1px solid var(--n4); }
.tag.red { background: var(--red2); color: #ffd6dc; border-color: var(--red); }
.tag.gold { background: #5a4410; color: var(--o7); border-color: var(--gold); }
.tag.good { background: #1c4a36; color: var(--grn2); border-color: var(--grn); }
.tag.law { background: #2a1f3e; color: #d9c6ff; border-color: #6b4a8c; }
.muted { color: var(--b3); opacity: .9; }
.small { font-size: 13px; }
.warn { color: #ffb3bd; background: rgba(200,54,74,.15); padding: 6px 8px; border-left: 3px solid var(--red); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; margin-top: 12px; }
.pad { padding: 12px; }
h2, h3, h4, h5 { font-family: var(--title); font-weight: 400; margin: 8px 0 6px; color: var(--o6); letter-spacing: .5px; }
h2 { font-size: 22px; } h3 { font-size: 18px; } h4 { font-size: 15px; color: var(--o5); } h5 { font-size: 13px; color: var(--b3); }
.bar { position: relative; height: 8px; background: var(--ink); border: 1px solid var(--n4); overflow: hidden; }
.bar i { position: absolute; top: 0; bottom: 0; left: 0; background: var(--o4); }
.meter { height: 6px; background: var(--ink); border: 1px solid var(--n4); margin: 3px 0; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--o3), var(--o6)); }

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0 0 auto 0; display: none; justify-content: space-between; align-items: flex-start; padding: 6px 8px; pointer-events: none; z-index: 20; gap: 8px; }
#hud.on { display: flex; }
#hud > * { pointer-events: auto; }
.hud-l { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; max-width: 50%; }
#hudPlace { font-family: var(--title); font-size: 13px; color: var(--o7); background: rgba(11,14,31,.82); padding: 3px 9px; border: var(--px) solid var(--n4); text-shadow: 1px 1px 0 #000; }
.nav { display: flex; gap: 3px; flex-wrap: wrap; }
.nav button { background: rgba(11,14,31,.85); border: var(--px) solid var(--n4); color: var(--o8); padding: 3px 8px; cursor: pointer; font-size: 13px; }
.nav button:hover { border-color: var(--o5); }
.nav button.notif { border-color: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { background: var(--red2); } }
#hudCase { background: rgba(11,14,31,.85); border: var(--px) solid var(--o3); color: var(--o7); padding: 3px 9px; font-size: 13px; cursor: pointer; text-align: left; max-width: 100%; }
#hudCase .urg { color: #ff8a99; font-weight: 700; animation: pulse 1s infinite; }
.hud-r { display: grid; grid-template-columns: repeat(2, minmax(118px, 1fr)); gap: 3px; background: rgba(11,14,31,.86); border: var(--px) solid var(--n4); padding: 5px 7px; box-shadow: 3px 3px 0 rgba(0,0,0,.5); }
.stat { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.stat .lbl { font-family: var(--title); font-size: 10px; color: var(--b3); text-transform: uppercase; }
.stat b { font-size: 15px; color: var(--o8); }
.stat b.neg { color: #ff8a99; }
#hudRep { display: grid; grid-template-columns: 1fr auto; column-gap: 6px; }
#hudRep .lbl { grid-column: 1 / 3; }
#hudRep .bar { align-self: center; }
#hudRep .bar i { background: linear-gradient(90deg, var(--o3), var(--o6)); }
.bar.legal { height: 10px; }
.bar.legal .mid { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--g5); z-index: 2; }
.bar.legal i.blue { background: var(--blue); }
.bar.legal i.red { background: var(--red); }
.bar.legal em { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1px; background: var(--o8); z-index: 3; }
.bar.legal { background: linear-gradient(90deg, rgba(200,54,74,.18), rgba(125,110,120,.25) 45%, rgba(125,110,120,.25) 55%, rgba(61,122,214,.18)); }
.hud-bottom { grid-column: 1 / 3; display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--b3); border-top: 1px solid var(--n3); padding-top: 3px; }
#profileBtn { background: var(--n3); border: 1px solid var(--b1); color: var(--o8); cursor: pointer; padding: 2px 8px; font-size: 12px; }
#profileBtn:hover { border-color: var(--o5); }

/* ---------- Toasts ---------- */
#toasts { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 4px; z-index: 90; pointer-events: none; width: min(440px, 40%); }
.toast { background: rgba(11,14,31,.94); border: var(--px) solid var(--b1); padding: 5px 10px; color: var(--o8); box-shadow: 3px 3px 0 #000; animation: tin .2s; font-size: 13px; }
.toast.good { border-color: var(--grn); } .toast.bad { border-color: var(--red); } .toast.info { border-color: var(--o4); }
.toast.out { opacity: 0; transform: translateY(8px); transition: all .35s; }
@keyframes tin { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Modales ---------- */
#modals { position: absolute; inset: 0; z-index: 70; pointer-events: none; }
.modal-wrap { position: absolute; inset: 0; background: rgba(5,7,15,.62); display: flex; align-items: center; justify-content: center; pointer-events: auto; padding: 14px; }
.modal-wrap.nodim { background: transparent; }
.modal { background: var(--n1); border: 3px solid var(--b1); box-shadow: 0 0 0 2px #000, 6px 6px 0 #000; width: min(520px, 100%); max-height: 92%; display: flex; flex-direction: column; animation: pop .15s; }
.modal.wide { width: min(760px, 100%); } .modal.xwide { width: min(1080px, 100%); }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
.modal-title { display: flex; justify-content: space-between; align-items: center; background: linear-gradient(90deg, var(--o3), var(--o4) 40%, var(--n3)); color: var(--ink); padding: 5px 8px 5px 12px; font-family: var(--title); font-size: 14px; }
.modal-title .x { background: var(--ink); color: var(--o7); border: 1px solid var(--o6); cursor: pointer; padding: 0 7px; }
.modal-body { padding: 12px 14px; overflow: auto; line-height: 1.4; }
.modal-body p { margin: 6px 0; }
.modal-btns { display: flex; gap: 8px; justify-content: flex-end; padding: 8px 12px 12px; flex-wrap: wrap; }
.modal.verdict.won .modal-title, .modal.verdict.dismissed .modal-title { background: linear-gradient(90deg, var(--grn), var(--gold)); }
.modal.verdict.lost .modal-title { background: linear-gradient(90deg, var(--red2), var(--red)); color: #fff; }
.modal.mafia { border-color: var(--red2); }
.modal.mafia .modal-title { background: linear-gradient(90deg, #1a0a0a, var(--red2)); color: var(--o7); }
.mafia-body { display: flex; gap: 14px; align-items: flex-start; }
details summary { cursor: pointer; color: var(--o6); }
.chkrow { display: flex; gap: 6px; align-items: center; padding: 3px 0; cursor: pointer; }
.chkrow input { accent-color: var(--o4); }

/* ---------- Portraits ---------- */
canvas.portrait { width: 144px; height: 144px; image-rendering: pixelated; border: 3px solid var(--ink); box-shadow: 3px 3px 0 #000; background: var(--n3); }
canvas.portrait.sm { width: 72px; height: 72px; }
canvas.portrait.big { width: 192px; height: 192px; }

/* ---------- Dialogue ---------- */
#talk { position: absolute; inset: auto 0 0 0; z-index: 50; display: none; padding: 8px; }
#talk.on { display: block; }
.talk-box { display: flex; gap: 10px; background: rgba(11,14,31,.96); border: 3px solid var(--o3); box-shadow: 0 0 0 2px #000, 5px 5px 0 #000; padding: 10px; height: min(330px, 58vh); }
.talk-box.parloir { border-color: var(--g3); }
.talk-box.phone { border-color: var(--b2); }
.talk-side { width: 170px; flex: none; display: flex; flex-direction: column; gap: 4px; overflow: auto; }
.portrait-wrap { position: relative; width: 144px; }
.portrait-wrap .glass { position: absolute; inset: 0; background: linear-gradient(135deg, rgba(185,208,230,.25) 0 18%, transparent 18% 30%, rgba(185,208,230,.15) 30% 36%, transparent 36%); pointer-events: none; border: 3px solid var(--g3); }
.portrait-wrap .ph-ico { position: absolute; right: -6px; bottom: -6px; background: var(--b1); border: 2px solid var(--ink); padding: 2px 6px; font-size: 18px; }
.talk-name { font-family: var(--title); color: var(--o6); font-size: 14px; }
.talk-job { font-size: 13px; color: var(--b3); }
.trust { display: flex; flex-direction: column; font-size: 11px; color: var(--b3); }
.trust .bar i { background: linear-gradient(90deg, var(--red), var(--o5), var(--grn2)); }
.talk-tel, .talk-case { font-size: 12px; color: var(--b4); }
.rec { color: #ff8a99; font-family: var(--mono); font-size: 18px; animation: pulse 1s infinite; }
.rec.ill { font-size: 13px; font-family: var(--font); }
.talk-main { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.talk-log { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 4px; }
.tl { max-width: 86%; padding: 6px 10px; line-height: 1.35; box-shadow: 2px 2px 0 #000; font-size: 15px; }
.tl b { display: block; font-family: var(--title); font-size: 10px; margin-bottom: 2px; opacity: .8; }
.tl.npc { align-self: flex-start; background: var(--o7); color: #1a1210; border: 2px solid var(--o5); }
.tl.me { align-self: flex-end; background: var(--b1); color: #fff; border: 2px solid var(--b2); }
.tl.sys { align-self: center; background: transparent; color: var(--o6); box-shadow: none; font-style: italic; font-size: 13px; border: 1px dashed var(--o3); }
.tl.typing span { animation: pulse 1s infinite; }
.talk-input { display: flex; gap: 6px; }
.talk-input input { flex: 1; }
.topics, .acts { display: flex; flex-wrap: wrap; gap: 3px; }
.acts .btn { font-size: 13px; }

/* ---------- PC ---------- */
#pc { position: absolute; inset: 0; z-index: 45; display: none; background: #000; padding: 1.2%; }
#pc.on { display: flex; flex-direction: column; }
#pc::before { content: ''; position: absolute; inset: 0; border: 14px solid #cfc2a8; border-radius: 18px; pointer-events: none; box-shadow: inset 0 0 0 3px #8a7a6a, inset 0 0 40px rgba(0,0,0,.6); z-index: 3; }
#pc.phone::before { border-color: #1a1a22; border-width: 10px; border-radius: 26px; }
.os-desk { position: relative; flex: 1; background: linear-gradient(160deg, #2c8c99 0%, #24365e 55%, #1b2747 100%); overflow: hidden; margin: 10px 10px 0; }
.os-desk::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(0,0,0,.05) 0 1px, transparent 1px 4px); pointer-events: none; z-index: 1000; }
.os-wall { position: absolute; right: 24px; bottom: 18px; text-align: right; opacity: .5; }
.os-logo { font-family: var(--title); font-size: 34px; color: var(--o6); text-shadow: 3px 3px 0 var(--ink); }
.os-sub { font-size: 13px; color: var(--b4); }
.os-icons { position: absolute; left: 14px; top: 14px; display: grid; grid-template-columns: repeat(2, 104px); gap: 10px; }
.os-icon { position: relative; background: none; border: 1px solid transparent; color: #fff; text-align: center; cursor: pointer; padding: 8px 2px; display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 15px; font-weight: 600; text-shadow: 1px 1px 0 #000, 0 0 4px #000; }
.os-icon:hover { border: 1px dotted var(--o7); background: rgba(11,14,31,.3); }
.os-icon .ii { font-size: 34px; width: 58px; height: 52px; display: flex; align-items: center; justify-content: center; background: var(--o7); color: var(--ink); border: 2px solid var(--ink); box-shadow: 2px 2px 0 #000; font-family: var(--title); }
.os-icon .badge { position: absolute; top: 2px; right: 16px; background: var(--red); color: #fff; font-style: normal; font-size: 14px; font-weight: 700; padding: 0 6px; border: 2px solid #fff; }
.os-bar { display: flex; align-items: center; gap: 6px; background: var(--g5); color: var(--ink); padding: 4px 6px; margin: 0 10px 10px; border-top: 2px solid #fff; }
.os-start { background: var(--o4); border: 2px outset var(--o6); font-family: var(--title); font-size: 15px; cursor: pointer; padding: 3px 12px; color: var(--ink); }
.os-tasks { display: flex; gap: 4px; flex: 1; overflow: hidden; }
.os-tasks button { background: var(--g6); border: 2px outset #fff; cursor: pointer; font-size: 15px; padding: 2px 10px; white-space: nowrap; color: var(--ink); }
.os-clock { font-family: var(--mono); font-size: 22px; border: 2px inset #fff; padding: 0 8px; }
.os-off { background: var(--red); color: #fff; border: 2px outset #ff8a99; cursor: pointer; padding: 0 8px; font-size: 16px; }
.os-startmenu { position: absolute; left: 22px; bottom: 46px; background: var(--g6); border: 2px outset #fff; display: flex; flex-direction: column; z-index: 2000; min-width: 200px; box-shadow: 4px 4px 0 #000; }
.os-startmenu button { background: none; border: none; text-align: left; padding: 6px 12px; cursor: pointer; color: var(--ink); }
.os-startmenu button:hover { background: var(--n3); color: #fff; }
.os-win { position: absolute; display: flex; flex-direction: column; background: var(--g6); color: #1a1210; border: 2px outset #fff; box-shadow: 4px 4px 0 rgba(0,0,0,.55); min-width: 280px; }
.os-win.max { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; }
.os-title { display: flex; justify-content: space-between; align-items: center; background: linear-gradient(90deg, var(--n2), var(--b1)); color: #fff; padding: 5px 6px 5px 10px; font-family: var(--title); font-size: 15px; cursor: move; user-select: none; }
.os-title button { background: var(--g5); color: var(--ink); border: 2px outset #fff; cursor: pointer; padding: 1px 9px; margin-left: 4px; font-size: 15px; }
.os-body { flex: 1; overflow: auto; padding: 10px 12px; font-size: 16px; font-family: 'Pixelify Sans', system-ui, sans-serif; line-height: 1.35; }
.os-body h3, .os-body h4, .os-body h5 { color: var(--n2); }
.os-body .muted { color: #5b4e5e; }
.os-body input, .os-body select, .os-body textarea { background: #fff; color: #1a1210; border: 2px inset #ccc; }
.os-body .btn { color: var(--o8); font-size: 15px; }
.os-body .btn.small { font-size: 15px; }
.os-body .btn.tiny { font-size: 14px; }
.os-body .btn.primary { color: var(--ink); }
.split { display: flex; gap: 8px; height: 100%; min-height: 0; }
.split > :first-child { width: 36%; min-width: 180px; overflow: auto; border-right: 2px solid #c9bdb2; padding-right: 6px; }
.split > :last-child { flex: 1; overflow: auto; min-width: 0; }
.mail-item, .law-item, .doc-item, .case-item { display: block; width: 100%; text-align: left; background: #fff; border: 1px solid #d9cfc4; padding: 8px 10px; margin-bottom: 3px; cursor: pointer; color: #1a1210; }
.mail-item b, .doc-item b, .case-item b, .law-item b { display: block; font-size: 16px; }
.mail-item span, .law-item span { display: block; font-size: 15px; color: #3e3546; }
.mail-item small, .doc-item small, .case-item small { color: #6d5e68; font-size: 14px; }
.mail-item.unread { border-left: 4px solid var(--o4); background: #fff8ec; }
.mail-item.unread b, .mail-item.unread span { font-weight: 700; }
.mail-item.sel, .law-item.sel, .doc-item.sel, .case-item.sel { background: var(--b4); border-color: var(--b1); }
.case-item.active { border-left: 4px solid var(--grn); }
.mail-head { border-bottom: 2px solid #d9cfc4; padding-bottom: 6px; margin-bottom: 8px; }
.mail-body { white-space: pre-wrap; line-height: 1.55; font-size: 17px; }
.mail-head b { font-size: 18px; } .mail-head div { font-size: 16px; }
.mail-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.web-nav { display: flex; gap: 4px; align-items: center; margin-bottom: 4px; }
.web-nav .addr { flex: 1; font-family: var(--mono); font-size: 16px; padding: 2px 6px; }
.web-favs { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 6px; }
.fav { background: #e3d9cd; border: 1px solid #bfb3a6; cursor: pointer; font-size: 12px; padding: 2px 7px; color: #1a1210; }
.fav.on { background: var(--o6); border-color: var(--o3); }
.web-page { background: #fff; border: 2px inset #ccc; padding: 10px; min-height: 70%; }
.site-head h2 { color: var(--n2); margin: 0; }
.site-lookr .site-head h2 { color: var(--o3); font-size: 30px; }
.site-chirp .site-head h2 { color: #2c8c99; }
.site-news .site-head h2 { font-family: Georgia, serif; color: #1a1210; font-size: 26px; border-bottom: 3px double #1a1210; }
.search { margin: 8px 0; } .search input { flex: 1; }
.web-res { display: block; width: 100%; text-align: left; background: none; border: none; border-bottom: 1px solid #eee; padding: 6px 2px; cursor: pointer; color: #1a1210; }
.web-res small { color: var(--grn); display: block; font-size: 12px; }
.web-res b { color: #1b4a9a; display: block; text-decoration: underline; }
.web-res span { font-size: 13px; color: #555; }
.rec-card { background: #faf6f0; border: 1px solid #d9cfc4; padding: 8px 10px; margin: 6px 0; color: #1a1210; }
.rec-card.big { padding: 12px 14px; }
.rec-card p { margin: 4px 0; }
.ai-body { font-style: italic; color: #3e3546; margin: 6px 0; white-space: pre-wrap; }
.law-ref { font-family: var(--mono); font-size: 20px; color: var(--o3); }
.law-text { font-size: 16px; line-height: 1.5; background: #fff; border-left: 4px solid var(--gold); padding: 8px 10px; }
.paper { background: #fffdf7; border: 1px solid #d9cfc4; box-shadow: 3px 3px 0 #bfb3a6; padding: 14px 18px; font-family: Georgia, 'Times New Roman', serif; color: #1a1210; line-height: 1.5; }
.paper.form { font-family: var(--mono); font-size: 18px; background: #f4f6f0; }
.paper h3 { font-family: Georgia, serif; color: #1a1210; text-align: center; font-size: 18px; }
.clause { padding: 4px 6px; margin: 3px 0; cursor: pointer; border-left: 3px solid transparent; }
.clause:hover { background: #fff2cc; border-left-color: var(--o5); }
.clause.marked { background: #fff07a; border-left-color: var(--red); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 8px 0; font-size: 16px; }
.kv span { color: #5b4e5e; }
.case-acts { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 3px; }
.os-body .chip { background: #e3d9cd; color: #1a1210; border-color: #bfb3a6; }
.dos-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.dos-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.dos-col { background: #fff; border: 1px solid #d9cfc4; padding: 6px; }
.ev { border-bottom: 1px dashed #d9cfc4; padding: 5px 0; }
.ev b { display: block; font-size: 13px; } .ev small { color: #5b4e5e; font-size: 12px; }
.ev.ill b { color: var(--red); }
.ptrow { padding: 4px 0; border-bottom: 1px dashed #d9cfc4; font-size: 13px; }
.ptrow small { display: block; color: #5b4e5e; }
.ptrow.me b { color: #1c6a46; } .ptrow.opp b { color: var(--red2); }
.tabs { display: flex; gap: 2px; border-bottom: 2px solid #bfb3a6; margin-bottom: 8px; flex-wrap: wrap; }
.tab { background: #e3d9cd; border: 2px outset #fff; border-bottom: none; padding: 3px 12px; cursor: pointer; color: #1a1210; }
.tab.on { background: var(--o6); }
.shop-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: #fff; border: 1px solid #d9cfc4; padding: 6px 8px; margin: 3px 0; }
.shop-item b { display: block; font-size: 14px; } .shop-item small { color: #5b4e5e; font-size: 12px; }
.shop-item.owned { background: #eef8ef; }
.slider { display: grid; grid-template-columns: 200px 1fr 110px; gap: 8px; align-items: center; margin: 6px 0; }
.slider input { accent-color: var(--o4); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-day { background: #fff; border: 1px solid #d9cfc4; min-height: 70px; padding: 3px; font-size: 12px; }
.cal-day.today { border: 2px solid var(--o4); background: #fff8ec; }
.cal-day.we { background: #f0ebe4; }
.cal-ev { background: var(--b4); margin-top: 2px; padding: 1px 3px; font-size: 11px; }
.cal-ev.hot { background: var(--o6); font-weight: 700; } .cal-ev.warn { background: #ffd0d6; }
.jl { font-size: 13px; padding: 3px 0; border-bottom: 1px dotted #d9cfc4; }
.jl.good { color: #1c6a46; } .jl.bad { color: var(--red2); }

/* ---------- Divers modales ---------- */
.svc { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 8px; border: 1px solid var(--n4); margin: 4px 0; background: var(--n2); }
.svc b { display: block; } .svc small { display: block; color: var(--b3); font-size: 12px; }
.svc.ill { border-color: var(--red2); background: rgba(122,31,48,.25); }
.svc-block { border: 1px solid var(--n4); padding: 6px 8px; margin: 6px 0; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.svc-block h4 { width: 100%; margin: 0 0 3px; }
.evlist { display: flex; flex-direction: column; gap: 4px; }
.evitem { text-align: left; background: var(--n2); border: 1px solid var(--n4); padding: 6px 8px; cursor: pointer; color: var(--o8); }
.evitem:hover { border-color: var(--o5); }
.evitem small { display: block; color: var(--b3); }
.search .results, .results { margin-top: 8px; }
.archives-modal .rec-card { background: #1a2a1e; color: #a8e6b0; border-color: #3f8f6b; font-family: var(--mono); font-size: 17px; }

/* Téléphone */
.phone-ui { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.ph-disp { width: 100%; background: #1a3a2a; color: #7cc68f; font-family: var(--mono); font-size: 26px; padding: 6px 10px; text-align: right; border: 3px inset #333; min-height: 46px; }
.phone-mobile .ph-disp { background: #0b1a3a; color: var(--b4); }
.keypad { display: grid; grid-template-columns: repeat(3, 64px); gap: 5px; }
.key { background: var(--g5); color: var(--ink); border: 2px outset #fff; font-family: var(--mono); font-size: 24px; padding: 4px; cursor: pointer; }
.phone-mobile .key { background: var(--n3); color: var(--o8); border: 2px solid var(--b1); border-radius: 50%; }
.key:active { border-style: inset; }
.ph-recent { width: 100%; }
.phone-desk .modal-title { background: linear-gradient(90deg, #3e3546, #5b4e5e); color: var(--o7); }

/* Rolodex */
.rolo-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin-top: 8px; }
.rcard { background: #fffaf0; color: #1a1210; padding: 8px 10px 6px; border: 1px solid #c9bdb2; box-shadow: 2px 2px 0 #000; position: relative; background-image: repeating-linear-gradient(0deg, transparent 0 17px, #cfe0f0 17px 18px); }
.rcard::before { content: ''; position: absolute; top: -6px; left: 40%; width: 20%; height: 6px; background: #fffaf0; border: 1px solid #c9bdb2; border-bottom: none; }
.rc-name { font-family: var(--title); font-size: 12px; color: var(--red2); }
.rc-job { font-size: 13px; color: #3e3546; } .rc-tel { font-family: var(--mono); font-size: 19px; } .rc-addr { font-size: 12px; color: #5b4e5e; }
.rc-btns { display: flex; gap: 3px; margin-top: 4px; }

/* Dictaphone */
.modal.dicta-modal { background: #2a2433; }
.dicta-screen { background: #1a1a22; border: 3px inset #555; padding: 8px; margin: 8px 0; }
.reels { display: flex; align-items: center; justify-content: center; gap: 10px; height: 56px; background: #3e3546; border: 2px solid #111; margin-bottom: 8px; }
.reel { width: 40px; height: 40px; border-radius: 50%; border: 6px dotted var(--g5); background: #111; }
.reels.spin .reel { animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tape-win { width: 90px; height: 16px; background: #5c2a1f; border: 2px solid #111; }
.dicta-subs { font-family: var(--mono); font-size: 19px; color: var(--o7); min-height: 110px; max-height: 190px; overflow: auto; background: #000; padding: 6px 8px; }
.sub { margin: 3px 0; opacity: .6; } .sub.cur { opacity: 1; } .sub.me { color: var(--b3); }
.sub .flag { margin-left: 6px; font-family: var(--font); }
.dicta-btns { display: flex; gap: 6px; justify-content: center; }
.dbtn { width: 58px; height: 42px; background: #5b4e5e; border: 3px outset #8a7a8a; color: var(--g6); font-size: 18px; cursor: pointer; }
.dbtn:active, .dbtn.on { border-style: inset; }
.dbtn.rec { color: #ff6a7a; } .dbtn.rec.on { background: var(--red2); }

/* Tableau en liège */
.board-modal .modal-body { background: #b8833e; background-image: radial-gradient(#a8743e 15%, transparent 16%), radial-gradient(#c4904a 15%, transparent 16%); background-size: 8px 8px; background-position: 0 0, 4px 4px; }
.b-help { background: var(--ink); color: var(--o7); padding: 4px 8px; display: inline-block; margin-bottom: 8px; }
.b-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.b-col h4 { color: var(--ink); background: var(--o7); display: inline-block; padding: 1px 8px; }
.pin { background: #fffaf0; color: #1a1210; padding: 6px 8px 6px; margin: 6px 0; box-shadow: 2px 3px 0 rgba(0,0,0,.4); cursor: pointer; position: relative; transform: rotate(-.6deg); }
.pin:nth-child(even) { transform: rotate(.7deg); }
.pin::before { content: ''; position: absolute; top: -4px; left: 50%; width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 1px 1px 0 #000; }
.pin b { display: block; font-size: 13px; } .pin small { font-size: 12px; color: #5b4e5e; display: block; }
.pin.sel { outline: 3px solid var(--red); }
.pin.linked { background: #fff3c4; }
.pin.reserve { background: #ffe9a8; }
.arg { background: var(--n2); color: var(--o8); padding: 8px; margin: 6px 0; border: 2px solid var(--b1); box-shadow: 2px 3px 0 rgba(0,0,0,.4); }
.arg.target { cursor: pointer; border-color: var(--red); animation: pulse 1.2s infinite; }
.arg.opp { background: var(--red2); border-color: var(--red); }
.threads { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.thread { font-size: 12px; background: rgba(200,54,74,.3); border: 1px solid var(--red); padding: 0 5px; }
.thread.law { background: rgba(107,74,140,.35); border-color: #9a7ac0; }
.b-law { margin-top: 10px; background: rgba(11,14,31,.8); padding: 6px 8px; }
.lawpin { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; padding: 3px 0; }
.sel.small { font-size: 13px; padding: 2px 4px; }

/* Fax & journal */
.fax-paper { background: #f6f3ea; color: #1a1210; font-family: var(--mono); font-size: 18px; padding: 10px 14px; margin: 8px 0; box-shadow: 2px 2px 0 #000; background-image: repeating-linear-gradient(0deg, rgba(0,0,0,.035) 0 1px, transparent 1px 3px); }
.fax-head { border-bottom: 1px dashed #555; margin-bottom: 4px; font-size: 15px; }
.fax-paper h5 { color: #1a1210; font-size: 15px; margin: 4px 0; }
.fax-paper p { margin: 2px 0; }
.modal.paper-modal { background: #efe6df; border-color: #1a1210; }
.modal.paper-modal .modal-title { background: #1a1210; color: #efe6df; }
.newspaper { color: #1a1210; font-family: Georgia, 'Times New Roman', serif; }
.np-mast { font-family: var(--title); font-size: 22px; text-align: center; border-bottom: 3px double #1a1210; padding-bottom: 4px; letter-spacing: 1px; }
.np-date { text-align: center; font-size: 12px; border-bottom: 1px solid #1a1210; padding: 2px 0; margin-bottom: 8px; }
.np-head { font-family: Georgia, serif; color: #1a1210; font-size: 22px; line-height: 1.15; text-transform: uppercase; }
.np-q { font-size: 16px; line-height: 1.4; }
.np-a { display: block; width: 100%; text-align: left; background: #fff9ef; border: 1px solid #1a1210; padding: 7px 10px; margin: 5px 0; cursor: pointer; font-family: Georgia, serif; font-size: 15px; color: #1a1210; box-shadow: 2px 2px 0 #1a1210; }
.np-a:hover { background: var(--o7); }

/* Négociation */
.nego-head { display: flex; gap: 12px; align-items: center; }
.fear { font-size: 12px; color: var(--b3); width: 220px; } .fear .bar i { background: linear-gradient(90deg, var(--grn2), var(--o5), var(--red)); }
.offer { background: var(--o7); color: #1a1210; padding: 8px 10px; margin: 10px 0; border: 2px solid var(--o4); }
.nego-acts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }

/* ---------- Procès ---------- */
#trial { position: absolute; inset: auto 0 0 0; z-index: 48; display: none; flex-direction: column; background: rgba(11,14,31,.95); border-top: 3px solid var(--gold); max-height: 54%; }
#trial.on { display: flex; }
.tr-top { display: flex; justify-content: space-between; align-items: center; padding: 4px 10px; background: var(--n2); font-family: var(--title); font-size: 12px; color: var(--o6); gap: 8px; }
#trScore { color: var(--b4); font-family: var(--font); font-size: 13px; }
.tr-log { overflow: auto; padding: 6px 12px; font-family: var(--mono); font-size: 18px; line-height: 1.15; min-height: 60px; max-height: 22vh; flex: none; }
.tr-line { margin: 2px 0; cursor: pointer; }
.tr-line b { color: var(--o5); font-weight: 400; }
.tr-line.w-judge b { color: var(--gold); } .tr-line.w-me b { color: var(--b3); } .tr-line.w-opp b { color: #ff8a99; } .tr-line.w-wit b { color: var(--grn2); }
.tr-line.sys { color: var(--o6); font-style: italic; font-size: 17px; }
.tr-ctrl { padding: 6px 10px 10px; border-top: 1px solid var(--n3); overflow: auto; flex: 1; min-height: 0; }
.tr-prompt { font-family: var(--title); font-size: 12px; color: var(--o7); margin-bottom: 5px; }
.tr-opts { display: flex; flex-direction: column; gap: 4px; }
.tr-opts.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.tr-opts .btn { text-align: left; }
.btn.chk.on { background: var(--o4); color: var(--ink); }
.btn.objection { display: block; width: 100%; font-family: var(--title); font-size: 26px; background: var(--red); color: #fff; border: 3px solid #ff8a99; padding: 10px; animation: shake .3s infinite; cursor: pointer; }
@keyframes shake { 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }
.objbar { height: 6px; background: var(--ink); margin-top: 4px; } .objbar i { display: block; height: 100%; background: var(--o5); }
.jury-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px; margin-bottom: 6px; }
.juror { background: var(--n2); border: 2px solid var(--n4); color: var(--o8); padding: 4px 6px; text-align: left; cursor: pointer; font-size: 13px; }
.juror b { display: block; } .juror small { display: block; color: var(--b3); } .juror i { display: block; font-size: 12px; color: var(--o7); }
.juror.struck { opacity: .45; text-decoration: line-through; border-color: var(--red); }
.lean { font-size: 11px; padding: 0 4px; } .lean.pos { background: #1c4a36; color: var(--grn2); } .lean.neg { background: var(--red2); color: #ffd6dc; }
.closing { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.cl-pt { border: 1px solid var(--n4); padding: 4px 6px; }
.cl-pt.on { border-color: var(--o4); background: rgba(224,122,50,.08); }
.cl-evs { display: flex; flex-wrap: wrap; margin: 3px 0; }
.timer { color: #ff8a99; font-size: 13px; }

/* ---------- Création / menus ---------- */
#create { position: absolute; inset: 0; z-index: 30; display: none; align-items: center; justify-content: center; padding: 16px; }
#create.on { display: flex; }
#create.side { justify-content: flex-end; align-items: flex-start; pointer-events: none; }
#create.side > * { pointer-events: auto; }
.menu-wrap { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 7%; }
.menu-box { display: flex; flex-direction: column; gap: 8px; align-items: stretch; width: min(380px, 90%); background: rgba(11,14,31,.82); border: 3px solid var(--o3); padding: 14px; box-shadow: 5px 5px 0 #000; }
.credit { font-size: 12px; color: var(--b3); text-align: center; margin: 4px 0 0; }
.create-box { background: rgba(11,14,31,.95); border: 3px solid var(--o3); box-shadow: 0 0 0 2px #000, 6px 6px 0 #000; padding: 14px 18px; width: min(860px, 100%); max-height: 100%; overflow: auto; }
.create-grid { display: grid; grid-template-columns: auto 1fr; gap: 16px; }
.opt { margin: 6px 0; } .opt > span { font-family: var(--title); font-size: 11px; color: var(--b3); display: block; }
.opt-row { display: flex; flex-wrap: wrap; }
.side-box { background: rgba(11,14,31,.94); border: 3px solid var(--o3); padding: 10px 14px; width: min(330px, 46%); box-shadow: 5px 5px 0 #000; max-height: 100%; overflow: auto; margin-top: 30px; }
.side-box ul { padding-left: 18px; margin: 6px 0; }
.city-card, .mode-card { display: block; width: 100%; text-align: left; background: var(--n2); border: 2px solid var(--n4); padding: 8px 10px; margin: 6px 0; cursor: pointer; color: var(--o8); }
.city-card:hover, .mode-card:hover { border-color: var(--o5); }
.city-card b, .mode-card b { display: block; font-family: var(--title); font-size: 14px; color: var(--o6); }
.city-card small { display: block; color: var(--b4); margin: 3px 0; }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mode-card p { font-size: 14px; color: var(--b4); margin: 4px 0; }
.mode-card.on { border-color: var(--o4); background: #2a2440; box-shadow: inset 0 0 0 2px var(--o4); }
.tiers .chip { display: block; width: 100%; text-align: left; }
.opts { margin-top: 10px; }
.profile .row { gap: 12px; }

/* Tutoriel */
#tuto { position: absolute; left: 8px; bottom: 8px; z-index: 60; display: none; max-width: min(380px, 60%); }
#tuto.on { display: block; animation: tin .3s; }
.tuto-in { background: var(--o7); color: #1a1210; border: 3px solid var(--o4); padding: 8px 10px; box-shadow: 4px 4px 0 #000; }
.tuto-in b { font-family: var(--title); font-size: 12px; }
.tuto-in p { margin: 4px 0 6px; line-height: 1.35; }
.tuto-in .btn { margin-right: 4px; }

/* ---------- Petits écrans / tablette ---------- */
@media (max-width: 900px) {
  html, body { font-size: 14px; }
  .hud-r { grid-template-columns: repeat(2, minmax(96px, 1fr)); padding: 3px 5px; }
  .stat b { font-size: 13px; }
  .talk-box { height: 62vh; }
  .talk-side { width: 120px; } canvas.portrait { width: 96px; height: 96px; } .portrait-wrap { width: 96px; }
  .modes { grid-template-columns: 1fr; }
  .dos-grid, .b-grid { grid-template-columns: 1fr; }
  .create-grid { grid-template-columns: 1fr; } canvas.portrait.big { width: 120px; height: 120px; }
  .slider { grid-template-columns: 1fr; }
  .os-icons { grid-template-columns: repeat(4, 76px); }
}
@media (max-width: 640px) {
  .nav button { font-size: 11px; padding: 2px 5px; }
  .hud-l { max-width: 46%; }
  .talk-box { flex-direction: column; height: 70vh; }
  .talk-side { width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; }
  canvas.portrait { width: 64px; height: 64px; } .portrait-wrap { width: 64px; }
  .split { flex-direction: column; } .split > :first-child { width: 100%; max-height: 40%; border-right: none; }
}

@media (max-width: 900px) { #toasts { width: 60%; top: auto; bottom: 8px; } }

/* Panneau IA */
.ia-panel { display: flex; flex-direction: column; gap: 6px; }
.ia-row { border: 1px solid #c9bdb2; background: #fff; padding: 6px 8px; }
.ia-panel.dark .ia-row { border-color: var(--n4); background: var(--n2); }
.ia-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.ia-status { font-size: 12px; color: #1c6a46; }
.ia-panel.dark .ia-status { color: var(--grn2); }
.ia-row input[type=password], .ia-row input[type=text] { flex: 1; min-width: 180px; font-family: var(--mono); font-size: 15px; }
.ia-results { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 3px; }

#pc.on ~ #toasts, #talk.on ~ #toasts { top: auto; bottom: 60px; left: auto; right: 22px; transform: none; width: 380px; }
#talk.on ~ #toasts { bottom: auto; top: 8px; }
