/* Olyveil — Le Sprint : écrans, HUD, dialogues, modales. Charte : Golos Text + palette officielle. */
@font-face { font-family: "Golos Text"; src: url("../assets/fonts/GolosText-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Golos Text"; src: url("../assets/fonts/GolosText-SemiBold.ttf") format("truetype"); font-weight: 500 800; font-display: swap; }

:root {
  --olyveil-primary-dark: #2f3f4c;
  --olyveil-primary: #445f75;
  --olyveil-accent-blue: #72a4cd;
  --olyveil-cyan: #b4dee4;
  --olyveil-cyan-light: #d4ecef;
  --olyveil-green: #8dc082;
  --olyveil-green-surface: #d7e7d8;
  --olyveil-green-pale: #eaf4e9;
  --olyveil-yellow-soft: #fdf9d5;
  --olyveil-cream: #fdfaf2;
  --olyveil-warning: #f4d35e;
  --olyveil-danger: #d77a7a;
  --olyveil-on-strong: #162430;

  --glass: rgba(253, 250, 242, .84);
  --glass-strong: rgba(253, 250, 242, .95);
  --glass-dark: rgba(22, 36, 48, .78);
  --line: rgba(47, 63, 76, .12);
  --line-strong: rgba(47, 63, 76, .22);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 8px rgba(22, 36, 48, .10);
  --shadow: 0 10px 28px rgba(22, 36, 48, .16), 0 2px 6px rgba(22, 36, 48, .08);
  --shadow-lg: 0 24px 60px rgba(22, 36, 48, .28), 0 4px 14px rgba(22, 36, 48, .12);
  --blur: blur(14px) saturate(1.25);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--olyveil-cream); color: var(--olyveil-primary-dark);
  font: 400 15px/1.45 "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#scene.dragging { cursor: grabbing; }
[hidden] { display: none !important; }
kbd { display: inline-block; min-width: 1.7em; padding: 1px 6px; border-radius: 6px; background: var(--olyveil-primary-dark);
  color: var(--olyveil-cream); font: 600 12px/1.5 "Golos Text", sans-serif; text-align: center; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .25); }
button { font-family: inherit; }
.muted { color: var(--olyveil-primary); font-weight: 400; opacity: .85; }
.glass { background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid rgba(255, 255, 255, .55); box-shadow: var(--shadow); }
.glass-dark { background: var(--glass-dark); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid rgba(180, 222, 228, .16); box-shadow: var(--shadow); color: var(--olyveil-cream); }
.ico { width: 18px; height: 18px; flex-shrink: 0; fill: currentColor; }

