/* Minehaven Stats — modern dark dashboard */
:root {
  --bg:          #0b1015;
  --bg-elev:    #10161d;
  --panel:       #141b23;
  --panel-2:     #1a222c;
  --border:      #222c38;
  --border-soft: #1a222c;
  --text:        #e6edf3;
  --text-dim:    #8b949e;
  --text-soft:   #b8c0ca;
  --accent:      #4ade80;          /* grass-green */
  --accent-2:    #16a34a;
  --gold:        #e5b94a;
  --red:         #f87171;
  --diamond:     #5eead4;
  --shadow:      0 1px 0 rgba(255,255,255,0.03), 0 0 0 1px var(--border);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(74,222,128,0.06), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(94,234,212,0.04), transparent 60%),
    var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #6ee7a1; }

code { font-family: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }

/* ---- Header ---- */
.site-header {
  background: rgba(11, 16, 21, 0.85);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  font-size: 17px;
  color: var(--text);
}
.brand .logo {
  width: 26px; height: 26px;
  display: inline-block;
  background:
    linear-gradient(135deg, #4ade80 25%, transparent 25%) -4px 0,
    linear-gradient(225deg, #4ade80 25%, transparent 25%) -4px 0,
    linear-gradient(315deg, #22c55e 25%, transparent 25%),
    linear-gradient(45deg,  #22c55e 25%, #16a34a 25%);
  background-size: 10px 10px;
  background-color: #16a34a;
  border-radius: 4px;
  image-rendering: pixelated;
  box-shadow: 0 0 0 1px #0a0a0a, inset 0 0 0 1px rgba(255,255,255,0.08);
}
.brand .slash { color: var(--text-dim); font-weight: 400; margin: 0 4px; }
.brand .suffix { color: var(--text-soft); font-weight: 500; }

.nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}
.nav a {
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--text-dim);
  font-weight: 500;
  font-size: 14px;
  transition: background 120ms, color 120ms;
}
.nav a:hover { background: var(--panel); color: var(--text); }
.nav a.active { background: var(--panel); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.nav a.external { color: var(--accent); }

/* ---- Layout ---- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---- Panels ---- */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 16px;
}
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px 0;
}
.panel h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.panel h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  margin: 14px 0 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.panel .count-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel-2);
  color: var(--text);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
}
.panel .count-chip.live::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

/* ---- Player row ---- */
.player-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-top: 1px solid var(--border-soft);
}
.player-row:first-child { border-top: none; }
.player-row .head {
  width: 40px; height: 40px;
  border-radius: 6px;
  image-rendering: pixelated;
  background: #000;
  border: 1px solid var(--border);
}
.player-row .name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  letter-spacing: 0.1px;
}
.player-row .name .dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  margin-right: 8px;
  vertical-align: middle;
}
.player-row .meta {
  color: var(--text-dim);
  font-size: 13px;
  margin-top: 2px;
}
.player-row .value {
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  text-align: right;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.player-row .value .label {
  color: var(--text-dim);
  font-weight: 400;
  font-size: 12px;
  margin-top: 2px;
  display: block;
  font-family: 'Inter', sans-serif;
}

.dot-online {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  margin-right: 6px; vertical-align: middle;
}
.dot-offline {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; background: #3a434f;
  margin-right: 6px; vertical-align: middle;
}

/* ---- Rank list ---- */
.rank-list .row {
  display: grid;
  grid-template-columns: 28px 32px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--border-soft);
}
.rank-list .row:first-child { border-top: none; }
.rank-list .rank {
  color: var(--text-dim);
  font-size: 13px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.rank-list .rank.gold { color: var(--gold); }
.rank-list .head {
  width: 32px; height: 32px;
  image-rendering: pixelated;
  border-radius: 5px;
  border: 1px solid var(--border);
}
.rank-list .bar-wrap {
  position: relative;
  height: 28px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
  display: flex;
  align-items: center;
}
.rank-list .bar {
  position: absolute; inset: 0 auto 0 0;
  background: linear-gradient(90deg, rgba(74,222,128,0.22), rgba(74,222,128,0.05));
  border-right: 1px solid rgba(74,222,128,0.5);
}
.rank-list .name {
  position: relative;
  z-index: 2;
  padding: 0 12px;
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
}
.rank-list .value {
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-weight: 600;
  text-align: right;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 14px;
}

/* ---- Profile header ---- */
.profile-hero {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 24px;
  align-items: center;
}
.profile-hero .body-img {
  width: 120px;
  image-rendering: pixelated;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 6px;
}
.profile-hero h1 {
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 6px 0;
  letter-spacing: -0.3px;
}
.profile-hero .sub {
  color: var(--text-dim);
  font-size: 14px;
}
.profile-hero .badges { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  background: var(--panel-2);
  color: var(--text-soft);
  border: 1px solid var(--border);
}
.badge.online { background: rgba(74,222,128,0.12); color: var(--accent); border-color: rgba(74,222,128,0.3); }
.badge.online::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 6px var(--accent);
}
.badge.offline { color: var(--text-dim); }

