/* ============================================================
   BoarTiers — minimal dark theme (mctiers-inspired)
   clean cards, subtle borders, light animations
   ============================================================ */

:root {
  --bg:          #0e0f13;
  --bg-2:        #14161c;
  --card:        #181a21;
  --card-2:      #1e212a;
  --border:      #272b35;
  --border-soft: #20232c;
  --text:        #e8eaf0;
  --text-dim:    #9aa0ad;
  --text-faint:  #6b7280;
  --accent:      #5b8cff;
  --radius:      12px;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 50% -120px, #1a2030 0%, transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* the old .glass surfaces are now flat cards */
.glass {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ---------- layout ---------- */
.site-header,
.tabs,
.content > .panel,
.site-footer {
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
}

.site-header {
  margin-top: 26px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 13px; }
.brand-logo {
  font-size: 26px;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--card-2);
  border: 1px solid var(--border);
}
.brand-text h1 {
  margin: 0;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.brand-text p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-dim); }

.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}
.discord-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  background: #5865f2;
  border: 1px solid #4853d6;
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.discord-btn:hover {
  background: #4752e0;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(88, 101, 242, 0.4);
}
.discord-btn svg { display: block; }

.header-tools #search {
  width: 230px;
  max-width: 46vw;
  padding: 9px 13px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .15s ease, background .15s ease;
}
.header-tools #search::placeholder { color: var(--text-faint); }
.header-tools #search:focus { border-color: var(--accent); background: #11141b; }

/* ---------- tabs ---------- */
.tabs {
  margin-top: 14px;
  padding: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  padding: 8px 13px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.tab:hover { color: var(--text); background: var(--card-2); }
.tab.active {
  color: var(--text);
  background: var(--card-2);
  border-color: var(--border);
}
.tab-icon { font-size: 14px; display: inline-flex; align-items: center; gap: 2px; }

/* Minecraft item sprites (pixel art) */
.mc-icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.tab .mc-icon { width: 16px; height: 16px; }
.mode-ic .mc-icon { width: 14px; height: 14px; }
.mode-ic { display: inline-flex; align-items: center; }
.emoji-icon { font-size: 14px; }

/* ---------- panel ---------- */
.content { padding: 14px 0 44px; }
.panel { margin-top: 14px; padding: 16px 18px 20px; }
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.panel-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  display: inline-flex; align-items: center; gap: 8px;
}
.count { font-size: 12.5px; color: var(--text-dim); }

/* ---------- overall table ---------- */
.table { display: flex; flex-direction: column; gap: 6px; }
.row {
  display: grid;
  grid-template-columns: 40px 40px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  transition: border-color .15s ease, transform .15s ease, background .15s ease;
  animation: fade-up .35s ease both;
}
.row:hover {
  background: var(--card-2);
  border-color: var(--border);
  transform: translateX(2px);
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.rank {
  font-weight: 700;
  font-size: 16px;
  text-align: center;
  color: var(--text-faint);
}
.rank-1 { color: #f5c451; }
.rank-2 { color: #c9d1d9; }
.rank-3 { color: #e08a4b; }

.head {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--card-2);
  image-rendering: pixelated;
}
.head.sm { width: 24px; height: 24px; border-radius: 6px; }

.who { min-width: 0; }
.pname {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.meta { display: flex; align-items: center; gap: 8px; margin-top: 2px; flex-wrap: wrap; }

.region {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 5px;
  color: #fff;
  background: #3a3f4b;
}
.region-NA { background: #c0463a; }
.region-EU { background: #3275c4; }
.region-AS { background: #c79330; }
.region-OCE{ background: #2f9d6b; }
.region-SA { background: #7d4fc4; }
.region-AF { background: #b0683a; }

.title { font-size: 11px; font-weight: 600; }
.title-gm     { color: #d36bdd; }
.title-master { color: #e0833a; }
.title-ace    { color: #4f9fe0; }
.title-spec   { color: #43b06a; }
.title-cadet  { color: #3aa0c0; }
.title-novice { color: #8a93a3; }
.title-rookie { color: #6b7280; }

.pts {
  font-weight: 700;
  font-size: 16px;
  text-align: right;
  white-space: nowrap;
}
.pts small { font-size: 10px; font-weight: 500; color: var(--text-faint); margin-left: 2px; }

.modes { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 320px; }
.mode-cell { display: inline-flex; align-items: center; gap: 3px; }
.mode-ic { font-size: 12px; opacity: 0.85; }

/* ---------- tier badges ---------- */
.badge {
  display: inline-block;
  min-width: 30px;
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  color: #fff;
}
.badge-none {
  color: var(--text-faint);
  background: #20232c;
}
/* tier color ramps (flat, dark-friendly) */
.t1 { background: #c79a2e; }
.t2 { background: #6f7884; }
.t3 { background: #b06a37; }
.t4 { background: #3a82b8; }
.t5 { background: #6f5bb0; }
.badge.low { opacity: 0.6; }

/* ---------- gamemode tier grid ---------- */
.tier-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.tier-col {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  background: var(--bg-2);
  animation: fade-up .35s ease both;
}
.tier-col-head {
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  padding: 8px;
  color: #fff;
}
.tcol-1 .tier-col-head { background: #c79a2e; }
.tcol-2 .tier-col-head { background: #6f7884; }
.tcol-3 .tier-col-head { background: #b06a37; }
.tcol-4 .tier-col-head { background: #3a82b8; }
.tcol-5 .tier-col-head { background: #6f5bb0; }

.tier-band { padding: 8px; }
.high-band { background: rgba(255,255,255,0.02); }
.low-band  { border-top: 1px dashed var(--border); }
.band-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.tier-player {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  margin-bottom: 5px;
  border-radius: 8px;
  background: var(--card-2);
  border: 1px solid var(--border-soft);
  transition: border-color .15s ease;
}
.tier-player:hover { border-color: var(--border); }
.tier-player .pname { font-size: 12px; }
.tier-player .region { font-size: 9px; padding: 0 5px; }
.band-empty { color: var(--text-faint); font-size: 12px; text-align: center; padding: 4px 0; }

/* ---------- footer ---------- */
.empty { text-align: center; padding: 24px; color: var(--text-dim); }
.site-footer {
  margin: 16px auto 30px;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-dim);
}
.site-footer code {
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  padding: 1px 6px;
  border-radius: 5px;
  color: var(--text-dim);
}

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .row { grid-template-columns: 30px 34px 1fr auto; }
  .modes { grid-column: 1 / -1; justify-content: flex-start; max-width: none; margin-top: 4px; }
  .tier-grid { grid-template-columns: 1fr 1fr; }
  .brand-text p { display: none; }
}
@media (max-width: 460px) {
  .tier-grid { grid-template-columns: 1fr; }
  .header-tools #search { width: 130px; }
  .discord-btn span { display: none; }
  .discord-btn { padding: 9px 11px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