/* ---------- Boutons ---------- */
.btn { font: 600 15px "Golos Text", sans-serif; padding: 10px 20px; border-radius: 12px; cursor: pointer; line-height: 1.2;
  border: 1.5px solid var(--line-strong); background: var(--olyveil-cream); color: var(--olyveil-primary-dark);
  box-shadow: var(--shadow-sm); transition: transform .12s var(--ease), background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { background: var(--olyveil-cyan-light); border-color: var(--olyveil-accent-blue); transform: translateY(-1px); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn:focus-visible { outline: 3px solid rgba(114, 164, 205, .55); outline-offset: 2px; }
.btn.primary { background: var(--olyveil-primary-dark); border-color: var(--olyveil-primary-dark); color: var(--olyveil-cream); }
.btn.primary:hover { background: var(--olyveil-primary); border-color: var(--olyveil-primary); }
.btn.danger { border-color: rgba(215, 122, 122, .7); color: #8a3434; }
.btn.danger:hover { background: #f7e1e1; border-color: var(--olyveil-danger); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* ---------- Écrans plein cadre ---------- */
.screen { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; overflow: auto;
  background: radial-gradient(ellipse at top, var(--olyveil-cyan-light), var(--olyveil-cream) 62%); }

/* Chargement */
.loading-screen { z-index: 60; transition: opacity .55s var(--ease); background:
  radial-gradient(1200px 600px at 50% -10%, var(--olyveil-cyan-light), transparent 70%),
  radial-gradient(900px 500px at 90% 110%, var(--olyveil-green-pale), transparent 70%), var(--olyveil-cream); }
.loading-screen.out { opacity: 0; pointer-events: none; }
.loading-card { width: min(440px, 100%); text-align: center; }
.loading-logo { width: min(300px, 76%); }
.loading-title { font-size: 15px; font-weight: 600; letter-spacing: .32em; text-transform: uppercase; color: var(--olyveil-primary); margin: 6px 0 28px; }
.loading-bar { height: 8px; border-radius: 99px; background: rgba(47, 63, 76, .08); overflow: hidden; }
#load-bar { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--olyveil-accent-blue), var(--olyveil-green)); transition: width .35s var(--ease); }
.loading-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 13.5px; color: var(--olyveil-primary); }
#load-pct { font-variant-numeric: tabular-nums; font-weight: 600; }
.loading-tip { margin: 28px auto 0; max-width: 380px; font-size: 14px; color: var(--olyveil-primary); min-height: 3em; }
.loading-screen.error #load-bar { background: var(--olyveil-danger); }
.loading-screen.error .loading-tip { color: #8a3434; }

/* Titre : carte à gauche, personnage visible à droite */
.title-screen { background: linear-gradient(90deg, rgba(253, 250, 242, .78) 0%, rgba(253, 250, 242, .35) 42%, rgba(253, 250, 242, 0) 62%);
  place-items: center start; padding: 24px 5vw; }
.title-card { width: min(560px, 100%); background: var(--glass-strong); border-radius: 26px; padding: 30px 32px 22px; box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, .7); text-align: left; backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.title-logo { width: min(260px, 70%); display: block; }
.title-card h1 { margin: 6px 0 6px; font-size: 42px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; color: var(--olyveil-primary-dark); }
.tagline { color: var(--olyveil-primary); font-size: 16px; line-height: 1.55; margin: 0 0 18px; }
.custom { background: var(--olyveil-green-pale); border-radius: var(--radius); padding: 14px 16px; border: 1px solid var(--olyveil-green-surface); }
.custom h2 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--olyveil-primary); }
.custom-grid { display: grid; grid-template-columns: 1fr; gap: 9px; }
.custom-grid label { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 600; }
.custom-grid label.check { justify-content: flex-start; cursor: pointer; }
.custom-grid select { font: inherit; font-weight: 500; padding: 5px 10px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--olyveil-cream); color: inherit; min-width: 190px; }
.custom-grid input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--olyveil-primary-dark); }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.swatches button { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); transition: transform .12s var(--ease); }
.swatches button:hover { transform: scale(1.12); }
.swatches button.on { border-color: var(--olyveil-primary-dark); transform: scale(1.16); box-shadow: inset 0 0 0 2px var(--olyveil-cream); }
.title-actions { display: flex; gap: 10px; margin: 18px 0 12px; flex-wrap: wrap; }
.title-actions .btn { padding: 12px 22px; }
.controls-mini { font-size: 12.5px; color: var(--olyveil-primary); margin: 0; line-height: 1.9; }
.controls-mini kbd { font-size: 11px; }

/* Fin */
#ending { background: radial-gradient(ellipse at top, rgba(212, 236, 239, .85), rgba(253, 250, 242, .92) 62%); }
.ending-card { text-align: center; width: min(720px, 100%); }
.ending-card .title-logo { margin: 0 auto; }
#ending-body { text-align: left; line-height: 1.6; }
#ending-body .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 14px 0; }
#ending-body .stat { background: var(--olyveil-green-pale); padding: 12px 10px; border-radius: 14px; text-align: center; border: 1px solid var(--olyveil-green-surface); font-size: 13px; color: var(--olyveil-primary); }
#ending-body .stat b { display: block; font-size: 24px; color: var(--olyveil-primary-dark); }
.ending-card .title-actions { justify-content: center; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud-topleft { position: absolute; top: 16px; left: 16px; min-width: 240px; max-width: 330px; border-radius: var(--radius); padding: 11px 14px 12px; }
#hud-location-row { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 15px; }
#hud-location-row .ico { color: var(--olyveil-accent-blue); }
#hud-location { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#hud-level { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12.5px; }
.lvl-badge { display: inline-block; padding: 1px 8px; border-radius: 99px; background: var(--olyveil-green); color: var(--olyveil-on-strong); font-weight: 700; margin-right: 4px; }
#hud-title { color: var(--olyveil-primary); }
.xpbar { height: 6px; background: rgba(47, 63, 76, .1); border-radius: 99px; margin-top: 7px; overflow: hidden; }
.xpbar > div { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--olyveil-green), #a6d29b); transition: width .5s var(--ease); }

#hud-objective { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px;
  padding: 10px 18px 10px 12px; border-radius: var(--radius); max-width: min(540px, calc(100vw - 600px)); min-width: 260px; }
