:root { --gold: #e8c35a; --ink: #f4ead2; --dark: rgba(18, 14, 24, 0.82); --edge: #6b5636; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d0b12; color: var(--ink); font-family: "Alegreya Sans", "Trebuchet MS", sans-serif; user-select: none; }
canvas#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: default; }
.hidden { display: none !important; }
button { font: inherit; color: var(--ink); background: linear-gradient(#4a3a24, #2e2416); border: 2px solid var(--edge); border-radius: 6px; padding: 8px 16px; cursor: pointer; }
button:hover, button.focus { border-color: var(--gold); color: #fff; box-shadow: 0 0 12px rgba(232, 195, 90, 0.5); }
button:disabled { opacity: 0.45; cursor: default; box-shadow: none; }
.big { font-size: 22px; padding: 12px 40px; }
.hint { opacity: 0.75; font-size: 14px; }
h1, h2, h3 { font-family: "Cinzel", Georgia, serif; color: var(--gold); margin: 0 0 10px; text-shadow: 0 2px 0 #000; }

#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.lbl { position: absolute; left: 0; top: 0; text-align: center; white-space: nowrap; }
.hname { font-size: 12px; font-weight: 700; text-shadow: 0 1px 2px #000; }
.hname.me { color: #ffe68a; }
.npcname { font-size: 12px; color: #ffe68a; text-shadow: 0 1px 2px #000; }
.ename { font-size: 11px; color: #ffcc44; font-weight: 700; text-shadow: 0 1px 2px #000; }
.bar { position: relative; width: 60px; height: 6px; background: rgba(0,0,0,0.6); border: 1px solid rgba(0,0,0,0.8); border-radius: 3px; overflow: hidden; margin: 1px auto; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(#6fe06f, #2f9a3a); }
.bar i.sh { background: rgba(255, 226, 138, 0.75); }
.ebar i { background: linear-gradient(#ff6a5a, #b02a2a); }
.revive { width: 60px; height: 4px; background: rgba(0,0,0,0.6); margin: 2px auto; }
.revive i { display: block; height: 100%; background: #9affea; }
.downtxt { font-size: 11px; color: #ff9a8a; text-shadow: 0 1px 2px #000; }
.float { position: absolute; left: 0; top: 0; font-weight: 700; font-size: 16px; color: #fff; text-shadow: 0 0 3px #000, 0 1px 0 #000; }
.float.crit { color: #ffd84a; font-size: 21px; }
.float.aegis { color: #c9a24a; font-size: 13px; }
.float.dot { color: #ff9a4a; font-size: 13px; }
.float.hurt { color: #ff5a4a; }
.float.healn { color: #8aff8a; }
.float.immune { color: #c9a0ff; font-size: 13px; }
.bubble { position: absolute; left: 0; top: 0; background: #f4ead2; color: #2a2016; padding: 4px 10px; border-radius: 10px; font-size: 13px; font-weight: 700; }

#reticle { position: fixed; width: 22px; height: 22px; margin: -11px 0 0 -11px; border: 2px solid rgba(255, 230, 160, 0.9); border-radius: 50%; pointer-events: none; display: none; box-shadow: 0 0 4px #000; }
#reticle::after { content: ""; position: absolute; left: 8px; top: 8px; width: 2px; height: 2px; background: #ffe6a0; }

#hud { position: fixed; inset: 0; pointer-events: none; }
#hud button { pointer-events: auto; font-size: 13px; padding: 4px 10px; }
#party { position: absolute; left: 12px; top: 12px; display: flex; flex-direction: column; gap: 6px; }
.pf { display: flex; align-items: center; gap: 8px; background: var(--dark); border: 1px solid var(--edge); border-radius: 6px; padding: 5px 8px; width: 210px; }
.pf .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #111; flex: none; }
.pf .nm { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf .bar { width: 150px; height: 8px; margin: 2px 0 0; }
.pf.down { filter: grayscale(1); opacity: 0.7; }
.pf.me { border-color: var(--gold); }
#objective { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); text-align: center; min-width: 360px; }
#objtext { background: var(--dark); border: 1px solid var(--edge); padding: 6px 16px; border-radius: 6px; font-size: 16px; display: inline-block; }
#objtext:empty { display: none; }
#bossbar, #novabar, #totembar { margin-top: 8px; background: var(--dark); border: 1px solid var(--edge); border-radius: 6px; padding: 6px 12px; }
#bossname { font-family: Cinzel, serif; color: #ffb0a0; }
#bossbar .bar, #totembar .bar { width: 420px; height: 12px; }
#bosstag { font-size: 12px; color: #c9a0ff; min-height: 14px; }
#novabar .bar { width: 420px; height: 10px; } #novabar .bar i { background: linear-gradient(#a0c0ff, #4060ff); }
#novabar .hold { width: 420px; height: 6px; margin: 4px auto 0; background: rgba(0,0,0,0.6); } #novabar .hold i { display: block; height: 100%; background: #9affea; }
#novabar > div:first-child { color: #9fc0ff; font-weight: 800; letter-spacing: 2px; }
#totembar .bar i { background: linear-gradient(#fff4a0, #e0b030); }
#group { position: absolute; right: 12px; top: 12px; background: var(--dark); border: 1px solid var(--edge); border-radius: 6px; padding: 8px 10px; text-align: right; max-width: 300px; }
#groupline { font-size: 13px; margin-bottom: 6px; }
#groupline b { color: var(--gold); letter-spacing: 2px; }
#groupbtns { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
#prompt { position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%); background: var(--dark); border: 1px solid var(--gold); padding: 6px 14px; border-radius: 6px; font-size: 15px; }
#prompt kbd, .key { display: inline-block; min-width: 20px; padding: 0 5px; border: 1px solid var(--gold); border-radius: 4px; color: var(--gold); font-weight: 700; font-family: inherit; text-align: center; }
#toasts { position: absolute; top: 120px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.toast { background: var(--dark); border: 1px solid var(--gold); padding: 8px 18px; border-radius: 6px; font-size: 17px; font-weight: 700; animation: toast 4s forwards; text-align: center; }
.toast.big { font-family: Cinzel, serif; font-size: 24px; color: var(--gold); }
@keyframes toast { 0% { opacity: 0; transform: translateY(-8px); } 8% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }
#bottom { position: absolute; bottom: 14px; left: 0; right: 0; display: flex; align-items: flex-end; justify-content: center; gap: 24px; }
#xp { background: var(--dark); border: 1px solid var(--edge); border-radius: 6px; padding: 6px 10px; font-size: 13px; }
#xp .bar { width: 120px; } #xp .bar i { background: linear-gradient(#b48cff, #6a3cd0); }
#abilities { display: flex; gap: 8px; }
.ab { position: relative; width: 62px; height: 62px; background: var(--dark); border: 2px solid var(--edge); border-radius: 8px; display: grid; place-items: center; font-size: 26px; overflow: hidden; }
.ab .k { position: absolute; left: 3px; top: 1px; font-size: 11px; color: var(--gold); font-weight: 800; }
.ab .n { position: absolute; bottom: 1px; left: 0; right: 0; font-size: 9px; text-align: center; line-height: 1; }
.ab .cd { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.65); }
.ab .cdt { position: absolute; inset: 0; display: grid; place-items: center; font-size: 18px; font-weight: 800; }
#arts { display: flex; gap: 6px; }
.art { width: 40px; height: 40px; border-radius: 8px; background: var(--dark); border: 2px solid var(--edge); display: grid; place-items: center; font-size: 20px; position: relative; }
.art .r { position: absolute; right: 2px; bottom: 0; font-size: 10px; color: var(--gold); font-weight: 800; }
.art.empty { opacity: 0.35; }

.screen { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, rgba(20,14,30,0.35), rgba(8,6,12,0.85)); }
.titlebox { text-align: center; padding: 30px 50px; }
#title h1 { font-size: 64px; line-height: 1; letter-spacing: 2px; }
#title h1 span { font-size: 44px; color: #f4ead2; }
.tag { font-size: 19px; max-width: 520px; margin: 10px auto 26px; }
.menu { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.menu button { min-width: 240px; }
#herocards { display: flex; gap: 16px; margin: 20px; flex-wrap: wrap; justify-content: center; }
.hc { width: 210px; background: var(--dark); border: 2px solid var(--edge); border-radius: 10px; padding: 16px; text-align: left; cursor: pointer; }
.hc:hover, .hc.focus { border-color: var(--gold); box-shadow: 0 0 16px rgba(232,195,90,0.45); }
.hc h3 { margin: 0; font-size: 20px; }
.hc .role { font-size: 13px; opacity: 0.8; margin-bottom: 8px; }
.hc .ab2 { font-size: 13px; margin-top: 6px; }
.hc .sw { width: 100%; height: 6px; border-radius: 3px; margin-bottom: 10px; }

#modal { position: fixed; inset: 0; background: rgba(5,3,10,0.55); display: grid; place-items: center; }
#modalbox { background: linear-gradient(#241c2e, #17121e); border: 2px solid var(--edge); border-radius: 12px; padding: 22px 26px; min-width: 420px; max-width: min(860px, 94vw); max-height: 88vh; overflow: auto; box-shadow: 0 10px 40px #000; }
#modalbox .row { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.mission { display: flex; gap: 14px; align-items: center; padding: 10px 12px; border: 1px solid var(--edge); border-radius: 8px; margin: 8px 0; background: rgba(0,0,0,0.25); }
.mission .info { flex: 1; }
.mission h3 { font-size: 17px; margin: 0 0 4px; }
.mission p { margin: 0; font-size: 14px; opacity: 0.9; }
.mission .rw { font-size: 18px; margin-top: 4px; }
.mission.raid { border-color: #a04040; background: rgba(80,10,10,0.25); }
.done { color: #8aff8a; font-size: 13px; }
.bag { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.bagitem { border: 2px solid var(--edge); border-radius: 8px; padding: 8px 10px; background: rgba(0,0,0,0.3); cursor: pointer; text-align: left; }
.bagitem.on { border-color: var(--gold); background: rgba(80,60,10,0.35); }
.bagitem .t { font-weight: 800; }
.bagitem .d { font-size: 13px; opacity: 0.85; }
.bagitem.locked { opacity: 0.35; cursor: default; }
.reward { display: flex; gap: 12px; align-items: center; border: 1px solid var(--gold); border-radius: 8px; padding: 10px; margin: 8px 0; background: rgba(80,60,10,0.25); }
.reward .ic { font-size: 34px; }
label.vol { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin: 8px 0; }
.controls td { padding: 3px 10px; font-size: 14px; }
.credits { font-size: 12px; max-height: 50vh; overflow: auto; opacity: 0.9; }
.credits li { margin: 4px 0; }
input[type=text] { font: inherit; font-size: 22px; letter-spacing: 4px; text-transform: uppercase; padding: 6px 10px; width: 200px; text-align: center; background: #120e18; color: var(--ink); border: 2px solid var(--edge); border-radius: 6px; }
#loading { position: fixed; inset: 0; display: grid; place-items: center; background: #0d0b12; font-family: Cinzel, serif; font-size: 26px; color: var(--gold); }

/* Minimap and the full map */
#minimap { position: fixed; top: 96px; right: 14px; width: 176px; height: 176px; border-radius: 50%; box-shadow: 0 2px 10px rgba(0,0,0,0.6); pointer-events: none; }
#maphint { position: fixed; top: 276px; right: 14px; width: 176px; text-align: center; font-size: 12px; color: #e8dcc0; text-shadow: 0 1px 2px #000; pointer-events: none; }
#bigmap { position: fixed; inset: 0; background: rgba(8,6,4,0.72); display: flex; align-items: center; justify-content: center; z-index: 30; }
#bigmap.hidden { display: none; }
#bigmap .mapbox { background: rgba(28,22,16,0.95); border: 2px solid var(--edge); border-radius: 12px; padding: 14px 18px; box-shadow: 0 6px 30px rgba(0,0,0,0.7); }
#bigmaptitle { font-family: Cinzel, serif; font-size: 22px; color: #f0c860; text-align: center; margin-bottom: 8px; }
#bigmapcv { width: min(74vh, 86vw); height: min(74vh, 86vw); display: block; border-radius: 8px; }
#bigmap .legend { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; margin-top: 10px; font-size: 13px; color: #e8dcc0; }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: middle; font-style: normal; }
.lg.me { background: #fff; } .lg.ally { background: #4a8cff; } .lg.foe { background: #ff3a3a; } .lg.elite { background: #ff9a30; } .lg.boss { background: #c060ff; }
.lg.chest { background: #ffcc44; border-radius: 2px; } .lg.obj { width: auto; height: auto; color: #ffd040; font-size: 14px; }

/* Flash of light over the whole screen (ultimates) */
#flash { position: fixed; inset: 0; pointer-events: none; opacity: 0; z-index: 5; mix-blend-mode: screen; }

/* The ultimate in the action bar */
.ab.ult { border-color: #8a6a30; }
.ab.ult .fury { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(0deg, rgba(255,150,40,0.55), rgba(255,210,90,0.25)); border-radius: 0 0 6px 6px; pointer-events: none; }
.ab.ult.ready { border-color: #ffd050; animation: ultglow 0.9s ease-in-out infinite alternate; }
@keyframes ultglow { from { box-shadow: 0 0 6px 2px rgba(255,200,60,0.5); } to { box-shadow: 0 0 18px 6px rgba(255,170,40,0.95); } }

/* Weapons in the bag */
.bag h3, .modal h3 { margin: 10px 0 6px; }
.bagitem.weapon.r-rare { border-color: #5aa8ff; }
.bagitem.weapon.r-epique { border-color: #c070ff; box-shadow: 0 0 8px rgba(192,112,255,0.35); }
.bagitem.weapon.r-legendaire { border-color: #ffb030; box-shadow: 0 0 12px rgba(255,176,48,0.55); }
