* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: #06080e; overflow: hidden; overscroll-behavior: none; }
body { font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif; color: #f2e9d8; user-select: none; -webkit-user-select: none; touch-action: none; }
:root { --ink: #0a0d14; --panel: #1c2536; --panel2: #263249; --orange: #f39a2b; --yellow: #ffd23f; --red: #c2334a; --blue: #5fbcff; --paper: #f2e9d8; }

#app { position: relative; height: 100%; width: 100%; max-width: calc(100vh * 0.5625); max-width: calc(100dvh * 0.5625); margin: 0 auto; overflow: hidden; background: #0e1420; }
@media (max-aspect-ratio: 9/16) { #app { max-width: none; } }
canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; }

#hud { position: absolute; left: 0; right: 0; top: 0; padding: calc(10px + env(safe-area-inset-top)) 12px 0; pointer-events: none; }
#top { display: flex; align-items: center; }
#wave { flex: none; font-weight: 900; font-size: 15px; letter-spacing: 1px; padding: 4px 10px; background: var(--orange); color: var(--ink); border: 2px solid var(--ink); border-radius: 8px; box-shadow: 0 3px 0 var(--ink); }
#bar { flex: 1; height: 12px; margin: 0 10px; background: rgba(10, 13, 20, .75); border: 2px solid var(--ink); border-radius: 7px; overflow: hidden; }
#bar i { display: block; height: 100%; width: 100%; background: linear-gradient(#ffe27a, var(--yellow)); transform-origin: left; }
#mute { pointer-events: auto; flex: none; width: 32px; height: 32px; font-size: 16px; font-weight: 900; color: var(--paper); background: rgba(10, 13, 20, .7); border: 2px solid var(--ink); border-radius: 50%; }
#mute.off { color: #6b7385; text-decoration: line-through; }
#row2 { display: flex; align-items: center; margin-top: 8px; }
#hp { position: relative; flex: none; width: 44%; height: 16px; background: rgba(10, 13, 20, .75); border: 2px solid var(--ink); border-radius: 9px; overflow: hidden; }
#hp i { display: block; height: 100%; width: 100%; background: linear-gradient(#ff7a7a, var(--red)); transform-origin: left; transition: transform .15s; }
#hp span { position: absolute; left: 0; right: 0; top: 0; line-height: 12px; font-size: 10px; font-weight: 900; text-align: center; text-shadow: 0 1px 0 var(--ink); }
#loot { flex: 1; display: flex; justify-content: flex-end; }
#loot b { display: flex; align-items: center; margin-left: 8px; padding: 2px 8px 2px 3px; font-size: 14px; font-weight: 900; background: rgba(10, 13, 20, .7); border: 2px solid var(--ink); border-radius: 12px; }
#loot img { width: 20px; height: 20px; object-fit: contain; margin-right: 3px; }
#loot b.bump { animation: bump .22s; }
@keyframes bump { 40% { transform: scale(1.25); background: rgba(95, 188, 255, .45); } }
#boss { margin-top: 10px; text-align: center; }
#boss span { font-size: 12px; font-weight: 900; letter-spacing: 3px; color: #ffb199; text-shadow: 0 2px 0 var(--ink); }
#boss div { height: 12px; margin-top: 3px; background: rgba(10, 13, 20, .8); border: 2px solid var(--ink); border-radius: 7px; overflow: hidden; }
#boss i { display: block; height: 100%; background: linear-gradient(#ff9a4a, #d6331f); transform-origin: left; }

#banner { position: absolute; left: 0; right: 0; top: 24%; text-align: center; font-size: 40px; font-weight: 900; letter-spacing: 6px; color: var(--yellow); text-shadow: 0 4px 0 var(--ink), 0 0 24px rgba(243, 154, 43, .6); -webkit-text-stroke: 1px var(--ink); opacity: 0; pointer-events: none; }
#banner small { display: block; margin-top: 6px; font-size: 15px; letter-spacing: 2px; color: var(--paper); -webkit-text-stroke: 0; }
#banner.show { animation: banner 1.7s ease-out; }
@keyframes banner { 0% { opacity: 0; transform: scale(1.6); } 12% { opacity: 1; transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }

#hint { position: absolute; left: 0; right: 0; bottom: calc(15% + env(safe-area-inset-bottom)); text-align: center; font-size: 15px; font-weight: 700; letter-spacing: 1px; color: var(--paper); text-shadow: 0 2px 0 var(--ink); pointer-events: none; transition: opacity .5s; }
#hint.gone { opacity: 0; }

#overlay { position: absolute; left: 0; top: 0; right: 0; bottom: 0; display: flex; flex-direction: column; justify-content: center; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); background: rgba(6, 8, 16, .72); animation: fade .25s; }
#overlay[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
#overlay h2 { text-align: center; font-size: 26px; font-weight: 900; letter-spacing: 3px; color: var(--yellow); text-shadow: 0 3px 0 var(--ink); }
#overlay h2 + p { margin: 6px 0 16px; text-align: center; font-size: 14px; color: #c9c2b4; }

.card { position: relative; display: flex; align-items: center; width: 100%; margin-bottom: 12px; padding: 12px 14px; text-align: left; color: var(--paper); font: inherit; background: var(--panel); border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 5px 0 var(--ink); animation: rise .35s backwards; }
.card:nth-child(2) { animation-delay: .07s; } .card:nth-child(3) { animation-delay: .14s; } .card:nth-child(4) { animation-delay: .21s; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
.card:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.card .ico { flex: none; width: 58px; height: 58px; margin-right: 12px; display: flex; align-items: center; justify-content: center; background: var(--panel2); border: 2px solid var(--ink); border-radius: 12px; }
.card .ico img, .card .ico svg { width: 46px; height: 46px; object-fit: contain; }
.card strong { display: block; font-size: 18px; font-weight: 900; color: var(--yellow); }
.card em { display: block; margin-top: 3px; font-style: normal; font-size: 13.5px; line-height: 1.45; color: #d8d0c0; }
.card.go { background: #3a1f2a; } .card.go strong { color: #ff9a7a; }
.card.out { background: #1d3340; } .card.out strong { color: #8fd6ff; }
.card .tag { position: absolute; right: 10px; top: -10px; padding: 1px 8px; font-size: 11px; font-weight: 900; color: var(--ink); background: var(--yellow); border: 2px solid var(--ink); border-radius: 8px; }

.sheet { background: var(--panel); border: 3px solid var(--ink); border-radius: 16px; box-shadow: 0 6px 0 var(--ink); padding: 14px 16px; margin-bottom: 14px; }
.rows { display: flex; justify-content: space-around; }
.rows div { text-align: center; }
.rows img { display: block; width: 44px; height: 44px; margin: 0 auto 2px; object-fit: contain; }
.rows b { font-size: 26px; font-weight: 900; color: var(--paper); }
.rows small { display: block; font-size: 12px; color: #a9a294; }
.split { margin-top: 12px; padding-top: 12px; border-top: 2px dashed #3b4760; font-size: 13.5px; line-height: 1.7; color: #d8d0c0; }
.split b { color: var(--yellow); }
.meter { height: 14px; margin: 6px 0 2px; background: var(--ink); border-radius: 7px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: linear-gradient(#8fd6ff, var(--blue)); transition: width 1.1s .5s cubic-bezier(.2, .8, .2, 1); }
.btns { display: flex; }
.btn { flex: 1; padding: 13px 6px; font: inherit; font-size: 16px; font-weight: 900; color: var(--ink); background: var(--yellow); border: 3px solid var(--ink); border-radius: 12px; box-shadow: 0 5px 0 var(--ink); text-decoration: none; text-align: center; }
.btn + .btn { margin-left: 10px; }
.btn.alt { background: var(--orange); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.btn small { display: block; font-size: 11px; font-weight: 700; opacity: .75; }
