/* Forever-like game HUD, shared by the landing page and the training ground.
   Everything here is drawn in CSS: no game texture, font or art is used.
   Sizes scale with the screen height through --u (1px at 1080 px high),
   the way the game scales its own interface. */

@font-face {
  font-family: "Marcellus";
  src: url("fonts/Marcellus-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  --u: calc(min(100vh, 56.25vw) / 1080);
  --serif: "Marcellus", "Palatino Linotype", Georgia, serif;
  --sans: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --gold: #ffd100;
  --yellow: #ffff00;
  --instance: #ff7f00;
  --whisper: #ff80ff;
  --ally: #52a1ff;
  --horde: #e6383a;
  --health: #18c418;
  --mana: #1a5cff;
  --text: #f2efe6;
  --muted: #b9b2a2;
  --frame: rgba(6, 6, 8, 0.78);
  --edge: #5c4a2e;
  --edge-light: #a8874f;
  --stone: #6b665d;
  color-scheme: dark;
}

[hidden] { display: none !important; }

/* ---- the world behind the interface (blurred, original art) ---- */
.world { position: absolute; inset: 0; overflow: hidden; background: #0b0d10; }
.world-layer {
  position: absolute;
  inset: -24px;
  background: center / cover no-repeat;
  filter: blur(3px) saturate(0.9);
  opacity: 0;
  transition: opacity 0.8s ease;
}
.world-layer.ours { background-image: url("bg/ours.webp"); }
.world-layer.mid { background-image: url("bg/mid.webp"); }
.world-layer.theirs { background-image: url("bg/theirs.webp"); }
.world[data-zone="ours"] .ours,
.world[data-zone="mid"] .mid,
.world[data-zone="theirs"] .theirs { opacity: 1; }
.world::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 45%, transparent 35%, rgba(0, 0, 0, 0.55) 80%, rgba(0, 0, 0, 0.85) 100%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.25), transparent 25%, transparent 70%, rgba(0, 0, 0, 0.45));
}

/* ---- frames ---- */
.wow-panel {
  background: var(--frame);
  border: 2px solid var(--edge);
  border-radius: 4px;
  box-shadow: 0 0 0 1px #000, inset 0 0 0 1px rgba(0, 0, 0, 0.9), inset 0 0 18px rgba(0, 0, 0, 0.7);
}
.wow-tooltip {
  background: rgba(4, 6, 14, 0.88);
  border: 2px solid #8a8a8a;
  border-radius: 6px;
  box-shadow: 0 0 0 1px #000, inset 0 0 0 1px #2b2b2b;
}

