/* Get Thee Hence — dark fantasy theme */
:root {
  --gold: #d4af37;
  --gold-dim: #8a7326;
  --bg: #0d0a14;
  --panel: rgba(20, 14, 30, 0.94);
  --red: #c0392b;
  --blue: #2471a3;
  --ink: #e8dfc8;
  --ink-dim: #9a8f76;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg); color: var(--ink);
  font-family: Georgia, 'Times New Roman', serif;
  overflow: hidden;
}
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
.hidden { display: none !important; }
.mono { font-family: 'Courier New', monospace; font-size: 0.85em; word-break: break-all; }

/* ---------- generic ---------- */
.btn {
  background: linear-gradient(180deg, #3a2c12, #241b0a);
  border: 1px solid var(--gold-dim); color: var(--gold);
  padding: 10px 22px; font-size: 16px; font-family: inherit;
  cursor: pointer; border-radius: 6px; letter-spacing: 0.5px;
  transition: all 0.15s;
}
.btn:hover:not(:disabled) { border-color: var(--gold); color: #ffe9a3; box-shadow: 0 0 12px rgba(212,175,55,0.35); }
.btn:disabled { opacity: 0.45; cursor: wait; }
.btn.big { font-size: 20px; padding: 14px 40px; }
.btn.small { font-size: 13px; padding: 6px 14px; }
.btn.ghost { background: transparent; }
.btn.active { border-color: var(--gold); color: #ffe9a3; box-shadow: 0 0 12px rgba(212,175,55,0.5); }
.note { color: var(--ink-dim); font-size: 14px; }
.status { color: var(--gold); min-height: 1.4em; font-style: italic; }
.kbd {
  display: inline-block; border: 1px solid var(--gold-dim); border-radius: 4px;
  padding: 0 6px; font-size: 11px; color: var(--gold); background: #1a1410;
}

/* ---------- landing ---------- */
.landing-inner { text-align: center; max-width: 560px; padding: 20px; }
.crest { font-size: 72px; filter: drop-shadow(0 0 18px rgba(212,175,55,0.6)); }
.landing-inner h1 {
  font-size: 56px; margin: 12px 0; color: var(--gold); letter-spacing: 3px;
  text-shadow: 0 0 24px rgba(212,175,55,0.4);
}
.theme-line { font-size: 18px; line-height: 1.6; color: var(--ink); margin-bottom: 30px; }
#screen-landing {
  background: radial-gradient(ellipse at center, #1a1226 0%, #0d0a14 70%);
}

/* ---------- panels (create / lobby) ---------- */
.panel {
  background: var(--panel); border: 1px solid var(--gold-dim); border-radius: 10px;
  padding: 30px 36px; width: 560px; max-width: 92vw; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 0 40px rgba(0,0,0,0.7);
}
.panel.wide { width: 680px; }
.panel h2 { color: var(--gold); margin-top: 0; letter-spacing: 1px; }
.field-label { display: block; margin: 14px 0 6px; color: var(--ink-dim); }
#saint-name {
  width: 100%; padding: 12px; font-size: 18px; font-family: inherit;
  background: #141020; border: 1px solid var(--gold-dim); border-radius: 6px; color: var(--ink);
}
#saint-name:focus { outline: none; border-color: var(--gold); }
.class-cards { display: flex; gap: 12px; margin: 22px 0; }
.class-card {
  flex: 1; border: 1px solid var(--gold-dim); border-radius: 8px; padding: 16px 10px;
  text-align: center; cursor: pointer; transition: all 0.15s; background: #161021;
}
.class-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.class-card.selected { border-color: var(--gold); box-shadow: 0 0 16px rgba(212,175,55,0.45); background: #201829; }
.class-card h3 { color: var(--gold); margin: 8px 0 6px; font-size: 17px; }
.class-card p { font-size: 13px; color: var(--ink-dim); margin: 0; line-height: 1.4; }
.class-icon { font-size: 40px; }

/* ---------- lobby ---------- */
.lobby-head { display: flex; justify-content: space-between; align-items: center; }
.exp-list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; }
.exp-list .empty { color: var(--ink-dim); font-style: italic; padding: 18px; text-align: center; }
.exp-row {
  display: flex; align-items: center; gap: 14px; padding: 10px 14px;
  background: #161021; border: 1px solid #2c2340; border-radius: 6px;
}
.exp-id { color: var(--gold); font-weight: bold; }
.exp-players { color: var(--ink); }
.exp-block { color: var(--ink-dim); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- game screen ---------- */
#screen-game { display: block; }
#game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: default; }

#topbar {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 18px;
  background: var(--panel); border: 1px solid var(--gold-dim); border-top: none;
  border-radius: 0 0 10px 10px; padding: 8px 22px; z-index: 10;
  box-shadow: 0 4px 18px rgba(0,0,0,0.6);
}
.tb-logo { color: var(--gold); font-weight: bold; letter-spacing: 1px; white-space: nowrap; }
.tb-item { white-space: nowrap; font-size: 15px; }
.tb-item b { color: #ffe9a3; }

#minimap {
  position: absolute; top: 64px; right: 12px; z-index: 10;
  border: 1px solid var(--gold-dim); border-radius: 6px;
  background: #000; box-shadow: 0 0 14px rgba(0,0,0,0.7);
}

/* build / recruit panel */
#build-panel {
  position: absolute; right: 12px; top: 240px; z-index: 10;
  background: var(--panel); border: 1px solid var(--gold-dim); border-radius: 8px;
  padding: 10px; display: flex; flex-direction: column; gap: 6px; width: 132px;
}
.bp-title { color: var(--gold); font-size: 13px; letter-spacing: 1px; text-align: center; margin-top: 4px; }
.bp-btn {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: #161021; border: 1px solid #2c2340; border-radius: 6px;
  color: var(--ink); font-family: inherit; font-size: 13px; padding: 7px 8px; cursor: pointer;
}
.bp-btn:hover:not(:disabled) { border-color: var(--gold); }
.bp-btn.active { border-color: var(--gold); box-shadow: 0 0 10px rgba(212,175,55,0.5); }
.bp-btn .ico { font-size: 18px; }

/* ability bar */
#ability-bar {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 12px; z-index: 10;
}
.ab-slot {
  position: relative; width: 64px; height: 64px;
  background: #161021; border: 2px solid var(--gold-dim); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; cursor: pointer; overflow: hidden;
}
.ab-slot:hover { border-color: var(--gold); }
.ab-slot.targeting { border-color: #fff; box-shadow: 0 0 16px #fff; }
.ab-key {
  position: absolute; top: 2px; left: 5px; font-size: 11px; color: var(--gold);
  font-family: 'Courier New', monospace; z-index: 2;
}
.ab-name {
  position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%);
  font-size: 10px; color: var(--ink-dim); white-space: nowrap;
}
.ab-cd {
  position: absolute; left: 0; right: 0; bottom: 0; height: 0%;
  background: rgba(0,0,0,0.75); pointer-events: none;
}
.ab-cd-num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff; font-family: 'Courier New', monospace; pointer-events: none;
}

