:root {
  --bg: #fff;
  --fg: #111827;
  --muted: #6b7280;
  --card: #f3f4f6;
  --off: #d1d5db;
  --off-fg: #6b7280;
  --hot: #f43f5e;
  --warn: #d97706;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #030712;
    --fg: #f3f4f6;
    --card: #1f2937;
    --off: #374151;
    --off-fg: #9ca3af;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.4 system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
main { max-width: 28rem; margin: 0 auto; padding: 1.25rem 1rem 6rem; display: grid; gap: 1.25rem; }
h1 { margin: 0; font-size: 1.5rem; }
.center { text-align: center; }
.muted { color: var(--muted); }
.warn { color: var(--warn); text-align: center; margin: 0; }
.row { display: flex; justify-content: space-between; align-items: baseline; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.stat { background: var(--card); border-radius: 0.75rem; padding: 1rem; text-align: center; }
.stat b { display: block; font-size: 1.9rem; }
.stat.broke b { color: var(--hot); }
.stat small { color: var(--muted); }
button, .btn {
  font: inherit; border: 0; border-radius: 1rem; cursor: pointer; text-decoration: none; text-align: center;
}
button:active:not(:disabled), .btn:active { transform: scale(0.96); }
.player {
  min-height: 7.5rem; padding: 0.75rem; background: var(--hot); color: #fff; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem;
}
.player:disabled { background: var(--off); color: var(--off-fg); }
.player img { width: 3rem; height: 3rem; border-radius: 50%; }
.player span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player small { font-weight: 400; }
.big { display: block; padding: 1.1rem; font-size: 1.15rem; font-weight: 700; color: #fff; }
.discord { background: #5865f2; }
.tier { background: #ec4899; }
.tier.rapier { background: #9333ea; }
.plain { background: var(--card); color: var(--fg); padding: 0.9rem; }
.link { background: none; color: var(--muted); font-size: 0.9rem; padding: 0; }
section { display: grid; gap: 0.75rem; border-top: 1px solid var(--off); padding-top: 1.25rem; }
#toast {
  position: fixed; left: 1rem; right: 1rem; bottom: calc(1.5rem + env(safe-area-inset-bottom));
  max-width: 26rem; margin: 0 auto; padding: 1rem; border-radius: 0.75rem;
  background: #111827; color: #fff; text-align: center; box-shadow: 0 10px 30px #0006;
}
h2 { margin: 0; font-size: 1.05rem; }
.small { margin: 0; font-size: .85rem; }
.hero { background: var(--card); border-radius: 1rem; padding: 1.25rem 1rem; text-align: center; }
.hero > b { display: block; font-size: 3.4rem; line-height: 1; }
.hero > small { color: var(--muted); }
.hero p { margin: .75rem 0 0; font-size: 1.05rem; }
.hero p.broke b { color: var(--hot); }
.banner {
  background: var(--hot); color: #fff; border-radius: .75rem; padding: .9rem 1rem; text-align: center;
  font-size: 1.1rem;
}
.player small { font-size: .8rem; text-align: center; }
.player .pname { font-size: 1.05rem; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.feed li { background: var(--card); border-radius: .6rem; padding: .6rem .8rem; font-size: .95rem; }
.feed span { color: var(--muted); }
.pack { background: #0ea5e9; }
/* Dota-style cooldown: --p = share of the protection left (1 → 0); the dark wedge shrinks clockwise. */
.cd { position: relative; width: 3.4rem; height: 3.4rem; border-radius: 50%; overflow: hidden; }
.cd img { width: 100%; height: 100%; display: block; }
.player .cd img { width: 100%; height: 100%; }
.cd i {
  position: absolute; inset: 0;
  /* clear from 12 o'clock clockwise as time passes; dark for the share still left */
  background: conic-gradient(transparent calc((1 - var(--p, 1)) * 360deg), rgb(0 0 0 / .72) 0);
}
.cd b {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #fff; font-size: .95rem; font-weight: 700; text-shadow: 0 1px 3px #000;
}
.player:disabled .cd img { filter: grayscale(1); }
.player em { display: block; font-style: normal; font-size: .72rem; opacity: .85; }
.player.pricey:not(:disabled) { background: #9f1239; }
/* landing page */
.brand { display: flex; align-items: center; gap: .75rem; margin-top: .5rem; }
.brand h1 { font-size: 1.8rem; }
.brand img { border-radius: 12px; }
.lead { font-size: 1.15rem; margin: 0; }
main > p { margin: 0; }
.teaser > b { font-size: 2.6rem; }
footer { border-top: 1px solid var(--off); padding-top: 1rem; color: var(--muted); font-size: .85rem; display: grid; gap: .4rem; }
footer p { margin: 0; }
footer a { color: inherit; }
