:root { --bg: #1b1012; --panel: #2a1a1a; --panel2: #402625; --line: #7a4f33; --accent: #ffd23f; --accent-ink: #2a2000; --dim: #d0b9a8; }
#app { position: fixed; inset: 0; display: grid; grid-template-rows: minmax(0, 1fr) minmax(0, 46%); }
#scene { position: relative; min-height: 0; overflow: hidden; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
#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; }
#dpsBox { font-size: 13px; color: #a8e6ff; }
#skills { position: absolute; left: 0; right: 0; bottom: 6px; display: flex; justify-content: center; gap: 7px; pointer-events: none; }
.skill { pointer-events: auto; position: relative; width: 58px; height: 58px; padding: 0; border-radius: 50%; border: 0; background: center / 100% 100% no-repeat; overflow: hidden; cursor: pointer; font-weight: 800; font-size: 11px; line-height: 1.05; color: #fff; text-shadow: 0 1px 3px #000; filter: grayscale(.45) brightness(.72); }
.skill.ready { filter: none; }
.skill.lock { filter: grayscale(1) brightness(.5); }
.skill i { position: absolute; left: 0; right: 0; bottom: 0; background: #0009; pointer-events: none; }
.skill span { position: relative; z-index: 1; }
#panel { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-top: 3px 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: var(--panel2); color: var(--dim); font-weight: 800; cursor: pointer; border-bottom: 3px solid transparent; position: relative; }
.tab.on { color: var(--accent); background: linear-gradient(#3b1e1e, var(--panel)); border-bottom-color: var(--accent); }
.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; }
.row { margin-bottom: 5px; padding: 5px 7px; }
.row .btn { min-width: 100px; padding: 0 2px; line-height: 1.1; font-size: 12.5px; border-width: 9px 12px; }
.row .btn small { color: inherit; opacity: .8; }
.row.locked { opacity: .55; }
.gear-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
.bag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 5px; }
.gslot { position: relative; min-height: 62px; border: 2px solid #fff2; background: #0004; border-radius: 10px; padding: 3px; display: grid; place-items: center; cursor: pointer; }
.gslot img { width: 44px; height: 44px; }
.gslot small { font-size: 10px; color: var(--dim); }
.gslot.r0 { border-color: #9a9db5; } .gslot.r1 { border-color: #58e08f; } .gslot.r2 { border-color: #4d9dff; } .gslot.r3 { border-color: #c79bff; } .gslot.r4 { border-color: #ffb13d; box-shadow: 0 0 9px #ffb13d88; }
.rar0 { color: #d4d6e6; } .rar1 { color: #58e08f; } .rar2 { color: #6db0ff; } .rar3 { color: #c79bff; } .rar4 { color: #ffb13d; }
@media (orientation: landscape) {
  #app { grid-template-rows: none; grid-template-columns: minmax(0, 1fr) minmax(300px, 42%); }
  #panel { border-top: 0; border-left: 3px solid var(--line); padding-right: env(safe-area-inset-right); }
}
@media (orientation: landscape) and (max-height: 430px) {
  .skill { width: 48px; height: 48px; }
  .tab { min-height: 40px; font-size: 13px; }
}
