:root {
  --espresso: #1f140e; --espresso-2: #2b1c14; --walnut: #5a3a26; --walnut-2: #7a5236;
  --cream: #f4e9d8; --cream-2: #e7d7bd; --beige: #cdb48e; --gold: #c9a25e; --gold-2: #e0be7c;
  --ink: #1c1410; --muted: #b7a58c; --good: #7fb685; --warn: #e2b049; --bad: #d9695f; --info: #8fb3d9;
  --panel: rgba(28, 19, 13, 0.92); --panel-2: rgba(44, 30, 21, 0.94); --line: rgba(201, 162, 94, 0.28);
  --radius: 14px; --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --font-ui: "Inter", "Segoe UI", system-ui, sans-serif; --font-title: "Playfair Display", Georgia, serif;
  --font-ar: "Noto Kufi Arabic", "Segoe UI", Tahoma, sans-serif;
  color-scheme: dark; /* single deliberate dark café look */
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--espresso); color: var(--cream); font-family: var(--font-ui); -webkit-font-smoothing: antialiased; }
html[lang="ar"] body, html[lang="ar"] button, html[lang="ar"] input { font-family: var(--font-ar); }
html[lang="ar"] .title-font { font-family: var(--font-ar); font-weight: 700; }
#app { position: fixed; inset: 0; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
#ui { position: absolute; inset: 0; pointer-events: none; }
/* zero specificity, so overlay layers that declare pointer-events: none (.hud, .fade, .toasts, .cs) stay click-through */
:where(#ui) > * { pointer-events: auto; }
#ui .passthru { pointer-events: none; }
button { font: inherit; cursor: pointer; }
.hidden { display: none !important; }
.title-font { font-family: var(--font-title); }

/* ---------- boot ---------- */
.boot { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 40%, #3a2619 0%, #160e09 70%); z-index: 50; transition: opacity .6s; }
.boot-inner { text-align: center; width: min(460px, 86vw); }
.boot-logo { font: 700 clamp(34px, 6vw, 56px) var(--font-title); letter-spacing: .02em; color: var(--cream); }
.boot-sub { font-weight: 600; letter-spacing: .32em; font-size: 12px; color: var(--gold); margin: 8px 0 28px; }
.boot-bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,.08); overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold-2)); transition: width .25s; }
.boot-msg { margin-top: 12px; font-size: 13px; color: var(--muted); min-height: 1.4em; }
.boot-error { margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: rgba(217,105,95,.14); border: 1px solid rgba(217,105,95,.5); color: #f6c9c3; font-size: 13px; text-align: start; white-space: pre-wrap; }

/* ---------- generic ---------- */
.btn { appearance: none; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--cream); padding: 11px 18px; border-radius: 10px; font-weight: 600; font-size: 15px; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { background: rgba(201,162,94,.14); border-color: var(--gold); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.primary { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn.ghost { background: transparent; }
.btn.selected { border-color: var(--gold); background: rgba(201,162,94,.22); box-shadow: inset 0 0 0 1px var(--gold); }
.btn.good { border-color: rgba(127,182,133,.6); }
.btn.danger { border-color: rgba(217,105,95,.6); }
.kbd { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 6px; background: var(--cream); color: var(--ink); font: 700 13px var(--font-ui); box-shadow: 0 2px 0 #9c8a6d; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(6px); }
.muted { color: var(--muted); }
.gold { color: var(--gold); }
.row { display: flex; gap: 10px; align-items: center; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.sep { height: 1px; background: var(--line); margin: 12px 0; }
.pill { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: rgba(201,162,94,.16); color: var(--gold-2); }
.pill.good { background: rgba(127,182,133,.16); color: #a9d9ae; }
.pill.bad { background: rgba(217,105,95,.16); color: #f0a49c; }
.pill.warn { background: rgba(226,176,73,.16); color: #f1cf86; }

/* ---------- screens (menus) ---------- */
.screen { position: absolute; inset: 0; display: flex; align-items: stretch; justify-content: flex-start; z-index: 20; }
.screen.center { align-items: center; justify-content: center; }
.menu-side { width: min(440px, 100%); padding: clamp(24px, 5vw, 56px); display: flex; flex-direction: column; justify-content: center; gap: 12px; background: linear-gradient(90deg, rgba(20,13,9,.94) 0%, rgba(20,13,9,.82) 70%, rgba(20,13,9,0) 100%); }
html[dir="rtl"] .menu-side { background: linear-gradient(270deg, rgba(20,13,9,.94) 0%, rgba(20,13,9,.82) 70%, rgba(20,13,9,0) 100%); }
.menu-logo { font: 700 clamp(40px, 6vw, 64px)/1 var(--font-title); letter-spacing: .01em; }
.menu-logo .amp { color: var(--gold); }
.menu-sub { letter-spacing: .3em; font-weight: 600; font-size: 12px; color: var(--gold); margin: 6px 0 26px; }
html[lang="ar"] .menu-sub { letter-spacing: 0; font-size: 15px; }
.menu-btn { text-align: start; padding: 14px 18px; font-size: 17px; display: flex; justify-content: space-between; align-items: center; }
.menu-btn small { color: var(--muted); font-weight: 500; font-size: 12px; }
.menu-foot { margin-top: 22px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.lang-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.lang-toggle button { border: 0; background: transparent; color: var(--cream); padding: 8px 14px; font-weight: 600; }
.lang-toggle button.on { background: var(--gold); color: var(--ink); }

.modal-wrap { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10,6,4,.55); z-index: 30; padding: 16px; }
.modal { width: min(720px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 24px 26px; }
.modal.wide { width: min(1120px, 100%); }
.modal h2 { margin: 0 0 6px; font: 700 28px var(--font-title); }
html[lang="ar"] .modal h2 { font-family: var(--font-ar); }
.modal h3 { margin: 18px 0 8px; font-size: 15px; color: var(--gold-2); letter-spacing: .04em; }
.modal .close { float: inline-end; }
.setting-row { display: grid; grid-template-columns: 170px 1fr 52px; gap: 12px; align-items: center; padding: 8px 0; }
.setting-row input[type=range] { width: 100%; accent-color: var(--gold); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; color: var(--cream); padding: 8px 14px; font-weight: 600; }
.seg button.on { background: var(--gold); color: var(--ink); }

/* ---------- character select ---------- */
.cs { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr auto; z-index: 20; pointer-events: none; }
.cs > * { pointer-events: auto; }
.cs-head { text-align: center; padding: 26px 16px 0; }
.cs-head h1 { margin: 0; font: 700 clamp(28px, 4vw, 44px) var(--font-title); letter-spacing: .04em; }
.cs-head .ar { font: 700 clamp(20px, 3vw, 30px) var(--font-ar); color: var(--gold); margin-top: 4px; }
.cs-cards { display: flex; justify-content: space-between; align-items: flex-end; padding: 0 clamp(12px, 6vw, 90px) 12px; pointer-events: none; }
.cs-card { pointer-events: auto; width: min(260px, 40vw); padding: 14px 16px; cursor: pointer; transition: border-color .2s, transform .2s; }
.cs-card.on { border-color: var(--gold); transform: translateY(-4px); box-shadow: 0 0 0 1px var(--gold), var(--shadow); }
.cs-card b { display: block; font-size: 18px; }
.cs-foot { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; padding: 16px; background: linear-gradient(0deg, rgba(20,13,9,.95), rgba(20,13,9,.0)); }
.cs-foot input { background: rgba(255,255,255,.06); border: 1px solid var(--line); color: var(--cream); border-radius: 10px; padding: 11px 14px; font-size: 15px; width: 220px; }
.cs-foot input:focus { outline: 2px solid var(--gold); }

/* ---------- HUD ---------- */
.hud { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.hud > * { pointer-events: none; }
.hud-top { position: absolute; top: 14px; inset-inline-start: 14px; display: flex; flex-direction: column; gap: 10px; max-width: min(440px, calc(100vw - 28px)); }
.hud-chip { display: inline-flex; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; font-weight: 600; width: fit-content; }
.hud-chip .clock { font-variant-numeric: tabular-nums; color: var(--gold-2); }
.hud-obj { padding: 12px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.hud-obj .mission { font-size: 11px; letter-spacing: .12em; color: var(--gold); font-weight: 700; text-transform: uppercase; }
html[lang="ar"] .hud-obj .mission { letter-spacing: 0; font-size: 12px; }
.hud-obj .text { font-size: 15px; font-weight: 600; margin-top: 4px; line-height: 1.35; }
.hud-obj .sub { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.hud-obj .prog { height: 4px; border-radius: 4px; background: rgba(255,255,255,.08); margin-top: 8px; overflow: hidden; }
.hud-obj .prog i { display: block; height: 100%; background: var(--gold); transition: width .3s; }
.hud-checklist { margin: 8px 0 0; padding: 0; list-style: none; font-size: 13px; }
.hud-checklist li { padding: 2px 0; color: var(--cream-2); }
.hud-checklist li::before { content: "○"; color: var(--gold); margin-inline-end: 8px; }
.hud-checklist li.done { color: var(--muted); text-decoration: line-through; }
.hud-checklist li.done::before { content: "●"; color: var(--good); }
.hud-right { position: absolute; top: 14px; inset-inline-end: 14px; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; max-width: min(320px, 46vw); }
.hud-order { padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; min-width: 220px; }
.hud-order h4 { margin: 0 0 6px; font-size: 12px; color: var(--gold); letter-spacing: .1em; }
.hud-order .line { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.hud-order .steps { margin-top: 6px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.hud-order .steps .ok { color: var(--good); }
.hud-order .steps .next { color: var(--gold-2); font-weight: 600; }
.sat-meter { display: flex; align-items: center; gap: 8px; }
.sat-meter .bar { width: 110px; height: 6px; border-radius: 6px; background: rgba(255,255,255,.08); overflow: hidden; }
.sat-meter .bar i { display: block; height: 100%; background: var(--good); }
.crosshair { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: rgba(255,255,255,.75); box-shadow: 0 0 0 2px rgba(0,0,0,.25); transition: transform .15s, background .15s; }
.crosshair.active { transform: scale(1.8); background: var(--gold-2); }
.prompt { position: absolute; left: 50%; top: calc(50% + 34px); transform: translateX(-50%); display: flex; gap: 10px; align-items: center; padding: 8px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-weight: 600; font-size: 15px; white-space: nowrap; }
.prompt .sub { color: var(--muted); font-weight: 500; font-size: 12px; }
.held { position: absolute; bottom: 16px; inset-inline-end: 16px; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; max-width: 280px; }
.held b { color: var(--gold-2); }
.hint-bar { position: absolute; bottom: 16px; inset-inline-start: 16px; display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--cream-2); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; max-width: calc(100vw - 340px); }
.hint-bar span { display: inline-flex; gap: 6px; align-items: center; }
.hint-bar .kbd { height: 20px; min-width: 20px; font-size: 11px; }
.compass { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); padding: 6px 14px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.compass .arrow { display: inline-block; color: var(--gold-2); transition: transform .1s linear; }
.marker { position: absolute; transform: translate(-50%, -100%); pointer-events: none; text-align: center; font-size: 12px; font-weight: 700; color: var(--gold-2); text-shadow: 0 1px 3px #000; }
.marker .gem { width: 16px; height: 16px; margin: 0 auto 2px; transform: rotate(45deg); border: 2px solid var(--gold-2); background: rgba(201,162,94,.35); box-shadow: 0 0 12px rgba(224,190,124,.8); }
.bubble { position: absolute; transform: translate(-50%, -100%); padding: 5px 10px; border-radius: 10px; background: rgba(244,233,216,.95); color: var(--ink); font-size: 12.5px; font-weight: 600; white-space: nowrap; pointer-events: none; box-shadow: 0 4px 12px rgba(0,0,0,.3); }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: rgba(244,233,216,.95); }
.bubble .pat { display: block; height: 3px; border-radius: 3px; margin-top: 3px; background: #ddd; overflow: hidden; }
.bubble .pat i { display: block; height: 100%; }

/* ---------- toast / title cards ---------- */
.toasts { position: absolute; top: 76px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; z-index: 25; pointer-events: none; }
.toast { padding: 9px 16px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); font-weight: 600; font-size: 14px; animation: toastIn .25s ease-out; box-shadow: var(--shadow); }
.toast.good { border-color: rgba(127,182,133,.7); }
.toast.bad { border-color: rgba(217,105,95,.7); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.titlecard { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(ellipse at center, rgba(20,13,9,.75), rgba(10,6,4,.95)); z-index: 40; text-align: center; animation: fadeIn .6s; }
.titlecard .ch { color: var(--gold); letter-spacing: .3em; font-weight: 700; font-size: 13px; }
.titlecard h1 { font: 700 clamp(34px, 5vw, 60px) var(--font-title); margin: 10px 0; }
html[lang="ar"] .titlecard h1 { font-family: var(--font-ar); }
.titlecard .time { color: var(--cream-2); font-size: 15px; }
.titlecard .story { max-width: 620px; margin: 18px auto 0; color: var(--cream-2); line-height: 1.7; font-size: 15px; padding: 0 20px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.fade { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .5s; z-index: 45; }
.fade.on { opacity: 1; }

/* ---------- dialogue ---------- */
.dialogue { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(860px, calc(100vw - 24px)); padding: 16px 20px; z-index: 15; }
.dialogue .who { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.dialogue .who b { font: 700 18px var(--font-title); color: var(--gold-2); }
html[lang="ar"] .dialogue .who b { font-family: var(--font-ar); }
.dialogue .who span { font-size: 12px; color: var(--muted); }
.dialogue .text { font-size: 17px; line-height: 1.55; min-height: 2.6em; }
.dialogue .choices { display: grid; gap: 8px; margin-top: 12px; }
.dialogue .choice { text-align: start; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--cream); font-size: 15px; display: flex; gap: 10px; align-items: center; }
.dialogue .choice:hover, .dialogue .choice.focus { background: rgba(201,162,94,.16); border-color: var(--gold); }
.dialogue .choice .kbd { flex: none; }
.dialogue .cont { margin-top: 10px; font-size: 12px; color: var(--muted); text-align: end; }

/* ---------- POS ---------- */
.pos { width: min(1180px, 100%); height: min(720px, calc(100vh - 32px)); display: grid; grid-template-columns: 1fr 340px; overflow: hidden; padding: 0; }
.pos-main { display: flex; flex-direction: column; min-width: 0; border-inline-end: 1px solid var(--line); }
.pos-top { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: rgba(0,0,0,.18); }
.pos-top .brand { font: 700 18px var(--font-title); }
.pos-cats { display: flex; gap: 6px; padding: 10px 14px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.pos-cats button { border: 1px solid var(--line); background: transparent; color: var(--cream); padding: 8px 12px; border-radius: 9px; font-weight: 600; font-size: 13px; }
.pos-cats button.on { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.pos-grid { flex: 1; overflow: auto; padding: 12px 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; align-content: start; }
.prod { border: 1px solid var(--line); background: rgba(255,255,255,.035); border-radius: 12px; padding: 10px; color: var(--cream); text-align: start; display: flex; flex-direction: column; gap: 6px; min-height: 120px; }
.prod:hover { border-color: var(--gold); background: rgba(201,162,94,.1); }
.prod canvas { width: 100%; height: 64px; border-radius: 8px; background: #2a1c14; }
.prod b { font-size: 13.5px; line-height: 1.25; }
.prod .price { color: var(--gold-2); font-weight: 700; font-size: 13px; }
.pos-mods { padding: 12px 14px; border-top: 1px solid var(--line); background: rgba(0,0,0,.2); max-height: 46%; overflow: auto; }
.pos-mods h4 { margin: 0 0 8px; font-size: 15px; }
.mod-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.mod-row label { width: 96px; font-size: 12px; color: var(--muted); font-weight: 600; }
.mod-row .btn { padding: 6px 10px; font-size: 12.5px; }
.pos-side { display: flex; flex-direction: column; min-height: 0; }
.pos-said { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 13px; background: rgba(143,179,217,.07); }
.pos-said b { color: var(--info); font-size: 11px; letter-spacing: .1em; }
.pos-said p { margin: 6px 0 0; line-height: 1.45; }
.pos-ticket { flex: 1; overflow: auto; padding: 10px 14px; }
.tline { padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; cursor: pointer; }
.tline.sel { background: rgba(201,162,94,.1); }
.tline .t1 { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.tline .t2 { color: var(--muted); font-size: 12px; margin-top: 2px; }
.pos-totals { padding: 10px 14px; border-top: 1px solid var(--line); font-size: 14px; }
.pos-totals .r { display: flex; justify-content: space-between; padding: 2px 0; }
.pos-totals .total { font-size: 20px; font-weight: 700; color: var(--gold-2); }
.pos-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 14px 14px; }
.pos-actions .btn { padding: 10px; font-size: 13.5px; }
.pos-actions .wide { grid-column: span 2; }
.cashpad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.money { border-radius: 8px; padding: 10px 6px; border: 1px solid var(--line); background: rgba(127,182,133,.08); color: var(--cream); font-weight: 700; }
.money.coin { border-radius: 30px; background: rgba(201,162,94,.12); }
.receipt { background: #faf6ee; color: #2a2a2a; font: 13px/1.5 "Consolas", "Courier New", monospace; padding: 16px; border-radius: 4px; width: 300px; margin: 0 auto; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
html[lang="ar"] .receipt { font-family: var(--font-ar); }
.receipt .c { text-align: center; }
.receipt .r { display: flex; justify-content: space-between; gap: 8px; }
.receipt hr { border: 0; border-top: 1px dashed #999; }

/* ---------- station / minigames ---------- */
.station { width: min(640px, 100%); padding: 20px 22px; }
.station h2 { margin: 0; font: 700 24px var(--font-title); }
html[lang="ar"] .station h2 { font-family: var(--font-ar); }
.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-top: 12px; }
.opts .btn { padding: 12px 10px; font-size: 14px; }
.gauge { position: relative; height: 26px; border-radius: 8px; background: rgba(255,255,255,.07); overflow: hidden; margin: 14px 0 6px; border: 1px solid var(--line); }
.gauge .zone { position: absolute; top: 0; bottom: 0; background: rgba(127,182,133,.32); border-inline: 2px solid rgba(127,182,133,.9); }
.gauge .fill { position: absolute; inset-block: 0; inset-inline-start: 0; background: linear-gradient(90deg, #8a5a36, #c9a25e); }
.gauge .needle { position: absolute; top: -2px; bottom: -2px; width: 4px; margin-left: -2px; background: var(--cream); box-shadow: 0 0 8px #fff; }
.gauge-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.ticket-mini { padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px dashed var(--line); font-size: 13px; margin-top: 10px; }

/* ---------- map / journal / inventory ---------- */
.mapcanvas { width: 100%; border-radius: 12px; background: #1b120c; display: block; }
.journal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.jlist { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.jlist li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.jlist li.done { color: var(--muted); }
.jlist li.done::before { content: "✓ "; color: var(--good); }
.inv-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.inv-table th, .inv-table td { text-align: start; padding: 7px 8px; border-bottom: 1px solid var(--line); }
.inv-table th { color: var(--gold); font-size: 12px; letter-spacing: .06em; }
.stock-bar { width: 120px; height: 6px; border-radius: 6px; background: rgba(255,255,255,.08); overflow: hidden; display: inline-block; vertical-align: middle; }
.stock-bar i { display: block; height: 100%; }

/* ---------- evaluation ---------- */
.eval-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 12px; }
.eval-card { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.03); }
.eval-card .lbl { font-size: 12px; color: var(--muted); font-weight: 600; }
.eval-card .val { font: 700 26px var(--font-title); margin-top: 4px; }
.eval-card .bar { height: 5px; border-radius: 5px; background: rgba(255,255,255,.08); margin-top: 8px; overflow: hidden; }
.eval-card .bar i { display: block; height: 100%; }
.grade { text-align: center; padding: 18px; border-radius: 14px; border: 1px solid var(--gold); background: rgba(201,162,94,.08); margin-top: 16px; }
.grade .big { font: 700 34px var(--font-title); color: var(--gold-2); }
html[lang="ar"] .grade .big { font-family: var(--font-ar); }
.feedback { margin-top: 14px; font-size: 14px; line-height: 1.6; color: var(--cream-2); }
.feedback li { margin: 4px 0; }

/* ---------- menu book ---------- */
.book { display: grid; grid-template-columns: 220px 1fr; gap: 16px; min-height: 380px; }
.book-list { display: flex; flex-direction: column; gap: 4px; max-height: 460px; overflow: auto; }
.book-list button { text-align: start; border: 1px solid transparent; background: transparent; color: var(--cream); padding: 7px 10px; border-radius: 8px; font-size: 13.5px; }
.book-list button.on { border-color: var(--gold); background: rgba(201,162,94,.12); }
.book-list button.seen::after { content: " ✓"; color: var(--good); }
.book-page canvas { width: 100%; height: 160px; border-radius: 12px; background: #2a1c14; }
.book-page h3 { font: 700 24px var(--font-title); color: var(--cream); margin: 12px 0 4px; letter-spacing: 0; }
html[lang="ar"] .book-page h3 { font-family: var(--font-ar); }
.book-page p { line-height: 1.6; color: var(--cream-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

@media (max-width: 760px) {
  .pos { grid-template-columns: 1fr; height: auto; }
  .pos-side { border-top: 1px solid var(--line); }
  .journal-grid, .book { grid-template-columns: 1fr; }
  .hint-bar { display: none; }
  .setting-row { grid-template-columns: 110px 1fr 44px; }
  .cs-cards { gap: 8px; }
}