/* ---- Stat tiles ---- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

.stat-tile {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-tile .label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 500;
}
.stat-tile .value {
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: -0.2px;
}
.stat-tile.big .value { font-size: 28px; }
.stat-tile .hint { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.val-gold { color: var(--gold); }
.val-red { color: var(--red); }
.val-green { color: var(--accent); }
.val-diamond { color: var(--diamond); }

/* ---- Tabs ---- */
.tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: 0 0 16px 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.tabs a {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
}
.tabs a:hover { background: var(--panel-2); color: var(--text); }
.tabs a.active {
  background: rgba(74,222,128,0.1);
  color: var(--accent);
  border: 1px solid rgba(74,222,128,0.25);
}

/* ---- Tables ---- */
.t {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.t th, .t td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
}
.t th {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: var(--panel-2);
}
.t tr:last-child td { border-bottom: none; }
.t tr:hover td { background: rgba(255,255,255,0.015); }
.t td.num, .t th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.t .mini-head {
  width: 24px; height: 24px;
  vertical-align: middle;
  image-rendering: pixelated;
  border-radius: 4px;
  margin-right: 8px;
}
.t a { color: var(--text); font-weight: 500; }
.t a:hover { color: var(--accent); }

/* ---- Empty state ---- */
.empty {
  color: var(--text-dim);
  padding: 20px;
  text-align: center;
  font-size: 14px;
}

/* ---- Footer ---- */
.site-footer {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-dim);
  font-size: 13px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
.site-footer .ip {
  color: var(--text);
  font-weight: 600;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  background: var(--panel);
  padding: 2px 8px;
  border-radius: 5px;
  border: 1px solid var(--border);
}

/* ---- Home hero row (world banner + online) ---- */
.hero-row { margin-bottom: 16px; }
.hero-row .world-banner { margin-bottom: 0; height: 100%; }
.hero-row .panel { margin-bottom: 0; height: 100%; }

.panel-flush { padding: 14px 16px; }

.player-row.compact { padding: 8px 0; }
.player-row.compact .head { width: 36px; height: 36px; }
.player-row.compact .name { font-size: 14px; }
.player-row.compact .meta { font-size: 12px; }
.player-row.compact .value { font-size: 15px; }
.player-row.compact .value .unit {
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 400;
  margin-left: 3px;
  font-family: 'Inter', sans-serif;
}
.player-row.compact .value.small-v { font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; font-family: 'Inter', sans-serif; }

.tabs-inline {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  gap: 2px !important;
}
.tabs-inline a {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 6px;
}

