:root {
  --bg: #0a0a0a;
  --bg2: #111;
  --bg3: #1a1a1a;
  --line: #2a2a2a;
  --text: #f0f0f0;
  --muted: #8c8c8c;
  --red: #e63946;
  --red2: #ff4d5a;
  --green: #00ff88;
  --yellow: #d4b45d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(230,57,70,.14), transparent 34%),
    var(--bg);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg3);
  color: var(--text);
  padding: 10px 12px;
  cursor: pointer;
}

button:hover { border-color: var(--red); color: var(--red2); }
button.primary { background: var(--red); border-color: var(--red); color: white; }

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #080808;
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

input:focus,
textarea:focus { border-color: var(--red); }

label {
  display: grid;
  gap: 6px;
  font-size: .72rem;
  color: var(--muted);
}

.admin-shell {
  width: min(1280px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.admin-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 18px 0 22px;
}

.kicker {
  color: var(--red2);
  font-size: .72rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

h1 {
  margin: 4px 0;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1;
}

p { margin: 0; color: var(--muted); line-height: 1.5; }
.admin-logo { width: 64px; height: 64px; border-radius: 14px; }

.panel {
  background: rgba(17,17,17,.92);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,.42);
}

.panel-title {
  font-weight: 900;
  letter-spacing: 1px;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.panel-row,
.search-row,
.selected-head,
.raw-head {
  display: flex;
  gap: 10px;
  align-items: end;
}

.token-row label { flex: 1; }
.hint { margin-top: 10px; color: var(--muted); font-size: .76rem; }
.hint code { color: var(--yellow); }

.grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.players {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  max-height: 70vh;
  overflow: auto;
}

.player-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg3);
  padding: 10px;
  cursor: pointer;
}

.player-card:hover,
.player-card.active {
  border-color: var(--red);
}

.player-name { font-weight: 900; }
.player-meta { color: var(--muted); font-size: .72rem; margin-top: 5px; }

.empty {
  min-height: 260px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 10px;
}

.hidden { display: none; }
.selected-head { justify-content: space-between; margin-bottom: 16px; }
.selected-name { font-size: 1.25rem; font-weight: 900; }
.selected-meta { color: var(--muted); font-size: .75rem; margin-top: 4px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.tool {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.025);
  border-radius: 10px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.tool h2 {
  margin: 0;
  font-size: .86rem;
  color: var(--red2);
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check input { width: auto; }

textarea {
  min-height: 360px;
  resize: vertical;
  line-height: 1.5;
  tab-size: 2;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: 420px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--green);
  background: #07120d;
  color: var(--green);
  opacity: 0;
  transform: translateY(12px);
  transition: .2s;
  pointer-events: none;
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-color: var(--red); color: var(--red2); background: #140709; }

@media (max-width: 900px) {
  .grid,
  .tool-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .panel-row,
  .search-row,
  .selected-head,
  .raw-head {
    align-items: stretch;
    flex-direction: column;
  }
}
