:root { --bg: #1d140c; --panel: #e9d6a8; --panel2: #6b4423; --line: #4a2c14; --accent: #ffd97a; --accent-ink: #1e1204; --dim: #6d4a26; --ink: #3a2410; }
#app { position: fixed; inset: 0; display: grid; grid-template-rows: minmax(0, 1fr) minmax(0, 52%); }
#scene { position: relative; min-height: 0; overflow: hidden; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#hud { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 6px; pointer-events: none;
  padding: max(6px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) 0 max(6px, env(safe-area-inset-left)); }
#hud > * { pointer-events: auto; }
#hud .sp { flex: 1; pointer-events: none; }
.stat { display: flex; align-items: center; gap: 5px; padding: 3px 10px; min-height: 32px; background: #000a; border-radius: 10px; font-weight: 800; white-space: nowrap; }
.stat img { width: 20px; height: 20px; }
#rateBox { font-size: 13px; color: #b5f5b0; }
#panel { display: flex; flex-direction: column; min-height: 0; background: var(--panel) url(assets/ui/parchment.webp) center / cover; color: var(--ink); border-top: 4px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
#tabs { display: grid; grid-template-columns: repeat(4, 1fr); flex: none; }
.tab { min-height: 44px; border: 0; background: linear-gradient(#7b5230, #54351c); color: #e9d6a8; font-weight: 800; cursor: pointer; border-bottom: 3px solid transparent; position: relative; }
.tab.on { color: var(--ink); background: linear-gradient(#f3e4bd, #e4cf9d); border-bottom-color: #8fbf5a; }
.tab em { position: absolute; top: 3px; right: 6px; font-style: normal; font-size: 11px; background: var(--bad); color: #fff; border-radius: 8px; padding: 0 5px; }
#list { flex: 1; min-height: 0; overflow-y: auto; padding: 6px; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.buybar { display: flex; gap: 5px; margin-bottom: 6px; align-items: center; font-size: 13px; color: var(--dim); }
.buybar .btn { min-height: 36px; padding: 0 2px; font-size: 13px; border-width: 8px 11px; }
#panel .row { background: #5a381a22; box-shadow: inset 0 0 0 1px #5a381a44; }
#panel .row small { color: var(--dim); }
#panel .row .btn small { color: #fff; opacity: 1; }
.row { margin-bottom: 5px; padding: 5px 7px; gap: 8px; }
.row.pulse { box-shadow: inset 0 0 0 2px var(--accent); }
.row .btn { min-width: 92px; padding: 0 2px; line-height: 1.1; font-size: 12.5px; flex: none; border-width: 9px 12px; }
.row .btn small { color: inherit; opacity: .8; }
.row img { width: 46px; height: 46px; }
.row.locked { opacity: .55; }
.pbar { height: 9px; margin-top: 3px; border-radius: 5px; background: #5a381a66; overflow: hidden; }
.pbar i { display: block; height: 100%; width: 0; background: #5aa84a; border-radius: 5px; }
.pbar.ready i { background: #e8a81c; }
.tapme { cursor: pointer; min-width: 0; flex: 1; min-height: 44px; }
.check { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 4px 8px; margin-bottom: 5px; background: #5a381a33; border-radius: 10px; cursor: pointer; }
.check.on { box-shadow: inset 0 0 0 2px #5aa84a; }
.check small { color: var(--dim); }
.card { border-width: 22px; border-image: url(assets/ui/window.webp) 72 fill stretch; color: var(--ink); }
.card h2 { color: #6e3a10; text-shadow: none; }
.card .row { background: #5a381a22; } .card .row small { color: var(--dim); }
@media (orientation: landscape) {
  #app { grid-template-rows: none; grid-template-columns: minmax(0, 1fr) minmax(320px, 46%); }
  #panel { border-top: 0; border-left: 3px solid var(--line); padding-right: env(safe-area-inset-right); }
}
@media (orientation: landscape) and (max-height: 430px) { .tab { min-height: 40px; font-size: 13px; } .row img { width: 38px; height: 38px; } }
