:root {
  --bg: #f4f1ea;
  --surface: #fffdf8;
  --text: #2a2620;
  --muted: #776f62;
  --border: #e2dccf;
  --accent: #8a5a1f;
  --accent-text: #fff;
  --error-bg: #fbe9e6;
  --error: #9b2c1f;
  --warrior: #a23b2a;
  --sura: #5b3a8c;
  --shaman: #2f7a5b;
  --ninja: #34414f;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17150f;
    --surface: #221f18;
    --text: #ece6da;
    --muted: #a49b8b;
    --border: #3a352a;
    --accent: #d39a4c;
    --accent-text: #1a1610;
    --error-bg: #3a1e19;
    --error: #f0a093;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
h1 { margin: 0 0 .25rem; font-size: 1.6rem; }
.muted { color: var(--muted); margin: 0; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem 16px;
}
.brand { font-weight: 700; font-size: 1.2rem; color: var(--text); text-decoration: none; letter-spacing: .02em; }
.logout { display: flex; gap: .75rem; align-items: center; margin: 0; }
.who { color: var(--muted); }

main { max-width: 720px; margin: 0 auto; padding: 0 16px 3rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
}
.narrow { max-width: 400px; margin: 2rem auto 0; }
.download { max-width: 560px; margin: 2rem auto 0; }
.download h2 { font-size: 1.1rem; margin: 1.75rem 0 .5rem; }
.download ol { padding-left: 1.25rem; line-height: 1.6; }
.download .small { font-size: .85rem; margin-top: .5rem; }
.download h2:first-child { margin-top: 0; }
.download + .download, .shots + .download { margin-top: 1.5rem; }
.pitch { margin: .5rem 0 1rem; font-size: 1.05rem; }

/* in-game screenshots on the download page */
.shot { margin: 0; }
.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgb(0 0 0 / .18);
}
.shot.hero { margin-top: 1rem; }
.shot figcaption { color: var(--muted); font-size: .9rem; margin-top: .5rem; text-align: center; }
.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; }
@media (max-width: 600px) { .shots { grid-template-columns: 1fr; } }
a.button {
  display: inline-block;
  margin-top: 1.25rem;
  padding: .7rem 1.4rem;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent);
  border-radius: 8px;
  text-decoration: none;
}
a.button:hover { filter: brightness(1.08); }

