:root {
  --night: #0d1224;
  --deep: #141a33;
  --teal: #1f4e5a;
  --plum: #2a1633;
  --plum2: #3a1f4d;
  --ink: #3a2342;
  --amber: #ffb347;
  --gold: #ffd878;
  --cream: #fff1cf;
  --paper: #f4e4bd;
  --danger: #e2583e;
  --font: "Baskerville", "Hoefler Text", "Palatino Linotype", Palatino, "Book Antiqua", "Iowan Old Style", Georgia, serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #070a16; overflow: hidden; color: var(--cream); font-family: var(--font); user-select: none; -webkit-user-select: none; }
.hidden { display: none !important; }
#app { position: fixed; inset: 0; overflow: hidden; background: #070a16; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
img { -webkit-user-drag: none; }

/* ------------------------------------------------------------ screens */
.screen { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; animation: screenIn .45s ease both; z-index: 20; }
@keyframes screenIn { from { opacity: 0; } to { opacity: 1; } }
.panel {
  position: relative; width: min(520px, 92vw); max-height: 92vh; overflow: auto; padding: 28px 34px 30px; text-align: center;
  background: linear-gradient(180deg, rgba(34,24,52,.96), rgba(20,18,40,.97));
  border: 3px solid #5a3a68; border-radius: 18px;
  box-shadow: 0 0 0 2px #1a1028, 0 0 0 5px rgba(255,179,71,.28), 0 24px 70px rgba(0,0,0,.65), inset 0 0 60px rgba(255,179,71,.06);
  animation: panelIn .5s cubic-bezier(.2,.9,.3,1.2) both;
}
.panel.wide { width: min(880px, 94vw); }
@keyframes panelIn { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
.panel h2, .levelup-inner h2 { margin: 0 0 14px; font-weight: 400; font-size: clamp(26px, 3.4vw, 38px); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); text-shadow: 0 0 22px rgba(255,170,60,.55), 0 2px 0 #1a1028; }
.lede { font-size: 17px; line-height: 1.5; color: #e8d9c0; margin: 0 0 18px; }
.lede b { color: var(--gold); font-weight: 600; }
.hint { color: #a99bc0; font-style: italic; letter-spacing: .04em; margin-top: 14px; }
.hint.small { font-size: 13px; opacity: .8; }
.row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 14px 0; }

/* ------------------------------------------------------------ buttons */
.btn {
  position: relative; font-family: var(--font); font-size: 18px; letter-spacing: .1em; text-transform: uppercase; color: var(--cream);
  height: 52px; min-width: 190px; padding: 0 34px; margin: 6px 4px; cursor: pointer; border: 0; background: transparent;
  background-image: url(../assets/img/ui_button.webp); background-size: 100% 100%; background-repeat: no-repeat;
  text-shadow: 0 2px 0 rgba(0,0,0,.55), 0 0 12px rgba(255,200,120,.25);
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.5)); transition: transform .12s, filter .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
}
.btn:hover { transform: translateY(-2px) scale(1.03); filter: drop-shadow(0 8px 14px rgba(0,0,0,.55)) brightness(1.18) saturate(1.1); }
.btn:active { transform: translateY(1px) scale(.99); filter: brightness(.95); }
.btn.big { height: 62px; font-size: 22px; min-width: 260px; }
.btn.small { height: 40px; font-size: 14px; min-width: 120px; padding: 0 20px; }
.btn.danger { filter: hue-rotate(150deg) saturate(1.2) drop-shadow(0 6px 10px rgba(0,0,0,.5)); }
.btn.danger:hover { filter: hue-rotate(150deg) saturate(1.3) brightness(1.15) drop-shadow(0 8px 14px rgba(0,0,0,.55)); }
.btn[disabled] { opacity: .45; cursor: default; pointer-events: none; }
.btn em { font-style: normal; font-size: 13px; color: var(--amber); letter-spacing: .04em; text-transform: none; }
.btn.pulse { animation: btnPulse 1.8s ease-in-out infinite; }
@keyframes btnPulse { 0%,100% { filter: drop-shadow(0 0 6px rgba(255,170,60,.25)) drop-shadow(0 6px 10px rgba(0,0,0,.5)); } 50% { filter: drop-shadow(0 0 22px rgba(255,170,60,.85)) drop-shadow(0 6px 10px rgba(0,0,0,.5)) brightness(1.1); } }

/* ------------------------------------------------------------ splash / title */
#screen-splash { background: radial-gradient(ellipse at 50% 42%, #1b2448 0%, #0a0e1f 70%); }
.splash-inner { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.splash-logo { width: min(520px, 76vw); filter: drop-shadow(0 0 40px rgba(255,170,70,.35)); animation: logoFloat 4.5s ease-in-out infinite; }
@keyframes logoFloat { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-8px) } }
.loadbar { width: min(340px, 70vw); height: 8px; border-radius: 6px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 12px; box-shadow: inset 0 0 0 1px rgba(255,200,120,.2); }
.loadfill { height: 100%; width: 0%; background: linear-gradient(90deg, #ff8a3d, #ffd45c); box-shadow: 0 0 14px rgba(255,170,60,.8); transition: width .2s; }
.headphones { position: absolute; bottom: 22px; left: 0; right: 0; text-align: center; }

#screen-title { background: #05070f; overflow: hidden; }
.title-bg { position: absolute; inset: -4%; background: center 40%/cover no-repeat url(../assets/img/art_title.webp); animation: kenburns 38s ease-in-out infinite alternate; filter: saturate(1.05); }
@keyframes kenburns { from { transform: scale(1.02) translate(0,0); } to { transform: scale(1.14) translate(-1.5%, -1%); } }
#title-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; mix-blend-mode: screen; }
.title-vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 55%, rgba(5,7,15,0) 30%, rgba(5,7,15,.72) 100%), linear-gradient(180deg, rgba(5,7,15,.55), rgba(5,7,15,0) 28%, rgba(5,7,15,0) 55%, rgba(5,7,15,.82)); }
.title-inner { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; height: 100%; width: 100%; padding: 3vh 0 2vh; }
.title-logo { width: min(520px, 56vw, 48vh); margin-top: 0; filter: drop-shadow(0 6px 24px rgba(0,0,0,.7)) drop-shadow(0 0 40px rgba(255,170,70,.25)); animation: logoFloat 6s ease-in-out infinite; }
.menu-col { position: absolute; right: clamp(16px, 7vw, 140px); bottom: 9vh; display: flex; flex-direction: column; align-items: center; padding: 14px 18px 12px; border-radius: 22px; background: radial-gradient(ellipse at 50% 50%, rgba(5,7,15,.72), rgba(5,7,15,.45) 70%, rgba(5,7,15,0)); }
.menu { display: flex; flex-direction: column; align-items: center; }
.menu .btn { min-width: 270px; }
@media (max-width: 900px) { .menu-col { right: 50%; transform: translateX(50%); bottom: 6vh; } }
.difficulty { display: flex; gap: 6px; margin-top: 10px; padding: 5px; background: rgba(10,8,22,.7); border-radius: 30px; border: 1px solid rgba(255,200,120,.25); }
.diff { font-family: var(--font); font-size: 14px; letter-spacing: .1em; text-transform: uppercase; padding: 8px 18px; border-radius: 22px; border: 0; background: transparent; color: #b9aacd; cursor: pointer; transition: all .15s; }
.diff:hover { color: var(--cream); }
.diff.on { background: linear-gradient(180deg, #ffbe5c, #e88a2c); color: #2a1633; box-shadow: 0 0 18px rgba(255,170,60,.55); }
.diff-desc { min-height: 22px; margin-top: 8px; font-size: 14px; font-style: italic; color: #cbbcd9; text-shadow: 0 2px 6px #000; }
.title-foot { position: absolute; left: 0; right: 0; bottom: 1.6vh; text-align: center; font-size: 13px; color: #a79bbd; letter-spacing: .08em; text-shadow: 0 2px 6px #000; }

/* ------------------------------------------------------------ how / settings / hearth */
.how-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 22px; margin: 6px 0 16px; text-align: left; }
.how-item { display: flex; gap: 14px; align-items: center; padding: 10px 12px; background: rgba(255,255,255,.04); border-radius: 12px; border: 1px solid rgba(255,200,120,.12); }
.how-item p { margin: 0; font-size: 15px; line-height: 1.4; color: #e3d5c0; }
.how-item b { color: var(--gold); }
.keys { display: flex; gap: 4px; flex-shrink: 0; width: 84px; flex-wrap: wrap; justify-content: center; }
kbd { font-family: var(--font); font-size: 13px; padding: 5px 9px; min-width: 30px; text-align: center; border-radius: 7px; background: linear-gradient(180deg, #4b3560, #2f2040); border: 1px solid #6d4f86; box-shadow: 0 3px 0 #170e22; color: var(--cream); }
.how-list { text-align: left; margin: 0 0 16px 4px; padding-left: 18px; font-size: 15px; line-height: 1.55; color: #dccfba; }
.how-list b { color: var(--gold); }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 14px 4px; font-size: 18px; letter-spacing: .04em; }
.setting label { flex: 0 0 150px; text-align: left; color: #e6d7c1; }
.setting input[type=range] { flex: 1; accent-color: var(--amber); height: 6px; cursor: pointer; }
.credits { font-size: 12.5px; line-height: 1.5; color: #9b8fb3; font-style: italic; margin: 8px 0 4px; letter-spacing: .03em; }
.setting.check { justify-content: flex-start; }
.setting.check input { width: 22px; height: 22px; accent-color: var(--amber); cursor: pointer; }
.hearth .lede { margin-bottom: 8px; }
.ember-count { display: inline-flex; align-items: center; gap: 10px; font-size: 24px; color: var(--gold); margin-bottom: 14px; text-shadow: 0 0 16px rgba(255,170,60,.5); }
.ember-count img { width: 34px; height: 34px; filter: drop-shadow(0 0 8px rgba(255,170,60,.7)); }
.hearth-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-bottom: 14px; text-align: left; }
.perk { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,200,120,.16); cursor: pointer; transition: all .15s; align-items: center; }
.perk:hover { background: rgba(255,179,71,.1); border-color: rgba(255,200,120,.5); transform: translateY(-2px); }
.perk.max { opacity: .8; cursor: default; }
.perk.cant { opacity: .5; }
.perk img { width: 64px; height: 64px; filter: drop-shadow(0 4px 6px rgba(0,0,0,.5)); }
.perk h4 { margin: 0 0 2px; font-weight: 600; font-size: 17px; color: var(--cream); letter-spacing: .03em; }
.perk p { margin: 0 0 6px; font-size: 13px; line-height: 1.3; color: #bfb0d0; }
.pips { display: flex; gap: 4px; align-items: center; }
.pip { width: 11px; height: 11px; border-radius: 50%; background: #2c2040; border: 1px solid #5d4678; }
.pip.on { background: radial-gradient(circle at 35% 30%, #fff0b0, #ffa63a); border-color: #ffd070; box-shadow: 0 0 8px rgba(255,170,60,.8); }
.perk .cost { margin-left: auto; font-size: 14px; color: var(--amber); display: inline-flex; align-items: center; gap: 4px; }
.perk .cost.max { color: #9ab; }

/* ------------------------------------------------------------ level up */
#screen-levelup { background: radial-gradient(ellipse at 50% 45%, rgba(10,14,32,.55), rgba(5,7,16,.88)); backdrop-filter: blur(3px); }
.levelup-inner { text-align: center; width: min(1000px, 96vw); }
.cards { display: flex; gap: 22px; justify-content: center; align-items: stretch; margin: 12px 0 8px; perspective: 1000px; flex-wrap: wrap; }
.card {
  position: relative; width: clamp(148px, calc((96vw - 24px - 22px * var(--n, 3)) / var(--n, 3)), 232px); min-height: 330px; padding: 18px 16px 16px; border-radius: 14px; cursor: pointer; color: var(--ink); text-align: center;
  background: linear-gradient(180deg, rgba(255,246,220,.2), rgba(255,246,220,0) 40%), url(../assets/img/ui_paper.webp) center/cover;
  border: 5px solid #3b2150; box-shadow: 0 0 0 2px #f0b552 inset, 0 0 0 1px #1a1028, 0 18px 40px rgba(0,0,0,.6);
  animation: dealIn .55s cubic-bezier(.2,.9,.3,1.15) both; transition: transform .18s, box-shadow .18s, filter .18s;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.card:nth-child(2) { animation-delay: .09s; } .card:nth-child(3) { animation-delay: .18s; } .card:nth-child(4) { animation-delay: .27s; }
@keyframes dealIn { from { opacity: 0; transform: translateY(70px) rotateX(35deg) scale(.85); } to { opacity: 1; transform: none; } }
.card:hover, .card.focus { transform: translateY(-10px) scale(1.05); box-shadow: 0 0 0 2px #ffd070 inset, 0 0 0 1px #1a1028, 0 0 38px rgba(255,170,60,.65), 0 24px 46px rgba(0,0,0,.6); filter: brightness(1.05); }
.card .tag { margin-top: 16px; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: #8a5a2b; font-weight: 700; }
.card .tag.new { color: #b3382a; }
.card .tag.pass { color: #2a6d68; }
.card .icon { width: 96px; height: 96px; margin: 2px 0; filter: drop-shadow(0 6px 6px rgba(40,10,40,.45)); }
.card h3 { margin: 0; font-size: 21px; letter-spacing: .04em; font-weight: 700; color: #34173f; }
.card p { margin: 4px 2px 0; font-size: 14.5px; line-height: 1.38; color: #4b3550; }
.card .pips { margin-top: auto; padding-top: 8px; justify-content: center; }
.card .pip { background: #cdb88f; border-color: #8a6a3a; }
.card .pip.on { background: radial-gradient(circle at 35% 30%, #fff0b0, #ff9a2e); border-color: #b3641a; box-shadow: 0 0 6px rgba(255,150,40,.7); }
.card .pip.next { background: #ffd070; border-color: #b3641a; animation: pipBlink 1s infinite; }
@keyframes pipBlink { 50% { opacity: .35; } }
@media (max-width: 900px) { .card h3 { font-size: 18px; } .card p { font-size: 13px; } .card .icon { width: 72px; height: 72px; } .card { min-height: 280px; padding: 14px 10px 12px; } }
.card .keyhint { position: absolute; top: 8px; left: 10px; font-size: 12px; color: #8a6a3a; border: 1px solid #b3946a; border-radius: 5px; padding: 0 6px; background: rgba(255,255,255,.35); }
.levelup-foot { display: flex; gap: 16px; align-items: center; justify-content: center; margin-top: 6px; }
.levelup-foot .hint { margin: 0; }

/* ------------------------------------------------------------ pause / end */
.pause-stats { margin: 4px 0 16px; font-size: 16px; line-height: 1.6; color: #d6c8e2; }
.pause-stats b { color: var(--gold); }
#screen-pause { background: rgba(5,7,16,.55); backdrop-filter: blur(2px); }
#screen-end { background: #05070f; overflow: hidden; }
.end-bg { position: absolute; inset: -3%; background: center/cover no-repeat; animation: kenburns 30s ease-in-out infinite alternate; }
.end-shade { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 50%, rgba(5,7,15,.15), rgba(5,7,15,.82)); }
.end-inner { position: relative; text-align: center; width: 100%; height: 100%; padding: 5vh 4vw 4vh; display: flex; flex-direction: column; justify-content: space-between; align-items: center; }
.end-inner:not(.defeat) { padding-left: min(34vw, 420px); }
.end-top { width: min(760px, 94vw); }
.end-buttons { margin: 0; }
@media (max-width: 900px) { .end-inner:not(.defeat) { padding-left: 4vw; } }
.end-inner h1 { margin: 0; font-weight: 400; font-size: clamp(34px, 6vw, 64px); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); text-shadow: 0 0 36px rgba(255,170,60,.7), 0 4px 0 #1a1028; animation: titleRise 1.2s cubic-bezier(.2,.8,.2,1) both; }
.end-inner.defeat h1 { color: #b9c8f0; text-shadow: 0 0 30px rgba(120,150,255,.55), 0 4px 0 #0a0c20; }
@keyframes titleRise { from { opacity: 0; transform: translateY(16px) scale(.96); letter-spacing: .3em; } to { opacity: 1; transform: none; } }
.end-sub { font-size: 20px; font-style: italic; color: #e8dcc8; margin: 8px 0 18px; text-shadow: 0 2px 10px #000; animation: screenIn 1.6s .4s both; }
.end-stats { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 6px 0 14px; animation: screenIn 1.4s .8s both; }
.stat { min-width: 118px; padding: 10px 14px; border-radius: 12px; background: rgba(10,8,24,.62); border: 1px solid rgba(255,200,120,.22); backdrop-filter: blur(3px); }
.stat b { display: block; font-size: 26px; color: var(--gold); font-weight: 400; }
.stat span { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #b7a9cc; }
.end-embers { font-size: 22px; color: var(--amber); margin: 4px 0 12px; text-shadow: 0 0 18px rgba(255,150,40,.6); animation: screenIn 1.4s 1.1s both; }
.end-embers .newbest { display: inline-block; margin-left: 10px; padding: 2px 10px; border-radius: 12px; font-size: 14px; background: var(--amber); color: #2a1633; letter-spacing: .1em; text-transform: uppercase; }
#screen-end .row { animation: screenIn 1.2s 1.4s both; }

/* ------------------------------------------------------------ HUD */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 10; font-family: var(--font); }
#hud > * { position: absolute; }
.bar { position: relative; height: 22px; border-radius: 12px; background: linear-gradient(180deg, #1b1030, #2a1838); border: 2px solid #5a3a68; box-shadow: 0 0 0 1px #150a22, 0 4px 14px rgba(0,0,0,.5), inset 0 2px 6px rgba(0,0,0,.55); overflow: hidden; }
.bar .fill { position: absolute; inset: 0; width: 100%; transform-origin: left; border-radius: 10px; }
.bar .fill.ghost { background: rgba(255,255,255,.55); transition: width .6s .25s ease-out; z-index: 0; }
#hud-flame { top: 16px; left: 18px; display: flex; align-items: center; gap: 10px; width: min(330px, 34vw); }
.hud-flame-icon { width: 52px; height: 52px; margin-right: -26px; z-index: 2; filter: drop-shadow(0 3px 5px rgba(0,0,0,.6)); }
.bar-flame { flex: 1; height: 24px; margin-left: 0; padding-left: 0; }
.bar-flame #hp-fill { background: linear-gradient(180deg, #ffe08a, #ff9a2e 55%, #e8561c); box-shadow: 0 0 18px rgba(255,150,40,.7); z-index: 1; transition: width .12s; width: 100%; }
.bar-flame.low #hp-fill { background: linear-gradient(180deg, #ff9a7a, #e8441c 55%, #a8240e); animation: lowPulse .7s infinite; }
@keyframes lowPulse { 50% { filter: brightness(1.45); } }
#hp-text { position: absolute; inset: 0; z-index: 3; text-align: center; font-size: 14px; line-height: 20px; color: #fff4d8; text-shadow: 0 1px 2px #000, 0 0 6px #000; letter-spacing: .06em; }
#hud-clock { top: 12px; left: 50%; transform: translateX(-50%); width: min(380px, 38vw); text-align: center; }
.clock-track { display: flex; align-items: center; gap: 10px; }
.clock-moon, .clock-sun { width: 34px; height: 34px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.6)); }
.clock-sun { opacity: .55; }
.clock-line { position: relative; flex: 1; height: 8px; border-radius: 5px; background: linear-gradient(90deg, #1a1c4a, #2a2058 45%, #6a3d58 80%, #c8793a); border: 1px solid #5a3a68; box-shadow: inset 0 1px 3px rgba(0,0,0,.6); }
.clock-progress { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; border-radius: 5px; background: linear-gradient(90deg, rgba(255,210,120,.0), rgba(255,210,120,.55)); }
.clock-marker { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6c8, #ffa63a 60%, #d4561c); box-shadow: 0 0 14px 3px rgba(255,170,60,.85); left: 0%; }
.clock-tick { position: absolute; top: -3px; width: 2px; height: 12px; background: rgba(255,230,180,.45); }
.clock-time { margin-top: 2px; font-size: 18px; letter-spacing: .2em; color: var(--cream); text-shadow: 0 2px 6px #000; }
#hud-boss { top: 78px; left: 50%; transform: translateX(-50%); width: min(560px, 60vw); text-align: center; }
.boss-name { font-size: 20px; letter-spacing: .24em; text-transform: uppercase; color: #ffd9a8; text-shadow: 0 0 16px rgba(255,100,60,.7), 0 2px 0 #000; margin-bottom: 4px; }
.bar-boss { height: 20px; border-color: #7a3a4d; }
.bar-boss #boss-fill { background: linear-gradient(180deg, #d2d7ff, #8c8be0 55%, #5a4dc0); z-index: 1; width: 100%; box-shadow: 0 0 16px rgba(150,150,255,.6); }
#hud-stats { top: 70px; left: 22px; font-size: 14px; letter-spacing: .08em; color: #c8b9da; text-shadow: 0 2px 4px #000; opacity: .9; }
#hud-stats span { color: var(--gold); font-size: 17px; }
#hud-abilities { right: 22px; bottom: 56px; display: flex; gap: 14px; }
.ability { position: relative; width: 66px; height: 66px; border-radius: 50%; background: #1a1028; border: 3px solid #5a3a68; box-shadow: 0 0 0 2px #150a22, 0 6px 14px rgba(0,0,0,.55); overflow: hidden; }
.ability img { width: 100%; height: 100%; display: block; transition: filter .2s; }
.ability .cd { position: absolute; inset: 0; background: conic-gradient(rgba(6,8,20,.78) var(--p, 0deg), transparent 0); }
.ability .key { position: absolute; bottom: -1px; left: 0; right: 0; text-align: center; font-size: 10px; letter-spacing: .12em; color: #fff4d8; background: rgba(10,6,22,.78); padding: 2px 0 1px; }
.ability.ready { border-color: var(--amber); box-shadow: 0 0 0 2px #150a22, 0 0 18px rgba(255,170,60,.75), 0 6px 14px rgba(0,0,0,.55); }
.ability.cooling img { filter: grayscale(.7) brightness(.7); }
#hud-loadout { left: 20px; bottom: 44px; display: flex; flex-direction: column; gap: 6px; }
.loadout-row { display: flex; gap: 8px; }
.slot { position: relative; width: 46px; height: 46px; }
.slot img { width: 100%; height: 100%; filter: drop-shadow(0 3px 4px rgba(0,0,0,.6)); }
.slot .lv { position: absolute; right: -4px; bottom: -4px; min-width: 20px; height: 20px; border-radius: 10px; background: #2a1633; border: 2px solid var(--amber); color: var(--cream); font-size: 11px; line-height: 16px; text-align: center; padding: 0 3px; }
.slot.max .lv { background: linear-gradient(180deg, #ffe08a, #ffb347); color: #2a1633; border-color: #fff2c0; box-shadow: 0 0 10px rgba(255,190,80,.8); }
.slot.max img { filter: drop-shadow(0 0 8px rgba(255,190,80,.85)); }
.loadout-row.small .slot { width: 34px; height: 34px; opacity: .92; }
.loadout-row.small .slot .lv { min-width: 16px; height: 16px; font-size: 9px; line-height: 12px; }
.slot.pop { animation: slotPop .5s ease; }
@keyframes slotPop { 0% { transform: scale(1.7); filter: brightness(2.2); } 100% { transform: none; } }
#hud-xp { left: 0; right: 0; bottom: 0; height: 30px; display: flex; align-items: center; padding: 0 16px 8px 12px; gap: 10px; }
.xp-level { min-width: 52px; height: 34px; padding: 0 10px; text-align: center; border-radius: 17px; background: linear-gradient(180deg, #3b2150, #24133a); border: 2px solid var(--amber); font-size: 17px; line-height: 30px; color: var(--cream); box-shadow: 0 0 12px rgba(255,170,60,.4); letter-spacing: .04em; }
.xp-level::before { content: "Lv "; font-size: 11px; opacity: .75; letter-spacing: .1em; }
.xp-track { position: relative; flex: 1; height: 12px; border-radius: 7px; background: rgba(12,8,28,.82); border: 1px solid #5a3a68; overflow: hidden; box-shadow: inset 0 1px 4px rgba(0,0,0,.7); }
.xp-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: linear-gradient(180deg, #8ff0e6, #3cc0b8 55%, #2a8f9a); box-shadow: 0 0 12px rgba(80,240,230,.65); transition: width .1s; }
.xp-glow { position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); opacity: 0; }
.xp-track.flash .xp-glow { animation: xpFlash .7s ease; }
@keyframes xpFlash { 0% { opacity: 0; transform: translateX(-100%); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateX(100%); } }
#lowhp-vignette { inset: 0; opacity: 0; background: radial-gradient(ellipse at 50% 50%, rgba(160,20,10,0) 45%, rgba(190,24,12,.55) 100%); transition: opacity .3s; }

/* ------------------------------------------------------------ banners / toasts */
#banner { position: absolute; left: 0; right: 0; top: 24%; text-align: center; pointer-events: none; z-index: 15; opacity: 0; }
#banner.show { animation: bannerIn 4.2s ease both; }
@keyframes bannerIn { 0% { opacity: 0; transform: translateY(14px) scale(.96); letter-spacing: .35em; } 12% { opacity: 1; transform: none; } 78% { opacity: 1; } 100% { opacity: 0; transform: translateY(-8px); } }
#banner-title { font-size: clamp(30px, 5.2vw, 62px); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); text-shadow: 0 0 34px rgba(255,160,50,.75), 0 4px 0 #1a1028, 0 0 2px #000; }
#banner.boss #banner-title { color: #ffd0b0; text-shadow: 0 0 40px rgba(255,70,50,.85), 0 4px 0 #1a0810; }
#banner.moon #banner-title { color: #dfe6ff; text-shadow: 0 0 44px rgba(130,150,255,.9), 0 4px 0 #0a0c24; }
#banner-sub { margin-top: 6px; font-size: clamp(15px, 2vw, 22px); font-style: italic; letter-spacing: .08em; color: #eadcc4; text-shadow: 0 2px 10px #000; }
#toasts { position: absolute; left: 50%; bottom: 70px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; z-index: 14; }
.toast { padding: 7px 18px; border-radius: 18px; background: rgba(20,12,36,.82); border: 1px solid rgba(255,200,120,.4); color: var(--cream); font-size: 16px; letter-spacing: .06em; animation: toast 2.6s ease both; box-shadow: 0 6px 18px rgba(0,0,0,.5); }
@keyframes toast { 0% { opacity: 0; transform: translateY(14px); } 10% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }

#fade { position: absolute; inset: 0; background: #05070f; opacity: 0; pointer-events: none; transition: opacity .6s ease; z-index: 50; }
#fade.on { opacity: 1; }
#flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 40; mix-blend-mode: screen; }

@media (max-width: 760px) { .how-grid { grid-template-columns: 1fr; } .card { width: 200px; min-height: 290px; } .cards { gap: 12px; } }
@media (max-height: 640px) { .card { min-height: 270px; } .card .icon { width: 70px; height: 70px; } .menu .btn { height: 44px; } .btn.big { height: 50px; } .title-logo { width: min(420px, 50vh); } }