#hud-objective.flash { animation: objFlash .9s var(--ease); }
@keyframes objFlash { 0% { box-shadow: 0 0 0 0 rgba(244, 211, 94, .7), var(--shadow); } 100% { box-shadow: 0 0 0 14px rgba(244, 211, 94, 0), var(--shadow); } }
#obj-arrow { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: rgba(244, 211, 94, .16); color: var(--olyveil-warning); transition: opacity .3s; }
#obj-arrow svg { width: 18px; height: 18px; fill: currentColor; }
.obj-main { min-width: 0; flex: 1; }
#obj-quest { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--olyveil-cyan); font-weight: 600; }
#obj-text { font-size: 14.5px; font-weight: 600; line-height: 1.3; }
#obj-dist { font-size: 13px; color: var(--olyveil-cyan); white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }

#hud-topright { position: absolute; top: 16px; right: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
#minimap { width: 184px; height: 184px; border-radius: 50%; box-shadow: var(--shadow), 0 0 0 4px rgba(253, 250, 242, .92); background: var(--olyveil-green-pale); }
#fps { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; font-variant-numeric: tabular-nums; }
#fps.low { color: #8a3434; }

#prompt { position: absolute; bottom: 132px; left: 50%; transform: translateX(-50%); padding: 9px 18px 9px 10px; border-radius: 99px;
  font-weight: 600; display: flex; align-items: center; gap: 10px; animation: promptIn .22s var(--ease); white-space: nowrap; }
#prompt kbd { background: var(--olyveil-warning); color: var(--olyveil-on-strong); font-size: 13px; min-width: 26px; padding: 2px 7px; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .15); }
@keyframes promptIn { from { opacity: 0; transform: translate(-50%, 6px); } }
#progress { position: absolute; bottom: 186px; left: 50%; transform: translateX(-50%); width: 300px; padding: 11px 16px; border-radius: 14px; font-weight: 600; font-size: 14px; text-align: center; }
#progress .xpbar > div { background: linear-gradient(90deg, var(--olyveil-accent-blue), var(--olyveil-green)); }
#hud-keys { position: absolute; bottom: 16px; left: 16px; font-size: 12px; padding: 6px 10px; border-radius: 12px; display: flex; gap: 6px; align-items: center; color: var(--olyveil-primary-dark); }
#hud-keys kbd { margin-left: 4px; }
body:has(#dialogue:not([hidden])) #hud-keys, body:has(#dialogue:not([hidden])) #prompt { opacity: 0; }
#hud-keys { transition: opacity .2s; }
#hud-keys kbd:first-child { margin-left: 0; }

/* Notifications */
#toasts { position: absolute; top: 232px; right: 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; width: 320px; }
.toast { position: relative; display: flex; gap: 11px; align-items: flex-start; width: 100%; padding: 11px 14px 12px 12px; border-radius: 14px; overflow: hidden;
  background: var(--glass-strong); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid rgba(255, 255, 255, .6);
  box-shadow: var(--shadow); font-size: 13.5px; line-height: 1.4; animation: toastIn .32s var(--ease); --tc: var(--olyveil-accent-blue); }
.toast .t-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; color: var(--olyveil-on-strong);
  background: color-mix(in srgb, var(--tc) 45%, white); }
.toast .t-ico svg { width: 17px; height: 17px; }
.toast .t-body { min-width: 0; }
.toast b { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--olyveil-primary); margin-bottom: 1px; }
.toast .t-life { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--tc); opacity: .55; transform-origin: left; animation: toastLife linear forwards; }
.toast.quest { --tc: var(--olyveil-warning); }
.toast.done { --tc: var(--olyveil-green); }
.toast.item { --tc: var(--olyveil-cyan); }
.toast.warn, .toast.gfx { --tc: var(--olyveil-danger); }
.toast.out { opacity: 0; transform: translateX(24px); transition: opacity .4s, transform .4s var(--ease); }
@keyframes toastIn { from { opacity: 0; transform: translateX(32px) scale(.98); } }
@keyframes toastLife { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ---------- Dialogue ---------- */
#dialogue { position: fixed; z-index: 20; left: 50%; bottom: 20px; transform: translateX(-50%); width: min(860px, calc(100% - 32px));
  background: var(--glass-strong); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 16px 20px 12px 16px; border: 1px solid rgba(255, 255, 255, .7);
  display: flex; gap: 16px; align-items: flex-start; animation: dlgIn .25s var(--ease); --sp: var(--olyveil-accent-blue); }