form label { display: block; margin: 1rem 0 .3rem; font-weight: 600; font-size: .9rem; }
form input {
  width: 100%;
  padding: .6rem .75rem;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
button {
  margin-top: 1.25rem;
  width: 100%;
  padding: .7rem;
  font: inherit;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
button.link { margin: 0; width: auto; padding: 0; background: none; color: var(--accent); font-weight: 500; }
button.link:hover { text-decoration: underline; }
.error { background: var(--error-bg); color: var(--error); padding: .6rem .75rem; border-radius: 8px; margin: 1rem 0 0; }

.hero { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.5rem; }
.badge {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  background: var(--muted);
}
.class-warrior { background: var(--warrior); }
.class-sura { background: var(--sura); }
.class-shaman { background: var(--shaman); }
.class-ninja { background: var(--ninja); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin: 0 0 1.5rem; }
.stats div { background: var(--bg); border-radius: 10px; padding: .9rem 1rem; }
.stats dt { color: var(--muted); font-size: .85rem; }
.stats dd { margin: 0; font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.details { margin: 0; }
.details div { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-top: 1px solid var(--border); }
.details dt { color: var(--muted); }
.details dd { margin: 0; text-align: right; }

@media (max-width: 480px) {
  .card { padding: 1.25rem; }
  .stats { grid-template-columns: 1fr; }
  .details div { flex-direction: column; gap: 0; }
  .details dd { text-align: left; }
}

/* ---------------------------------------------------------------- admin live view */
:root { --stage-bg: #0f1410; --ok: #2f8a4c; --bad: #b0412f; }
.topbar.wide, main.wide { max-width: none; }
.logout a { text-decoration: none; }

.live { display: flex; flex-direction: column; gap: .75rem; height: calc(100vh - 5.5rem); min-height: 480px; }
.live-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.tabs { display: flex; flex-wrap: wrap; gap: .35rem; }
.tabs button, .stage-tools button {
  width: auto;
  margin: 0;
  padding: .35rem .75rem;
  font-size: .9rem;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.live-stats { color: var(--muted); font-size: .9rem; margin-left: auto; }
.pill { font-size: .8rem; font-weight: 600; padding: .2rem .6rem; border-radius: 999px; background: var(--border); color: var(--muted); }
.pill.ok { background: var(--ok); color: #fff; }
.pill.ok::before { content: "● "; }
.pill.bad { background: var(--bad); color: #fff; }

.live-body { flex: 1; display: grid; grid-template-columns: 1fr 280px; gap: .75rem; min-height: 0; }
.stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--stage-bg);
}
.stage canvas { display: block; cursor: grab; touch-action: none; }
.overlay {
  position: absolute;
  inset: auto 1rem 1rem 1rem;
  padding: .6rem .8rem;
  border-radius: 8px;
  background: rgba(20, 10, 8, .85);
  color: #f3d2c9;
  font-size: .9rem;
}
.tooltip {
  position: absolute;
  pointer-events: none;
  padding: .4rem .6rem;
  border-radius: 6px;
  background: rgba(15, 15, 15, .9);
  color: #eee;
  font-size: .8rem;
  line-height: 1.35;
  white-space: nowrap;
}
.tt-title { font-weight: 700; color: #fff; }
.stage-tools { position: absolute; top: .6rem; right: .6rem; display: flex; gap: .3rem; }
.stage-tools button { background: rgba(255, 253, 248, .92); color: #2a2620; min-width: 2.2rem; }
.follow {
  position: absolute;
  top: .6rem;
  left: .6rem;
  padding: .3rem .7rem;
  border-radius: 999px;
  background: rgba(15, 15, 15, .8);
  color: #fff;
  font-size: .85rem;
}

.side {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  overflow-y: auto;
  min-height: 0;
}
.side h2 { font-size: 1rem; margin: 0 0 .75rem; display: flex; align-items: center; gap: .5rem; }
.count { font-size: .8rem; background: var(--bg); color: var(--muted); padding: .05rem .5rem; border-radius: 999px; }
.players { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .35rem; }
.players .empty { color: var(--muted); font-size: .9rem; }
button.player {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: .5rem;
  align-items: center;
  text-align: left;
  padding: .5rem .6rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid transparent;
  font-weight: 400;
}
button.player:hover { border-color: var(--border); }
button.player.active { border-color: var(--accent); }
.dot { width: 10px; height: 10px; border-radius: 50%; grid-row: 1 / span 4; align-self: start; margin-top: .4rem; }
.pname { font-weight: 600; }
.pmeta { color: var(--muted); font-size: .8rem; grid-column: 2; }
.hpbar { grid-column: 2; height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; margin-top: .25rem; }
.hpbar span { display: block; height: 100%; background: #3fae5c; }
.small { font-size: .8rem; }

@media (max-width: 800px) {
  .live { height: auto; }
  .live-body { grid-template-columns: 1fr; }
  .stage { height: 65vh; }
  .live-stats { margin-left: 0; width: 100%; order: 3; }
}
.manabar { margin-top: .15rem; }
.manabar span { background: #3f7fd6; }

/* equipment on the account page */
.gear-title { font-size: 1.05rem; margin: 1.5rem 0 .5rem; }
.gear { list-style: none; margin: 0 0 .5rem; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: .4rem; }
.gear li { display: grid; grid-template-columns: 36px 1fr; grid-template-rows: auto auto; column-gap: .6rem; align-items: center; padding: .45rem .6rem; background: var(--bg); border-radius: 8px; }
.gear .gear-icon { grid-row: span 2; display: grid; place-items: center; width: 36px; height: 36px; }
.gear .gear-slot { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
@media (max-width: 480px) { .gear { grid-template-columns: 1fr; } }
