* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2b1e4a; font-family: "Arial Black", Impact, sans-serif; color: #fff; user-select: none; }
canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
[hidden] { display: none !important; }
button { font-family: inherit; cursor: pointer; }

.txt { text-shadow: 2px 2px 0 #000, -2px 2px 0 #000, 2px -2px 0 #000, -2px -2px 0 #000; }

#menu { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 16px; pointer-events: none; }
#menu > * { pointer-events: auto; }
#menu h1 { margin: 0; font-size: clamp(22px, 4vw, 42px); color: #ffd23f; text-shadow: 3px 3px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000; letter-spacing: 1px; text-align: center; }
#info { align-self: flex-start; max-width: min(360px, 90vw); background: rgba(20, 10, 50, .85); border: 4px solid #000; border-radius: 16px; padding: 14px; font-family: Arial, sans-serif; font-weight: bold; font-size: 14px; line-height: 1.35; }
#info h3 { margin: 0 0 4px; font-family: "Arial Black", Impact, sans-serif; font-size: 26px; }
#info .strong { color: #ffd23f; margin-bottom: 8px; }
#info .row { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
#info .row span { width: 70px; }
#info .bar { flex: 1; height: 10px; background: #000; border-radius: 6px; overflow: hidden; }
#info .bar i { display: block; height: 100%; background: #4ade80; }
#info p { margin: 8px 0 0; }
#cards { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.card { width: 110px; padding: 10px 6px; border-radius: 14px; border: 4px solid #000; background: #3b2a75; color: #fff; font-size: 15px; text-align: center; }
.card .dot { width: 46px; height: 46px; border-radius: 50%; margin: 0 auto 6px; border: 3px solid #000; }
.card.sel { background: #ffd23f; color: #000; transform: translateY(-8px); }
#play, #again, #change { background: #4ade80; color: #000; border: 4px solid #000; border-radius: 14px; padding: 12px 40px; font-size: 26px; box-shadow: 0 5px 0 #000; }
#play:active, #again:active, #change:active { transform: translateY(3px); box-shadow: 0 2px 0 #000; }
#change { background: #ffd23f; font-size: 18px; padding: 10px 20px; }

#alive { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); background: rgba(0, 0, 0, .6); border: 3px solid #000; border-radius: 20px; padding: 6px 18px; font-size: 18px; }
#tags { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.tag { position: absolute; transform: translate(-50%, -100%); text-align: center; font-size: 13px; white-space: nowrap; }
.tag .nm { text-shadow: 1px 1px 0 #000, -1px 1px 0 #000, 1px -1px 0 #000, -1px -1px 0 #000; }
.tag .bar { width: 64px; height: 10px; margin: 2px auto 0; background: #000; border: 2px solid #000; border-radius: 6px; overflow: hidden; }
.tag .bar i { display: block; height: 100%; background: #ef4444; }
.tag.me .bar i { background: #4ade80; }
.dmg { position: absolute; font-size: 22px; color: #ffd23f; text-shadow: 2px 2px 0 #000, -2px 2px 0 #000, 2px -2px 0 #000, -2px -2px 0 #000; animation: up .8s ease-out forwards; pointer-events: none; transform: translate(-50%, -50%); }
.dmg.heal { color: #4ade80; }
@keyframes up { to { margin-top: -50px; opacity: 0; } }

#ammo { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
#ammo i { display: block; width: 70px; height: 16px; background: #000; border: 3px solid #000; border-radius: 8px; overflow: hidden; }
#ammo b { display: block; height: 100%; width: 0; background: #ff9f1c; }
#superBtn, #superBtn2 { position: fixed; bottom: 20px; right: 20px; width: 96px; height: 96px; border-radius: 50%; border: 5px solid #000; background: conic-gradient(#ffd23f var(--c, 0%), #333 0); color: #fff; font-size: 14px; }
#superBtn span, #superBtn2 span { display: block; width: 70px; height: 70px; line-height: 70px; margin: auto; border-radius: 50%; background: #2b1e4a; }
#superBtn.ready, #superBtn2.ready { animation: pulse .5s infinite alternate; }
#superBtn.ready span, #superBtn2.ready span { background: #ffd23f; color: #000; }
@keyframes pulse { to { transform: scale(1.12); } }
#hint { position: fixed; bottom: 60px; left: 16px; max-width: 280px; font-family: Arial, sans-serif; font-size: 13px; font-weight: bold; background: rgba(0, 0, 0, .55); padding: 8px 10px; border-radius: 10px; transition: opacity 1s; }

#end { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: rgba(0, 0, 0, .55); }
#end h2 { margin: 0; font-size: clamp(36px, 8vw, 80px); color: #ffd23f; text-shadow: 4px 4px 0 #000, -3px -3px 0 #000, 3px -3px 0 #000, -3px 3px 0 #000; }
#end p { margin: 0; font-size: 22px; }
#rankTitle { margin: 0; font-size: 22px; color: #ffd23f; }
#ranking { list-style: none; margin: 0; padding: 10px; width: min(340px, 90vw); max-height: 42vh; overflow: auto; background: rgba(20, 10, 50, .9); border: 4px solid #000; border-radius: 14px; font-family: Arial, sans-serif; font-weight: bold; font-size: 15px; }
#ranking li { display: flex; gap: 10px; padding: 3px 6px; border-radius: 8px; }
#ranking li b { width: 24px; color: #ffd23f; }
#ranking li span { margin-left: auto; opacity: .7; }
#ranking li.me { background: #4ade80; color: #000; }
#ranking li.me b { color: #000; }
#ranking li.wait { opacity: .8; }
#ranking li:first-child:not(.wait) b::after { content: ""; }
.card small { display: block; font-size: 12px; opacity: 0.8; }
#info h3 small { font-size: 14px; color: #ffd23f; }
.lvbar { height: 8px; margin: 2px 0 8px; }

#superBtn2 { right: 130px; bottom: 30px; width: 80px; height: 80px; }
#superBtn span, #superBtn2 span { font-size: 11px; line-height: 1.1; display: flex; align-items: center; justify-content: center; }
#superBtn2 span { width: 56px; height: 56px; }

.tag.ally .bar i { background: #38bdf8; }
#modes { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.mode { font-family: "Arial Black", Impact, sans-serif; font-size: 16px; color: #fff; background: #3b2a7a; border: 4px solid #000; border-radius: 12px; padding: 8px 14px; cursor: pointer; }
.mode small { display: block; font-family: Arial, sans-serif; font-size: 11px; color: #ddd; }
.mode.sel { background: #f59e0b; color: #000; }
.mode.sel small { color: #222; }
#quests { align-self: flex-start; max-width: min(360px, 90vw); background: rgba(20, 10, 50, .85); border: 4px solid #000; border-radius: 16px; padding: 10px 14px; font-family: Arial, sans-serif; font-weight: bold; font-size: 13px; line-height: 1.5; }
#quests h3 { margin: 0 0 4px; font-size: 16px; color: #ffd23f; }
#quests .done { color: #4ade80; }
#endText .quest { color: #ffd23f; }
#quests { position: fixed; right: 16px; top: 80px; align-self: auto; }
