:root {
  --bg: #0f1218; --panel: #171c25; --panel2: #1e2430; --line: #2a3140;
  --text: #e7e9ee; --muted: #8e97a8; --gold: #d9b44a; --gold-dim: #6b5a26;
  --ok: #3fb97f; --no: #59606e; --discord: #5865f2;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--gold); text-decoration: none; }
code { background: var(--panel2); padding: 1px 6px; border-radius: 4px; }
.muted { color: var(--muted); font-weight: 400; } .small { font-size: 13px; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 14px 28px; border-bottom: 1px solid var(--line); background: #11151c; position: sticky; top: 0; z-index: 8; }
.brand { color: var(--text); font-weight: 700; font-size: 18px; letter-spacing: .3px; }
.brand small { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 6px; }
.crest { filter: saturate(1.4); }
.top nav { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.top nav a { color: var(--muted); white-space: nowrap; padding: 4px 0; } .top nav a:hover { color: var(--text); }
.acct { order: 3; margin-left: 10px; display: flex; align-items: center; gap: 10px; color: var(--text); }
.acct img { width: 26px; height: 26px; border-radius: 50%; }
.out { font-size: 13px; }

main { max-width: 1180px; margin: 0 auto; padding: 28px 24px 48px; }
h1 { font-size: 26px; margin: 0 0 18px; } h2 { font-size: 19px; margin: 0; }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px; border-top: 1px solid var(--line); }

.btn { display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 8px;
  background: var(--gold); color: #1a1508; font-weight: 600; border: 0; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--gold); border: 1px solid var(--gold-dim); }
.btn.discord { background: var(--discord); color: #fff; font-size: 16px; padding: 12px 22px; }
.btn.discord svg { width: 22px; height: 22px; }

.hero { max-width: 560px; margin: 8vh auto 0; text-align: center; }
.hero h1 { font-size: 34px; }
.lead { color: var(--muted); font-size: 17px; margin: 0 0 28px; }
.safe { text-align: left; color: var(--muted); font-size: 13.5px; margin: 32px auto 0; max-width: 440px;
  padding: 14px 18px 14px 34px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.safe li { margin: 4px 0; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; margin: 0 0 16px; }
.card.narrow { max-width: 620px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head p { margin: 2px 0 0; }
.types { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.type { background: var(--panel2); border-radius: 10px; padding: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.type-name { font-weight: 600; flex: 1 0 100%; }

.tg { display: inline-block; min-width: 44px; text-align: center; padding: 2px 8px; border-radius: 6px;
  font-weight: 700; font-size: 13px; background: #262c38; color: var(--muted); }
.tg1, .tg2 { background: #2b3326; color: #b7c98f; }
.tg3, .tg4 { background: #33331f; color: #d9cf7a; }
.tg5, .tg6 { background: #3d331a; color: #f0c45a; }
.tg7, .tg8 { background: #4a3313; color: #ffb43c; box-shadow: inset 0 0 0 1px #8a5d1c; }
.t11 { font-weight: 700; font-size: 13px; }
.t11.yes { color: var(--ok); } .t11.no { color: var(--no); }

.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }
.tabs a { padding: 6px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.tabs a b { color: var(--text); margin-left: 4px; font-weight: 600; }
.tabs a.on { border-color: var(--gold); color: var(--gold); }
.tools { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; flex-wrap: wrap; }
.tools input { background: var(--panel); border: 1px solid var(--line); color: var(--text); padding: 8px 12px; border-radius: 8px; width: 260px; font: inherit; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; text-align: left; }
th { position: sticky; top: 0; background: var(--panel2); font-size: 12.5px; color: var(--muted); font-weight: 600;
  cursor: pointer; user-select: none; text-transform: uppercase; letter-spacing: .3px; }
th.asc::after { content: " ▲"; } th.desc::after { content: " ▼"; }
tbody tr:hover { background: #1b212c; } tbody tr:last-child td { border-bottom: 0; }
td .by { display: block; color: var(--gold); font-size: 11.5px; }
td .id { display: block; color: var(--muted); font-size: 12px; }
.num { text-align: right; } .c { text-align: center; }

.missing { margin-top: 22px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; }
.missing summary { cursor: pointer; font-weight: 600; }
.missing summary b { color: var(--gold); margin-left: 6px; }
.missing ul { columns: 3 200px; margin: 12px 0 0; padding-left: 18px; }
.missing li { margin: 2px 0; }

@media (max-width: 640px) {
  .top { padding: 10px 14px 0; gap: 0; } main { padding: 18px 12px 40px; }
  .brand { font-size: 17px; } .brand small { display: none; }
  .acct { order: 2; margin-left: auto; } .acct .who { display: none; }
  /* menu: one swipeable row of tabs under the logo */
  .top nav { order: 3; margin: 8px -14px 0; padding: 0 14px; gap: 4px; overflow-x: auto; scrollbar-width: none;
    width: calc(100% + 28px); }
  .top nav::-webkit-scrollbar { display: none; }
  .top nav a { padding: 10px 12px 11px; font-size: 15px; } .top nav a.on { box-shadow: inset 0 -3px 0 var(--accent); }
  .tools input { width: 100%; }
  h1 { font-size: 23px; } .card { padding: 16px 14px; border-radius: 12px; }
  .page-head { align-items: flex-start; }
  th, td { padding: 8px 9px; } td { font-size: 14px; }
  /* tables: hide the row number, keep the player's name pinned while swiping sideways */
  .table-wrap .rowno { display: none; }
  .table-wrap th.nm, .table-wrap td.nm { position: sticky; left: 0; z-index: 1; background: var(--panel);
    box-shadow: 1px 0 0 var(--line); max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
  .table-wrap th.nm { background: var(--panel2); z-index: 2; }
  table.sel th.nm, table.sel td.nm { left: 40px; }
  table.sel th:first-child, table.sel td:first-child { position: sticky; left: 0; z-index: 1; background: var(--panel); width: 40px; min-width: 40px; }
  table.sel th:first-child { background: var(--panel2); z-index: 2; }
  table.sel tr.picked td.nm, table.sel tr.picked td:first-child { background: #22261c; }
  .swipe-hint { color: var(--accent); font-size: 12.5px; margin: 0 0 6px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs a { white-space: nowrap; }
  button, .btn { min-height: 40px; }
}

th.rowno { cursor: default; } td.rowno { color: var(--muted); font-size: 12.5px; width: 1%; }
.rank { display: inline-block; min-width: 30px; text-align: center; padding: 1px 7px; border-radius: 6px;
  font-weight: 700; font-size: 12.5px; background: #262c38; color: var(--muted); }
.rank.r5 { background: #4a3313; color: #ffb43c; } .rank.r4 { background: #3d331a; color: #f0c45a; }
.rank.r3 { background: #23303d; color: #8fb8e0; }

tr.grp-head th { position: static; cursor: default; text-transform: none; letter-spacing: 0; font-size: 14px;
  color: var(--text); background: #141921; border-top: 1px solid var(--line); padding: 10px 12px; }
tbody.grp:first-of-type tr.grp-head th { border-top: 0; }
.rank.r0 { background: #262c38; color: var(--muted); }

/* rosters & lists */
.notice { background: #1c2430; border: 1px solid #2e3a4d; border-radius: 10px; padding: 10px 14px; }
table.sel tr.picked { background: #22261c; }
table.sel input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--gold); cursor: pointer; }
.actionbar { position: sticky; bottom: 12px; z-index: 6; margin: 16px auto 0; display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  background: #1b2130; border: 1px solid var(--gold-dim); border-radius: 12px; padding: 12px 16px; box-shadow: 0 8px 30px #0008; }
.actionbar select { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font: inherit; max-width: 100%; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.form input[type=text], .form textarea { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: inherit; font-weight: 400; }
.kinds { display: flex; gap: 10px; flex-wrap: wrap; }
.kind input { display: none; }
.kind span { display: inline-block; padding: 8px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel2); cursor: pointer; font-weight: 700; }
.kind input:checked + span { border-color: var(--gold); color: var(--gold); background: #2a2414; }
.kind-badge { display: inline-block; padding: 2px 10px; border-radius: 6px; font-size: .7em; font-weight: 800; vertical-align: middle; letter-spacing: .5px; }
.kKVK { background: #4a1f1f; color: #ff8f7a; } .kSSL { background: #1f3550; color: #8fc3ff; } .kFDT { background: #1f4232; color: #7be0a8; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.listcard { color: var(--text); margin: 0; } .listcard:hover { border-color: var(--gold-dim); }
.lc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 17px; }
.lc-note { white-space: pre-line; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; margin: 4px 0 8px; }
.note { white-space: pre-line; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
form.inline { display: contents; margin: 0; }
button.x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; padding: 4px 8px; border-radius: 6px; }
button.x:hover { color: #ff7a7a; background: #2a1b1b; }
details.card summary { cursor: pointer; font-weight: 600; }
details.card[open] summary { margin-bottom: 12px; }
.btn.red { background: #c0392b; color: #fff; }
.kTRANSFER { background: #3a2a52; color: #c9a8ff; }
.group-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 1.1rem; margin: 28px 0 12px; }
.group-head .kind-badge { font-size: .85rem; }
.addids { margin: 14px 0; }
.addids label { display: block; font-weight: 600; }
.addids .row { display: flex; gap: 10px; margin-top: 8px; }
.addids .row input { flex: 1; min-width: 0; }
.kd { color: #8fc3ff; font-weight: 700; }
.coords { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; white-space: nowrap; }
.bad { color: #ff8f7a; }
#newfields[hidden] { display: none; }
.addids input[type=text], .form select { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: inherit; font-weight: 400; }
#newfields:not([hidden]) { display: flex; flex-direction: column; gap: 14px; }
.form > .btn { align-self: flex-start; }
.conf { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.conf input { width: 20px; height: 20px; accent-color: #3fb97f; cursor: pointer; }
.cby { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.edit { margin-bottom: 14px; }
.table-wrap th[data-k] { cursor: pointer; user-select: none; }
.table-wrap th[data-k]:hover { color: var(--gold); }
.edit-troops { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.edit-troops summary { cursor: pointer; font-weight: 700; color: var(--gold); }
.troopform { margin-top: 14px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.tf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; width: 100%; }
.tf-type { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.tf-row { display: flex; flex-direction: column; gap: 6px; font-size: .9em; color: var(--muted, #8e97a8); }
.tf-row select { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font: inherit; font-weight: 700; }
.tf-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.tf-check input { width: 18px; height: 18px; accent-color: #3fb97f; }
.tf-type .type-name { flex: none; }
.kPOLL { background: #2e2350; color: #c9b5ff; } .kclosed { background: #2a2f3a; color: #8e97a8; }
.pollcard.closed { opacity: .75; }
.small-h { font-size: 1.05rem; margin: 0 0 12px; }
.vote { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.vote-opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); cursor: pointer; font-weight: 600; }
.vote-opt input { width: 20px; height: 20px; accent-color: #8e6cf0; }
.vote-opt.mine, .vote-opt:has(input:checked) { border-color: #8e6cf0; box-shadow: 0 0 0 1px #8e6cf0 inset; }
.live { color: #3fb97f; font-size: .7em; font-weight: 600; margin-left: 8px; }
.pres { margin: 14px 0; }
.pres-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.bar { height: 12px; background: var(--panel2); border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, #8e6cf0, #b49cff); border-radius: 999px; transition: width .4s; }
.voters { margin-top: 8px; }
.voters summary { cursor: pointer; }
.voters ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; }
.voters li { padding: 4px 0; border-bottom: 1px solid var(--line); }
.voters.missing { margin-top: 18px; padding-top: 10px; border-top: 1px dashed var(--line); }
#alliance { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; margin-left: 6px; }
.mt { font-size: .9em; color: #c9b5ff; white-space: nowrap; } .mt.mt-top { color: #f0c45a; font-weight: 700; }

/* ---------------------------------------------------------------- brand + landing page */
:root { --accent: #2fb8ff; --accent2: #ff4040; --glow: rgba(47, 184, 255, .35); }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand .crest { width: 34px; height: 34px; border-radius: 50%; box-shadow: 0 0 0 2px var(--accent), 0 0 14px var(--glow); }

body.landing { background:
    radial-gradient(900px 520px at 78% -8%, var(--glow), transparent 60%),
    radial-gradient(700px 480px at -10% 30%, rgba(255, 64, 64, .10), transparent 60%),
    var(--bg); background-attachment: fixed; }
.landing main { max-width: 1080px; }
.intro { display: grid; grid-template-columns: 340px 1fr; gap: 48px; align-items: center; margin: 6vh 0 64px; }
.intro-art { position: relative; justify-self: center; }
.intro-art img { position: relative; width: 300px; height: auto; display: block; z-index: 1;
  filter: drop-shadow(0 18px 28px rgba(0,0,0,.55)) drop-shadow(0 0 18px rgba(47,184,255,.25));
  transform-origin: 50% 100%; animation: breathe 4.5s ease-in-out infinite; }
.intro-art::after { content: ""; position: absolute; left: 8%; right: 8%; bottom: -6px; height: 30px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(47,184,255,.55), transparent); }
.intro-art .glow { position: absolute; inset: 8% -6% 18%; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent), transparent 30%, var(--accent2) 50%, transparent 70%, var(--accent));
  filter: blur(34px); opacity: .4; animation: spin 14s linear infinite; }
@keyframes breathe { 50% { transform: scale(1.012, 1.018) translateY(-3px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .intro-art img, .intro-art .glow { animation: none; } }
.eyebrow { text-transform: uppercase; letter-spacing: 2px; font-size: 12px; font-weight: 700; color: var(--accent); margin: 0 0 10px; }
.intro h1 { font-size: 46px; line-height: 1.08; margin: 0 0 16px; letter-spacing: -.5px; }
.intro .accent { background: linear-gradient(90deg, var(--accent), var(--accent-end, #9be6ff)); -webkit-background-clip: text;
  background-clip: text; color: transparent; }
.intro .lead { font-size: 17px; color: #b5bfd0; max-width: 560px; margin: 0 0 26px; }
.btn.discord.big { font-size: 17px; padding: 14px 26px; border-radius: 12px; box-shadow: 0 8px 24px rgba(88,101,242,.35); }
.hint { color: var(--muted); font-size: 13px; margin: 14px 0 0; }

.landing .intro, .landing .safe-box { position: relative; z-index: 1; }

.safe-box { position: relative; z-index: 1; }

.safe-box { position: relative; z-index: 1; }

.safe-box { max-width: 620px; margin: 0 auto 24px; background: rgba(23, 28, 37, .6); border: 1px solid var(--line);
  border-radius: 14px; padding: 18px 22px; }
.safe-box h3 { margin: 0 0 6px; font-size: 15px; } .safe-box ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13.5px; }

@media (max-width: 900px) {
  .intro { grid-template-columns: 1fr; text-align: center; gap: 28px; }
  .intro-art img { width: 190px; } .intro h1 { font-size: 34px; }
  .intro .lead { margin-left: auto; margin-right: auto; }
}


/* nav + dashboard */
.top nav a.on { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.dash-hero { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; align-items: center; }
.dash-avatar { width: 64px; height: 64px; border-radius: 50%; box-shadow: 0 0 0 2px var(--accent), 0 0 18px var(--glow); }
.dash-id h2 { font-size: 22px; } .dash-id p { margin: 2px 0 0; }
.stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 14px; }
.stat { background: var(--panel2); border-radius: 10px; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.stat span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.stat b { font-size: 17px; }
.dash-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.dash-cols .card { margin: 0 0 16px; }
.dash-list { list-style: none; margin: 0; padding: 0; }
.dash-list li { padding: 10px 0; border-top: 1px solid var(--line); } .dash-list li:first-child { border-top: 0; padding-top: 0; }
.dash-list .answer { color: var(--text); }
.pill { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 99px; margin-left: 6px; vertical-align: 1px; }
.pill.open { background: #163a2a; color: #6fe0a6; } .pill.closed { background: #262c38; color: var(--muted); }
.dash-history { margin-top: 12px; } .dash-history summary { cursor: pointer; }
table.mini { width: auto; margin-top: 8px; border-collapse: collapse; font-size: 13px; }
table.mini td { padding: 4px 14px 4px 0; white-space: nowrap; }
@media (max-width: 600px) { .dash-hero { grid-template-columns: 1fr; } }
.swipe-hint { display: none; }
@media (max-width: 640px) { .swipe-hint:not([hidden]) { display: block; } }
/* dashboard: heroes, governor gear, rankings */
.hero-refresh { display: flex; align-items: center; gap: 10px; }
.btn.small-btn { padding: 6px 12px; font-size: 13px; min-height: 0; }
.heroes { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; margin-bottom: 8px; }
.hcard { display: flex; gap: 12px; background: var(--panel2); border-radius: 12px; padding: 10px; text-align: left; }
.hero-pic { position: relative; flex: none; width: 104px; height: 104px; border-radius: 10px; overflow: hidden;
  background: linear-gradient(160deg, #8a5d1c, #3d2a10); box-shadow: inset 0 0 0 2px #c79a3d; }
.hero-pic img { width: 100%; height: 100%; object-fit: cover; }
.hero-lv { position: absolute; top: 4px; left: 4px; background: #000a; color: #fff; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; }
.hero-stars { position: absolute; bottom: 0; left: 0; right: 0; text-align: center; color: #ffcf4a; font-size: 13px;
  letter-spacing: 1px; background: linear-gradient(transparent, #000c); padding: 8px 0 2px; }
.hero-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.hero-name { font-size: 16px; }
.excl { font-size: 13px; color: #f0c45a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gear-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin-top: 2px; }
.gear { display: flex; align-items: baseline; gap: 5px; padding: 3px 7px; border-radius: 7px; font-size: 12px;
  background: #262c38; border: 1px solid #353d4d; white-space: nowrap; overflow: hidden; }
.gear-slot { flex: none; }
.gear b { flex: 1; }
.gear small { color: var(--muted); }
.q-legendary { background: #3a1416; border-color: #a1323a; } .q-legendary b { color: #ff7a7a; }
.q-mythic { background: #3a1416; border-color: #a1323a; } .q-mythic b { color: #ff7a7a; }
.q-epic { background: #3d2c12; border-color: #9a6a1c; } .q-epic b { color: #ffbf47; }
.q-rare { background: #2a1f3d; border-color: #6c4aa8; } .q-rare b { color: #c4a3ff; }
.q-uncommon { background: #16283d; border-color: #2f6aa8; } .q-uncommon b { color: #8fc6ff; }
.gov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.gov { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 5px; padding: 12px 8px;
  border-radius: 12px; background: var(--panel2); }
.gtile { position: relative; width: 86px; height: 86px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #f08a7a, #c9483e); box-shadow: inset 0 0 0 3px #ffb3a6, 0 4px 10px #0006; }
.gtile.plain { background: linear-gradient(160deg, #b8862c, #6a4a12); box-shadow: inset 0 0 0 3px #e0b44f, 0 4px 10px #0006; }
.gtile img { width: 74px; height: 74px; object-fit: contain; }
.gtile .tier { position: absolute; top: 2px; left: 6px; font-size: 15px; font-weight: 900; color: #ffd84a; text-shadow: 0 1px 0 #7a3a00, 0 0 3px #000; }
.gstars { position: absolute; left: 5px; top: 24px; color: #ffd84a; font-size: 11px; writing-mode: vertical-lr; text-shadow: 0 0 2px #000; }
.gems { display: flex; gap: 5px; }
.gem { width: 16px; height: 18px; display: inline-block; clip-path: polygon(50% 0, 100% 22%, 100% 70%, 50% 100%, 0 70%, 0 22%); box-shadow: inset 0 0 0 2px #ffe08a; background: #888; }
.gem.g1 { background: radial-gradient(circle at 50% 45%, #bff58a, #3fae2c 60%, #c99a22 61%); }
.gem.g2 { background: radial-gradient(circle at 50% 45%, #a6e3ff, #2c8fd6 60%, #c99a22 61%); }
.gem.g3 { background: radial-gradient(circle at 50% 45%, #fff2a6, #e0a520 60%, #c99a22 61%); }
.gname { font-size: 13px; } .gov small { color: var(--muted); font-size: 11.5px; }
.ranks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.rk { background: var(--panel2); border-radius: 10px; padding: 9px 12px; display: grid; grid-template-columns: 1fr auto; gap: 0 8px; }
.rk span { color: var(--muted); font-size: 12.5px; } .rk b { grid-row: span 2; align-self: center; font-size: 18px; }
.rk.top b { color: #ffcf4a; }
@media (max-width: 640px) { .heroes { grid-template-columns: 1fr; } .hero-pic { width: 92px; height: 92px; } }
/* hero kit tiles (widget + gear) */
.kit { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.tile { position: relative; width: 52px; height: 58px; border-radius: 9px; display: flex; align-items: flex-start; justify-content: center;
  background: #2a2f3a; border: 1px solid #3a4252; overflow: hidden; }
.tile img { width: 40px; height: 40px; object-fit: contain; margin-top: 3px; }
.tile-ico { font-size: 22px; margin-top: 8px; }
.tile em { position: absolute; top: 1px; right: 3px; font-style: normal; font-size: 10px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px #000; }
.tile .lv { position: absolute; bottom: 0; left: 0; right: 0; text-align: center; font-size: 10.5px; color: #fff; background: #0008; line-height: 15px; }
.tile.t-widget { background: linear-gradient(160deg, #b8862c, #6a4a12); border-color: #e0b44f; }
.tile.q-legendary, .tile.q-mythic { background: linear-gradient(160deg, #8e1f27, #4a0f14); border-color: #d2464f; box-shadow: 0 0 8px #d2464f44; }
.tile.q-epic { background: linear-gradient(160deg, #a06a17, #553606); border-color: #e0a640; }
.tile.q-rare { background: linear-gradient(160deg, #5a3d93, #2c1d4d); border-color: #9a78e0; }
.tile.q-uncommon { background: linear-gradient(160deg, #1f4f86, #10294a); border-color: #5c9ae0; }
.hcard .excl { font-size: 12px; }
.charm { width: 26px; height: 26px; object-fit: contain; } .gems { gap: 2px; }


/* Game-style stars: gold with a dark-orange rim, like the in-game icons. */
.star{display:inline-block;width:1em;height:1em;background:linear-gradient(#fff3a0,#ffd02a 55%,#f2a90f);
  clip-path:polygon(50% 2%,62% 36%,98% 37%,69% 59%,80% 95%,50% 74%,20% 95%,31% 59%,2% 37%,38% 36%);
  filter:drop-shadow(0 0 1px #8a4a00) drop-shadow(0 1px 0 #8a4a00);}
.hero-stars{display:flex;justify-content:center;gap:1px;font-size:18px;letter-spacing:0;padding:10px 0 3px;}
.hero-stars .star{width:18px;height:18px;}

/* Governor gear: the game's left/right columns (helmet, chest, ring | pendant, legs, weapon), straight and side by side. */
.gov-stage{display:flex;justify-content:center;gap:clamp(70px,24vw,240px);padding:6px 0;}
.gcol{display:flex;flex-direction:column;gap:14px;}
.gov-stage .gov{background:none;padding:0;gap:6px;}
.gov-stage .gtile{width:100px;height:100px;border-radius:16px;}
.gov-stage .gtile img{width:80px;height:80px;}
.gtile .tier{font-size:17px;}
.gstars{position:absolute;left:4px;top:25px;display:flex;flex-direction:column;gap:0;writing-mode:horizontal-tb;}
.gstars .star{width:21px;height:21px;}
.gov-stage .charm{width:30px;height:30px;}
.gov-stage .gems{gap:3px;}
@media (max-width:640px){
  .gov-stage{gap:clamp(40px,18vw,90px);}
  .gov-stage .gtile{width:78px;height:78px;border-radius:13px;}
  .gov-stage .gtile img{width:62px;height:62px;}
  .gtile .tier{font-size:14px;}
  .gstars{top:20px;}
  .gstars .star{width:16px;height:16px;}
  .gov-stage .charm{width:24px;height:24px;}
  .hero-stars .star{width:15px;height:15px;}
}

/* In-game colours (sampled from the game's hero-gear screen): red gear tiles, orange widget tile,
   red "+N" pill, yellow level text. Used for hero gear, widgets and governor gear alike. */
.tile.q-legendary, .tile.q-mythic, .gtile:not(.plain) {
  background: linear-gradient(180deg, #c34444 0%, #e35d5d 55%, #ee9e9d 100%);
  border: 2px solid #f26d6d; box-shadow: 0 3px 0 #a83a3a, 0 4px 8px #0006;
}
.tile.t-widget {
  background: linear-gradient(180deg, #d37c06 0%, #ef9a2c 60%, #f9a136 100%);
  border: 2px solid #ec9f2c; box-shadow: 0 3px 0 #c0600c, 0 4px 8px #0006;
}
.tile { overflow: visible; }
.tile em { top: -6px; right: -5px; padding: 0 4px; border-radius: 7px; background: #ff776a;
  color: #fff; font-size: 10px; line-height: 14px; text-shadow: 0 1px 0 #a3332a; box-shadow: 0 1px 0 #a3332a; }
.tile .lv { left: auto; right: 3px; bottom: 1px; background: none; color: #ffe14a; font-weight: 900;
  font-size: 11px; text-shadow: -1px 0 #6b2b00, 1px 0 #6b2b00, 0 -1px #6b2b00, 0 1px #6b2b00; }
.gtile:not(.plain) { box-shadow: 0 4px 0 #a83a3a, 0 5px 10px #0006; border: 3px solid #f26d6d; }
.kit { gap: 8px; margin-top: 6px; }

/* Poll results lists: answer badges + filter buttons */
.ans{display:inline-block;padding:1px 8px;border-radius:10px;font-weight:700;font-size:13px;background:#2a3140;color:#e7e9ee}
/* answer colours: no red/green (they read as "bad/good" and polls can have many options) */
.ans.a0{background:#1f3f6b;color:#a8cdff}.ans.a1{background:#5a4512;color:#ffdc8a}.ans.a2{background:#43206b;color:#d8b4ff}
.ans.a3{background:#1f5a5a;color:#a6f1f1}.ans.a4{background:#5c3410;color:#ffc58a}.ans.a5{background:#2b2f6b;color:#b9bfff}
.tabs.answers{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.tabs.answers button{background:var(--panel2);border:1px solid var(--line);color:var(--text);border-radius:999px;padding:4px 12px;cursor:pointer;min-height:32px}
.tabs.answers button.on{border-color:var(--gold);box-shadow:0 0 0 1px var(--gold) inset}
.kPOLL{background:#43206b;color:#e4ccff}

/* "← Back to …" link above detail pages */
.back{display:inline-flex;align-items:center;gap:6px;margin:0 0 10px;padding:6px 12px;border-radius:8px;border:1px solid var(--line);background:var(--panel);color:var(--muted);font-size:14px;text-decoration:none}
.back:hover{color:var(--text);border-color:var(--gold-dim)}

/* Troops page: TG / T11 filters */
.tgfilter{gap:10px}
.tabs.pills{display:flex;flex-wrap:wrap;gap:6px;margin:0;overflow-x:auto}
.tabs.pills button{background:var(--panel2);border:1px solid var(--line);color:var(--text);border-radius:999px;padding:4px 12px;cursor:pointer;min-height:32px;white-space:nowrap;font:inherit;font-size:13.5px}
.tabs.pills button.on{border-color:var(--gold);color:var(--gold);box-shadow:0 0 0 1px var(--gold) inset}
.chk{display:inline-flex;align-items:center;gap:6px;font-size:14px;cursor:pointer;white-space:nowrap}
.chk input{width:18px;height:18px;accent-color:var(--gold)}

/* Closed polls: who didn't vote */
.nonvoters{margin-top:18px;padding-top:12px;border-top:1px solid var(--line)}
.voters.nv summary{cursor:pointer;padding:8px 10px;border-radius:8px;background:var(--panel2);margin-bottom:6px}
.voters.nv-verified summary{border-left:3px solid var(--ok)}
.voters.nv-unverified summary{border-left:3px solid #c0392b}

/* Keep TG badges lined up whether or not the player has T11 (invisible placeholder takes the same space) */
.t11.gap{visibility:hidden}

/* in-game portrait: the game's avatar picture with its frame on top (or a gold game-style ring) */
.gava{position:relative;width:76px;height:76px;flex:none}
.gava img.pic{position:absolute;inset:6px;width:64px;height:64px;border-radius:12px;object-fit:cover;background:#1a1f29}
.gava img.frame{position:absolute;inset:-8px;width:92px;height:92px;pointer-events:none}
.gava.ring img.pic{box-shadow:0 0 0 3px #d9b44a,0 0 0 5px #6b5520,0 0 16px rgba(217,180,74,.45)}

.search-player{display:flex;gap:8px;margin:0 0 16px;max-width:520px}
.search-player input{flex:1;min-height:42px;padding:8px 12px;background:var(--panel2);border:1px solid var(--line);border-radius:10px;color:var(--text);font-size:16px}

/* Hero gear pills coloured like the game (+N per 20: grey, green, blue, purple, red); widget gets an orange +N */
.tile em.pill { min-width: 26px; text-align: center; border: 2px solid var(--panel2); box-shadow: none; text-shadow: 0 1px 0 #0005; }
.tile em.pill.w { background: #8a93a3; } .tile em.pill.g { background: #4fb85e; } .tile em.pill.b { background: #4a90e2; }
.tile em.pill.p { background: #9a7ee6; } .tile em.pill.r { background: #e5545a; } .tile em.pill.o { background: #f08a1c; }
.hcard { background: linear-gradient(100deg, rgba(240,160,60,.16), rgba(30,36,48,0) 45%), var(--panel2); border: 1px solid #2b3240; }

/* Governor gear stage: dark gold-framed panel, diamond pattern, warm glow, crown emblem in the gap */
.gov-stage { position: relative; overflow: hidden; border-radius: 14px; padding: 30px 12px 24px;
  background: radial-gradient(ellipse 45% 60% at 50% 48%, rgba(232,190,90,.22), rgba(232,190,90,0) 70%),
    radial-gradient(ellipse 80% 70% at 50% 120%, rgba(120,40,30,.35), transparent 70%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.025) 0 2px, transparent 2px 22px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.025) 0 2px, transparent 2px 22px),
    linear-gradient(180deg, #1d1a20, #141218);
  border: 1px solid rgba(217,180,74,.35); box-shadow: inset 0 0 0 6px rgba(15,18,24,.6), inset 0 0 0 7px rgba(217,180,74,.18); }
.gov-emblem { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -52%); width: min(230px, 30%); opacity: .22;
  filter: drop-shadow(0 0 18px rgba(240,200,100,.6)); pointer-events: none; }
.gov-plinth { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); width: 240px; max-width: 40%; height: 34px;
  border-radius: 50%; background: radial-gradient(ellipse, rgba(217,180,74,.28), transparent 70%); pointer-events: none; }
.gov-stage .gcol { position: relative; z-index: 1; }
.gov-stage .gtile { filter: drop-shadow(0 6px 10px rgba(0,0,0,.45)); }
.gov-stage .gems { gap: 6px; }
.cm { display: flex; flex-direction: column; align-items: center; }
.clv { font-size: 10.5px; line-height: 12px; font-weight: 800; color: #ffe066; margin-top: 1px; white-space: nowrap;
  text-shadow: 0 1px 0 #000, 0 0 3px rgba(0,0,0,.9), 1px 0 0 #3a2600, -1px 0 0 #3a2600; }
@media (max-width: 640px) { .clv { font-size: 9.5px; } .gov-stage .gems { gap: 3px; } .gov-emblem { width: 34%; } }
/* Phones: hero picture + name side by side, the gear row underneath across the whole card so all 5 tiles fit on one line */
@media (max-width: 640px) {
  .hcard { display: grid; grid-template-columns: 84px 1fr; column-gap: 12px; align-items: start; }
  .hcard .hero-body { display: contents; }
  .hcard .hero-pic { width: 84px; height: 84px; grid-row: 1 / span 2; }
  .hcard .hero-name { align-self: end; padding-top: 14px; }
  .hcard .kit { grid-column: 1 / -1; flex-wrap: nowrap; gap: 7px; margin-top: 12px; }
  .gov-stage { padding: 24px 6px 18px; }
}

/* Search Player: leaders can add the player to a transfer list */
.add-transfer { padding: 14px 18px; }
.at-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.at-label { font-weight: 700; margin-right: 4px; }
.at-form select, .at-form input { min-height: 38px; padding: 6px 10px; background: var(--panel2); border: 1px solid var(--line);
  border-radius: 9px; color: var(--text); font-size: 14px; }
.at-form select { max-width: 260px; } .at-form input { flex: 1; min-width: 160px; }
.add-transfer .muted { margin: 8px 0 0; }
@media (max-width: 640px) { .at-form select, .at-form input { flex: 1 1 100%; max-width: none; } .at-form .btn { flex: 1 1 100%; } }

/* Hero gear like the game: gold tiles while enhancement is 1-100 (plain +N), red tiles after that (coloured +N pill) */
.tile.g-red { background: linear-gradient(180deg, #c34444 0%, #e35d5d 55%, #ee9e9d 100%); border: 2px solid #f26d6d; box-shadow: 0 3px 0 #a83a3a, 0 4px 8px #0006; }
.tile.g-gold { background: linear-gradient(180deg, #d37c06 0%, #ef9a2c 60%, #f9a136 100%); border: 2px solid #ec9f2c; box-shadow: 0 3px 0 #c0600c, 0 4px 8px #0006; }
.tile.g-gold em.pill { background: none; border: 0; top: -2px; right: 2px; padding: 0; min-width: 0; font-size: 11px;
  text-shadow: -1px 0 #7a3d00, 1px 0 #7a3d00, 0 -1px #7a3d00, 0 1px #7a3d00; }

/* Governor gear tile colour follows the piece's quality, like the game (tier text shows just "T1"…) */
.gtile.gc-grey   { background: linear-gradient(180deg, #6f7682, #9aa1ad); border: 3px solid #b5bcc7; box-shadow: 0 4px 0 #555b66, 0 5px 10px #0006; }
.gtile.gc-green  { background: linear-gradient(180deg, #3c8a3a, #6cbf5e); border: 3px solid #86d676; box-shadow: 0 4px 0 #2c6a2a, 0 5px 10px #0006; }
.gtile.gc-blue   { background: linear-gradient(180deg, #2f69b8, #5d9be6); border: 3px solid #7fb3f0; box-shadow: 0 4px 0 #234f8c, 0 5px 10px #0006; }
.gtile.gc-purple { background: linear-gradient(180deg, #6a3fb0, #9a72e0); border: 3px solid #b494f0; box-shadow: 0 4px 0 #4f2c88, 0 5px 10px #0006; }
.gtile.gc-gold { background: linear-gradient(180deg, #e98a12 0%, #f6a33a 60%, #fbb04a 100%); border: 3px solid #ffc46a; box-shadow: 0 4px 0 #c0600c, 0 5px 10px #0006; }

/* Stars and tier text drawn like the game: 6-petal hero stars (5 slots, unearned ones dark), gold governor-gear stars,
   bright yellow "T6" with a thick dark outline */
.hero-stars { gap: 0; padding: 10px 0 4px; }
.hstar { display: inline-block; width: 20px; height: 20px; background: url(/static/img/star-hero.svg) center / contain no-repeat;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.45)); }
.hstar.off { background-image: url(/static/img/star-hero-empty.svg); filter: none; }
.gstars { left: 3px; top: 26px; gap: 0; }
.gstar { display: block; width: 22px; height: 22px; margin-top: -2px; background: url(/static/img/star-gov.svg) center / contain no-repeat;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
.gtile .tier { top: 3px; left: 7px; font-size: 18px; font-weight: 900; color: #fff21e; letter-spacing: .3px;
  text-shadow: -1.5px 0 #1f1a00, 1.5px 0 #1f1a00, 0 -1.5px #1f1a00, 0 1.5px #1f1a00, -1px -1px #1f1a00, 1px 1px #1f1a00, -1px 1px #1f1a00, 1px -1px #1f1a00; }
@media (max-width: 640px) { .hstar { width: 16px; height: 16px; } .gstar { width: 17px; height: 17px; } .gstars { top: 21px; } .gtile .tier { font-size: 15px; } }
/* Governor gear stars stack up from the bottom-left corner, like the game */
.gstars { top: auto; bottom: 4px; }
@media (max-width: 640px) { .gstars { top: auto; bottom: 3px; } }
.voters li .id { color: var(--muted); font-size: 12px; margin-left: 2px; }

/* Lower-quality hero gear tiles (game colours); +N shown as plain text like on gold gear */
.tile.g-purple { background: linear-gradient(180deg, #7c5ad6 0%, #9b80ea 60%, #b3a0f2 100%); border: 2px solid #b9a6f5; box-shadow: 0 3px 0 #5a3fae, 0 4px 8px #0006; }
.tile.g-blue   { background: linear-gradient(180deg, #2f72c4 0%, #5596e0 60%, #79b0ee 100%); border: 2px solid #8cbcf2; box-shadow: 0 3px 0 #22569a, 0 4px 8px #0006; }
.tile.g-green  { background: linear-gradient(180deg, #3d8f3d 0%, #62b25a 60%, #86ca7a 100%); border: 2px solid #96d68a; box-shadow: 0 3px 0 #2c6a2c, 0 4px 8px #0006; }
.tile.g-grey   { background: linear-gradient(180deg, #6b7280 0%, #8a919c 60%, #a5abb4 100%); border: 2px solid #b6bcc5; box-shadow: 0 3px 0 #4d535d, 0 4px 8px #0006; }
.tile:is(.g-purple, .g-blue, .g-green, .g-grey) em.pill { background: none; border: 0; top: -2px; right: 2px; padding: 0; min-width: 0; font-size: 11px;
  text-shadow: -1px 0 #2b2050, 1px 0 #2b2050, 0 -1px #2b2050, 0 1px #2b2050; }

/* Long alliance names stay inside their box: smaller text, and "…" if still too long (full name on hover) */
.stat { min-width: 0; }
.stat b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat b.long { font-size: 13px; line-height: 1.6; letter-spacing: -.2px; }

/* List pages use the full screen width so wide tables (transfer lists) fit without scrolling */
main.wide { max-width: 1560px; }
.table-wrap { position: relative; }
.table-wrap.more-right { box-shadow: inset -18px 0 14px -14px rgba(0,0,0,.75); }
.table-wrap.more-left.more-right { box-shadow: inset -18px 0 14px -14px rgba(0,0,0,.75), inset 18px 0 14px -14px rgba(0,0,0,.75); }
.table-wrap.more-left:not(.more-right) { box-shadow: inset 18px 0 14px -14px rgba(0,0,0,.75); }
.table-wrap td.small, .table-wrap .coords { white-space: nowrap; }
/* Transfer list table: tighter so all columns fit on a laptop screen */
table.tlist th, table.tlist td { padding-left: 10px; padding-right: 10px; }
table.tlist td.nm { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
table.tlist .an { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.tlist td.small { white-space: normal; min-width: 92px; }
table.tlist label.conf { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
table.tlist .cby { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
