/* ui3.css — thêm 28/10: Tủ hồ sơ (cs-), cài đặt giọng đọc trong menu, dấu hiệu đang đọc (vo), dụng cụ vụ 2–12 (dc-) */

/* ---------- thanh phòng + thanh dụng cụ khi có nhiều món ----------
   Vụ sau có tới 14 dụng cụ và 8–10 nơi: thanh phòng chiếm nửa trái, xuống dòng lên trên; dụng cụ nhỏ lại,
   xếp 2 hàng ở góc phải, không đè lên nhau */
#rooms { max-width: 50%; flex-wrap: wrap; row-gap: calc(var(--u) * .4); }
#tools { max-width: 46%; flex-wrap: wrap-reverse; justify-content: flex-end; }
#tools.many .tool { width: calc(var(--u) * 5); height: calc(var(--u) * 5); padding-bottom: calc(var(--u) * 1.3); }
#tools.many .tool small { font-size: calc(var(--u) * .66); }

/* ---------- điện thoại: "đang gõ…" ---------- */
.ip-bub.ip-typing { display: inline-flex; gap: .3em; padding: .7em .9em; width: auto; }
.ip-bub.ip-typing i { width: .5em; height: .5em; border-radius: 50%; background: #8e8e93; animation: ip-dot 1.2s infinite ease-in-out; }
.ip-bub.ip-typing i:nth-child(2) { animation-delay: .2s; } .ip-bub.ip-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes ip-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-.25em); } }

/* ---------- menu: hàng cài đặt ---------- */
.menu-row { display: flex; align-items: center; justify-content: center; gap: calc(var(--u) * .6); font-size: calc(var(--u) * 1.2); color: var(--dim); }
.menu-row span { margin-right: auto; }
.menu-box .menu-row .seg { padding: .35em 1em; font-size: calc(var(--u) * 1.1); letter-spacing: .06em; opacity: .55; }
.menu-box .menu-row .seg.on { opacity: 1; background: rgba(224, 168, 90, .18); border-color: rgba(224, 168, 90, .8); }