/* ---- World-time banner ---- */
.world-banner {
  background: linear-gradient(135deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}
.world-banner .wb-left { display: flex; align-items: center; gap: 16px; }
.world-banner .wb-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffd94a, #e5b94a 70%);
  box-shadow: 0 0 20px rgba(229,185,74,0.35), inset -4px -4px 0 rgba(0,0,0,0.15);
}
.world-banner .wb-icon.night {
  background: radial-gradient(circle at 30% 30%, #e2e8f0, #94a3b8 70%);
  box-shadow: 0 0 16px rgba(148,163,184,0.35), inset -4px -4px 0 rgba(0,0,0,0.18);
}
.world-banner .wb-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.world-banner .wb-day {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 600;
  font-size: 22px;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.world-banner .wb-right { font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* Scrollable content in panels */
.scroll-box {
  max-height: 360px;
  overflow-y: auto;
  border-radius: 8px;
}
.scroll-box::-webkit-scrollbar { width: 8px; }
.scroll-box::-webkit-scrollbar-track { background: var(--panel-2); border-radius: 8px; }
.scroll-box::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
.scroll-box::-webkit-scrollbar-thumb:hover { background: #2f3a49; }

/* ---- Me-link in nav ---- */
.nav a.me-link {
  background: rgba(74,222,128,0.1);
  color: var(--accent);
  border: 1px solid rgba(74,222,128,0.3);
}
.nav a.me-link::before {
  content: '';
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 6px;
  vertical-align: middle;
}
.nav a.me-switch {
  padding: 7px 10px;
  color: var(--text-dim);
  font-size: 13px;
}
.nav a.me-switch:hover { color: var(--red); }

/* ---- Login modal ---- */
#login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,14,19,0.92);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 36px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.login-box .login-logo {
  font-size: 48px;
  margin-bottom: 8px;
}
.login-box h2 {
  margin: 0 0 10px 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}
.login-box p { margin: 0 0 20px 0; font-size: 14px; }
#login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#login-select {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
}
#login-select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn-primary {
  background: var(--accent);
  color: #062811;
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
  transition: background 120ms;
}
.btn-primary:hover { background: #6ee7a1; }

/* ---- Global ranking page ---- */
.podium {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  align-items: end;
  gap: 16px;
  margin: 10px 0 6px 0;
}
@media (max-width: 700px) { .podium { grid-template-columns: 1fr; } }
.podium-slot {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 12px;
  text-align: center;
  position: relative;
  display: block;
  color: inherit;
  transition: transform 150ms, box-shadow 150ms;
}
.podium-slot:hover { transform: translateY(-2px); color: inherit; }
.podium-slot.gold:hover   { box-shadow: 0 0 0 1px rgba(229,185,74,0.4), 0 12px 28px rgba(229,185,74,0.15); }
.podium-slot.silver:hover { box-shadow: 0 0 0 1px rgba(203,213,225,0.4), 0 12px 28px rgba(0,0,0,0.25); }
.podium-slot.bronze:hover { box-shadow: 0 0 0 1px rgba(180,123,79,0.4), 0 12px 28px rgba(180,123,79,0.15); }
.podium-slot.gold   { border-color: rgba(229,185,74,0.4);   box-shadow: 0 0 0 1px rgba(229,185,74,0.2), 0 8px 20px rgba(229,185,74,0.08); }
.podium-slot.silver { border-color: rgba(203,213,225,0.3); }
.podium-slot.bronze { border-color: rgba(180,123,79,0.35); }
.podium-slot img {
  image-rendering: pixelated;
  border-radius: 10px;
  background: var(--bg);
  padding: 6px;
  border: 1px solid var(--border);
  margin-bottom: 10px;
}
.podium-slot .p-rank {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px; height: 32px;
  border-radius: 50%;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
}
.podium-slot.gold   .p-rank { background: #e5b94a; box-shadow: 0 0 20px rgba(229,185,74,0.5); }
.podium-slot.silver .p-rank { background: #cbd5e1; }
.podium-slot.bronze .p-rank { background: #b47b4f; color: #fff; }
.podium-slot .p-name { font-weight: 700; font-size: 17px; margin-bottom: 4px; color: var(--text); }
.podium-slot .p-points {
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px;
  font-weight: 600;
  color: var(--gold);
}
.podium-slot .p-wins { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

/* ---- Global table ---- */
.scroll-x {
  overflow-x: auto;
  border-radius: 8px;
}
.scroll-x::-webkit-scrollbar { height: 8px; }
.scroll-x::-webkit-scrollbar-track { background: var(--panel-2); border-radius: 8px; }
.scroll-x::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }

.global-table { min-width: 800px; }
.global-table thead th {
  position: sticky; top: 0;
  background: var(--panel-2);
  z-index: 1;
}
.global-table .cat-col a {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.4px;
  display: inline-block;
  white-space: nowrap;
}
.global-table .cat-col a:hover { color: var(--accent); text-decoration: underline; }

.global-table .cat-cell { font-size: 12px; color: var(--text-dim); font-family: 'JetBrains Mono', monospace; }
.global-table .cat-cell a { color: inherit; }
.global-table .cat-cell a:hover { color: var(--accent); }
.global-table .cat-cell.r1 { color: var(--gold); font-weight: 700; background: rgba(229,185,74,0.06); }
.global-table .cat-cell.r2 { color: #cbd5e1; font-weight: 600; background: rgba(203,213,225,0.04); }
.global-table .cat-cell.r3 { color: #b47b4f; font-weight: 600; background: rgba(180,123,79,0.05); }

.global-table .rank-cell { font-weight: 700; font-family: 'JetBrains Mono', monospace; font-size: 15px; }
.global-table .rank-cell.gold   { color: var(--gold); }
.global-table .rank-cell.silver { color: #cbd5e1; }
.global-table .rank-cell.bronze { color: #b47b4f; }

.global-table tr.me-row td {
  background: rgba(74,222,128,0.08) !important;
  box-shadow: inset 2px 0 0 var(--accent);
}
.me-chip {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  background: var(--accent);
  color: #062811;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  border-radius: 4px;
  vertical-align: middle;
}
.podium-slot.me-podium {
  box-shadow: 0 0 0 2px var(--accent), 0 8px 24px rgba(74,222,128,0.15);
}
.legend { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border-soft); }
.legend em { color: var(--text); font-style: normal; }

/* ---- Advancement chips ---- */
.adv-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.adv-chip {
  display: inline-block;
  padding: 4px 10px;
  background: var(--panel-2);
  color: var(--text-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  text-transform: capitalize;
}

.dim { color: var(--text-dim); }
.soft { color: var(--text-soft); }
.small { font-size: 13px; }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.center { text-align: center; }