/* Diablo orbs */
.orb {
  position: absolute; bottom: 18px; width: 120px; height: 120px; border-radius: 50%;
  border: 3px solid #5a4a20; overflow: hidden; z-index: 10;
  background: radial-gradient(circle at 50% 35%, #2a0f0a 0%, #120806 70%);
  box-shadow: 0 0 20px rgba(0,0,0,0.8), inset 0 0 24px rgba(0,0,0,0.9);
}
.orb.blue { background: radial-gradient(circle at 50% 35%, #0f2a3a 0%, #08121a 70%); border-color: #1f4a5a; }
#orb-hp { left: 24px; }
#orb-faith { right: 24px; }
.orb-fill {
  position: absolute; left: 0; right: 0; bottom: 0; height: 100%;
  background: radial-gradient(circle at 50% 80%, #e74c3c 0%, #922b21 70%);
  transition: height 0.3s;
}
.orb.blue .orb-fill { background: radial-gradient(circle at 50% 80%, #5dade2 0%, #1a5276 70%); }
.orb-num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: bold; color: #fff; text-shadow: 0 0 6px #000, 0 2px 2px #000;
}
.orb-title {
  position: absolute; bottom: -22px; width: 100%; text-align: center;
  font-size: 11px; letter-spacing: 2px; color: var(--gold-dim);
}

/* kill feed */
#killfeed {
  position: absolute; right: 170px; bottom: 150px; z-index: 10;
  display: flex; flex-direction: column-reverse; gap: 4px; max-width: 300px;
  pointer-events: none;
}
.kill-item {
  background: rgba(10, 8, 16, 0.85); border-left: 3px solid var(--gold);
  padding: 6px 10px; font-size: 13px; border-radius: 0 4px 4px 0;
  animation: feedfade 6.5s forwards;
}
@keyframes feedfade {
  0% { opacity: 0; transform: translateX(12px); }
  8% { opacity: 1; transform: translateX(0); }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

/* hint bar */
#hint-bar {
  position: absolute; bottom: 104px; left: 50%; transform: translateX(-50%);
  background: rgba(10,8,16,0.9); border: 1px solid var(--gold-dim); border-radius: 6px;
  padding: 8px 18px; font-size: 14px; color: var(--gold); z-index: 11;
}

/* modals */
.modal {
  position: absolute; inset: 0; z-index: 50;
  background: rgba(5, 3, 10, 0.75);
  display: flex; align-items: center; justify-content: center;
}
.modal-box {
  background: var(--panel); border: 1px solid var(--gold); border-radius: 10px;
  padding: 28px 34px; width: 520px; max-width: 92vw; max-height: 84vh; overflow-y: auto;
  box-shadow: 0 0 50px rgba(212,175,55,0.25); text-align: center;
}
.modal-box h2 { color: var(--gold); letter-spacing: 2px; font-size: 34px; margin: 0 0 16px; }
.modal-box h3 { color: var(--gold); margin-top: 0; }
.modal-box h4 { color: var(--gold); margin: 18px 0 8px; }
.kv { display: flex; justify-content: space-between; gap: 12px; margin: 8px 0; font-size: 14px; }
.kv span { color: var(--ink-dim); }
.cmd {
  display: block; background: #0a0712; border: 1px solid #2c2340; border-radius: 6px;
  padding: 10px 12px; margin: 10px 0; text-align: left; color: #9fe8a9; font-size: 12px;
}
.row { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }
#go-title.defeat { color: var(--red); text-shadow: 0 0 24px rgba(192,57,43,0.6); }
#go-stats { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.go-stat { display: flex; justify-content: space-between; padding: 6px 12px; background: #161021; border-radius: 4px; }
.go-stat span { color: var(--ink-dim); }
.go-stat b { color: #ffe9a3; }
#go-loot { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.loot-item {
  background: #161021; border: 1px solid var(--gold-dim); border-radius: 6px;
  padding: 8px 12px; font-size: 14px; color: #ffe9a3;
}

/* toasts */
#toast-root {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
  z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  background: rgba(20, 12, 8, 0.95); border: 1px solid var(--gold-dim); color: var(--ink);
  padding: 10px 20px; border-radius: 6px; font-size: 15px;
  animation: toastin 0.25s ease-out;
  box-shadow: 0 4px 16px rgba(0,0,0,0.6);
}
.toast.err { border-color: var(--red); color: #f5b7b1; }
@keyframes toastin { from { opacity: 0; transform: translateY(-8px); } }
