/* Last Light — base / shared styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #000; }
body { font-family: var(--f-text); color: #d9c9a3; font-size: 14px; line-height: 1.35; user-select: none; }
button, input, select { font-family: inherit; }
canvas#game { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
.hidden { display: none !important; }
.muted { color: #8a7c63; }

/* tier colours */
.t1 { color: #a8a39a; } .t2 { color: #5fcf6a; } .t3 { color: #5a9cff; } .t4 { color: #c06bff; } .t5 { color: #ff9d2e; text-shadow: 0 0 6px rgba(255,157,46,.45); }

/* parchment-dark panel ("gump") */
.gump {
  background: linear-gradient(160deg, #221a12 0%, #1b1510 55%, #140f0b 100%);
  border: 2px solid #6a5232; border-radius: 4px; padding: 12px;
  box-shadow: inset 0 0 0 1px #2e2316, inset 0 0 0 3px #110c08, inset 0 0 24px rgba(0,0,0,.6), 0 8px 28px rgba(0,0,0,.75);
}

/* buttons */
.btn {
  display: inline-block; cursor: pointer; padding: 6px 14px; border-radius: 3px;
  color: #e8d8b0; font-size: 13px; letter-spacing: .03em;
  background: linear-gradient(#4a3a28, #2e2418); border: 1px solid #7a6040;
  box-shadow: inset 0 1px 0 rgba(255,230,180,.12), 0 1px 2px rgba(0,0,0,.6);
  transition: filter .12s, border-color .12s;
}
.btn:hover:not(:disabled) { filter: brightness(1.25); border-color: #b08a50; }
.btn:active:not(:disabled) { filter: brightness(.9); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { color: #fff1d6; background: linear-gradient(#c8641e, #7a330c); border-color: #ff9d4a; box-shadow: 0 0 10px rgba(255,120,40,.35), inset 0 1px 0 rgba(255,220,160,.3); }
.btn.danger { color: #ffdede; background: linear-gradient(#7a2222, #3e0e0e); border-color: #b04a4a; }

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #120d09; }
::-webkit-scrollbar-thumb { background: #4a3a28; border: 2px solid #120d09; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #6a5232; }
* { scrollbar-color: #4a3a28 #120d09; }

/* ---------------- HUD layout ---------------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud #lootwin, #hud #invwin { pointer-events: auto; }
#topbar { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); text-align: center; text-shadow: 0 2px 4px #000, 0 0 8px #000; }
#timer { font-size: 30px; font-weight: bold; color: #f0dcae; letter-spacing: .06em; }
#portalinfo { font-size: 15px; color: #8ff0ff; margin-top: 2px; }
#zoneinfo { font-size: 13px; color: #b8a888; margin-top: 2px; }
#banner { position: absolute; top: 108px; left: 50%; transform: translateX(-50%); width: min(90vw, 900px); text-align: center; font-size: 22px; font-weight: bold; text-shadow: 0 0 12px currentColor, 0 2px 4px #000; transition: opacity .4s; }
#feed { position: absolute; left: 14px; bottom: 40px; width: 460px; font-size: 13px; text-shadow: 0 1px 3px #000, 0 0 6px #000; display: flex; flex-direction: column; gap: 2px; }
#mapwrap { position: absolute; top: 10px; right: 10px; padding: 6px; background: rgba(12,9,6,.82); border: 2px solid #6a5232; border-radius: 4px; box-shadow: 0 4px 16px rgba(0,0,0,.7); }
#mapwrap canvas { display: block; }
.maplegend { font-size: 10px; color: #8a7c63; margin-top: 3px; text-align: center; }
#bottombar { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 16px; padding: 8px 12px; background: rgba(12,9,6,.75); border: 1px solid #4a3a24; border-radius: 4px; }
.bars { display: flex; flex-direction: column; gap: 4px; }
.bar { position: relative; width: 260px; height: 14px; background: #0c0906; border: 1px solid #3a2c1a; border-radius: 7px; overflow: hidden; }
.bar .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; border-radius: 7px; transition: width .15s; }
.fill.hp { background: linear-gradient(#e0483a, #8a1a12); }
.fill.mp { background: linear-gradient(#5a8cff, #1a3a9a); }
.fill.wt { background: linear-gradient(#b08a50, #5a4220); }
.bar span { position: absolute; inset: 0; text-align: center; font-size: 10px; line-height: 13px; color: #fff; text-shadow: 0 1px 2px #000; }
#quick { font-size: 13px; display: flex; flex-direction: column; gap: 3px; }
#keys { position: absolute; left: 14px; bottom: 10px; font-size: 11px; color: #6a5e4a; text-shadow: 0 1px 2px #000; }

/* ---------------- the Keep ---------------- */
#hub { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; background: radial-gradient(ellipse at 50% 0%, #2a1e14 0%, #0d0a07 70%); }
#hub header { display: flex; align-items: center; gap: 20px; padding: 10px 20px; background: linear-gradient(#1f1710, #120d09); border-bottom: 2px solid #6a5232; box-shadow: 0 4px 16px rgba(0,0,0,.6); }
#hub .logo { font-size: 24px; font-weight: bold; letter-spacing: .25em; color: #ffb25a; text-shadow: 0 0 14px rgba(255,150,60,.6); white-space: nowrap; }
#tabs { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
#wallet { display: flex; gap: 14px; font-size: 14px; white-space: nowrap; }
#hubmain { flex: 1; overflow: auto; padding: 18px 22px; }

/* enlarged map (M) */
#mapwrap.big { width: auto; }
#mapwrap.big #minimap { width: 560px; height: 300px; }

/* Tier 6 Demi-God (red) and Tier 7 Holy (living rainbow).
   Holy's marker colour #fff4d6 appears in inline styles; animations override inline colours. */
.t6 { color: #ff2a2a; text-shadow: 0 0 8px rgba(255,42,42,.55); }
@keyframes holy-text { 0%{color:#ff4a4a} 16%{color:#ffb02a} 33%{color:#fff04a} 50%{color:#4aff7a} 66%{color:#4ad8ff} 83%{color:#b46aff} 100%{color:#ff4a4a} }
@keyframes holy-edge {
  0%{border-color:#ff4a4a;box-shadow:0 0 12px #ff4a4a} 16%{border-color:#ffb02a;box-shadow:0 0 12px #ffb02a} 33%{border-color:#fff04a;box-shadow:0 0 12px #fff04a}
  50%{border-color:#4aff7a;box-shadow:0 0 12px #4aff7a} 66%{border-color:#4ad8ff;box-shadow:0 0 12px #4ad8ff} 83%{border-color:#b46aff;box-shadow:0 0 12px #b46aff} 100%{border-color:#ff4a4a;box-shadow:0 0 12px #ff4a4a} }
.t7, [style*="#fff4d6"] { animation: holy-text 3s linear infinite; text-shadow: 0 0 8px rgba(255,255,255,.35); }
.item-cell[style*="#fff4d6"], .h-ess[style*="#fff4d6"] { animation: holy-edge 3s linear infinite; }