.wow-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 16px;
  font: 15px/1.2 var(--serif);
  color: var(--gold);
  text-decoration: none;
  text-shadow: 0 1px 1px #000;
  background: linear-gradient(#8e1210, #5a0806 55%, #3b0403);
  border: 1px solid #c9a24a;
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 220, 160, 0.25), 0 0 0 1px #000;
  cursor: pointer;
}
.wow-btn:hover { color: #fff; background: linear-gradient(#a8201c, #6c0c09 55%, #460504); }
.wow-btn:active { transform: translateY(1px); }
.wow-btn[aria-pressed="true"], .wow-btn[aria-selected="true"] {
  color: #fff;
  border-color: var(--gold);
  box-shadow: inset 0 0 8px rgba(255, 209, 0, 0.45), 0 0 0 1px #000;
}
.wow-btn.dark { background: linear-gradient(#2a2a2e, #141416); color: var(--gold); }

/* Raid warning: big yellow text with a hard black outline. */
.raid-warning {
  font-family: var(--serif);
  color: var(--gold);
  text-shadow: 0 0 2px #000, 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 0 2px 6px rgba(0, 0, 0, 0.9);
}
/* Red error line, like the game's UI error messages. */
.ui-error {
  font-family: var(--serif);
  color: #ff2a1f;
  text-shadow: 1px 1px 0 #000, 0 0 3px #000;
}

/* ---- BG score widget (top centre) ---- */
.bg-score {
  display: grid;
  grid-template-columns: auto auto;
  gap: calc(4 * var(--u)) calc(8 * var(--u));
  align-items: center;
  font: max(13px, calc(17 * var(--u))) / 1 var(--serif);
  color: #fff;
  text-shadow: 1px 1px 0 #000, 0 0 3px #000;
}
.bg-flag {
  width: calc(22 * var(--u));
  height: calc(22 * var(--u));
  min-width: 15px;
  min-height: 15px;
  border: 1px solid #000;
  border-radius: 3px;
  background: #1b1b1b;
  position: relative;
  box-shadow: inset 0 0 0 1px #6b5a3a;
}
.bg-flag::before {
  content: "";
  position: absolute;
  left: 22%;
  top: 14%;
  width: 62%;
  height: 72%;
  background: var(--c);
  clip-path: polygon(0 0, 100% 0, 100% 60%, 50% 100%, 0 60%);
}
.bg-flag.ally { --c: linear-gradient(#6fb4ff, #1d5fbf); }
.bg-flag.horde { --c: linear-gradient(#ff5b4f, #8e1410); }

/* ---- minimap ---- */
.minimap-zone {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 10px;
  font: max(11px, calc(14 * var(--u))) / 1.4 var(--serif);
  color: var(--gold);
  background: linear-gradient(rgba(0, 0, 0, 0.85), rgba(20, 16, 10, 0.85));
  border: 1px solid #3a3226;
  border-radius: 3px;
  text-shadow: 1px 1px 0 #000;
}
.minimap-zone time { color: #fff; font-variant-numeric: tabular-nums; }
.minimap-disc {
  position: relative;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 45% 40%, #3f4f2c, #26331c 60%, #1a2414);
  border: calc(7 * var(--u)) solid var(--stone);
  outline: 1px solid #000;
  box-shadow: 0 0 0 calc(2 * var(--u)) #2a2620, 0 0 0 calc(3 * var(--u)) #b08d4e, inset 0 0 24px rgba(0, 0, 0, 0.8);
}
.minimap-disc::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.75);
  pointer-events: none;
}

/* ---- unit frames ---- */
.unit {
  display: flex;
  align-items: center;
  gap: calc(6 * var(--u));
  font-family: var(--serif);
  color: #fff;
  text-shadow: 1px 1px 0 #000;
}
.unit-portrait {
  position: relative;
  flex: none;
  width: calc(64 * var(--u));
  height: calc(64 * var(--u));
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  border: 3px solid #b08d4e;
  box-shadow: 0 0 0 1px #000, inset 0 0 10px #000;
  background: radial-gradient(circle at 40% 35%, #4a4038, #1c1712);
  display: grid;
  place-items: center;
  font-size: max(18px, calc(26 * var(--u)));
  color: var(--gold);
}
.unit-portrait img { width: 66%; height: 66%; object-fit: contain; }
.unit-level {
  position: absolute;
  left: -6px;
  bottom: -4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #241c10;
  border: 2px solid #b08d4e;
  font: 11px/1 var(--serif);
  color: var(--gold);
}
.unit-bars { width: calc(150 * var(--u)); min-width: 110px; }
.unit-name {
  font-size: max(11px, calc(14 * var(--u)));
  padding: 1px 6px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.unit.enemy .unit-name { background: linear-gradient(90deg, #8b1210, #3c0605); }
.unit.friend .unit-name { background: linear-gradient(90deg, #14408c, #071c42); }
.bar {
  height: calc(12 * var(--u));
  min-height: 7px;
  border: 1px solid #000;
  background: #111;
  position: relative;
}
.bar > i { position: absolute; inset: 0 auto 0 0; width: var(--v, 100%); }
.bar.hp > i { background: linear-gradient(#3cf03c, var(--health) 60%, #0b780b); }
.bar.mp > i { background: linear-gradient(#5c8cff, var(--mana) 60%, #0b2d8c); }

/* ---- chat ---- */
.chat-tabs { display: flex; gap: 2px; }
.chat-tabs span {
  padding: 2px 10px 1px;
  font: max(11px, calc(13 * var(--u))) / 1.3 var(--serif);
  color: #d8c690;
  background: linear-gradient(rgba(30, 26, 18, 0.85), rgba(0, 0, 0, 0.6));
  border: 1px solid #3c3428;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  text-shadow: 1px 1px 0 #000;
}
.chat-tabs span.on { color: #fff; background: linear-gradient(rgba(70, 58, 34, 0.9), rgba(0, 0, 0, 0.6)); }
.chat-lines {
  list-style: none;
  margin: 0;
  padding: 4px 6px;
  font: max(13px, calc(16 * var(--u))) / 1.3 var(--serif);
  text-shadow: 1px 1px 1px #000, 0 0 2px #000;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.18));
}
.chat-lines li { padding: 1px 0; color: #fff; }
.chat-lines .instance { color: var(--instance); }
.chat-lines .system { color: var(--yellow); }
.chat-lines .whisper { color: var(--whisper); }
.chat-lines .ping { color: #8fd3ff; }
.chat-lines .alliance { color: #00aeff; }
.chat-lines .horde { color: #ff3d2e; }
.chat-lines .blocked { color: #ff2a1f; }

/* ---- objectives tracker ---- */
.tracker-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 10px;
  font: max(12px, calc(15 * var(--u))) / 1.3 var(--serif);
  color: var(--gold);
  background: linear-gradient(90deg, rgba(60, 44, 18, 0.95), rgba(20, 14, 6, 0.6));
  border: 1px solid var(--edge);
  border-radius: 3px;
  text-shadow: 1px 1px 0 #000;
}
.tracker-head b {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  font: 700 13px/1 var(--sans);
  color: #fff;
  background: linear-gradient(#a51d17, #5e0906);
  border: 1px solid #c9a24a;
  border-radius: 3px;
}

/* ---- action bar ---- */
.slot {
  position: relative;
  width: calc(46 * var(--u));
  height: calc(46 * var(--u));
  min-width: 34px;
  min-height: 34px;
  border: 1px solid #000;
  border-radius: 3px;
  background: radial-gradient(circle at 50% 40%, #2a2824, #0f0e0c);
  box-shadow: inset 0 0 0 1px #4a4336, inset 0 0 8px #000;
}
.slot img { position: absolute; inset: 12%; width: 76%; height: 76%; object-fit: contain; filter: drop-shadow(0 1px 1px #000); }
.slot kbd {
  position: absolute;
  top: 1px;
  right: 3px;
  padding: 0;
  border: 0;
  background: none;
  font: 600 max(10px, calc(12 * var(--u))) / 1 var(--sans);
  color: #e8e8e8;
  text-shadow: 1px 1px 0 #000, 0 0 2px #000;
}
.slot.down { box-shadow: inset 0 0 0 2px var(--gold), inset 0 0 12px rgba(255, 209, 0, 0.6); }
.slot.down img { transform: scale(0.92); }

/* ---- animations ---- */
@keyframes hud-fade-in { from { opacity: 0; transform: translateY(-6px) scale(1.04); } to { opacity: 1; transform: none; } }
@keyframes hud-slide-in { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@keyframes hud-flash { 0% { box-shadow: 0 0 0 1px #000, 0 0 0 rgba(255, 209, 0, 0); } 30% { box-shadow: 0 0 0 1px #000, 0 0 22px rgba(255, 209, 0, 0.9); } 100% { box-shadow: 0 0 0 1px #000, 0 0 0 rgba(255, 209, 0, 0); } }
@keyframes hud-pulse { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.35); color: #fff; } }
@keyframes hud-shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