#dialogue::before { content: ""; position: absolute; left: 22px; right: 22px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--sp); }
@keyframes dlgIn { from { opacity: 0; transform: translate(-50%, 10px); } }
.dlg-portrait-wrap { width: 108px; height: 108px; flex-shrink: 0; border-radius: 20px; overflow: hidden;
  background: radial-gradient(circle at 50% 30%, var(--olyveil-cream), color-mix(in srgb, var(--sp) 45%, var(--olyveil-cyan-light)) 75%);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--sp) 60%, white), var(--shadow-sm); }
#dlg-portrait { width: 100%; height: 100%; object-fit: cover; display: block; }
.dlg-main { flex: 1; min-width: 0; padding-top: 2px; }
.dlg-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
#dlg-name { font-weight: 800; font-size: 19px; letter-spacing: -.01em; }
#dlg-role { font-size: 12px; padding: 2px 10px; border-radius: 99px; font-weight: 600; color: var(--olyveil-on-strong);
  background: color-mix(in srgb, var(--sp) 30%, var(--olyveil-cream)); }
#dlg-text { font-size: 17.5px; line-height: 1.55; min-height: 54px; white-space: pre-wrap; color: var(--olyveil-on-strong); }
#dlg-text code { background: var(--olyveil-cyan-light); padding: 0 5px; border-radius: 5px; font-size: 15px; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
#dialogue.narr { --sp: var(--olyveil-primary); }
#dialogue.narr #dlg-text { font-style: italic; color: var(--olyveil-primary-dark); }
#dlg-choices { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
#dlg-choices button { text-align: left; font: 600 15px/1.35 "Golos Text", sans-serif; padding: 9px 14px; border-radius: 12px; cursor: pointer; display: flex; gap: 10px; align-items: center;
  border: 1.5px solid var(--line); background: var(--olyveil-green-pale); color: var(--olyveil-primary-dark); transition: background .12s, border-color .12s, transform .12s var(--ease); }
#dlg-choices button:hover, #dlg-choices button:focus-visible { background: var(--olyveil-cyan-light); border-color: var(--olyveil-accent-blue); outline: none; transform: translateX(3px); }
#dlg-choices button code { background: var(--olyveil-cream); padding: 0 4px; border-radius: 4px; }
#dlg-hint { text-align: right; font-size: 12px; color: var(--olyveil-primary); margin-top: 4px; animation: hintPulse 1.6s ease-in-out infinite; }
#dlg-hint kbd { font-size: 11px; }
@keyframes hintPulse { 50% { opacity: .55; } }

/* ---------- Modales ---------- */
.modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px;
  background: rgba(22, 36, 48, .42); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fadeIn .2s ease-out; }
@keyframes fadeIn { from { opacity: 0; } }
.modal-card { background: var(--olyveil-cream); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 20px 24px; width: min(460px, 100%);
  max-height: calc(100vh - 32px); overflow: auto; border: 1px solid rgba(255, 255, 255, .7); animation: cardIn .25s var(--ease); }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.modal-card.wide { width: min(1160px, 100%); }
.modal-card.huge { width: min(1280px, 100%); height: min(820px, calc(100vh - 32px)); display: flex; flex-direction: column; padding: 18px 20px; }
.modal-card h2 { margin: 0 0 12px; }
.modal-title { font-size: 17px; }
.tabs { display: flex; gap: 6px; align-items: center; margin-bottom: 14px; }
.tab { font: 600 14px "Golos Text", sans-serif; padding: 8px 14px; border-radius: 10px; border: none; cursor: pointer;
  background: var(--olyveil-cyan-light); color: var(--olyveil-primary-dark); display: inline-flex; gap: 8px; align-items: center; transition: background .15s; }
