body.admin {
  background: #0a0f26;
  color: #e8ecff;
  font: 15px/1.55 "Inter","Helvetica Neue",Arial,sans-serif;
  margin: 0;
  min-height: 100vh;
}
.adm-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  border-bottom: 1px solid #2b3470;
  gap: 16px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  background: #0a0f26;
  z-index: 10;
}
.adm-top .brand {
  font-family: "Impact","Arial Black",sans-serif;
  color: #d4af37;
  font-size: 1.5rem;
  letter-spacing: 1.5px;
}
.adm-top .actions { display: flex; gap: 10px; align-items: center; }
.adm-top .link-btn, .adm-top .btn {
  color: #c7cff5;
  background: transparent;
  border: 1px solid #2b3470;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.88rem;
  cursor: pointer;
}
.adm-top .link-btn:hover, .adm-top .btn:hover { background: #1a2258; }

/* ---------- Login gate ---------- */
.gate {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.gate.hidden { display: none; }
.gate-card {
  background: #131a44;
  border: 1px solid #2b3470;
  border-radius: 14px;
  padding: 28px;
  max-width: 420px;
  width: 100%;
}
.gate-card h1 {
  font-family: "Impact","Arial Black",sans-serif;
  color: #d4af37;
  letter-spacing: 1.5px;
  margin: 0 0 8px;
}
.gate-card p { margin: 0 0 16px; }
.gate-card code {
  background: #0d1230;
  border: 1px solid #2b3470;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}
.gate-card form { display: grid; gap: 12px; }
.gate-card input {
  background: #0a0f26;
  color: #fff;
  border: 1px solid #2b3470;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 1rem;
}
.gate-card input:focus { border-color: #d4af37; outline: none; }

/* ---------- Dashboard ---------- */
.adm-main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 32px 80px;
  display: grid;
  gap: 24px;
}
.adm-main.hidden { display: none; }

.card {
  background: #131a44;
  border: 1px solid #2b3470;
  border-radius: 12px;
  padding: 20px 24px;
}
.card-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #d4af37;
  font-family: "Impact","Arial Black",sans-serif;
  font-size: 1.2rem;
  letter-spacing: 1px;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #2b3470;
}
.muted { color: #8a93c0; }
.small { font-size: 0.85rem; }

/* Generic button sizes */
.btn {
  border: 1px solid #2b3470;
  background: transparent;
  color: #c7cff5;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.92rem;
  cursor: pointer;
}
.btn.small { padding: 4px 10px; font-size: 0.8rem; }
.btn.primary {
  background: #d4af37;
  color: #1a1500;
  border-color: #d4af37;
  font-weight: 600;
}
.btn.primary:hover { filter: brightness(1.1); }
.btn.ghost:hover { background: #1a2258; }
.btn.danger {
  color: #ff8080;
  border-color: #ff8080;
}
.btn.danger:hover { background: #ff8080; color: #1a0000; }

code {
  background: #0d1230;
  border: 1px solid #2b3470;
  padding: 1px 5px;
  border-radius: 4px;
  font-family: "SF Mono", Menlo, monospace;
  font-size: 0.88em;
}

/* MCP key */
.key-box {
  background: #0d1230;
  border: 1px solid #2b3470;
  border-radius: 8px;
  padding: 12px 14px;
  font-family: "SF Mono", Menlo, monospace;
  font-size: 0.9rem;
  color: #d4af37;
  overflow-x: auto;
  margin: 10px 0;
}

/* Create form */
.create-form {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr auto;
  gap: 12px;
  align-items: end;
}
.create-form label { display: grid; gap: 4px; font-size: 0.85rem; color: #8a93c0; }
.create-form input {
  background: #0a0f26;
  color: #fff;
  border: 1px solid #2b3470;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.95rem;
}
.create-form input:focus { border-color: #d4af37; outline: none; }
.create-form button { grid-column: auto; }
.create-form p { grid-column: 1 / -1; margin: 0; }
@media (max-width: 720px) {
  .create-form { grid-template-columns: 1fr; }
}

/* Rooms */
.room-row {
  background: #0d1230;
  border: 1px solid #2b3470;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 12px;
  display: grid;
  gap: 8px;
}
.room-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.room-code {
  font-family: "SF Mono", Menlo, monospace;
  font-size: 1.05rem;
  color: #d4af37;
  letter-spacing: 1px;
}
.room-name { color: #c7cff5; font-weight: normal; font-family: inherit; letter-spacing: 0; }
.room-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  background: #1a2258;
  color: #c7cff5;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
}
.chip.gold { background: #d4af37; color: #1a1500; font-weight: 700; }
.chip.muted { background: #0a0f26; color: #8a93c0; }
.room-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: #8a93c0;
  font-size: 0.9rem;
}
.room-meta .pass-cell {
  color: #d4af37;
  min-width: 70px;
  display: inline-block;
}
.room-players {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.player {
  background: #1a2258;
  color: #c7cff5;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
}
.player.p-on { color: #7ee78a; }
.player.p-off { color: #8a93c0; opacity: 0.75; }
.room-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
}

/* ---------- Modals ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(10, 15, 38, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal.hidden { display: none; }
.modal-card {
  background: #131a44;
  border: 1px solid #2b3470;
  border-radius: 14px;
  padding: 24px;
  width: 100%;
  max-width: 440px;
}
.modal-card h3 {
  margin: 0 0 10px;
  color: #d4af37;
  font-family: "Impact","Arial Black",sans-serif;
  letter-spacing: 1px;
}
.modal-card p { margin: 0 0 14px; }
.modal-card input {
  background: #0a0f26;
  color: #fff;
  border: 1px solid #2b3470;
  border-radius: 6px;
  padding: 10px 12px;
  width: 100%;
  margin-bottom: 14px;
  box-sizing: border-box;
}
.modal-card .actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.hidden { display: none !important; }
