/* Live GPS - WoW Forever look: dark stone panels, gold trim, class-colour accents */
:root {
  --gold: #d4a82f;
  --gold-hi: #ffd100;
  --gold-lo: #6b5316;
  --ink: #f2e6c4;
  --ink-dim: #a99c78;
  --bg-0: #0e0c09;
  --bg-1: #17140e;
  --panel: rgba(20, 16, 10, 0.88);
  --accent: #abd473;
  --accent-ink: #10150a;
  --good: #7fdc7f;
  --bad: #ff6b5a;
  --serif: "Friz Quadrata TT", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  color-scheme: dark;
}
[data-theme="druid"]   { --accent: #ff7d0a; --accent-ink: #1a0d00; --bg-0: #130c06; --bg-1: #1d120a; }
[data-theme="hunter"]  { --accent: #abd473; --accent-ink: #10150a; --bg-0: #0d110a; --bg-1: #151b0f; }
[data-theme="mage"]    { --accent: #69ccf0; --accent-ink: #04141b; --bg-0: #080f14; --bg-1: #0e1a22; }
[data-theme="paladin"] { --accent: #f58cba; --accent-ink: #1c0812; --bg-0: #130a0f; --bg-1: #1e1119; }
[data-theme="priest"]  { --accent: #ffffff; --accent-ink: #111111; --bg-0: #101012; --bg-1: #19191d; }
[data-theme="rogue"]   { --accent: #fff569; --accent-ink: #1a1800; --bg-0: #121108; --bg-1: #1b190b; }
[data-theme="shaman"]  { --accent: #2f8bff; --accent-ink: #00101f; --bg-0: #070d18; --bg-1: #0d1627; }
[data-theme="warlock"] { --accent: #9482c9; --accent-ink: #0e0a1a; --bg-0: #0d0a14; --bg-1: #15111f; }
[data-theme="warrior"] { --accent: #c79c6e; --accent-ink: #1a1007; --bg-0: #120e09; --bg-1: #1b150e; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 15px/1.45 var(--serif);
  color: var(--ink);
  background: radial-gradient(ellipse at 50% -10%, var(--bg-1), var(--bg-0) 70%) fixed, var(--bg-0);
  -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }
h1, h2 { margin: 0; font-weight: normal; }
button, input, select { font: inherit; color: inherit; }

/* ---------- panels ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--gold-lo);
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(255, 209, 0, 0.08), 0 6px 24px rgba(0, 0, 0, 0.55);
  padding: 14px 16px;
}
.panel h2 {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--gold-lo);
  display: flex;
  align-items: center;
  gap: 8px;
}
.count {
  margin-left: auto;
  min-width: 22px;
  text-align: center;
  padding: 0 7px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12px;
  letter-spacing: 0;
}
.muted { color: var(--ink-dim); margin: 0 0 8px; }
.small { font-size: 13px; }

/* ---------- logo ---------- */
.logo {
  font-size: 34px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-hi);
  text-shadow: 0 2px 0 #000, 0 0 18px rgba(255, 209, 0, 0.25);
}
.logo span { color: var(--accent); }
.logo.small { font-size: 20px; }

/* ---------- controls ---------- */
.btn {
  appearance: none;
  cursor: pointer;
  padding: 7px 14px;
  border-radius: 4px;
  border: 1px solid var(--gold-lo);
  background: linear-gradient(#2c2415, #1a150b);
  color: var(--ink);
  min-height: 36px;
  transition: border-color 0.12s, background 0.12s;
}
.btn:hover { border-color: var(--gold); background: linear-gradient(#3a2f1a, #221b0e); }
.btn:focus-visible, input:focus-visible, select:focus-visible, .swatch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: linear-gradient(var(--accent), color-mix(in srgb, var(--accent) 70%, #000)); color: var(--accent-ink); border-color: var(--gold); font-weight: bold; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger:hover { border-color: var(--bad); color: var(--bad); }
.btn.toggle.active { border-color: var(--accent); color: var(--accent); }
.btn.wide { width: 100%; margin-top: 6px; }

input[type="text"], input:not([type]), input[type="password"], select, .copyrow input {
  width: 100%;
  padding: 8px 10px;
  min-height: 38px;
  border-radius: 4px;
  border: 1px solid var(--gold-lo);
  background: #0b0906;
  color: var(--ink);
}
select { width: auto; max-width: 100%; }
label { display: block; margin-bottom: 12px; color: var(--ink-dim); font-size: 13px; letter-spacing: 0.04em; }
label input { margin-top: 4px; }
label.check { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 15px; letter-spacing: 0; margin-bottom: 4px; cursor: pointer; }
label.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.error { color: var(--bad); min-height: 1.4em; margin: 0 0 4px; font-size: 14px; }
.copyrow { display: flex; gap: 8px; margin-bottom: 10px; }
.copyrow input { font-family: Consolas, "Courier New", monospace; font-size: 13px; min-width: 0; }

/* ---------- auth ---------- */
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: min(100%, 400px); padding: 28px 26px; text-align: center; }
.auth-card form { text-align: left; }
.sub { color: var(--ink-dim); margin: 6px 0 22px; }
.tabs { display: flex; margin-bottom: 18px; border-bottom: 1px solid var(--gold-lo); }
.tab { flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px; color: var(--ink-dim); cursor: pointer; letter-spacing: 0.1em; text-transform: uppercase; font-size: 13px; }
.tab.active { color: var(--gold-hi); border-bottom-color: var(--accent); }

/* ---------- app shell ---------- */
.app { display: flex; flex-direction: column; min-height: 100%; padding: 0 0 12px; }
.topbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px max(16px, env(safe-area-inset-left)) 10px max(16px, env(safe-area-inset-right));
  border-bottom: 1px solid var(--gold-lo);
  background: linear-gradient(#1f180c, #120e08);
}
.spacer { flex: 1; }
.who { color: var(--gold); letter-spacing: 0.06em; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 14px; border: 1px solid var(--gold-lo); background: #0b0906; font-size: 13px; }
.pill .dot { width: 9px; height: 9px; border-radius: 50%; background: #666; }
.pill.live .dot { background: var(--good); box-shadow: 0 0 8px var(--good); }
.pill.warn .dot { background: var(--gold); }

.themes { display: flex; gap: 6px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--gold-lo); cursor: pointer; padding: 0; }
.swatch[aria-checked="true"] { border-color: var(--gold-hi); box-shadow: 0 0 0 2px #000, 0 0 10px var(--gold); }
.sw-druid { background: #ff7d0a; } .sw-hunter { background: #abd473; } .sw-mage { background: #69ccf0; }
.sw-paladin { background: #f58cba; } .sw-priest { background: #ffffff; } .sw-rogue { background: #fff569; }
.sw-shaman { background: #2f8bff; } .sw-warlock { background: #9482c9; } .sw-warrior { background: #c79c6e; }

.layout {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px;
  padding: 14px max(16px, env(safe-area-inset-left)) 0 max(16px, env(safe-area-inset-right));
}
.mapwrap { display: flex; flex-direction: column; padding: 10px; min-height: 420px; align-self: start; position: sticky; top: 10px; height: calc(100vh - 80px); }
.maptools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.maptools .hint { margin-left: auto; color: var(--ink-dim); font-size: 13px; }
.canvaswrap { position: relative; flex: 1; min-height: 340px; border-radius: 4px; overflow: hidden; border: 1px solid var(--gold-lo); background: #0a0806; touch-action: none; }
.canvaswrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
.side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; }
.kv dt { color: var(--ink-dim); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
details.alt { margin: 0 0 10px; color: var(--ink-dim); font-size: 13px; }
details.alt summary { cursor: pointer; padding: 4px 0; }
details.alt .copyrow { margin-top: 6px; margin-bottom: 0; }
.btn.small { min-height: 28px; padding: 3px 10px; font-size: 12px; letter-spacing: 0; text-transform: none; }
.push { margin-left: auto; }
code { font-family: Consolas, "Courier New", monospace; font-size: 0.92em; color: var(--gold); }
.curq { border: 1px solid var(--gold-lo); border-left: 3px solid var(--accent); border-radius: 4px; background: rgba(255, 209, 0, 0.05); padding: 8px 10px; margin-bottom: 10px; }
.curq-label { margin: 0; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-dim); }
.curq-title { margin: 2px 0 4px; color: var(--gold-hi); }
.objs { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.objs li { padding-left: 18px; position: relative; color: var(--ink); }
.objs li::before { content: "\25CB"; position: absolute; left: 2px; color: var(--ink-dim); }
.objs li.done { color: var(--ink-dim); text-decoration: line-through; }
.objs li.done::before { content: "\2713"; color: var(--good); }
#quest-list details { border-top: 1px solid rgba(107, 83, 22, 0.5); padding: 4px 0; }
#quest-list summary { cursor: pointer; color: var(--gold); font-size: 13px; letter-spacing: 0.06em; padding: 4px 0; }
.q-item { padding: 4px 0 6px 6px; }
.q-title { color: var(--ink); }
.q-title .lvl { color: var(--ink-dim); font-size: 12px; }
.q-title.complete { color: var(--good); }
.q-title.tracked::after { content: " \2605"; color: var(--gold-hi); }
#tip { position: fixed; z-index: 20; max-width: 320px; pointer-events: none; background: #1b150a; border: 1px solid var(--gold); border-radius: 4px; padding: 8px 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6); font-size: 13px; line-height: 1.35; }
#tip .tip-title { color: var(--gold-hi); font-size: 15px; margin-bottom: 2px; }
#tip .tip-line { color: var(--ink-dim); }
#tip .tip-obj { color: var(--ink); }
#tip .tip-obj.done { color: var(--ink-dim); text-decoration: line-through; }
#layers { margin-top: 10px; }
#layers .lgroup { margin: 10px 0 4px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-dim); }
#layers label.check { font-size: 14px; margin-bottom: 2px; gap: 8px; }
#layers label.check input { width: 17px; height: 17px; }
.lkey { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1px solid #000; color: #101010; font-size: 11px; font-weight: bold; flex: none; }
#search-results { margin-top: 6px; }
#search-results li { padding: 5px 6px; font-size: 14px; }
#search-results .pzone { font-size: 12px; }
.sel-title { margin: 0 0 2px; color: var(--gold-hi); font-size: 16px; }
#sel-list { margin: 4px 0 10px; }
.wp-line { margin: 0 0 6px; }
.wp-line strong { color: var(--gold-hi); font-weight: normal; }

.players { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.players li { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 4px; cursor: pointer; }
.players li:hover { background: rgba(255, 209, 0, 0.07); }
.players .pdot { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: 0 0 0 1px #000; }
.players .pname { font-weight: bold; }
.players .pzone { margin-left: auto; color: var(--ink-dim); font-size: 13px; text-align: right; }
.players .self .pname::after { content: " (du)"; color: var(--ink-dim); font-weight: normal; }
.players .empty { color: var(--ink-dim); cursor: default; }
.players .empty:hover { background: none; }

#toast {
  position: fixed; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: #1d170b; border: 1px solid var(--gold); color: var(--ink);
  padding: 10px 18px; border-radius: 4px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 10;
  max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translateX(-50%); }

/* ---------- tablet / phone ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .mapwrap { min-height: 0; position: static; height: auto; }
  .canvaswrap { min-height: 56vh; }
  .maptools .hint { display: none; }
  .themes { order: 5; width: 100%; justify-content: center; }
}
@media (max-width: 520px) {
  .who { display: none; }
  .swatch { width: 30px; height: 30px; }
}