.tab:hover { background: var(--olyveil-cyan); }
.tab.on { background: var(--olyveil-primary-dark); color: var(--olyveil-cream); }
.tab.on kbd { background: var(--olyveil-cream); color: var(--olyveil-primary-dark); }
.close { margin-left: auto; border: none; background: none; font-size: 18px; cursor: pointer; color: var(--olyveil-primary); width: 34px; height: 34px; border-radius: 10px; }
.close:hover { background: var(--olyveil-cyan-light); }
/* Carte : toujours entière dans la fenêtre (en-tête et marges compris), proportions conservées */
#bigmap { display: block; width: min(100%, calc((100vh - 140px) * 1100 / 760)); height: auto; aspect-ratio: 1100 / 760; margin: 0 auto;
  border-radius: 14px; background: var(--olyveil-green-pale); }

/* Pause */
.pause-card { width: min(820px, 100%); padding: 0; display: grid; grid-template-columns: 230px 1fr; overflow: hidden; min-height: 510px; }
.pause-side { background: linear-gradient(180deg, var(--olyveil-cyan-light), var(--olyveil-green-pale)); padding: 22px 18px; display: flex; flex-direction: column; gap: 12px; border-right: 1px solid var(--line); }
.pause-logo { width: 150px; display: block; }
.pause-side h2 { margin: 2px 0 2px; font-size: 26px; font-weight: 800; }
.pause-side .btn { width: 100%; }
.pause-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.pause-nav button { text-align: left; font: 600 14.5px "Golos Text", sans-serif; padding: 10px 12px; border-radius: 10px; border: none; cursor: pointer;
  background: transparent; color: var(--olyveil-primary-dark); transition: background .15s; }
.pause-nav button:hover { background: rgba(253, 250, 242, .7); }
.pause-nav button.on { background: var(--olyveil-cream); box-shadow: var(--shadow-sm); }
.pause-body { padding: 24px 28px; overflow: auto; max-height: calc(100vh - 32px); }
.pause-body h3 { margin: 0 0 16px; font-size: 20px; }
.field { display: block; margin-bottom: 18px; }
.field-label { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.field-label output { font-variant-numeric: tabular-nums; color: var(--olyveil-primary); font-weight: 600; }
.field-help { font-size: 13px; color: var(--olyveil-primary); margin: 8px 0 0; line-height: 1.5; }
.field.toggle { display: flex; gap: 10px; align-items: center; font-size: 14px; cursor: pointer; }
.field.toggle input { width: 18px; height: 18px; accent-color: var(--olyveil-primary-dark); flex-shrink: 0; }
input[type="range"] { width: 100%; accent-color: var(--olyveil-primary-dark); height: 22px; cursor: pointer; }
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 12px; background: rgba(47, 63, 76, .07); }
.seg button { font: 600 14px "Golos Text", sans-serif; padding: 8px 18px; border-radius: 9px; border: none; background: transparent; cursor: pointer; color: var(--olyveil-primary-dark); }
.seg button:hover { background: rgba(253, 250, 242, .8); }
.seg button.on { background: var(--olyveil-primary-dark); color: var(--olyveil-cream); box-shadow: var(--shadow-sm); }
.save-info { font-size: 14px; padding: 10px 14px; border-radius: 12px; background: var(--olyveil-green-pale); border: 1px solid var(--olyveil-green-surface); }
.controls-table { width: 100%; font-size: 13.5px; border-collapse: collapse; text-align: left; margin-top: 6px; }
.controls-table td { padding: 7px 4px; border-top: 1px solid var(--line); }
.controls-table td:first-child { font-weight: 600; white-space: nowrap; }

/* ---------- Journal, sac, équipe ---------- */
.journal { display: grid; grid-template-columns: 340px 1fr; gap: 16px; min-height: 420px; }
.quest-list { display: flex; flex-direction: column; gap: 6px; }
.quest-list h3 { margin: 10px 0 4px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--olyveil-primary); }
.quest-list h3:first-child { margin-top: 0; }
.quest-item { text-align: left; padding: 9px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--olyveil-cream);
  cursor: pointer; font: 600 14px "Golos Text", sans-serif; color: var(--olyveil-primary-dark); display: flex; gap: 9px; align-items: center; transition: border-color .12s, background .12s; }
