/* Delta Islands - Delta MC themed dashboard */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #0d0f14;
  --bg2: #141820;
  --panel: #1a1f2a;
  --line: #2a3142;
  --text: #eef1f6;
  --muted: #8b93a7;
  --delta: #e85d04;
  --delta2: #f48c06;
  --gold: #fbbf24;
  --ok: #4ade80;
  --err: #f87171;
  --mc-shadow: 0 4px 0 #0a0c10;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(232, 93, 4, .12), transparent),
    linear-gradient(180deg, #0d0f14 0%, #11151c 100%);
  color: var(--text);
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
}

@media (max-width: 860px) {
  body { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--line); }
}

.sidebar {
  border-right: 1px solid var(--line);
  padding: 1.25rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: var(--bg2);
  min-height: 100vh;
}

.logo-wrap {
  padding: .5rem .25rem;
  background: transparent;
}

.logo-wrap img {
  width: 100%;
  max-width: 190px;
  display: block;
}

.nav { list-style: none; display: flex; flex-direction: column; gap: .2rem; flex: 1; }

.nav a {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .6rem .75rem;
  color: var(--muted);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}

.nav a:hover, .nav a.active {
  color: var(--text);
  background: rgba(232, 93, 4, .1);
  border-color: rgba(232, 93, 4, .25);
}

.nav-icon { width: 18px; height: 18px; opacity: .85; flex-shrink: 0; }

.sidebar-foot {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.admin-key-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .55rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: .78rem;
  cursor: pointer;
}

.admin-key-btn:hover { color: var(--gold); border-color: rgba(251, 191, 36, .35); }

.main { padding: 2rem 2.5rem 3rem; max-width: 1040px; }

.page-title { font-size: 1.85rem; font-weight: 700; margin-bottom: .35rem; }
.page-sub { color: var(--muted); font-size: .95rem; margin-bottom: 2rem; max-width: 58ch; line-height: 1.5; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
@media (max-width: 700px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.cell, .section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--mc-shadow);
}

.cell { padding: 1.15rem 1.25rem; }
.cell-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: .45rem; }
.cell-value { font-size: 1.45rem; font-weight: 700; color: var(--delta2); }
.cell-value.neutral { color: var(--text); font-size: 1.05rem; font-weight: 600; }

.section { margin-bottom: 1.25rem; overflow: hidden; }
.section-head {
  padding: .85rem 1.15rem;
  border-bottom: 1px solid var(--line);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gold);
  font-weight: 600;
}
.section-body { padding: 1.15rem; }

.team-row {
  display: grid;
  grid-template-columns: 4px 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: .85rem 0;
  border-bottom: 1px solid var(--line);
}
.team-row:last-child { border-bottom: none; }
.team-stripe { width: 4px; min-height: 2.5rem; border-radius: 2px; background: var(--team-color, var(--delta)); }
.team-name { font-weight: 600; font-size: 1.02rem; }
.team-meta { font-size: .82rem; color: var(--muted); margin-top: .2rem; line-height: 1.45; }

.player-chip { display: inline-flex; align-items: center; gap: .35rem; margin: .15rem .35rem .15rem 0; font-size: .82rem; }
.player-chip img { width: 20px; height: 20px; border-radius: 4px; image-rendering: pixelated; }

.tag {
  font-size: .72rem;
  padding: .25rem .5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  margin: .2rem .3rem .2rem 0;
  display: inline-block;
  background: rgba(0,0,0,.2);
}

.rank-list { list-style: none; counter-reset: r; }
.rank-list li {
  counter-increment: r;
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  gap: .75rem;
  align-items: center;
  padding: .6rem 0;
  border-bottom: 1px solid var(--line);
  font-size: .9rem;
}
.rank-list li::before { content: counter(r); color: var(--gold); font-size: .85rem; font-weight: 700; }
.rank-val { font-weight: 700; color: var(--delta2); }

.bar-track { height: 6px; background: #0a0c10; border-radius: 3px; margin-top: .45rem; overflow: hidden; }
.bar-fill { height: 100%; background: var(--team-color, var(--delta)); border-radius: 3px; transition: width .4s ease; }

.wins-row { display: flex; flex-wrap: wrap; gap: .65rem 1rem; }
.wins-pill {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .4rem .7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .85rem;
  background: rgba(0,0,0,.25);
}
.wins-dot { width: 10px; height: 10px; border-radius: 50%; }

.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: .4rem; }
.status-dot.live { background: var(--ok); box-shadow: 0 0 8px var(--ok); }

.err {
  color: var(--err);
  font-size: .9rem;
  padding: 1rem;
  border: 1px solid var(--err);
  border-radius: 10px;
  margin-bottom: 1rem;
  background: rgba(248, 113, 113, .08);
}

.maintenance-banner { text-align: center; padding: 4rem 2rem; color: var(--muted); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.modal-backdrop.open { display: flex; }

.modal {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.25rem;
}

.modal h2 { font-size: 1.1rem; margin-bottom: .75rem; }
.modal label { display: block; font-size: .78rem; color: var(--muted); margin: .65rem 0 .25rem; }
.modal input[type="text"], .modal input[type="password"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: .55rem .65rem;
  font-size: .9rem;
}
.modal-check { display: flex; align-items: center; gap: .5rem; margin-top: .75rem; font-size: .88rem; }
.modal-actions { display: flex; gap: .5rem; margin-top: 1rem; }
.modal-actions button { flex: 1; padding: .55rem; border-radius: 8px; border: none; font-weight: 600; cursor: pointer; }
.btn-primary { background: var(--delta); color: #fff; }
.btn-ghost { background: var(--bg); color: var(--muted); border: 1px solid var(--line) !important; }

.perk-card { padding: .85rem 0; border-bottom: 1px solid var(--line); }
.perk-card:last-child { border-bottom: none; }
.perk-title { color: var(--delta2); font-weight: 600; margin-bottom: .25rem; }

code.cmd { color: var(--gold); background: rgba(0,0,0,.3); padding: .15rem .4rem; border-radius: 4px; }
