* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #a9c6dc; font-family: "Segoe UI", Arial, sans-serif; user-select: none; touch-action: none; }
canvas#c { display: block; position: fixed; inset: 0; width: 100%; height: 100%; }
.hidden { display: none !important; }
#hint { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); padding: 6px 14px; border-radius: 99px; background: #0a1a2c99; color: #dff3ff; font-size: 13px; max-width: calc(100vw - 32px); width: max-content; text-align: center; pointer-events: none; }
#load { position: fixed; inset: 0; z-index: 10; overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: #05040a; transition: opacity .6s; }
#load.fade { opacity: 0; pointer-events: none; }
#lscene { position: absolute; inset: 0; width: 100%; height: 100%; }
.lweb { position: absolute; top: 0; width: min(38vw, 40vh); height: min(38vw, 40vh); overflow: visible; pointer-events: none; }
.lweb.wl { left: 0; } .lweb.wr { right: 0; }
.lvig { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 48%, #0000 0%, #0000 35%, #000a 100%); }
#lscene .ey { transform-box: fill-box; transform-origin: center; animation-name: eblink, ewalk; animation-iteration-count: infinite; animation-timing-function: linear, ease-in-out; }
#lscene .ey.lurk { animation-name: eblink, elurk; }
@keyframes eblink { 0%, 90%, 100% { transform: scaleY(1); } 93%, 96% { transform: scaleY(.08); } }
@keyframes ewalk { 0%, 100% { translate: 0 0; } 50% { translate: 3px 0; } }
@keyframes elurk { 0%, 100% { opacity: 0; } 30%, 70% { opacity: 1; } }
#load .hang { animation: hang 5s ease-in-out infinite; }
@keyframes hang { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(40px); } }
.lsnow { position: absolute; inset: -100px 0 0 0; pointer-events: none; opacity: .8;
  background-image: radial-gradient(2px 2px at 20px 30px, #fff, transparent), radial-gradient(2px 2px at 90px 120px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 160px 60px, #fff, transparent), radial-gradient(2.5px 2.5px at 230px 170px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 300px 90px, #fff, transparent);
  background-size: 340px 220px; animation: lsnow 9s linear infinite; }
.lsnow.l2 { background-size: 210px 160px; opacity: .45; animation-duration: 14s; }
@keyframes lsnow { from { transform: translate(0, 0); } to { transform: translate(-80px, 220px); } }
.lbox { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: -8vh; padding: 26px 48px; border-radius: 40px; background: radial-gradient(ellipse, #05040acc 0%, #05040a88 55%, #0000 75%); }
#load .lt { color: #fff; font-size: clamp(34px, 7vw, 64px); font-weight: 900; letter-spacing: .18em; text-shadow: 0 0 24px #b58cff, 0 4px 0 #3a2a5c, 0 6px 18px #000a; }
.lsub { color: #e6dcff; font-size: 15px; letter-spacing: .2em; text-transform: uppercase; opacity: .85; margin-top: -4px; }
.lpct { color: #ffd9a0; font-weight: 900; margin-top: 18px; text-shadow: 0 0 18px #ff8a2a99; }
.lpct b { font-size: 46px; font-variant-numeric: tabular-nums; } .lpct span { font-size: 24px; margin-left: 2px; }
#load .lb { width: min(360px, 80vw); height: 12px; border-radius: 99px; background: #0007; border: 1px solid #ffffff33; overflow: hidden; }
#load .lb i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ff5a1a, #ffb040, #fff0a0); box-shadow: 0 0 12px #ffa040; }
.ltip { color: #fff; font-size: 14px; opacity: 1; transition: opacity .3s; margin-top: 8px; text-shadow: 0 1px 3px #000; min-height: 20px; }

#bars { position: fixed; left: 14px; top: 14px; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.bar { display: flex; align-items: center; gap: 8px; color: #fff; font: 700 14px "Segoe UI", Arial, sans-serif; text-shadow: 0 1px 2px #000; }
.bar span { width: 22px; text-align: center; }
.bb { width: 180px; height: 12px; border-radius: 99px; background: #0008; overflow: hidden; border: 1px solid #fff4; }
.bb i { display: block; height: 100%; width: 100%; background: linear-gradient(#ff6b6b, #d23b3b); transition: width .15s; }
.bb.torch i { background: linear-gradient(#ffd36b, #ff8a2a); }
#hurt { position: fixed; inset: 0; pointer-events: none; opacity: 0; box-shadow: inset 0 0 160px 40px #c0101088; }
#msg { position: fixed; left: 50%; top: 18%; transform: translateX(-50%); color: #fff; font: 800 22px "Segoe UI", Arial, sans-serif; text-shadow: 0 2px 6px #000; pointer-events: none; white-space: nowrap; }

/* ---------------- menu */
#btnMenu { position: fixed; right: 204px; top: 12px; pointer-events: auto; width: 44px; height: 44px; border-radius: 12px; border: 1px solid #ffffff44; background: #0a0814aa; color: #fff; font-size: 24px; cursor: pointer; z-index: 5; }
#btnMenu:hover { background: #2a2045cc; }
#menu { position: fixed; inset: 0; z-index: 8; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(ellipse at 50% 45%, #05040a66 0%, #05040acc 80%); backdrop-filter: blur(3px); }
.mpanel { display: flex; flex-direction: column; align-items: center; gap: 12px; width: min(440px, 100%); padding: 28px 26px; border-radius: 22px;
  background: linear-gradient(#1b1530ee, #0d0a18ee); border: 1px solid #b58cff44; box-shadow: 0 20px 60px #000b, inset 0 1px 0 #ffffff14; color: #eee8ff; }
.mtitle { font-size: clamp(32px, 7vw, 48px); font-weight: 900; letter-spacing: .16em; color: #fff; text-shadow: 0 0 20px #b58cff, 0 3px 0 #3a2a5c; text-align: center; }
.mtitle.small { font-size: 28px; letter-spacing: .1em; margin-bottom: 4px; }
.msub { letter-spacing: .2em; text-transform: uppercase; font-size: 13px; opacity: .8; margin: -4px 0 10px; text-align: center; }
.mbtn { width: 100%; padding: 13px 18px; border-radius: 14px; border: 1px solid #ffffff2a; background: #2a2145; color: #fff; font: 700 18px "Segoe UI", Arial, sans-serif; cursor: pointer; transition: transform .08s, background .15s; }
.mbtn:hover { background: #3a2e60; } .mbtn:active { transform: scale(.97); }
.mbtn.big { padding: 16px 18px; font-size: 22px; border: none; background: linear-gradient(#ffb040, #ff6a1a); color: #2a1206; box-shadow: 0 0 22px #ff8a2a66; }
.mbtn.big:hover { background: linear-gradient(#ffc460, #ff7a2a); }
.mrow { display: grid; grid-template-columns: 90px 1fr 44px; align-items: center; gap: 12px; width: 100%; font-weight: 700; }
.mrow b { text-align: right; font-variant-numeric: tabular-nums; color: #ffd9a0; }
.mrow input { width: 100%; accent-color: #ff8a2a; height: 22px; cursor: pointer; }
.mlab { align-self: flex-start; font-weight: 700; margin-top: 6px; }
.mlangs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; width: 100%; margin-bottom: 6px; }
.mlangs button { padding: 9px 10px; border-radius: 10px; border: 1px solid #ffffff22; background: #1f1936; color: #eee; font: 600 15px "Segoe UI", Arial, sans-serif; cursor: pointer; }
.mlangs button:hover { background: #2e2550; }
.mlangs button.on { background: #ff8a2a; color: #2a1206; border-color: #ffb040; }

/* ---------------- minimap */
#mini { position: fixed; right: 14px; top: 12px; width: 180px; height: 180px; pointer-events: auto; border-radius: 50%; z-index: 4;
  border: 3px solid #d8cfff66; box-shadow: 0 4px 18px #000a, inset 0 0 18px #0008; background: #100c1a; cursor: crosshair; overflow: visible; }
#mini canvas { display: block; border-radius: 50%; }
#mini .mnorth { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: #1b1530; border: 1px solid #ffffff66;
  color: #ffd9a0; font: 800 11px/16px "Segoe UI", Arial, sans-serif; text-align: center; pointer-events: none; }

/* ---------------- game HUD: storage, backpack, task */
.ic { display: inline-block; width: 26px; height: 26px; flex: none; } .ic svg { width: 100%; height: 100%; display: block; }
.hudg { position: fixed; inset: 0; pointer-events: none; z-index: 3; }
.resbar { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); display: flex; gap: 6px; align-items: center; padding: 5px 10px; border-radius: 16px;
  background: linear-gradient(#1b1530e6, #0d0a18e6); border: 1px solid #b58cff44; box-shadow: 0 6px 20px #0008; }
.rtitle { display: flex; align-items: center; gap: 5px; color: #e0d4ff; font: 800 12px "Segoe UI", Arial, sans-serif; text-transform: uppercase; letter-spacing: .08em; margin-right: 4px; }
.rtitle .ic { width: 22px; height: 22px; }
.rchip { display: flex; align-items: center; gap: 5px; padding: 3px 9px 3px 5px; border-radius: 12px; background: #ffffff10; color: #fff; font: 900 17px "Segoe UI", Arial, sans-serif; min-width: 62px; }
.rchip.bump { animation: bump .35s; } @keyframes bump { 40% { transform: scale(1.18); background: #ffffff30; } }
.bagp { position: absolute; left: 14px; top: 58px; display: flex; gap: 8px; align-items: center; padding: 6px 10px 6px 7px; border-radius: 14px; background: #0d0a18cc; border: 1px solid #ffffff22; color: #fff; }
.bagp > .ic { width: 34px; height: 34px; }
.bagt { font: 800 15px "Segoe UI", Arial, sans-serif; } .bagt b { font-size: 17px; }
.bagbar { width: 120px; height: 7px; border-radius: 9px; background: #ffffff1c; overflow: hidden; margin: 3px 0; }
.bagbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffb040, #ff7a2a); transition: width .2s; }
.bagbar i.full { background: #ff3a3a; animation: blinkbar .6s infinite alternate; } @keyframes blinkbar { to { opacity: .45; } }
.bagi { display: flex; gap: 6px; font: 800 13px "Segoe UI", Arial, sans-serif; min-height: 18px; }
.bi { display: flex; align-items: center; gap: 2px; } .bi .ic { width: 17px; height: 17px; }
.questp { position: absolute; left: 14px; top: 132px; width: 300px; padding: 9px 13px 11px; border-radius: 14px; background: linear-gradient(#2a1f45e6, #16102ae6);
  border: 1px solid #ffd23a66; color: #fff; box-shadow: 0 6px 20px #0008; }
.qh { font: 900 12px "Segoe UI", Arial, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: #ffd23a; }
.qt { font: 700 15px/1.3 "Segoe UI", Arial, sans-serif; margin-top: 3px; }
.qbar { height: 6px; border-radius: 9px; background: #ffffff1c; overflow: hidden; margin-top: 7px; } .qbar i { display: block; height: 100%; width: 0; background: #ffd23a; transition: width .3s; }

/* ---------------- dialog with the commander's portrait */
.dlg { position: fixed; left: 14px; bottom: 14px; z-index: 6; display: flex; gap: 14px; align-items: stretch; width: 640px; pointer-events: auto; padding: 12px; border-radius: 18px;
  background: linear-gradient(#1b1530f2, #0d0a18f2); border: 1px solid #b58cff66; box-shadow: 0 10px 40px #000c; cursor: pointer; animation: dlgin .35s ease-out; }
@keyframes dlgin { from { transform: translateY(30px); opacity: 0; } }
.dface { width: 118px; height: 118px; flex: none; border-radius: 14px; overflow: hidden; border: 3px solid #ffb040; box-shadow: 0 0 18px #ff8a2a66; background: #2a2045; }
.dface img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dbody { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.dname { font: 900 15px "Segoe UI", Arial, sans-serif; color: #ffb040; letter-spacing: .06em; }
.dtext { flex: 1; color: #f2eeff; font: 600 16px/1.4 "Segoe UI", Arial, sans-serif; margin: 5px 0 6px; min-height: 66px; }
.dnext { align-self: flex-end; padding: 7px 16px; border-radius: 11px; border: none; background: linear-gradient(#ffb040, #ff6a1a); color: #2a1206; font: 800 14px "Segoe UI", Arial, sans-serif; cursor: pointer; }

/* ---------------- floating +1 texts, launch button, victory */
#fxl { position: fixed; inset: 0; pointer-events: none; z-index: 4; overflow: hidden; }
.ftxt { position: absolute; left: 0; top: 0; font: 900 22px "Segoe UI", Arial, sans-serif; text-shadow: 0 2px 4px #000, 0 0 10px #000a; white-space: nowrap; }
.launchb { position: fixed; left: 50%; bottom: 70px; transform: translateX(-50%); z-index: 5; padding: 18px 44px; border-radius: 20px; border: none; cursor: pointer;
  background: linear-gradient(#ffd060, #ff5a1a); color: #2a1206; font: 900 28px "Segoe UI", Arial, sans-serif; letter-spacing: .1em; box-shadow: 0 0 40px #ff8a2acc; animation: pulseb 1s infinite alternate; }
@keyframes pulseb { to { box-shadow: 0 0 70px #ffb040; transform: translateX(-50%) scale(1.06); } }
.winp { position: fixed; inset: 0; z-index: 9; display: flex; align-items: center; justify-content: center; padding: 16px; background: radial-gradient(#05040a55, #05040ae0); animation: dlgin .6s; }
.wtxt { color: #e6dcff; font: 600 16px/1.4 "Segoe UI", Arial, sans-serif; text-align: center; margin-bottom: 8px; }
#garrow { position: fixed; left: 0; top: 0; width: 48px; height: 48px; z-index: 4; pointer-events: none; display: none; filter: drop-shadow(0 0 8px #ffb000cc); }
#garrow svg { width: 100%; height: 100%; display: block; }

/* backpack with a slot per resource */
.bagp { flex-direction: column; align-items: stretch; gap: 5px; padding: 8px 10px; width: 236px; }
.bagh { display: flex; align-items: center; gap: 7px; font: 800 14px "Segoe UI", Arial, sans-serif; }
.bagh .ic { width: 26px; height: 26px; } .bagh .bagt { margin-left: auto; font: 800 15px "Segoe UI", Arial, sans-serif; color: #ffd9a0; }
.bagp .bagbar { width: 100%; margin: 0; }
.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.slot { position: relative; height: 46px; border-radius: 10px; background: #ffffff0d; border: 1px solid #ffffff1f; display: flex; align-items: center; justify-content: center; opacity: .55; transition: opacity .2s, background .2s; }
.slot .ic { width: 30px; height: 30px; }
.slot b { position: absolute; right: 4px; bottom: 1px; font: 900 15px "Segoe UI", Arial, sans-serif; color: #fff; text-shadow: 0 1px 3px #000, 0 0 4px #000; }
.slot.has { opacity: 1; background: #ffffff1c; border-color: #ffd9a066; }
.slot.bump { animation: bump .35s; }
.questp { top: 178px; }
canvas#c.pick { cursor: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'%3E%3Cpath d='M9 30 L25 14' stroke='%23241206' stroke-width='6' stroke-linecap='round'/%3E%3Cpath d='M9 30 L25 14' stroke='%23b8743a' stroke-width='3.4' stroke-linecap='round'/%3E%3Cpath d='M12 6 Q27 5 32 22 Q24 12 12 10 Z' fill='%23d8dee6' stroke='%23241206' stroke-width='2' stroke-linejoin='round'/%3E%3Ccircle cx='24' cy='13' r='3' fill='%237a8490' stroke='%23241206' stroke-width='1.5'/%3E%3C/svg%3E") 12 6, pointer; }

.tostore { pointer-events: auto; display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 2px; padding: 6px 8px; border-radius: 10px; border: 1px solid #ffc86066;
  background: linear-gradient(#3a2a18, #24180e); color: #ffd9a0; font: 800 13px "Segoe UI", Arial, sans-serif; cursor: pointer; }
.tostore .ic { width: 20px; height: 20px; } .tostore kbd { font: 800 11px "Segoe UI", Arial, sans-serif; padding: 1px 5px; border-radius: 5px; background: #ffffff22; color: #fff; }
.tostore:hover { background: linear-gradient(#5a3a18, #3a2410); }
.bagp.isfull .tostore { background: linear-gradient(#ffb040, #ff6a1a); color: #2a1206; border-color: #ffd060; animation: pulseb2 .8s infinite alternate; }
@keyframes pulseb2 { to { box-shadow: 0 0 16px #ffb040; } }
.rchip.hlp { background: #3aa86033; }
.questp { top: 214px; }
.bagp { width: 270px; } .slots { grid-template-columns: repeat(5, 1fr); } .slot { height: 44px; } .slot .ic { width: 28px; height: 28px; }

/* ---------------- full-screen story (intro / ending / commander lines) */
.story { position: fixed; inset: 0; z-index: 12; background: #05040a; cursor: pointer; overflow: hidden; animation: sin .9s ease-out; display: flex; align-items: center; justify-content: center; }
.story.live { background: radial-gradient(ellipse at 50% 55%, #0a0818aa 0%, #05040ae6 75%); backdrop-filter: blur(7px) saturate(.8); }
.story.out { animation: sout .7s ease-in forwards; }
@keyframes sin { from { opacity: 0; } } @keyframes sout { to { opacity: 0; } }
.story .sbgs { position: absolute; inset: 0; }
.story .sbg { position: absolute; inset: -5%; animation: sbgin 1.6s ease-out, kenburns 26s ease-in-out infinite alternate; }
.story .sbg svg { width: 100%; height: 100%; display: block; }
@keyframes sbgin { from { opacity: 0; } }
@keyframes kenburns { from { transform: scale(1.02) translate(0, 0); } to { transform: scale(1.14) translate(-2.5%, 1.5%); } }
.story .sbg .ey { transform-box: fill-box; transform-origin: center; animation-name: eblink, ewalk; animation-iteration-count: infinite; animation-timing-function: linear, ease-in-out; }
.story .sbg .ey.lurk { animation-name: eblink, elurk; }
.story .sfade { position: absolute; inset: 0; background: linear-gradient(transparent 58%, #05040a88 82%, #05040ad0 100%), radial-gradient(ellipse at 50% 40%, transparent 40%, #05040a99 100%); pointer-events: none; }
.story.live .sfade { display: none; }
.story .sbar { position: absolute; left: 0; right: 0; height: 7vh; background: #000; z-index: 3; animation: sbar 1s ease-out; }
.story .sbar.top { top: 0; } .story .sbar.bot { bottom: 0; }
.story.live .sbar { display: none; }
@keyframes sbar { from { height: 0; } }
.story .sbox { position: absolute; z-index: 4; left: 50%; bottom: 13vh; transform: translateX(-50%); width: min(980px, calc(100vw - 40px)); text-align: center; }
.story.live .sbox { bottom: auto; top: 50%; transform: translate(-50%, -50%); }
.swho { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 16px; }
.swho img { width: clamp(90px, 14vw, 150px); height: clamp(90px, 14vw, 150px); border-radius: 50%; object-fit: cover; border: 4px solid #ffb040; box-shadow: 0 0 0 6px #ffb04022, 0 0 40px #ff8a2a88; background: #2a2045; animation: swho .6s ease-out; }
@keyframes swho { from { transform: scale(.7); opacity: 0; } }
.swho b { font: 400 clamp(16px, 2vw, 22px) "Russo One", "Segoe UI", sans-serif; letter-spacing: .14em; text-transform: uppercase; color: #ffb040; text-shadow: 0 0 18px #ff8a2a99; }
.sline { width: min(420px, 60%); height: 2px; margin: 0 auto 18px; background: linear-gradient(90deg, transparent, #ffb040, #fff4b0, #ffb040, transparent); box-shadow: 0 0 12px #ffb040; animation: sline2 1.2s ease-out; }
@keyframes sline2 { from { width: 0; opacity: 0; } }
.story .stext p { margin: 0; color: #f7f2ff; font: 500 clamp(21px, 3vw, 36px)/1.5 "Exo 2", "Segoe UI", Arial, sans-serif; text-shadow: 0 2px 10px #000, 0 0 28px #000c; }
.story .stext p span { display: inline; opacity: 0; filter: blur(6px); animation: sword .6s ease-out forwards; }
.story .stext.all p span { animation: none; opacity: 1; filter: none; }
@keyframes sword { to { opacity: 1; filter: none; } }
.story .sdots { position: absolute; bottom: calc(7vh + 16px); left: 50%; transform: translateX(-50%); display: flex; gap: 10px; z-index: 4; }
.story.live .sdots { bottom: 40px; }
.story .sdots i { width: 26px; height: 4px; border-radius: 4px; background: #ffffff30; transition: background .3s, box-shadow .3s; } .story .sdots i.on { background: #ffb040; box-shadow: 0 0 10px #ff8a2a; }
.story .shint { position: absolute; right: 36px; bottom: calc(7vh + 10px); color: #ffd9a0; font: 400 14px "Russo One", sans-serif; z-index: 4; animation: shint 1.2s ease-in-out infinite; }
.story.live .shint { bottom: 32px; }
@keyframes shint { 50% { opacity: .25; transform: translateX(5px); } }
.story .sskip { position: absolute; top: calc(7vh + 14px); right: 20px; z-index: 5; padding: 9px 18px; border-radius: 12px; border: 1px solid #ffffff44; background: #0008; color: #fff; font: 400 14px "Russo One", "Segoe UI", sans-serif; letter-spacing: .06em; cursor: pointer; }
.story.live .sskip { top: 18px; }
.story .sskip:hover { background: #2a2045cc; }

/* resource buttons on the right (go to the nearest one and mine it) */
.resbtns { position: absolute; right: 14px; top: 208px; display: flex; flex-direction: column; gap: 8px; pointer-events: auto; }
.resbtns button { position: relative; width: 58px; height: 58px; border-radius: 16px; border: 2px solid #ffffff2a; background: linear-gradient(#2a2145ee, #16102aee); cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px #0008; transition: transform .08s; }
.resbtns button:hover { border-color: #ffd23a; transform: translateX(-3px); } .resbtns button:active { transform: scale(.94); }
.resbtns .ic { width: 38px; height: 38px; }
.resbtns kbd { position: absolute; left: 3px; top: 2px; font: 800 10px "Segoe UI", Arial, sans-serif; color: #ffffffaa; }
/* language picker (first screen) */
#langpick { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 16px; background: radial-gradient(#2a2045, #05040a); }
#langpick.out { animation: sout .4s forwards; }
.lpbox { width: min(560px, 100%); display: flex; flex-direction: column; align-items: center; gap: 22px; }
.lpt { font: 400 clamp(34px, 7vw, 56px) "Russo One", "Segoe UI", sans-serif; letter-spacing: .14em; color: #fff; text-shadow: 0 0 24px #b58cff; }
.lpg { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; width: 100%; }
.lpg button { padding: 14px 12px; border-radius: 14px; border: 1px solid #ffffff2a; background: #1f1936; color: #fff; font: 700 18px "Exo 2", "Segoe UI", sans-serif; cursor: pointer; }
.lpg button:hover { background: #3a2e60; } .lpg button.on { border-color: #ffb040; box-shadow: 0 0 14px #ff8a2a66; }

.rchip.low { background: #ff3a2a55; animation: blinkbar .7s infinite alternate; }

.mbtn.danger { background: #4a1a22; border-color: #ff5a5a55; color: #ffd0d0; font-size: 15px; } .mbtn.danger:hover { background: #6a2230; } .mbtn.danger[data-sure] { background: #c8302a; color: #fff; }

/* task panel: bigger and clearer */
.questp { width: 360px; padding: 11px 14px 13px; border-width: 2px; border-color: #ffd23aaa; box-shadow: 0 6px 24px #000a, 0 0 18px #ffd23a33; }
.qh { font: 400 13px "Russo One", "Segoe UI", sans-serif; letter-spacing: .16em; }
.qrow { display: flex; gap: 11px; align-items: center; margin-top: 6px; }
.qic { width: 46px; height: 46px; flex: none; border-radius: 12px; background: #ffffff12; display: flex; align-items: center; justify-content: center; }
.qic svg { width: 38px; height: 38px; }
.questp .qt { font: 700 18px/1.3 "Exo 2", "Segoe UI", sans-serif; margin: 0; }
.qneed { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.qn { display: flex; align-items: center; gap: 4px; padding: 3px 9px 3px 4px; border-radius: 10px; background: #ffffff10; font: 700 15px "Exo 2", "Segoe UI", sans-serif; color: #cfc6ea; }
.qn .ic { width: 24px; height: 24px; } .qn b { font-size: 17px; }
.qn.ok { background: #3aa86033; } .qn.ok b { color: #8dffb0; }
.qn.mid { background: #ffd23a26; } .qn.mid b { color: #ffd23a; }
.qn.no b { color: #ff8a7a; }
.questp .qbar { position: relative; height: 18px; border-radius: 9px; margin-top: 9px; }
.questp .qbar i { background: linear-gradient(90deg, #ffb040, #ffd23a); }
.qnum { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 800 13px "Exo 2", "Segoe UI", sans-serif; color: #fff; text-shadow: 0 1px 3px #000; }

/* raid banner */
.raidb { position: fixed; left: 50%; top: 64px; transform: translateX(-50%); z-index: 5; padding: 12px 26px; border-radius: 16px; background: linear-gradient(#c8201a, #7a0e0a); border: 2px solid #ffb040;
  color: #fff; font: 400 26px "Russo One", "Segoe UI", sans-serif; letter-spacing: .06em; text-shadow: 0 2px 6px #000; box-shadow: 0 0 40px #ff3a1a99; pointer-events: none; animation: raidp .6s infinite alternate; white-space: nowrap; }
.raidb b { display: inline-block; min-width: 1.6em; margin-left: 8px; padding: 0 8px; border-radius: 8px; background: #0006; color: #ffd23a; text-align: center; }
@keyframes raidp { to { box-shadow: 0 0 70px #ff5a1a; transform: translateX(-50%) scale(1.04); } }

/* ---------------- the cave: countdown, task panel, fade */
.cavehud.intro { opacity: 0; }
.cavehud { transition: opacity .6s; }
.cavehud .questp { top: 214px; border-color: #7fe8ffaa; box-shadow: 0 6px 24px #000a, 0 0 18px #7fe8ff33; background: linear-gradient(#1a2445e6, #0e1228e6); }
.cavehud .qh { color: #7fe8ff; }
.ctimer { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 8px 22px; border-radius: 18px;
  background: linear-gradient(#1a2445ee, #0b0f22ee); border: 2px solid #7fe8ffaa; color: #fff; font: 400 38px "Russo One", "Segoe UI", sans-serif; text-shadow: 0 2px 6px #000; box-shadow: 0 6px 24px #000a; }
.ctimer .cic { font-size: .75em; }
.ctimer.mid { border-color: #ffd23a; color: #ffe27a; }
.ctimer.low { border-color: #ff4a3a; color: #ff8a7a; background: linear-gradient(#5a1010ee, #2a0808ee); animation: raidp .5s infinite alternate; }
.ctimer.done { border-color: #6fe0a0; color: #8dffb0; animation: none; }
.cbag { display: flex; align-items: center; gap: 5px; margin-top: 9px; font: 700 15px "Exo 2", "Segoe UI", sans-serif; color: #cfc6ea; flex-wrap: wrap; }
.cbag .ic { width: 22px; height: 22px; display: inline-flex; } .cbag .ic svg { width: 100%; height: 100%; }
.cbag b { color: #fff; } .cbag b.full { color: #ff8a7a; }
.cdots { display: flex; gap: 6px; margin-top: 9px; } .cdots i { flex: 1; height: 7px; border-radius: 4px; background: #ffffff1c; }
.cdots i.on { background: #6fe0a0; } .cdots i.cur { background: #7fe8ff; animation: blinkbar .7s infinite alternate; }
.cavefade { position: fixed; inset: 0; z-index: 8; pointer-events: none; opacity: 0; background: #000; }

/* cave: event banner + resource buttons */
.cevt { position: absolute; left: 50%; top: 88px; transform: translateX(-50%); padding: 10px 26px 12px; border-radius: 16px; text-align: center; white-space: nowrap;
  background: linear-gradient(#3a1a55f2, #1a0c2cf2); border: 2px solid #ffb040; box-shadow: 0 0 40px #ff8a3a66, 0 8px 30px #000a; color: #fff; }
.cevt .cet { font: 400 30px "Russo One", "Segoe UI", sans-serif; letter-spacing: .05em; color: #ffd23a; text-shadow: 0 2px 8px #000; }
.cevt .ced { font: 700 16px "Exo 2", "Segoe UI", sans-serif; margin-top: 3px; color: #f0e8ff; }
.cevt.pop { animation: cevtin .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes cevtin { from { transform: translateX(-50%) scale(.3); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
.cres button.need { box-shadow: 0 0 0 2px #7fe8ff, 0 0 16px #7fe8ff88; }
.cres button:not(.need):not(.cpad) { opacity: .45; }
.cavehud .cres { top: 96px; }

.cbagp .slots { grid-template-columns: repeat(3, 1fr); }
.cbagp .tostore { border-color: #7fe8ff66; background: linear-gradient(#1a3048, #0e1a2c); color: #bff4ff; }
.cbagp.isfull .tostore { background: linear-gradient(#7fe8ff, #3aa8e8); color: #06202c; border-color: #bff4ff; }

/* thunder flash, ritual banner, torch badge */
.thunder { position: fixed; inset: 0; z-index: 7; pointer-events: none; opacity: 0; background: #dfe8ff; visibility: hidden; }
.ritualb { background: linear-gradient(#5a1a7a, #2a0a3a); border-color: #c070ff; box-shadow: 0 0 40px #b060ff99; animation: none; top: 64px; }
.ritualb .rbar { height: 8px; border-radius: 4px; background: #0006; margin-top: 6px; overflow: hidden; } .ritualb .rbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #c070ff, #ff5a8a); }
#tbadge { position: fixed; right: 14px; bottom: 50px; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 10px; border-radius: 14px; pointer-events: none;
  background: #0d0a18d9; border: 2px solid #ffffff2a; color: #fff; font: 800 15px "Exo 2", "Segoe UI", sans-serif; box-shadow: 0 4px 16px #0008; }
#tbadge.hidden { display: none; }
#tbadge .tf { font-size: 30px; line-height: 1; }
#tbadge b { display: block; font-size: 16px; } #tbadge small { display: block; font: 600 12px "Exo 2", "Segoe UI", sans-serif; color: #cfc6ea; }
#tbadge.tb-lit { border-color: #ffb040; box-shadow: 0 0 18px #ff9a3a66; } #tbadge.tb-lit .tf { text-shadow: 0 0 10px #ffb040; }
#tbadge.tb-away .tf { opacity: .45; } #tbadge.tb-away b { color: #cfc6ea; }
#tbadge.tb-dead { border-color: #ff5a4a; } #tbadge.tb-dead .tf { opacity: .25; } #tbadge.tb-dead b { color: #ff8a7a; }

/* local stand-in for the CrazyGames video ad */
#adstub { position: fixed; inset: 0; background: #000d; color: #fff; display: flex; align-items: center; justify-content: center; font: 400 34px "Russo One", sans-serif; z-index: 40; }

/* the whole HUD lives in one 1280x760 layout scaled to the window (main.js fitUI): same places on every screen.
   A transformed parent is the containing block for its fixed children, so their positions stay as written above. */
#ui { position: fixed; left: 0; top: 0; transform-origin: 0 0; z-index: 3; pointer-events: none; }
#ui .launchb { pointer-events: auto; }
