.hud { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 8px 20px; background: linear-gradient(#1f1510, #120c09); border-bottom: 1px solid var(--line); }
.brand { font-size: 1.25rem; letter-spacing: .08em; } .brand-mark { color: var(--gold); }
.badge { padding: 2px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: .85rem; }
.badge.demo { color: #1b1208; background: var(--gold); font-weight: 700; }
.timer { color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.hud-actions { margin-left: auto; display: flex; gap: 8px; }
.pips { display: inline-flex; gap: 3px; margin-left: 6px; vertical-align: middle; }
.pips i { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--gold); } .pips i.on { background: var(--gold); }
.hint-box { flex-basis: 100%; padding: 8px 14px; border-left: 4px solid var(--gold); background: rgba(217, 179, 106, .1); border-radius: 0 8px 8px 0; animation: rise .3s ease; }
.demo-panel { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 10px; border: 1px dashed var(--gold); border-radius: 8px; }
.demo-panel > span { color: var(--gold); font-weight: 700; } .demo-panel .obj { color: var(--ink-dim); font-style: normal; flex: 1 1 200px; }
.inventory { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 8px 20px; background: linear-gradient(#120c09, #1f1510); border-top: 1px solid var(--line); min-height: 0; }
.inv-title { font-size: 1rem; color: var(--gold); }
.slots { display: flex; gap: 8px; flex-wrap: wrap; }
.slot { min-width: 56px; min-height: 56px; border: 1px solid var(--line); border-radius: 10px; background: rgba(0, 0, 0, .4); display: flex; align-items: stretch; }
.slot.empty { opacity: .45; border-style: dashed; width: 56px; }
.slot .item { display: flex; align-items: center; gap: 6px; min-height: 56px; padding: 4px 10px; background: transparent; border: 0; border-radius: 10px; text-align: left; position: relative; }
.slot.sel { border-color: var(--gold); box-shadow: 0 0 16px rgba(217, 179, 106, .5); background: rgba(217, 179, 106, .12); }
.slot.used .item { opacity: .75; } .used-tag { position: absolute; right: 4px; top: 0; font-size: .7rem; color: var(--good); }
.item-name { font-size: .85rem; max-width: 9em; }
.slot .read { min-height: 44px; margin: auto 6px auto 0; padding: 4px 10px; }
.sel-info { font-size: .85rem; color: var(--ink-dim); flex: 1 1 260px; }
.toast { position: fixed; left: 50%; bottom: 120px; transform: translate(-50%, 20px); max-width: min(90vw, 640px); padding: 10px 20px; border-radius: 10px; background: rgba(12, 8, 6, .94);
  border: 1px solid var(--line); opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease; z-index: 30; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); } .toast.ok { border-color: var(--good); } .toast.bad { border-color: var(--bad); }
.backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(5, 3, 2, .72); animation: fade .2s ease; }
.modal { width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto; border: 1px solid var(--gold); border-radius: 14px; background: linear-gradient(#271b14, #17100c);
  box-shadow: 0 20px 80px #000, 0 0 40px rgba(217, 179, 106, .15); animation: zoom .28s cubic-bezier(.2, .8, .3, 1); }
.modal.wide { width: min(720px, 100%); }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.modal h2 { font-size: 1.3rem; } .modal .close { padding: 0; width: 44px; }
.modal-body { display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.desc { color: var(--ink-dim); } .ok { color: var(--good); } .small { font-size: .88rem; color: var(--ink-dim); }
.figure { display: grid; place-items: center; } .row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.bookrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.btn.book { flex-direction: column; display: flex; align-items: center; gap: 4px; padding: 10px; font-size: .9rem; }
.btn.book[aria-pressed="true"] { opacity: .35; }
.slots4 { display: flex; gap: 10px; justify-content: center; }
.bslot { width: 60px; height: 60px; border: 2px dashed var(--line); border-radius: 50%; display: grid; place-items: center; } .bslot.filled { border-style: solid; border-color: var(--gold); }
.frame-row { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 14px; background: #0d1220; border: 6px solid #9a7a3a; border-radius: 6px; flex-wrap: wrap; }
.frame-row figure { text-align: center; font-size: .85rem; width: 110px; } .frame-row figcaption b { display: block; font-size: 1.3rem; color: var(--gold); }
.arrow { font-size: 1.6rem; color: var(--gold); }
.dials { display: flex; flex-direction: column; gap: 8px; } .dial { display: flex; gap: 6px; justify-content: center; }
.btn.digit { padding: 0; width: 48px; font-size: 1.2rem; } .btn.digit[aria-pressed="true"] { background: var(--gold); color: #1b1208; font-weight: 700; }
.code { font-size: 1.6rem; letter-spacing: .3em; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: #000; min-width: 120px; text-align: center; }
.note-paper { display: flex; gap: 14px; align-items: center; padding: 18px; background: #e9dcb4; color: #3a2a18; border-radius: 6px; font-size: 1.1rem; box-shadow: inset 0 0 30px rgba(120, 90, 40, .35); }
.screen { position: fixed; inset: 0; z-index: 25; display: grid; place-items: center; padding: 16px; background: radial-gradient(ellipse at 50% 40%, rgba(40, 26, 18, .85), rgba(5, 3, 2, .96)); animation: fade .6s ease; }
.screen .card { max-width: 560px; text-align: center; padding: 32px; display: flex; flex-direction: column; gap: 18px; align-items: center; border: 1px solid var(--gold); border-radius: 16px; background: rgba(20, 13, 9, .9); box-shadow: 0 0 80px rgba(217, 179, 106, .2); }
.screen h1 { font-size: 2.6rem; letter-spacing: .1em; text-shadow: 0 0 24px rgba(255, 217, 138, .5); } .lead { font-size: 1.1rem; }
.ending { animation-delay: .5s; animation-fill-mode: backwards; } dl { display: grid; grid-template-columns: auto auto; gap: 4px 20px; } dt { color: var(--ink-dim); text-align: right; } dd { margin: 0; text-align: left; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } } @keyframes zoom { from { opacity: 0; transform: scale(.94) translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 700px) {
  .hud { padding: 8px 12px; } .inventory { padding: 8px 12px; position: sticky; bottom: 0; background: #130d0a; z-index: 5; }
  .slots { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; padding-bottom: 4px; } .slot { flex: 0 0 auto; }
  .backdrop { padding: 0; align-items: end; } .modal, .modal.wide { width: 100%; max-height: 92dvh; border-radius: 16px 16px 0 0; }
  .toast { bottom: 100px; } .screen h1 { font-size: 2rem; } .screen .card { padding: 22px; }
  .btn.digit { width: 44px; } .frame-row figure { width: 74px; } .arrow { display: none; }
}
