:root {
  --bg: #000;
  --card: #0c0c0f;
  --card2: #131318;
  --line: rgba(255, 255, 255, .08);
  --text: #f4f4f5;
  --mute: #8a8a96;
  --accent: #a855f7;
  --radius: 16px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.4 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
body::before { /* soft glow in the selected clan's colour */
  content: ""; position: fixed; inset: -20vh -20vw auto; height: 60vh; z-index: -1; pointer-events: none;
  background: radial-gradient(50% 60% at 50% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%);
  transition: background .4s;
}
.wrap { max-width: 560px; margin: 0 auto; padding: 18px 16px 40px; }
.display { font-family: "Lilita One", "Inter", sans-serif; font-weight: 400; letter-spacing: .3px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ---------- header + search ---------- */
.top { display: flex; align-items: center; justify-content: space-between; margin: 4px 2px 14px; }
.top h1 { margin: 0; font-size: 26px; line-height: 1; }
.top h1 span { color: var(--accent); transition: color .3s; }
.search { position: relative; display: block; margin-bottom: 14px; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.search input {
  width: 100%; height: 50px; padding: 0 44px 0 46px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line); outline: none; font-size: 16px;
  transition: border-color .2s, box-shadow .2s;
}
.search input::placeholder { color: var(--mute); }
.search input:focus { border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent); }
.search svg { position: absolute; left: 16px; top: 15px; width: 20px; height: 20px; color: var(--mute); }
.search .clear { position: absolute; right: 6px; top: 6px; width: 38px; height: 38px; border: 0; background: none; color: var(--mute); font-size: 22px; display: none; border-radius: 10px; }
.search.has-text .clear { display: block; }

/* ---------- clan banners ---------- */
.clans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.clan {
  --c: #fff;
  position: relative; overflow: hidden; text-align: left; min-height: 78px; padding: 12px 14px;
  border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--c) 22%, transparent);
  background:
    radial-gradient(120% 130% at 100% 0%, color-mix(in srgb, var(--c) 34%, transparent), transparent 62%),
    repeating-linear-gradient(135deg, transparent 0 14px, color-mix(in srgb, var(--c) 5%, transparent) 14px 15px),
    #08080a;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: transform .15s, border-color .2s, box-shadow .2s;
}
.clan:active { transform: scale(.98); }
.clan.on { border-color: var(--c); box-shadow: 0 0 0 1px var(--c), 0 8px 30px -8px color-mix(in srgb, var(--c) 55%, transparent); }
.clan .nm { font-size: 19px; line-height: 1.05; display: block; }
.clan .meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: #c9c9d1; }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 600;
  background: color-mix(in srgb, var(--c, var(--accent)) 18%, transparent); color: color-mix(in srgb, var(--c, var(--accent)) 80%, #fff); }
.count { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--mute); }
.count svg { width: 12px; height: 12px; vertical-align: -1px; margin-right: 3px; }

/* ---------- player list ---------- */
.list-head { display: flex; align-items: baseline; gap: 10px; margin: 0 4px 10px; }
.list-head h2 { margin: 0; font-size: 22px; color: var(--c); }
.list { list-style: none; margin: 0; padding: 0; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 10px; min-height: 58px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row .ic { width: 42px; height: 42px; object-fit: contain; flex: none; display: block; }
.row .name { flex: 1; min-width: 0; font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub { display: block; font-size: 12px; font-weight: 600; color: var(--c); margin-top: 1px; }
.row.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 30% { background: color-mix(in srgb, var(--c) 28%, transparent); } 100% { background: transparent; } }
button.row { width: 100%; background: none; border: 0; border-top: 1px solid var(--line); text-align: left; color: inherit; }
button.row:first-child { border-top: 0; }
button.row:active { background: var(--card2); }
.go { color: var(--mute); font-size: 18px; flex: none; }

.lg-wrap { position: relative; flex: none; display: block; }
.tier { position: absolute; right: -4px; bottom: -2px; font: 700 10px/1 "Inter", sans-serif; padding: 2px 4px; border-radius: 6px; background: #000; color: #e9d5ff; border: 1px solid rgba(255,255,255,.18); }
.lg-none { display: block; width: 42px; height: 42px; flex: none; border-radius: 50%; border: 2px dashed rgba(255,255,255,.14); transform: scale(.7); }

.empty { padding: 34px 16px; text-align: center; color: var(--mute); }
.skel { height: 58px; border-top: 1px solid var(--line); background: linear-gradient(90deg, transparent, rgba(255,255,255,.04), transparent) 0 0/200% 100%; animation: sh 1.2s infinite linear; }
@keyframes sh { to { background-position: -200% 0; } }

@media (max-width: 360px) {
  .clan .nm { font-size: 17px; }
  .row { gap: 10px; }
  .row .ic, .lg-none { width: 38px; height: 38px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