/* ---------- câu thoại đang được đọc: vạch sóng nhỏ bên tên người nói ---------- */
.tk-line.vo small::after { content: ''; display: inline-block; width: 1.6em; height: .8em; margin-left: .5em; vertical-align: middle;
  background: repeating-linear-gradient(90deg, currentColor 0 2px, transparent 2px 5px); opacity: .55;
  -webkit-mask: linear-gradient(180deg, transparent 0 20%, #000 20% 80%, transparent 80%); animation: vo-bar .9s ease-in-out infinite alternate; }
@keyframes vo-bar { from { transform: scaleY(.4); } to { transform: scaleY(1); } }

/* ---------- dụng cụ vụ 2–12 (js/dungcu.js) ---------- */
/* 68: trên cảnh cận (60) và phòng điều tra (65), dưới hội thoại (70), điện thoại (72), thẻ vật chứng (97):
   hành động của dụng cụ (talkLines, call, ev) hiện đè lên màn dụng cụ */
#tool2 { z-index: 68; background: rgba(0, 0, 0, .92); }
.dc-box { position: absolute; inset: 3% 6% 3%; display: flex; flex-direction: column; gap: calc(var(--u) * .6); }
.dc-head { display: flex; align-items: baseline; gap: 1em; color: #efe6d2; }
.dc-head b { font-family: 'Cousine', monospace; letter-spacing: .2em; font-size: calc(var(--u) * 1.3); color: #c9a25a; text-transform: uppercase; }
.dc-head span { font-size: calc(var(--u) * 1.1); color: rgba(233, 228, 216, .7); }
.dc-frame { position: relative; flex: none; width: calc(var(--u) * 80); aspect-ratio: 3 / 2; margin: 0 auto; overflow: hidden; border-radius: 4px;
  cursor: none; touch-action: none; box-shadow: 0 10px 40px rgba(0, 0, 0, .7); }
.dc-layer { position: absolute; inset: 0; }
.dc-dark { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); pointer-events: none; }
.dc-lit { pointer-events: none; }
.dc-litimg { position: absolute; inset: 0; }
.dc-mark { position: absolute; pointer-events: none; line-height: 1.15; }
.dc-mark.f-hand { font-family: 'Patrick Hand', cursive; }
.dc-mark.f-ui { font-family: var(--ui); font-weight: 600; }
.dc-mark.f-type { font-family: 'Cousine', monospace; }
.dc-mark.img .vis { position: absolute; inset: 0; }
.dc-ring { position: absolute; border-radius: 50%; pointer-events: none; border: 2px solid rgba(255, 255, 255, .35); transition: border-color .2s, box-shadow .2s; }
.dc-ring.near { border-color: rgba(255, 230, 160, .85); }
.dc-ring.hit { box-shadow: 0 0 0 6px rgba(255, 230, 160, .5), 0 0 40px rgba(255, 230, 160, .7); }
.dc-cap { position: absolute; left: 50%; bottom: 5%; transform: translate(-50%, 20px); opacity: 0; transition: .35s; background: rgba(0, 0, 0, .78);
  color: #ffe9b8; padding: .5em 1.1em; border-radius: 999px; font-size: calc(var(--u) * 1.2); pointer-events: none; white-space: nowrap; }
.dc-cap.on { opacity: 1; transform: translate(-50%, 0); }
.dc-foot { display: flex; justify-content: space-between; align-items: center; color: rgba(233, 228, 216, .7); font-size: calc(var(--u) * 1.1); }
/* đèn UV: ảnh trong vòng sáng nhuộm tím, mực ẩn phát sáng xanh trắng */
.dc-uv .dc-litimg .vis img { filter: brightness(.6) contrast(1.25) saturate(.4) sepia(1) hue-rotate(205deg) saturate(3.2); }
.dc-uv .dc-litimg::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at var(--lx) var(--ly), rgba(120, 60, 255, .28), rgba(70, 20, 160, .38) 60%); mix-blend-mode: screen; }
.dc-uv .dc-mark { color: #d9fff4; text-shadow: 0 0 4px #7fffe0, 0 0 12px #44e0ff, 0 0 22px rgba(80, 200, 255, .7); }
.dc-uv .dc-mark.img { filter: drop-shadow(0 0 8px rgba(120, 255, 230, .9)); mix-blend-mode: screen; }
.dc-uv .dc-ring { border-color: rgba(190, 140, 255, .55); box-shadow: 0 0 30px rgba(140, 90, 255, .35) inset; }
/* kính lúp: viền kính dày, ảnh bên trong rõ và sáng hơn */
.dc-lens .dc-dark { background: rgba(0, 0, 0, .18); }
.dc-lens .dc-ring { border: calc(var(--u) * .7) solid #2a2622; box-shadow: 0 0 0 2px #a4895a, 0 12px 30px rgba(0, 0, 0, .6), inset 0 0 18px rgba(255, 255, 255, .25); }
.dc-lens .dc-litimg .vis img { filter: contrast(1.08) brightness(1.06); }
.dc-lens .dc-base .dc-mark { color: #3a3226; }
/* bút chì than: canvas than phủ lên ảnh giấy; đầu chì đi theo con trỏ */
.rb-cv { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; mix-blend-mode: multiply; }
.rb-tip { position: absolute; width: calc(var(--u) * 1.2); height: calc(var(--u) * 9); margin: calc(var(--u) * -.4) 0 0 calc(var(--u) * -.2); pointer-events: none;
  transform-origin: 0 0; transform: rotate(-35deg); border-radius: 2px 2px 40% 40%;
  background: linear-gradient(180deg, #1c1b1d 0 9%, #c9a25a 9% 13%, #2c2b2e 13% 100%); box-shadow: 4px 6px 10px rgba(0, 0, 0, .45); opacity: .85; transition: transform .08s; }
.rb-tip.on { transform: rotate(-35deg) translate(1px, 2px); opacity: 1; }

/* bảng so màu mực & giấy (swatch): trái là tài liệu + mẫu cắt, phải là hai hàng mẫu theo năm */
.sw-wrap { display: grid; grid-template-columns: 1fr 1.25fr; gap: calc(var(--u) * 2); flex: 1; min-height: 0; }
.sw-doc { position: relative; border-radius: 4px; overflow: hidden; box-shadow: 0 10px 40px rgba(0, 0, 0, .7); }
.sw-cut { position: absolute; right: 4%; bottom: 4%; padding: calc(var(--u) * .6); background: rgba(0, 0, 0, .72); border: 1px solid rgba(201, 162, 90, .6); border-radius: 4px; }
.sw-cut label { display: block; font-size: calc(var(--u) * .95); color: #c9a25a; margin-bottom: .3em; letter-spacing: .05em; }
.sw-chip { position: relative; width: calc(var(--u) * 7); height: calc(var(--u) * 5); border-radius: 2px; display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.sw-chip.big { width: calc(var(--u) * 13); height: calc(var(--u) * 9); }
.sw-chip.big .sw-chip { width: 70%; height: 60%; box-shadow: none; }
.sw-chip b { font-size: calc(var(--u) * 1.6); font-weight: 400; }
.sw-chip.big b { font-size: calc(var(--u) * 2.4); }
.ink-ribbon b { font-family: 'Cousine', monospace; color: #4a4744; text-shadow: 0 0 1.2px rgba(60, 55, 50, .9), .6px .3px 1px rgba(60, 55, 50, .5); }
.ink-dot b { font-family: 'Cousine', monospace; font-weight: 700; color: #222;
  -webkit-mask: radial-gradient(circle, #000 52%, transparent 58%) 0 0 / 3px 3px; mask: radial-gradient(circle, #000 52%, transparent 58%) 0 0 / 3px 3px; }
.ink-laser b { font-family: 'Cousine', monospace; font-weight: 700; color: #050505; text-shadow: 0 0 .3px #000, 0 -1px 0 rgba(255, 255, 255, .35); }
.ink-ballpoint b { font-family: 'Patrick Hand', cursive; color: #2f4690; opacity: .82; -webkit-mask: linear-gradient(100deg, #000 55%, rgba(0, 0, 0, .45) 70%, #000 85%); mask: linear-gradient(100deg, #000 55%, rgba(0, 0, 0, .45) 70%, #000 85%); }
.ink-gel b { font-family: 'Patrick Hand', cursive; color: #1d3ad0; text-shadow: 0 0 1px rgba(60, 90, 255, .8), 0 -1px 0 rgba(255, 255, 255, .5); }
.sw-board { display: grid; gap: calc(var(--u) * 1.6); align-content: center; }
.sw-row { display: grid; grid-template-columns: calc(var(--u) * 5) repeat(5, 1fr); gap: calc(var(--u) * .8); align-items: start; }
.sw-row h5 { margin: calc(var(--u) * 1.6) 0 0; font-size: calc(var(--u) * 1.2); color: #c9a25a; font-weight: 600; }
.sw-cell { display: grid; justify-items: center; gap: .25em; padding: calc(var(--u) * .5); border-radius: 6px; cursor: pointer; border: 1px solid rgba(233, 228, 216, .12); transition: border-color .2s, background .2s; }
.sw-cell:hover { background: rgba(255, 255, 255, .05); }
.sw-cell.on { border-color: #c9a25a; background: rgba(201, 162, 90, .12); }
.sw-cell em { font-style: normal; font-family: 'Cousine', monospace; color: #efe6d2; font-size: calc(var(--u) * 1.1); }
.sw-cell small { color: rgba(233, 228, 216, .6); font-size: calc(var(--u) * .85); text-align: center; line-height: 1.25; }
.sw-info { color: #ffd9a8; }
.dc-swatch .dc-box { inset: 5% 5% 4%; }

/* bản đồ + com-pa (map): SVG đơn vị km, khung 150 × 100 */
.dc-map .dc-box { inset: 4% 4% 4%; }
.mp-wrap { display: grid; grid-template-columns: 1.7fr 1fr; gap: calc(var(--u) * 1.6); flex: 1; min-height: 0; }
.mp-frame { position: relative; aspect-ratio: 3 / 2; align-self: center; border-radius: 4px; overflow: hidden; box-shadow: 0 10px 40px rgba(0, 0, 0, .7); }
.mp-svg { position: absolute; inset: 0; width: 100%; height: 100%; font-family: var(--ui); }
.mp-bg { fill: #e9e1cc; }
.mp-river { fill: none; stroke: #8fb4c9; stroke-width: 2.4; opacity: .8; }
.mp-hw { fill: none; stroke: #d9822b; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.mp-road { fill: none; stroke: #b7a98a; stroke-width: .8; stroke-linecap: round; }
.mp-rail { fill: none; stroke: #3f3a33; stroke-width: .7; stroke-dasharray: 2 1.4; }
.mp-lab { font-size: 2.6px; fill: #5a4f3e; letter-spacing: .08px; }
.mp-lab.big { font-size: 3.6px; font-weight: 700; fill: #3d3428; }
.mp-lab.hw { fill: #a85a14; font-weight: 600; }
.mp-scale path { stroke: #3d3428; stroke-width: .5; fill: none; }
.mp-scale text { font-size: 2.4px; fill: #3d3428; }
.mp-anc circle { fill: #b23a2a; stroke: #fff; stroke-width: .4; }
.mp-anc text { font-size: 2.6px; font-weight: 700; fill: #7a2418; paint-order: stroke; stroke: #e9e1cc; stroke-width: .8px; }
.mp-ring { fill: rgba(178, 58, 42, .05); stroke: #b23a2a; stroke-width: .45; stroke-dasharray: 1.6 1; }
.mp-ring.ok { stroke: #c08a12; fill: rgba(220, 170, 40, .08); stroke-dasharray: none; stroke-width: .55; }
.mp-spot { cursor: pointer; }
.mp-spot rect { fill: #2d5b8a; stroke: #fff; stroke-width: .35; }
.mp-spot text { font-size: 2.4px; fill: #1f3d5c; font-weight: 600; paint-order: stroke; stroke: #e9e1cc; stroke-width: .7px; }
.mp-svg.all-ok .mp-spot rect { animation: mp-pulse 1.2s ease-in-out infinite; }
.mp-spot.hit rect { fill: #c08a12; animation: none; }
@keyframes mp-pulse { 50% { fill: #5a8fc4; } }
.mp-side { display: grid; align-content: center; gap: calc(var(--u) * 1.6); }
.mp-row h5 { margin: 0 0 .3em; font-size: calc(var(--u) * 1.2); color: #c9a25a; }
.mp-row p { margin: 0 0 .5em; font-size: calc(var(--u) * 1); color: rgba(233, 228, 216, .75); line-height: 1.4; }
.mp-ctl { display: grid; grid-template-columns: 1fr calc(var(--u) * 6); align-items: center; gap: calc(var(--u) * 1); }
.mp-ctl input { accent-color: #c9a25a; }
.mp-ctl b { font-family: 'Cousine', monospace; font-weight: 400; color: #efe6d2; text-align: right; }
.mp-info { color: #ffd9a8; }

/* camera nội soi (scope): khung tròn, ánh LED trắng xanh, viền tối như mắt cá */
.sc-frame { background: #050606; cursor: grab; }
.sc-frame:active { cursor: grabbing; }
.sc-lens { position: absolute; left: 50%; top: 50%; width: 76%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; overflow: hidden;
  box-shadow: 0 0 0 calc(var(--u) * .5) #1b1d1d, 0 0 0 calc(var(--u) * .8) #3a3d3c, 0 0 40px rgba(120, 220, 255, .15); transition: box-shadow .2s; }
.sc-lens.near { box-shadow: 0 0 0 calc(var(--u) * .5) #1b1d1d, 0 0 0 calc(var(--u) * .8) #c9a25a, 0 0 50px rgba(255, 220, 140, .35); }
.sc-pano { position: absolute; }
.sc-pano .vis img { filter: contrast(1.15) saturate(.75) brightness(1.05) hue-rotate(-8deg); }
.sc-lens::after { content: ''; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, transparent 52%, rgba(0, 0, 0, .55) 72%, #000 82%); }
.sc-cross { position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: linear-gradient(rgba(140, 255, 220, .4), rgba(140, 255, 220, .4)) center / calc(var(--u) * 3) 1px no-repeat,
              linear-gradient(rgba(140, 255, 220, .4), rgba(140, 255, 220, .4)) center / 1px calc(var(--u) * 3) no-repeat; }
.sc-hud { position: absolute; left: 3%; top: 4%; font-family: 'Cousine', monospace; font-size: calc(var(--u) * 1); color: #8cffdc; letter-spacing: .12em; text-shadow: 0 0 6px rgba(140, 255, 220, .6); }

/* đầu đọc thẻ nhớ (card): lưới ô nhớ bên trái, danh sách file đã xoá bên phải */
.dc-card .dc-box { inset: 5% 5% 4%; }
.cd-wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: calc(var(--u) * 2); flex: 1; min-height: 0; align-items: center; }
.cd-left { display: grid; gap: calc(var(--u) * 1); }
.cd-grid { display: grid; gap: 3px; padding: calc(var(--u) * 1); background: #0b0d0c; border: 1px solid rgba(120, 220, 180, .25); border-radius: 6px; }
.cd-cell { aspect-ratio: 1; background: #1c2421; border-radius: 2px; transition: background .15s, box-shadow .15s; }
.cd-cell.over { background: repeating-linear-gradient(45deg, #5a2a26 0 3px, #3d1e1b 3px 6px); }
.cd-cell.ok { background: #3f8f6a; }
.cd-cell.sel { background: #3d6fb0; box-shadow: 0 0 0 1px #9cc4ff inset; }
.cd-cell.hitc { background: #d0463a; box-shadow: 0 0 6px rgba(255, 90, 70, .8); }
.cd-legend { display: flex; flex-wrap: wrap; gap: 1em; font-size: calc(var(--u) * .95); color: rgba(233, 228, 216, .7); }
.cd-legend i { display: inline-block; width: 1em; height: 1em; margin-right: .4em; vertical-align: -.15em; border-radius: 2px; }
.cd-legend i.over { background: repeating-linear-gradient(45deg, #5a2a26 0 3px, #3d1e1b 3px 6px); }
.cd-legend i.sel { background: #3d6fb0; } .cd-legend i.hitc { background: #d0463a; } .cd-legend i.ok { background: #3f8f6a; }
.cd-list { display: grid; gap: calc(var(--u) * .6); align-content: center; }
.cd-list h5 { margin: 0 0 .3em; font-size: calc(var(--u) * 1.15); color: #c9a25a; }
.cd-file { display: grid; gap: .15em; padding: .5em .8em; border: 1px solid rgba(233, 228, 216, .15); border-radius: 6px; cursor: pointer; transition: border-color .2s, background .2s; }
.cd-file b { font-family: 'Cousine', monospace; font-weight: 400; color: #efe6d2; font-size: calc(var(--u) * 1.05); }
.cd-file small { color: rgba(233, 228, 216, .6); font-size: calc(var(--u) * .9); }
.cd-file:hover { background: rgba(255, 255, 255, .05); }
.cd-file.on { border-color: #9cc4ff; background: rgba(61, 111, 176, .18); }
.cd-file.done b::after { content: '  ✓ đã cứu'; color: #7fd6a6; }
.cd-go { justify-self: start; margin-top: .4em; }
.cd-info { color: #ffd9a8; }

/* tài khoản (js/taikhoan.js): bảng đăng nhập, bảng thanh toán QR. #acct nằm trên mọi lớp khác
   (cao hơn Tủ hồ sơ 110, khung soi ảnh 120, màn mở đầu 99: mở từ đâu cũng thấy) */
#acct { z-index: 130; background: rgba(5, 4, 3, .82); display: none; align-items: center; justify-content: center; }
#acct.on { display: flex; }
.ac-box { width: min(92%, calc(var(--u) * 62)); max-height: 92%; overflow-y: auto; padding: calc(var(--u) * 2.4) calc(var(--u) * 2.8); border-radius: 8px;
  background: #f3ecd9; color: #1d1a14; box-shadow: 0 20px 60px rgba(0, 0, 0, .7); font-size: calc(var(--u) * 1.25); line-height: 1.45; }
.ac-box h3, .ac-inline h3 { margin: 0 0 .4em; font-size: calc(var(--u) * 1.9); }
.ac-sub { margin: 0 0 1em; color: #5a4f3c; }
.ac-row { display: flex; gap: .6em; margin: .6em 0; }
.ac-row input { flex: 1; min-width: 0; font: inherit; padding: .5em .8em; border: 1px solid #6d5a3a; background: #fffaf0; color: #1d1a14; user-select: text; }
/* nút mặc định của game là chữ sáng cho nền tối: trên nền giấy sáng phải đổi sang nút tối chữ sáng */
.ac-box .btn, .ac-inline .btn { background: #2a2219; color: #f3ecd9; border: 1px solid #2a2219; }
.ac-box .btn:disabled, .ac-inline .btn:disabled { opacity: .55; }
.ac-box .btn-line { background: transparent; color: #2a2219; }
.ac-google { display: flex; align-items: center; justify-content: center; gap: .6em; width: 100%; padding: .7em; font-weight: 600; }
.ac-box .ac-google, .ac-inline .ac-google { background: #fff; color: #1d1a14; border: 1px solid #c9bfa8; }
.ac-google i { display: grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 50%; background: #fff; color: #4285f4; font-style: normal; font-weight: 800; }
.ac-or { margin: 1em 0 .2em; text-align: center; color: #7a6c52; font-size: .9em; }
.ac-msg { min-height: 1.4em; margin: .5em 0; color: #8a2b1d; }
.ac-fine { margin: .6em 0 0; color: #6a5d44; font-size: .82em; }
.ac-fine a { color: inherit; }
.ac-link { background: none; border: 0; padding: 0; color: #6d4a1a; text-decoration: underline; font: inherit; font-size: .9em; cursor: pointer; }
.ac-plea { margin: 0 0 .3em; font-size: 1.12em; }
.ac-pay-in { display: grid; grid-template-columns: auto 1fr; gap: calc(var(--u) * 2); align-items: center; margin: 1em 0; }
.ac-qr { width: calc(var(--u) * 20); height: calc(var(--u) * 20); background: #fff; border: 6px solid #fff; border-radius: 6px; box-shadow: 0 2px 8px rgba(0, 0, 0, .2); }
.ac-pay-in dl { display: grid; grid-template-columns: auto 1fr; gap: .25em 1em; margin: 0; }
.ac-pay-in dt { color: #6a5d44; }
.ac-pay-in dd { margin: 0; font-weight: 600; word-break: break-all; }
.ac-code { font-family: 'Cousine', monospace; letter-spacing: .05em; color: #8a2b1d; }
.ac-pay .btn { margin-top: .6em; }
/* bảng đăng nhập nằm trong màn mở đầu */
.ac-inline { margin-top: calc(var(--u) * 1.6); padding: calc(var(--u) * 1.8); max-width: calc(var(--u) * 46); border-radius: 8px; background: rgba(243, 236, 217, .96); color: #1d1a14; font-size: calc(var(--u) * 1.2); line-height: 1.45; }
@media (max-width: 700px) { .ac-pay-in { grid-template-columns: 1fr; justify-items: center; } }

/* bảng dòng thời gian (timeline, hồ sơ cuối): hàng cột giờ trên tấm bần, khay mảnh bên dưới */
.dc-tline .dc-box { inset: 4% 3% 3%; }
.tl-board { display: grid; gap: 4px; flex: 1; min-height: 0; padding: calc(var(--u) * .8); border-radius: 6px;
  background: #6b4f33 radial-gradient(circle at 20% 30%, rgba(0, 0, 0, .18) 0 1px, transparent 2px) 0 0 / 9px 11px; box-shadow: inset 0 0 30px rgba(0, 0, 0, .6); }
.tl-col { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: .4em .25em; border-radius: 4px; background: rgba(243, 236, 217, .1); cursor: pointer; transition: background .15s, box-shadow .15s; }
.tl-col.target { box-shadow: inset 0 0 0 1px rgba(255, 217, 168, .5); }
.tl-col.target:hover { background: rgba(255, 217, 168, .22); }
.tl-col i { font-style: normal; font-family: 'Cousine', monospace; font-size: calc(var(--u) * 1.05); color: #ffe7b8; text-align: center; }
.tl-col small { min-height: 2.4em; font-size: calc(var(--u) * .78); line-height: 1.2; color: rgba(255, 240, 215, .75); text-align: center; }
.tl-drop { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.tl-tray { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; align-content: flex-start; min-height: calc(var(--u) * 5); max-height: calc(var(--u) * 13); overflow-y: auto; margin-top: calc(var(--u) * .8); flex-shrink: 0; }
.tl-card { position: relative; display: grid; grid-template-columns: calc(var(--u) * 3.6) 1fr; align-items: center; gap: .35em; width: calc(var(--u) * 15); padding: 3px; border-radius: 3px;
  background: #f3ecd9; color: #1d1a14; font-size: calc(var(--u) * .78); line-height: 1.15; cursor: pointer; box-shadow: 0 2px 4px rgba(0, 0, 0, .4); }
.tl-drop .tl-card { width: auto; grid-template-columns: 1fr; text-align: center; }
.tl-drop .tl-card .ivis { display: none; }
/* .vis mặc định tràn đầy khung cha: trong thẻ mảnh phải bó lại thành ô vuông nhỏ */
.tl-card .ivis { position: relative; inset: auto; width: calc(var(--u) * 3.6); height: calc(var(--u) * 3.6); overflow: hidden; border-radius: 2px; }
.tl-card .ivis img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tl-card.sel { outline: 2px solid #c9a25a; transform: translateY(-2px); }
.tl-card.ok { background: #d9ecd6; cursor: default; }
.tl-card.ok::after { content: '✓'; position: absolute; right: 3px; top: 1px; color: #2d6a3a; font-weight: 700; }
.tl-info { color: #ffd9a8; flex: 1; }
.tl-check { margin-right: .6em; }

/* đầu đọc băng Betacam (tape): --n = độ nhiễu 0 → 1. Hình nhoè + trôi ngang, tuyết, sọc ngang, một dải nhiễu cuộn dọc, kính CRT cong */
.tp-frame { --n: 1; background: #050505; overflow: hidden; border-radius: calc(var(--u) * 1.4); }
.tp-pic { position: absolute; inset: 0; filter: blur(calc(var(--n) * 3px)) saturate(calc(1 - var(--n) * .7)) contrast(calc(1 + var(--n) * .4)); animation: tp-jit .18s steps(2) infinite; }
.tp-pic .vis img { filter: sepia(.25) hue-rotate(-12deg) saturate(.8); }
@keyframes tp-jit { 0% { transform: translateX(calc(var(--n) * -2.5%)); } 50% { transform: translateX(calc(var(--n) * 3%)) translateY(calc(var(--n) * 1%)); } }
.tp-snow, .tp-bars, .tp-band, .tp-glass { position: absolute; inset: 0; pointer-events: none; }
.tp-snow { opacity: calc(var(--n) * .75); mix-blend-mode: screen; animation: tp-snow .12s steps(3) infinite;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23f)' opacity='.9'/%3E%3C/svg%3E"); }
@keyframes tp-snow { 0% { background-position: 0 0; } 33% { background-position: -40px 25px; } 66% { background-position: 30px -50px; } }
.tp-bars { opacity: calc(.18 + var(--n) * .7); background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .45) 0 2px, rgba(255, 255, 255, calc(var(--n) * .18)) 2px 3px, transparent 3px 5px); }
.tp-band { opacity: var(--n); background: linear-gradient(180deg, transparent 0 40%, rgba(255, 255, 255, .55) 45%, rgba(200, 200, 200, .9) 48%, rgba(255, 255, 255, .4) 52%, transparent 58%);
  background-size: 100% 260%; animation: tp-roll 2.2s linear infinite; mix-blend-mode: screen; }
@keyframes tp-roll { from { background-position: 0 -120%; } to { background-position: 0 120%; } }
.tp-glass { border-radius: inherit; box-shadow: inset 0 0 calc(var(--u) * 6) rgba(0, 0, 0, .9), inset 0 0 0 calc(var(--u) * .4) #111; background: radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, .08), transparent 50%); }
.tp-osd { position: absolute; left: 4%; top: 5%; font-family: 'Cousine', monospace; font-size: calc(var(--u) * 1.3); color: #e8f4ff; letter-spacing: .12em; text-shadow: 0 0 6px rgba(140, 200, 255, .8); z-index: 2; }
.tp-ctl { display: grid; grid-template-columns: auto 1fr calc(var(--u) * 6); gap: calc(var(--u) * 1.2); align-items: center; margin-top: calc(var(--u) * 1); }
.tp-ctl span { font-family: 'Cousine', monospace; letter-spacing: .2em; color: #c9a25a; font-size: calc(var(--u) * 1); }
.tp-ctl input { accent-color: #c9a25a; }
.tp-ctl b { font-family: 'Cousine', monospace; font-weight: 400; color: #efe6d2; text-align: right; }
.tp-tabs { display: flex; flex-wrap: wrap; gap: .5em; margin-top: calc(var(--u) * .8); }
.tp-tab { padding: .35em .9em; border: 1px solid rgba(233, 228, 216, .25); border-radius: 4px; background: transparent; color: #efe6d2; font: inherit; font-size: calc(var(--u) * 1); cursor: pointer; }
.tp-tab.on { border-color: #c9a25a; background: rgba(201, 162, 90, .15); }
.tp-tab.done::after { content: ' ✓'; color: #7fd6a6; }
.tp-info { color: #ffd9a8; }

/* kính phân cực (polar): lớp loá trắng phủ cả mặt kính (sheen) + một dải loá gắt trùm chỗ có chữ (band); vòng kính lọc xoay theo góc */
.pl-frame { cursor: grab; touch-action: none; }
.pl-sheen, .pl-band { position: absolute; pointer-events: none; z-index: 2; transition: opacity .12s; }
.pl-sheen { inset: 0; background: linear-gradient(118deg, transparent 8%, rgba(255, 255, 255, .5) 26%, rgba(255, 255, 255, .15) 38%, transparent 52%, rgba(255, 255, 255, .35) 70%, transparent 86%); mix-blend-mode: screen; }
.pl-band { background: radial-gradient(ellipse at 45% 45%, rgba(255, 255, 255, .98) 0 45%, rgba(255, 252, 240, .9) 62%, rgba(255, 255, 255, 0) 80%); filter: blur(6px); }
.pl-ring { position: absolute; right: 3%; top: 5%; width: calc(var(--u) * 7); height: calc(var(--u) * 7); border-radius: 50%; z-index: 3; pointer-events: none;
  border: calc(var(--u) * .5) solid #2b2a28; background: radial-gradient(circle, rgba(120, 140, 170, .25) 0 60%, rgba(30, 30, 30, .6) 61%); box-shadow: 0 0 0 1px rgba(233, 228, 216, .3); transition: box-shadow .2s; }
.pl-ring i { position: absolute; left: 50%; top: 8%; bottom: 8%; width: 2px; margin-left: -1px; background: #c9a25a; }
.pl-ring.near { box-shadow: 0 0 0 2px #c9a25a, 0 0 24px rgba(201, 162, 90, .6); }
.pl-ctl { display: grid; grid-template-columns: auto 1fr auto calc(var(--u) * 14); gap: calc(var(--u) * 1); align-items: center; margin-top: calc(var(--u) * 1); }
.pl-ctl input { accent-color: #c9a25a; }
.pl-ctl b { font-family: 'Cousine', monospace; font-weight: 400; color: #c9a25a; text-align: right; font-size: calc(var(--u) * 1.05); }
.pl-info { color: #ffd9a8; }

/* máy dò sóng (radar): ảnh tối đi một chút, đầu dò tròn đổi màu theo tín hiệu --s (0 → 1), cột 10 vạch góc trên trái */
.rd-frame { cursor: none; touch-action: none; }
.rd-frame .vis img { filter: brightness(.82) saturate(.85); }
.rd-probe { --s: 0; position: absolute; width: calc(var(--u) * 5); height: calc(var(--u) * 5); transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none; z-index: 2;
  border: 2px solid hsl(calc(140 - 140 * var(--s)), 80%, 60%); box-shadow: 0 0 calc(var(--u) * 2 * var(--s)) hsl(calc(140 - 140 * var(--s)), 90%, 55%), inset 0 0 0 1px rgba(0, 0, 0, .6);
  background: radial-gradient(circle, hsla(calc(140 - 140 * var(--s)), 90%, 60%, .9) 0 3px, transparent 4px); }
.rd-probe::after { content: ''; position: absolute; inset: -40%; border-radius: 50%; border: 1px solid hsla(calc(140 - 140 * var(--s)), 80%, 60%, .5); animation: rd-ping 1.4s ease-out infinite; }
.rd-probe.hot { border-width: 3px; }
@keyframes rd-ping { from { transform: scale(.5); opacity: 1; } to { transform: scale(1.3); opacity: 0; } }
.rd-meter { position: absolute; left: 2.5%; top: 4%; display: flex; align-items: flex-end; gap: 3px; padding: .5em .7em; background: rgba(5, 8, 7, .78); border: 1px solid rgba(140, 255, 220, .3); border-radius: 6px; z-index: 2; }
.rd-meter i { width: calc(var(--u) * .6); background: #1f2b27; border-radius: 1px; }
.rd-meter i:nth-child(n) { height: calc(var(--u) * .5); }
.rd-meter i:nth-child(2) { height: calc(var(--u) * .7); } .rd-meter i:nth-child(3) { height: calc(var(--u) * .9); } .rd-meter i:nth-child(4) { height: calc(var(--u) * 1.1); }
.rd-meter i:nth-child(5) { height: calc(var(--u) * 1.3); } .rd-meter i:nth-child(6) { height: calc(var(--u) * 1.5); } .rd-meter i:nth-child(7) { height: calc(var(--u) * 1.7); }
.rd-meter i:nth-child(8) { height: calc(var(--u) * 1.9); } .rd-meter i:nth-child(9) { height: calc(var(--u) * 2.1); } .rd-meter i:nth-child(10) { height: calc(var(--u) * 2.3); }
.rd-meter i.on { background: #6fe0a8; } .rd-meter i.on:nth-child(n+6) { background: #e0c95a; } .rd-meter i.on:nth-child(n+9) { background: #e2604c; }
.rd-meter b { margin-left: .6em; min-width: 2ch; font-family: 'Cousine', monospace; font-weight: 400; font-size: calc(var(--u) * 1.1); color: #8cffdc; }

/* máy ghi âm 3 lớp (mixer) */
.dc-mixer .dc-box { inset: 6% 12% 5%; }
.mx-deck { position: relative; height: calc(var(--u) * 11); margin: calc(var(--u) * 1) auto 0; width: calc(var(--u) * 46); border-radius: calc(var(--u) * 1);
  background: linear-gradient(180deg, #2b2a28, #151413); border: 1px solid rgba(233, 228, 216, .2); display: flex; justify-content: center; align-items: center; gap: calc(var(--u) * 10);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, .8), 0 10px 30px rgba(0, 0, 0, .6); }
.mx-reel { width: calc(var(--u) * 7); height: calc(var(--u) * 7); border-radius: 50%; border: calc(var(--u) * .5) solid #4a4740; background: radial-gradient(circle, #1a1918 30%, #3a3630 31% 60%, #1a1918 61%);
  animation: mx-spin 2.4s linear infinite; position: relative; }
.mx-reel i { position: absolute; inset: 42%; background: #c9a25a; border-radius: 50%; }
@keyframes mx-spin { to { transform: rotate(360deg); } }
.mx-src { position: absolute; left: 0; right: 0; bottom: 6%; text-align: center; font-family: 'Cousine', monospace; font-size: calc(var(--u) * .9); color: #c9a25a; letter-spacing: .15em; }
.mx-rows { display: grid; gap: calc(var(--u) * 1); margin-top: calc(var(--u) * 1.5); }
.mx-row { display: grid; grid-template-columns: calc(var(--u) * 12) 1fr calc(var(--u) * 22) calc(var(--u) * 3); align-items: center; gap: calc(var(--u) * 1); color: #efe6d2; font-size: calc(var(--u) * 1.15); }
.mx-meter { height: calc(var(--u) * 1.2); background: #0d0c0b; border-radius: 3px; overflow: hidden; border: 1px solid rgba(233, 228, 216, .15); }
.mx-meter i { display: block; height: 100%; background: linear-gradient(90deg, #4f9a5a, #c9b13a 70%, #c9513a); transition: width .1s; }
.mx-row input, .fr-ctl input { accent-color: #c9a25a; }
.mx-row b { font-family: 'Cousine', monospace; font-weight: 400; color: #c9a25a; text-align: right; }
.mx-sub { margin-top: calc(var(--u) * 1.4); min-height: calc(var(--u) * 8); padding: .8em 1.2em; background: rgba(255, 255, 255, .03); border-left: 3px solid rgba(201, 162, 90, .5);
  font-size: calc(var(--u) * 1.25); color: #efe6d2; opacity: .25; transition: opacity .6s; }
.mx-sub.on { opacity: 1; }
.mx-sub p { margin: .25em 0; }
.mx-info { color: #ffd9a8; }

/* tua khung hình (frames) */
.dc-frames .dc-frame { width: calc(var(--u) * 66); cursor: default; }
.fr-view .vis { position: absolute; inset: 0; }
.fr-odd { opacity: 0; transition: opacity .05s; }
.fr-tc { position: absolute; left: 2%; bottom: 3%; font-family: 'Cousine', monospace; font-size: calc(var(--u) * 1.1); color: #fff; background: rgba(0, 0, 0, .6); padding: .2em .6em; letter-spacing: .1em; }
.fr-tc.hot { color: #ff9a8a; }
.fr-strip { position: relative; height: calc(var(--u) * 1.4); width: calc(var(--u) * 66); margin: 0 auto; background: repeating-linear-gradient(90deg, #2a2620 0 calc(var(--u) * 1), #1a1815 calc(var(--u) * 1) calc(var(--u) * 1.1)); }
.fr-strip i { position: absolute; top: 0; bottom: 0; width: 1px; }
.fr-strip i.hot { width: calc(var(--u) * .5); background: rgba(255, 150, 130, .55); }
.fr-ctl { display: flex; align-items: center; gap: calc(var(--u) * 1); width: calc(var(--u) * 66); margin: 0 auto; }
.fr-ctl input { flex: 1; }
.fr-info { color: #ffd9a8; }

/* khớp giờ (sync) */
.dc-sync .dc-box { inset: 8% 7% 6%; }
.sy-tl { position: relative; margin-top: calc(var(--u) * 1.5); }
.sy-ruler { position: relative; height: calc(var(--u) * 2); margin-left: calc(var(--u) * 16); border-bottom: 1px solid rgba(233, 228, 216, .25); }
.sy-ruler i { position: absolute; transform: translateX(-50%); font-style: normal; font-family: 'Cousine', monospace; font-size: calc(var(--u) * .95); color: rgba(233, 228, 216, .6); }
.sy-row { display: flex; align-items: center; gap: calc(var(--u) * 1); margin: calc(var(--u) * 1.2) 0; }
.sy-row label { width: calc(var(--u) * 15); flex: none; font-size: calc(var(--u) * 1.05); color: #efe6d2; line-height: 1.3; }
.sy-track { position: relative; flex: 1; height: calc(var(--u) * 4.4); background: #0d0c0b; border: 1px solid rgba(233, 228, 216, .2); overflow: hidden; border-radius: 3px; }
.sy-row.b .sy-track { cursor: ew-resize; touch-action: none; border-color: rgba(224, 168, 90, .6); }
.sy-strip { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(90deg, #15130f 0 6px, #1a1813 6px 12px); }
.sy-on { position: absolute; left: 0; top: 18%; bottom: 18%; background: linear-gradient(180deg, #f5d98a, #c99b3a); box-shadow: 0 0 14px rgba(245, 217, 138, .45); }
.sy-row.b .sy-on { background: linear-gradient(180deg, #9fc8ff, #4f86d6); box-shadow: 0 0 14px rgba(159, 200, 255, .45); }
.sy-mk { position: absolute; top: 0; bottom: 0; border-left: 2px dashed #fff; padding-left: .4em; font-family: 'Cousine', monospace; font-size: calc(var(--u) * 1); color: #fff; display: flex; align-items: center; }
.sy-info { margin: calc(var(--u) * 1) 0 0 calc(var(--u) * 16); font-size: calc(var(--u) * 1.2); color: rgba(233, 228, 216, .8); }
.sy-evs { margin: calc(var(--u) * 1.4) 0 0 calc(var(--u) * 16); display: grid; gap: calc(var(--u) * .5); }
.sy-evs div { display: grid; grid-template-columns: calc(var(--u) * 6) calc(var(--u) * 7) 1fr; gap: 1em; font-size: calc(var(--u) * 1.1); color: rgba(233, 228, 216, .65);
  padding: .4em .8em; background: rgba(255, 255, 255, .03); border-left: 3px solid rgba(159, 200, 255, .4); }
.sy-evs i { font-style: normal; font-family: 'Cousine', monospace; color: #9fc8ff; }
.sy-evs b { font-family: 'Cousine', monospace; color: #f5d98a; }
.sy-evs div.ok { color: #efe6d2; border-left-color: #f5d98a; }

/* ---------- Tủ hồ sơ ---------- */
#cases { z-index: 110; background: radial-gradient(ellipse at 50% 20%, #221d16, #070605 75%); overflow: hidden; }
.cs-box { position: absolute; inset: 4% 4% 3%; display: flex; flex-direction: column; gap: calc(var(--u) * 1); }
.cs-head small { font-family: 'Cousine', monospace; letter-spacing: .3em; color: #c9a25a; font-size: calc(var(--u) * 1); }
.cs-head h2 { margin: .1em 0 0; font-family: 'Noto Serif', serif; font-size: calc(var(--u) * 3.4); font-weight: 700; color: #efe6d2; }
.cs-head p { margin: .2em 0 0; color: rgba(233, 228, 216, .6); font-size: calc(var(--u) * 1.15); }
.cs-list { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: max-content; gap: calc(var(--u) * 1.1); padding-right: .6em; align-content: start; }
.cs-season { grid-column: 1 / -1; font-family: 'Cousine', monospace; letter-spacing: .25em; font-size: calc(var(--u) * 1); color: #c9a25a; border-bottom: 1px solid rgba(201, 162, 90, .3); padding: .8em 0 .3em; }
.cs-card { position: relative; cursor: pointer; background: #e9dfc8; color: #1d1a14; border-radius: 2px 10px 2px 2px; box-shadow: 0 6px 18px rgba(0, 0, 0, .55);
  transition: transform .25s, box-shadow .25s; overflow: hidden; }
.cs-card::before { content: ''; position: absolute; left: 0; top: 0; width: 38%; height: 7px; background: #c8b48c; border-radius: 0 0 6px 0; z-index: 2; }
.cs-card:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: 0 12px 26px rgba(0, 0, 0, .65); }
.cs-img.vis { position: relative; inset: auto; aspect-ratio: 3 / 2; overflow: hidden; background: #2a2620; }
.cs-img img { width: 100%; height: 100%; object-fit: cover; display: block; filter: sepia(.25) contrast(1.05); }
.cs-img.ph span { position: absolute; inset: 0; display: grid; place-items: center; font-family: 'Xanh Mono', monospace; font-size: calc(var(--u) * 4); color: rgba(233, 228, 216, .25); }
.cs-txt { padding: .7em .8em .8em; display: grid; gap: .15em; }
.cs-txt i { font-style: normal; font-family: 'Cousine', monospace; font-size: calc(var(--u) * .85); letter-spacing: .2em; color: #7c6440; }
.cs-txt b { font-family: 'Noto Serif', serif; font-size: calc(var(--u) * 1.3); line-height: 1.25; }
.cs-txt small { font-size: calc(var(--u) * .95); color: #5d5444; }
.cs-txt em { font-style: normal; margin-top: .3em; font-size: calc(var(--u) * .9); font-weight: 600; color: #3e5a3a; }
.cs-card.done em { color: #8a2a1e; }
.cs-card.done::after { content: 'ĐÃ KHÉP'; position: absolute; right: 6%; top: 34%; transform: rotate(-12deg); font-family: 'Cousine', monospace; font-weight: 700;
  font-size: calc(var(--u) * 1.5); letter-spacing: .15em; color: rgba(160, 30, 20, .85); border: 3px solid rgba(160, 30, 20, .8); padding: .1em .5em; border-radius: 4px; }
.cs-card.here { outline: 2px solid #e0a85a; outline-offset: 3px; }
.cs-card.lock, .cs-card.soon { cursor: default; filter: grayscale(.85) brightness(.62); }
.cs-card.lock:hover, .cs-card.soon:hover { transform: none; }
.cs-card.soon em, .cs-card.lock em { color: #6d6556; }
.cs-card.lock .cs-img.ph span, .cs-card.soon .cs-img.ph span { opacity: 0; }
.cs-lock { position: absolute; left: 50%; top: 32%; transform: translate(-50%, -50%); width: calc(var(--u) * 4); color: rgba(255, 255, 255, .85); filter: drop-shadow(0 2px 6px #000); }