.quest-item:hover { border-color: var(--olyveil-accent-blue); }
.quest-item.sel { background: var(--olyveil-cyan-light); border-color: var(--olyveil-accent-blue); }
.quest-item.done { opacity: .62; }
.qi-ico { width: 18px; display: grid; place-items: center; color: var(--olyveil-primary); flex-shrink: 0; }
.qi-ico.done { color: #4f8a45; }
.qi-ico.track { color: #b8941c; }
.qi-ico svg { width: 16px; height: 16px; fill: var(--olyveil-warning); }
.qi-title { min-width: 0; }
.quest-item .tag { margin-left: auto; font-size: 11px; padding: 1px 8px; border-radius: 99px; background: var(--olyveil-green-surface); white-space: nowrap; }
.quest-item .tag.main { background: var(--olyveil-yellow-soft); box-shadow: inset 0 0 0 1px var(--olyveil-warning); }
.quest-detail { background: var(--olyveil-green-pale); border-radius: 18px; padding: 18px 22px; border: 1px solid var(--olyveil-green-surface); align-self: start; }
.qd-kicker { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--olyveil-primary); font-weight: 600; }
.quest-detail h2 { margin: 2px 0 4px; }
.quest-detail .giver { color: var(--olyveil-primary); font-size: 14px; margin-bottom: 10px; }
.quest-detail p { line-height: 1.55; }
.steps { padding-left: 22px; line-height: 1.7; }
.steps li.done { text-decoration: line-through; color: var(--olyveil-primary); }
.steps li.cur { font-weight: 600; }
.steps li.cur::marker { color: #b8941c; }
.steps li.locked { opacity: .45; }
.quest-detail .reward { margin-top: 10px; font-size: 14px; }
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.inv-item { background: var(--olyveil-green-pale); border-radius: 16px; padding: 14px 12px; text-align: center; border: 1px solid var(--olyveil-green-surface); }
.inv-item .ico { font-size: 34px; line-height: 1.2; }
.inv-item .nm { font-weight: 600; font-size: 14px; margin-top: 2px; }
.inv-item .qty { color: var(--olyveil-primary); }
.inv-item .ds { font-size: 12.5px; color: var(--olyveil-primary); margin-top: 4px; line-height: 1.4; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.team-card { display: flex; gap: 12px; align-items: flex-start; background: var(--olyveil-green-pale); border-radius: 16px; padding: 12px 14px;
  border: 1px solid var(--olyveil-green-surface); border-left: 5px solid var(--c, var(--olyveil-accent-blue)); }
.team-card img, .team-card .ph { width: 64px; height: 64px; border-radius: 14px; flex-shrink: 0;
  background: radial-gradient(circle at 50% 30%, var(--olyveil-cream), color-mix(in srgb, var(--c, #72a4cd) 40%, var(--olyveil-cyan-light)) 75%); }
.team-card .nm { font-weight: 800; }
.team-card .rl { font-size: 13px; color: var(--olyveil-primary); }
.team-card .ds { font-size: 13px; margin-top: 6px; line-height: 1.45; }
.empty { color: var(--olyveil-primary); font-style: italic; }

/* ---------- Petits écrans ---------- */
@media (max-width: 1100px) {
  #hud-objective { max-width: calc(100vw - 520px); min-width: 220px; }
}
@media (max-width: 860px) {
  .journal { grid-template-columns: 1fr; }
  #minimap { width: 116px; height: 116px; }
  #hud-topleft { width: auto; max-width: calc(100vw - 160px); padding: 8px 12px; }
  #hud-level { display: none; }
  #hud-objective { top: auto; bottom: 70px; max-width: calc(100% - 32px); min-width: 0; width: calc(100% - 32px); }
  #toasts { top: 150px; width: min(300px, calc(100vw - 32px)); }
  #hud-keys { display: none; }
  #prompt { bottom: 150px; }
  .title-screen { place-items: center; background: rgba(253, 250, 242, .55); padding: 16px; }
  .title-card { padding: 22px 18px 16px; }
  .title-card h1 { font-size: 34px; }
  .custom-grid select { min-width: 0; }
  .pause-card { grid-template-columns: 1fr; min-height: 0; }
  .pause-side { border-right: none; border-bottom: 1px solid var(--line); }
  .pause-nav { flex-direction: row; flex-wrap: wrap; }
  .dlg-portrait-wrap { width: 72px; height: 72px; border-radius: 16px; }
  #dlg-text { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
