/* CAPA Quest · UI in Matrero's layout (panels with stitched borders, round context button, floating joystick)
   re-coloured for a pharma plant: navy/teal panels instead of leather. */
@font-face { font-family: 'Bree Serif'; src: url('../fonts/BreeSerif-Regular.ttf') format('truetype'); font-display: block; }
:root { --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --ink: #f3efe4; --muted: #a9bccb; --teal: #3aa0c8; --gold: #e8c060; --ok: #4fbf7a; --bad: #e0604f;
  --panel: linear-gradient(180deg, #24394b 0%, #1b2d3c 100%); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #14222e; color: var(--ink); overflow: hidden; touch-action: none; overscroll-behavior: none; font-family: 'Bree Serif', Georgia, serif;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
#game, #touch { position: fixed; inset: 0; }
#touch { z-index: 2; }
canvas { display: block; }
.hidden { display: none !important; }
.panel { background: var(--panel); border-radius: 14px; padding: 14px 16px; position: relative; box-shadow: 0 6px 0 #0c1620, 0 10px 24px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.12); color: var(--ink); text-align: left; }
.panel::after { content: ''; position: absolute; inset: 5px; border: 2px dashed rgba(160,210,235,.35); border-radius: 10px; pointer-events: none; }
h1 { font-size: 44px; margin: 6px 0 4px; letter-spacing: .5px; text-shadow: 0 3px 0 #0c1620; }
h2 { font-size: 22px; margin: 4px 0 10px; }
p { line-height: 1.38; margin: 8px 0; }
.small { font-size: 13.5px; } .muted { color: var(--muted); }
.kicker { font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--gold); }
.btn { font: inherit; font-size: 16px; color: var(--ink); background: linear-gradient(180deg, #3a8fb0, #2a6f8e); border: 0; border-radius: 12px; padding: 11px 16px; box-shadow: 0 4px 0 #17465c, inset 0 1px 0 rgba(255,255,255,.25); cursor: pointer; position: relative; }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #17465c; }
.btn.big { font-size: 19px; padding: 13px 22px; background: linear-gradient(180deg, #e8a040, #c8781e); box-shadow: 0 4px 0 #7a4410, inset 0 1px 0 rgba(255,255,255,.3); }
.btn.ghost { background: linear-gradient(180deg, #34495a, #2a3b4a); box-shadow: 0 4px 0 #18242e; }
.btn.small { font-size: 13px; padding: 7px 10px; }
.btn:disabled { opacity: .75; cursor: default; }
.chip { font: inherit; font-size: 14px; color: var(--ink); background: #22384a; border: 2px solid #3a5a72; border-radius: 20px; padding: 6px 12px; margin: 3px; }
.chip.on { border-color: var(--gold); background: #2e4a60; }
#ui { position: fixed; inset: 0; z-index: 20; overflow-y: auto; background: radial-gradient(ellipse at 50% 20%, #24405a 0%, #14222e 70%); touch-action: pan-y; }
.screen { max-width: 560px; margin: 0 auto; padding: calc(18px + var(--sat)) 16px calc(24px + var(--sab)); display: flex; flex-direction: column; gap: 12px; }
.screen.title { align-items: center; text-align: center; padding-top: calc(30px + var(--sat)); }
.titleart img { width: min(440px, 92vw); image-rendering: pixelated; border-radius: 12px; box-shadow: 0 6px 0 #0c1620, 0 0 0 3px #3a5a72; }
.tagline { color: var(--muted); max-width: 420px; }
.col { display: flex; flex-direction: column; gap: 12px; align-items: center; margin-top: 12px; }
.langs { display: flex; flex-wrap: wrap; justify-content: center; }
.foot { margin-top: 18px; font-size: 12px; color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.tag { font-size: 12px; background: #2e4a60; border-radius: 10px; padding: 4px 8px; color: var(--gold); }
.role { display: flex; gap: 12px; align-items: center; border: 0; font: inherit; cursor: pointer; width: 100%; }
.role.on { outline: 3px solid var(--gold); }
.role b { display: block; font-size: 19px; margin-bottom: 4px; } .role span { font-size: 14px; color: var(--muted); line-height: 1.35; }
.pt { width: 64px; height: 64px; image-rendering: pixelated; border-radius: 10px; flex: none; box-shadow: 0 0 0 2px #3a5a72; }
.case { display: flex; gap: 12px; align-items: center; border: 0; font: inherit; cursor: pointer; width: 100%; padding: 10px 14px; }
.case.locked { opacity: .5; }
.case .num { width: 38px; height: 38px; border-radius: 50%; background: #2e4a60; display: flex; align-items: center; justify-content: center; font-size: 17px; flex: none; }
.case .meta { flex: 1; display: flex; flex-direction: column; gap: 2px; } .case .meta span { font-size: 13px; color: var(--muted); } .case .dots { color: var(--gold) !important; }
.case .stars, .starsbig { color: var(--gold); } .starsbig { font-size: 34px; text-align: center; }
.note { background: #3a3020; border-radius: 8px; padding: 6px 10px; font-size: 14px; }
.goal { color: var(--gold); }
/* HUD */
#hud { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
.hudtop { position: absolute; left: 10px; right: 10px; top: calc(8px + var(--sat)); display: flex; gap: 8px; align-items: flex-start; }
.objp { flex: 1; max-width: 560px; background: rgba(20,34,46,.88); border-radius: 12px; padding: 8px 12px; box-shadow: 0 3px 0 #0c1620; border: 2px dashed rgba(160,210,235,.3); font-size: 15px; line-height: 1.3; }
#clock { font-size: 12.5px; color: var(--gold); margin-top: 3px; }
#pause { pointer-events: auto; width: 46px; height: 46px; border-radius: 50%; border: 3px solid #a8d0e4; background: #24394b; color: var(--ink); font: inherit; font-size: 16px; box-shadow: 0 3px 0 #0c1620; }
#act { pointer-events: auto; position: absolute; right: calc(18px + env(safe-area-inset-right, 0px)); bottom: calc(22px + var(--sab)); width: 104px; height: 104px; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #f0b050 0%, #d0802a 60%, #a85e18 100%); border: 5px solid #f3e2b8; box-shadow: 0 5px 0 #6a3a10, 0 0 0 3px #3a2410, 0 10px 18px rgba(0,0,0,.4); color: #fff; font: inherit; font-size: 17px; text-shadow: 0 2px 0 #5a300c; }
#act:active { transform: translateY(3px); }
#joy { position: fixed; z-index: 3; display: none; border-radius: 50%; background: rgba(12,22,32,.3); border: 3px solid rgba(243,239,228,.6); pointer-events: none; }
#knob { position: absolute; left: 50%; top: 50%; width: 42%; height: 42%; margin: -21% 0 0 -21%; border-radius: 50%; background: rgba(243,239,228,.85); border: 3px solid rgba(12,22,32,.5); }
#banner { position: fixed; z-index: 6; left: 0; right: 0; top: 26%; text-align: center; font-size: 26px; color: #fff; text-shadow: 0 3px 0 #0c1620, 0 0 12px rgba(0,0,0,.6); opacity: 0; pointer-events: none; }
#banner.show { animation: ban 2.2s ease forwards; }
@keyframes ban { 0% { opacity: 0; transform: translateY(8px); } 15%, 70% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.toast { position: fixed; z-index: 40; left: 50%; bottom: calc(140px + var(--sab)); transform: translateX(-50%); background: rgba(20,34,46,.95); border-radius: 12px; padding: 9px 14px; max-width: 86vw; text-align: center; box-shadow: 0 3px 0 #0c1620; transition: opacity .4s; }
.toast.out { opacity: 0; }
/* modal: dialogue (bottom), cards and meeting (center) */
.modal { position: fixed; inset: 0; z-index: 10; display: flex; justify-content: center; padding: 10px; background: rgba(8,14,20,.35); overflow-y: auto; touch-action: pan-y; }
.modal.bottom { align-items: flex-end; padding-bottom: calc(12px + var(--sab)); }
.modal.center { align-items: center; }
.modal > .panel { width: 100%; max-width: 640px; max-height: 100%; overflow-y: auto; }
.who { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; } .who b { display: block; font-size: 18px; } .who span { font-size: 13px; color: var(--muted); } .who .prog { margin-left: auto; color: var(--gold); }
.say { font-size: 17px; }
.choices { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.opt { text-align: left; font-size: 15px; line-height: 1.3; background: linear-gradient(180deg, #2f4d63, #26404f); box-shadow: 0 3px 0 #142430; }
.opt.right { background: linear-gradient(180deg, #3f9f66, #2f7f50); } .opt.wrong { background: linear-gradient(180deg, #c05a48, #9a4232); }
.opt.gone { opacity: .25; pointer-events: none; text-decoration: line-through; }
.evtext { font-size: 17px; background: #f2efe6; color: #1e2a34; border-radius: 8px; padding: 10px 12px; box-shadow: inset 0 0 0 2px #c8c0a8; }
.kf { background: #2a2a20; border-left: 4px solid var(--gold); padding: 6px 10px; border-radius: 6px; font-size: 14px; }
.q { font-size: 18px; }
.fb { margin-top: 10px; border-radius: 10px; padding: 8px 12px; } .fb.ok { background: rgba(79,191,122,.16); } .fb.bad { background: rgba(224,96,79,.16); }
.fb p { font-size: 14.5px; }
#fb .btn { margin-top: 10px; width: 100%; }
#hint { margin-top: 10px; }
.report .big { font-size: 40px; text-align: center; color: var(--gold); }
.brk { width: 100%; border-collapse: collapse; font-size: 14px; } .brk td { padding: 3px 0; border-bottom: 1px solid rgba(160,210,235,.15); } .brk td:last-child { text-align: right; }
a { color: #8fd0f0; }
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.8); display: flex; align-items: center; justify-content: center; }
.adbox { background: #fff; color: #222; border-radius: 12px; padding: 18px; width: 280px; text-align: center; font-family: sans-serif; }
.ad-art { height: 120px; margin: 10px 0; background: repeating-linear-gradient(45deg, #ddd, #ddd 10px, #eee 10px, #eee 20px); display: flex; align-items: center; justify-content: center; font-weight: bold; color: #888; }
.adbox .kicker { color: #666; }
@media (min-width: 700px) { .objp { font-size: 16px; } #act { width: 120px; height: 120px; font-size: 19px; } }
