* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #05060c; font-family: "Nunito", "Segoe UI", system-ui, sans-serif; color: #fff; user-select: none; }
canvas { display: block; }
.hidden { display: none !important; }
.muted { opacity: .65; } .small { font-size: 13px; }
.hud { position: fixed; pointer-events: none; z-index: 5; }
.panel { background: linear-gradient(180deg, rgba(22,16,38,.68), rgba(10,8,20,.6)); border: 1px solid rgba(255,220,170,.18); border-radius: 14px;
         box-shadow: 0 6px 24px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.06); backdrop-filter: blur(6px); }
#areaBox { top: 16px; left: 16px; padding: 10px 16px; }
#areaName { font-family: "Cinzel Decorative", serif; font-weight: 900; font-size: 20px; color: #ffe2b0; letter-spacing: 1px; }
#areaSub { font-size: 13px; opacity: .75; margin-top: 2px; }
#waveBox { top: 16px; left: 50%; transform: translateX(-50%); padding: 8px 20px; text-align: center; display: none; }
#waveTitle { font-family: "Cinzel Decorative", serif; font-weight: 900; font-size: 18px; color: #c8ff9a; }
#waveLeft { font-size: 13px; opacity: .85; }
#resBox { top: 16px; right: 16px; padding: 9px 14px; display: flex; gap: 16px; font-size: 15px; }
#lifeBox { left: 16px; bottom: 16px; width: 280px; padding: 12px 14px; }
.lbl { font-size: 13px; font-weight: 800; display: flex; justify-content: space-between; margin-bottom: 4px; }
.track { height: 12px; border-radius: 6px; background: rgba(0,0,0,.5); overflow: hidden; box-shadow: inset 0 1px 3px rgba(0,0,0,.6); }
.fill { height: 100%; border-radius: 6px; transition: width .15s; box-shadow: inset 0 1px 0 rgba(255,255,255,.35); }
#hpFill { background: linear-gradient(90deg,#c22848,#ff7a8a); }
#dashRow { margin-top: 9px; display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 800; }
.dlbl { opacity: .75; margin-right: 4px; }
.pip { width: 30px; height: 8px; border-radius: 4px; background: rgba(255,255,255,.12); overflow: hidden; position: relative; }
.pip.on { background: linear-gradient(90deg,#7ad8ff,#cfefff); box-shadow: 0 0 8px rgba(120,210,255,.6); }
#slots { bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; }
.slot { width: 86px; height: 74px; border-radius: 12px; position: relative; text-align: center; padding-top: 10px; overflow: hidden;
        background: linear-gradient(180deg, rgba(22,16,38,.7), rgba(10,8,20,.65)); border: 2px solid rgba(255,220,170,.15); }
.slot.on { border-color: #ffb347; box-shadow: 0 0 14px rgba(255,170,70,.45); }
.slot .key { position: absolute; top: 3px; left: 6px; font-size: 10px; font-weight: 900; opacity: .7; }
.slot .ico { font-size: 22px; } .slot .nm { font-size: 11px; font-weight: 800; margin-top: 4px; padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot .cd { position: absolute; inset: 0; background: rgba(0,0,0,.55); transform-origin: bottom; transform: scaleY(0); }
.slot.spell { border-color: rgba(160,140,255,.4); } .slot.pet { border-color: rgba(255,150,60,.35); }
#cross { left: 50%; top: 50%; width: 0; height: 0; }
#dot { position: absolute; left: -2.5px; top: -2.5px; width: 5px; height: 5px; border-radius: 50%; background: #fff; box-shadow: 0 0 4px rgba(0,0,0,.8); }
#ring { position: absolute; left: -19px; top: -19px; width: 38px; height: 38px; border-radius: 50%; opacity: 0;
        -webkit-mask: radial-gradient(circle, transparent 15px, #000 16px); mask: radial-gradient(circle, transparent 15px, #000 16px); }
#hitmark { position: absolute; left: -12px; top: -12px; width: 24px; height: 24px; opacity: 0; transition: opacity .1s; }
#hitmark::before, #hitmark::after { content: ""; position: absolute; left: 11px; top: -2px; width: 2px; height: 28px; background: #fff; }
#hitmark::before { transform: rotate(45deg); } #hitmark::after { transform: rotate(-45deg); }
#combo { left: calc(50% + 60px); top: calc(50% - 40px); font-family: "Cinzel Decorative", serif; font-weight: 900; font-size: 26px; color: #ffd27a; text-shadow: 0 2px 8px rgba(0,0,0,.8); opacity: 0; transition: opacity .2s; }
#hurtDir { left: 50%; top: 50%; width: 220px; height: 220px; margin: -110px 0 0 -110px; border-radius: 50%; opacity: 0;
           background: conic-gradient(from -20deg, rgba(255,40,40,.85) 0deg, rgba(255,40,40,0) 40deg, transparent 0);
           -webkit-mask: radial-gradient(circle, transparent 92px, #000 96px, #000 104px, transparent 108px); mask: radial-gradient(circle, transparent 92px, #000 96px, #000 104px, transparent 108px); }
#prompt { left: 50%; bottom: 112px; transform: translateX(-50%); font-size: 16px; font-weight: 800; padding: 9px 18px; display: none; white-space: nowrap; }
#prompt b { color: #ffcf7a; }
#banner { left: 0; right: 0; top: 19%; text-align: center; opacity: 0; transform: scale(.94); transition: opacity .5s, transform .5s; }
#banner.on { opacity: 1; transform: scale(1); }
#bBig { font-family: "Cinzel Decorative", serif; font-size: 54px; font-weight: 900; letter-spacing: 4px;
        background: linear-gradient(#fff2d6, #ffb24a); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 12px rgba(0,0,0,.7)); }
#bSmall { font-size: 19px; font-weight: 700; margin-top: 8px; text-shadow: 0 2px 8px rgba(0,0,0,.9); }
#toasts { right: 16px; top: 70px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { padding: 8px 14px; border-radius: 10px; font-weight: 800; font-size: 14px; background: rgba(12,10,22,.78); border: 1px solid rgba(255,220,170,.2); animation: tin .3s ease-out; }
.toast.rare { border-color: #ffd24a; box-shadow: 0 0 18px rgba(255,210,74,.5); font-size: 16px; }
@keyframes tin { from { opacity: 0; transform: translateX(30px); } }
#trainBox { right: 16px; bottom: 16px; padding: 10px 14px; font-size: 14px; display: none; min-width: 150px; }
#trainBox .tt { font-weight: 900; color: #ffcf7a; margin-bottom: 3px; }
#hint { right: 16px; bottom: 12px; font-size: 12px; opacity: .5; }
#fade { position: fixed; inset: 0; background: #000; opacity: 1; transition: opacity .6s; pointer-events: none; z-index: 8; }
.overlay { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
           background: radial-gradient(ellipse at center, rgba(20,10,40,.45), rgba(0,0,0,.88)); }
.overlay h1 { font-family: "Cinzel Decorative", serif; font-size: 84px; font-weight: 900; margin: 0; letter-spacing: 8px;
              background: linear-gradient(#fff4dc, #ffb24a 60%, #ff5a1a); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 6px 22px rgba(255,120,30,.4)); }
.overlay .h1s { font-size: 60px; }
.overlay .sub { opacity: .8; margin: 6px 0 26px; font-size: 18px; font-weight: 700; letter-spacing: 1px; }
.controls { display: grid; grid-template-columns: auto auto auto auto; gap: 6px 22px; font-size: 14px; text-align: left; padding: 16px 24px; }
.controls b { color: #ffcf7a; }
.btnrow { display: flex; gap: 14px; margin-top: 24px; justify-content: center; }
.btn { padding: 13px 32px; border-radius: 30px; border: 2px solid #ffa04a; font-size: 17px; font-weight: 900; letter-spacing: 1px; cursor: pointer;
       background: linear-gradient(180deg, rgba(255,150,60,.35), rgba(255,100,20,.15)); box-shadow: 0 0 26px rgba(255,120,30,.3); transition: transform .1s; }
.btn:hover { transform: translateY(-2px); } .btn.ghost { border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.06); box-shadow: none; }
.btn.small { padding: 7px 16px; font-size: 13px; } .btn.dis { opacity: .4; pointer-events: none; }
#title .small { margin-top: 14px; }
.settings { padding: 18px 24px; display: grid; gap: 12px; text-align: left; min-width: 420px; }
.settings label { display: flex; align-items: center; justify-content: space-between; gap: 14px; font-weight: 700; }
.settings input[type=range] { width: 180px; }
#pause, #modal { display: none; }
.modalBox { width: min(980px, 94vw); max-height: 86vh; overflow: auto; text-align: left; padding: 18px 22px; }
.mHead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
#mTitle { font-family: "Cinzel Decorative", serif; font-weight: 900; font-size: 26px; color: #ffe2b0; }
.x { cursor: pointer; font-size: 22px; opacity: .7; padding: 4px 10px; } .x:hover { opacity: 1; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.card { padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); }
.card.locked { opacity: .55; } .card.eq { border-color: #ffb347; box-shadow: 0 0 12px rgba(255,170,70,.3); }
.card h3 { margin: 0 0 4px; font-size: 16px; } .card p { margin: 4px 0; font-size: 13px; opacity: .85; }
.tag { display: inline-block; font-size: 11px; font-weight: 900; padding: 2px 8px; border-radius: 10px; background: rgba(255,255,255,.1); margin-right: 4px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0 14px; }
select { background: #1a1428; color: #fff; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; padding: 5px 8px; font-family: inherit; font-weight: 700; }
.camp { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.campCard { border-radius: 14px; overflow: hidden; border: 1px solid rgba(255,255,255,.15); }
.campCard .art { height: 120px; display: flex; align-items: flex-end; padding: 12px; font-family: "Cinzel Decorative", serif; font-weight: 900; font-size: 22px; text-shadow: 0 2px 10px rgba(0,0,0,.8); }
.campCard .body { padding: 12px 14px; background: rgba(0,0,0,.35); font-size: 13px; }
.lvl { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; border-radius: 8px; margin: 4px 0; background: rgba(255,255,255,.05); font-weight: 800; }
.lvl.go { cursor: pointer; border: 1px solid rgba(120,255,140,.4); } .lvl.go:hover { background: rgba(120,255,140,.12); }
.lvl .st { font-size: 12px; opacity: .75; }
.big { font-family: "Cinzel Decorative", serif; font-size: 40px; font-weight: 900; color: #ffe2b0; text-align: center; margin: 4px 0 8px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; text-align: center; }
.stats div { padding: 10px; border-radius: 10px; background: rgba(255,255,255,.05); } .stats b { display: block; font-size: 24px; color: #ffcf7a; }
