/* ============================================================
   UltraInstinct Hub — Admin surface (Ember Console)
   ============================================================ */

.admin-body { background: var(--bg); min-height: 100vh; }

/* ===== Login ===== */
.login-overlay {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--bg);
  background-image: radial-gradient(ellipse 60% 40% at 50% -10%, rgba(255, 157, 69, 0.07), transparent 65%);
}

.login-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.4rem 2rem;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}

.login-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px; height: 52px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-line);
  border-radius: 10px;
  font-size: 1.5rem;
  margin-bottom: .9rem;
}

.login-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: .25rem;
}

.login-sub { color: var(--text2); font-size: .88rem; margin-bottom: 1.6rem; }

.form-group { margin-bottom: 1rem; }

.form-input {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: .72rem .95rem;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  transition: border-color .18s, box-shadow .18s;
  outline: none;
}

.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 157, 69, 0.15); }
.form-input::placeholder { color: var(--text2); opacity: .55; }

.login-error { color: var(--red); font-size: .88rem; margin-top: .75rem; min-height: 1.2rem; }

/* ===== Admin layout ===== */
.admin-wrap {
  min-height: 100vh;
  padding-left: 224px;
}

.admin-sidebar {
  width: 224px;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 50;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .85rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--accent);
  padding: 0 1.25rem 1.1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: .9rem;
}
.admin-brand span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-line);
  border-radius: 6px;
  font-size: .8rem;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: 0 .7rem;
  flex: 1;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: var(--text2);
  text-decoration: none;
  padding: .6rem .75rem;
  border-radius: 7px;
  font-weight: 600;
  font-size: .92rem;
  transition: all .18s;
  border: 1px solid transparent;
}
.admin-nav-item:hover { color: var(--text); background: var(--bg2); }
.admin-nav-item.active {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: var(--accent-line);
}

.admin-footer-nav {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: .9rem .7rem 0;
  border-top: 1px solid var(--border);
}

.admin-main {
  padding: 2rem;
  min-height: 100vh;
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
}

.admin-page-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: .4px;
  color: var(--text);
  margin-bottom: 1.6rem;
}

/* ===== Server control ===== */
.server-status-card {
  display: flex;
  align-items: center;
  gap: 2rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.2rem 1.5rem;
  margin-bottom: 1.1rem;
}

.ss-dot {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--text2);
  flex-shrink: 0;
  transition: background .25s ease, box-shadow .25s ease;
}
.ss-dot.online { background: var(--green); box-shadow: 0 0 12px rgba(126, 216, 143, .6); }
.ss-dot.offline { background: var(--red); }

.ss-label {
  font-family: var(--font-mono);
  font-size: .68rem;
  color: var(--text2);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: .15rem;
}

.ss-value { font-size: 1.02rem; font-weight: 700; font-variant-numeric: tabular-nums; transition: color .2s ease; }

.server-actions {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.btn-action {
  padding: .62rem 1.3rem;
  border: 1px solid;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: .92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .18s;
  letter-spacing: .3px;
  min-height: 40px;
}

.btn-action:active { transform: scale(.97); }
.btn-action:disabled {
  opacity: .45;
  cursor: not-allowed;
  filter: grayscale(.4);
  transform: none !important;
  box-shadow: none !important;
}
.btn-action.loading { pointer-events: none; opacity: .8; }
.btn-action.loading::after {
  content: '';
  width: 13px; height: 13px;
  margin-left: .45rem;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: btnSpin .7s linear infinite;
  flex: none;
  display: inline-block;
  vertical-align: middle;
}

.btn-green { background: var(--green-dim); color: var(--green); border-color: rgba(126, 216, 143, .35); }
.btn-green:hover { background: rgba(126, 216, 143, .22); }

.btn-yellow { background: rgba(255, 157, 69, .12); color: var(--accent2); border-color: var(--accent-line); }
.btn-yellow:hover { background: rgba(255, 157, 69, .22); }

.btn-red { background: var(--red-dim); color: var(--red); border-color: rgba(255, 138, 117, .35); }
.btn-red:hover { background: rgba(255, 138, 117, .22); }

.btn-blue { background: var(--accent-dim); color: var(--accent); border-color: var(--accent-line); }
.btn-blue:hover { background: rgba(255, 157, 69, .22); }

.action-result {
  font-size: .88rem;
  color: var(--text2);
  min-height: 1.4rem;
  animation: resultIn .2s ease both;
}
.action-result.ok { color: var(--green); }
.action-result.err { color: var(--red); }

@keyframes resultIn { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: translateY(0); } }

/* ===== Game config top split ===== */
.gcfg-top {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 1.1rem;
  margin-bottom: 1.1rem;
  align-items: start;
}
.gcfg-status-panel .server-status-card { margin-bottom: .9rem; }

/* ===== Section tabs ===== */
.gcfg-tabs {
  display: flex;
  gap: .3rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .4rem;
  position: sticky;
  top: .75rem;
  z-index: 40;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .35);
}

.gcfg-tab {
  background: none;
  border: none;
  color: var(--text2);
  font-family: var(--font-sans);
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .2px;
  padding: .55rem 1.05rem;
  border-radius: 7px;
  cursor: pointer;
  transition: all .18s;
}
.gcfg-tab:hover { color: var(--text); background: var(--bg2); }
.gcfg-tab.active { background: var(--accent); color: #1a120a; font-weight: 700; }

.gcfg-pane[hidden] { display: none; }

.gcfg-pane { animation: paneIn .25s cubic-bezier(.2, .7, .3, 1) backwards; }
@keyframes paneIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.admin-games-grid .admin-game-card { animation: cardIn .3s cubic-bezier(.2, .7, .3, 1) backwards; }
@keyframes cardIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  .gcfg-pane, .admin-games-grid .admin-game-card, .action-result {
    animation-duration: .12s;
    animation-name: fadeOnly;
  }
  .metric-card:hover { transform: none; }
  @keyframes fadeOnly { from { opacity: 0; } to { opacity: 1; } }
}

/* ===== Admin forms ===== */
.admin-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.4rem;
}

.admin-form h3 {
  color: var(--accent2);
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.form-row { display: flex; gap: .7rem; flex-wrap: wrap; align-items: center; }
.form-row .form-input { flex: 1; min-width: 120px; }
.form-col { display: flex; flex-direction: column; gap: .7rem; }
.form-textarea { min-height: 100px; resize: vertical; }

/* ===== Admin leaderboard table ===== */
.leaderboard-table td .btn-del {
  background: none;
  border: 1px solid rgba(255, 138, 117, .35);
  color: var(--red);
  padding: .22rem .6rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: .8rem;
  transition: all .18s;
  font-family: var(--font-sans);
  font-weight: 600;
}
.leaderboard-table td .btn-del:hover { background: var(--red-dim); }

/* ===== Admin announcements ===== */
.ann-admin-list { display: flex; flex-direction: column; gap: .7rem; }

.ann-admin-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.ann-admin-info { flex: 1; }
.ann-admin-title { font-weight: 700; color: var(--accent2); margin-bottom: .25rem; }
.ann-admin-content { font-size: .9rem; color: var(--text2); }

/* ===== Role badges (admin copy) ===== */
.role-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .62rem;
  font-weight: 500;
  letter-spacing: .8px;
  text-transform: uppercase;
  padding: .14rem .5rem;
  border-radius: 4px;
  vertical-align: middle;
}
.role-member    { background: rgba(168, 157, 142, .14); color: #b8ad9e; }
.role-moderator { background: rgba(255, 157, 69, .14); color: var(--accent2); }
.role-admin     { background: rgba(255, 157, 69, .22); color: var(--accent); }

/* ===== Auth tabs ===== */
.auth-box { max-width: 400px; }

.auth-tabs {
  display: flex;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .25rem;
  margin-bottom: 1.4rem;
}

.auth-tab {
  flex: 1;
  padding: .55rem;
  background: none;
  border: none;
  color: var(--text2);
  font-family: var(--font-sans);
  font-size: .92rem;
  font-weight: 600;
  letter-spacing: .3px;
  border-radius: 6px;
  cursor: pointer;
  transition: all .18s;
}
.auth-tab.active { background: var(--accent); color: #1a120a; font-weight: 700; }

/* ===== Sidebar user chip ===== */
.admin-user-chip {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .65rem .8rem;
  margin: 0 .7rem .9rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 9px;
}

.side-name { font-weight: 700; font-size: .88rem; color: var(--text); }
.side-game-roles { margin-top: .3rem; display: flex; flex-wrap: wrap; gap: .25rem; }
.side-game-roles .game-role-chip { font-size: .62rem; margin: 0; }

/* ===== Users table ===== */
.users-hint { color: var(--text2); font-size: .88rem; margin-bottom: 1.1rem; }
.u-handle { color: var(--text2); font-size: .78rem; }
.self-tag { color: var(--text2); font-size: .78rem; }

.role-select {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: .35rem .6rem;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
  outline: none;
}
.role-select:focus { border-color: var(--accent); }
.role-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Per-game role chips in the users table */
.game-role-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: var(--accent-dim);
  border: 1px solid var(--accent-line);
  color: var(--accent2);
  font-family: var(--font-mono);
  font-size: .7rem;
  padding: .15rem .45rem;
  border-radius: 5px;
  margin: 0 .3rem .3rem 0;
  white-space: nowrap;
}

.game-role-x {
  background: none;
  border: none;
  color: var(--accent2);
  cursor: pointer;
  font-size: .85rem;
  line-height: 1;
  padding: 0 .1rem;
}
.game-role-x:hover { color: var(--red); }

.game-role-row {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-top: .4rem;
  flex-wrap: wrap;
}
.game-role-select { max-width: 180px; }

.btn-grant {
  padding: .3rem .6rem;
  font-size: .78rem;
  border-color: var(--accent-line);
  color: var(--accent);
}
.btn-grant:hover { background: var(--accent-dim); }

/* ===== Settings page ===== */
.settings-page { padding: 90px 1rem 4rem; min-height: 100vh; }
.settings-container { max-width: 680px; margin: 0 auto; }

.settings-heading {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 1.6rem;
  letter-spacing: .4px;
}

.settings-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.6rem;
  margin-bottom: 1.1rem;
}

.settings-card-title {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent2);
  margin-bottom: 1.15rem;
}

.settings-field { margin-bottom: 1rem; }
.settings-field label {
  display: block;
  font-size: .84rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: .35rem;
}

.settings-msg { display: inline-block; margin-left: 1rem; font-size: .88rem; font-weight: 600; }
.settings-msg.ok { color: var(--green); }
.settings-msg.err { color: var(--red); }

.profile-header { display: flex; align-items: center; gap: 1.2rem; }

.profile-avatar {
  width: 68px; height: 68px;
  border-radius: 12px;
  background: var(--accent);
  color: #1a120a;
  font-size: 1.8rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.profile-name { font-size: 1.2rem; font-weight: 800; }
.profile-meta { display: flex; align-items: center; gap: .6rem; margin: .3rem 0; }
.profile-meta span:first-child { color: var(--text2); font-size: .88rem; }
.profile-joined { color: var(--text2); font-size: .78rem; opacity: .75; }

/* ===== Admin games grid ===== */
.admin-games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .9rem; }

.admin-game-card {
  display: flex; align-items: center; gap: 1rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 1rem 1.2rem; cursor: pointer;
  transition: all .18s; position: relative; overflow: hidden;
}
.admin-game-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--gc, var(--accent)); }
.admin-game-card:hover { transform: translateX(3px); border-color: var(--gc, var(--accent)); }
.admin-game-card:active { transform: scale(.99) translateX(2px); }

.agc-icon {
  font-size: 1.6rem; width: 48px; height: 48px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--gc, var(--accent)) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--gc, var(--accent)) 30%, transparent);
  border-radius: 9px;
}

.agc-info { flex: 1; min-width: 0; }
.agc-name { font-weight: 700; font-size: 1.02rem; margin-bottom: .25rem; }
.agc-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.agc-port { font-family: var(--font-mono); color: var(--text2); font-size: .8rem; }
.agc-arrow { font-size: 1.4rem; color: var(--text2); }

/* ===== Game config header ===== */
.gcfg-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.4rem; }

.gcfg-icon {
  font-size: 1.9rem; width: 58px; height: 58px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--gc, var(--accent)) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--gc, var(--accent)) 30%, transparent);
  border-radius: 12px;
}

.gcfg-name { font-size: 1.3rem; font-weight: 800; }
.gcfg-tagline { color: var(--text2); font-size: .88rem; }

/* ===== Config form ===== */
.cfg-source { font-size: .84rem; color: var(--text2); margin-bottom: 1.2rem; }
.cfg-section { margin-bottom: 1.4rem; }

.cfg-section-title {
  font-weight: 700;
  color: var(--accent2);
  font-size: .88rem;
  margin-bottom: .8rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--border);
}

.cfg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .9rem; }
.cfg-field { display: flex; flex-direction: column; gap: .4rem; }
.cfg-field label { font-size: .84rem; color: var(--text2); font-weight: 600; display: flex; align-items: center; gap: .3rem; }
.cfg-help { cursor: help; opacity: .6; font-size: .8rem; }
.cfg-actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.4rem; }

/* Toggle switch */
.cfg-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.cfg-switch input { opacity: 0; width: 0; height: 0; }
.cfg-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 24px; transition: .2s;
}
.cfg-slider::before {
  content: ''; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px;
  background: var(--text2); border-radius: 50%; transition: .2s;
}
.cfg-switch input:checked + .cfg-slider { background: var(--green-dim); border-color: var(--green); }
.cfg-switch input:checked + .cfg-slider::before { transform: translateX(20px); background: var(--green); }
.cfg-switch input:focus-visible + .cfg-slider { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Range slider */
.cfg-field-wide { grid-column: 1 / -1; }
.cfg-range-wrap { display: flex; align-items: center; gap: .8rem; }
.cfg-range {
  flex: 1;
  -webkit-appearance: none; appearance: none;
  height: 6px; border-radius: 999px;
  background: var(--bg2);
  border: 1px solid var(--border);
  outline: none; cursor: pointer;
}
.cfg-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(255, 157, 69, .45);
}
.cfg-range::-moz-range-thumb {
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg); cursor: pointer;
}
.cfg-range-num { width: 80px; flex-shrink: 0; text-align: center; padding: .5rem; }
.cfg-unit { color: var(--text2); font-size: .84rem; min-width: 32px; }

.cfg-range-scale {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono);
  font-size: .68rem; color: var(--text2); opacity: .65; margin-top: .25rem;
  padding: 0 .1rem;
}

/* ===== Auto restart ===== */
.autorestart-row {
  display: flex; align-items: center; gap: .8rem;
  flex-wrap: wrap; margin-bottom: .85rem;
}
.ar-label { color: var(--text); font-weight: 600; font-size: .9rem; }
.ar-time { width: 130px; flex: none; color-scheme: dark; }
.ar-servertime { color: var(--text2); font-size: .8rem; font-family: var(--font-mono); }

/* ===== Resource limits ===== */
.res-block { margin-bottom: 1.4rem; }
.res-head {
  display: flex; align-items: center; gap: .75rem;
  color: var(--text); font-weight: 600; font-size: .9rem; margin-bottom: .8rem;
}
.cores-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: .55rem; }
.core-box { cursor: pointer; }
.core-box input { display: none; }
.core-face {
  display: block; text-align: center;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 7px; padding: .55rem .4rem;
  font-family: var(--font-mono);
  font-weight: 500; font-size: .8rem; color: var(--text2);
  transition: all .15s;
}
.core-box input:checked + .core-face {
  background: var(--accent-dim); border-color: var(--accent-line);
  color: var(--accent); box-shadow: 0 0 10px rgba(255, 157, 69, .15);
}
.core-box input:focus-visible + .core-face { outline: 2px solid var(--accent); outline-offset: 2px; }
.res-actions { display: flex; gap: .5rem; margin-top: .7rem; }
.res-mini {
  background: var(--bg2); border: 1px solid var(--border); color: var(--text2);
  border-radius: 6px; padding: .35rem .8rem; cursor: pointer;
  font-family: var(--font-sans); font-weight: 600; font-size: .82rem; transition: all .15s;
}
.res-mini:hover { color: var(--accent); border-color: var(--accent-line); }
.res-ram { display: flex; align-items: center; gap: .8rem; }

/* ===== Backup ===== */
.bk-num { width: 70px; flex: none; text-align: center; }
.backup-list { margin-top: 1.15rem; display: flex; flex-direction: column; gap: .45rem; }

.backup-item {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; padding: .65rem .9rem;
}

.backup-info { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.backup-name { font-family: var(--font-mono); font-size: .82rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.backup-meta { font-size: .76rem; color: var(--text2); }
.backup-actions { display: flex; gap: .35rem; flex-shrink: 0; }

.bk-act {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  padding: .3rem .55rem; cursor: pointer; font-size: .88rem; transition: all .15s;
}
.bk-act:hover { border-color: var(--accent-line); background: var(--accent-dim); }
.bk-del:hover { border-color: var(--red); background: var(--red-dim); }
.bk-restore:hover { border-color: var(--accent2); background: rgba(255, 201, 138, .14); }

/* ===== Minecraft management ===== */
.mc-block {
  border-top: 1px solid var(--border);
  padding-top: 1.05rem;
  margin-top: 1.05rem;
}
.mc-block h4 { margin: 0 0 .35rem; font-size: .98rem; color: var(--text); }
.mc-block .gd-note { margin: .3rem 0 .7rem; }

.mc-console {
  background: #0b0a08;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: .65rem .85rem;
  margin-top: .7rem;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: #ffd9ae;
  white-space: pre-wrap; word-break: break-word;
  max-height: 220px; overflow-y: auto;
}

.mc-cmd-ref { margin-top: .8rem; font-size: .84rem; }
.mc-cmd-ref summary { cursor: pointer; color: var(--accent2); }
.mc-cmd-list {
  margin-top: .6rem; max-height: 260px; overflow-y: auto;
  display: flex; flex-wrap: wrap; gap: .35rem;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 7px; padding: .7rem;
}
.mc-cmd-item {
  font-family: var(--font-mono); font-size: .72rem; color: var(--text2);
  background: var(--accent-dim); border: 1px solid var(--border);
  border-radius: 5px; padding: .15rem .45rem; white-space: nowrap;
}

/* ===== Minecraft mods ===== */
.mods-tabs { display: flex; gap: .45rem; margin-bottom: .95rem; flex-wrap: wrap; }
.mods-tab {
  background: var(--bg2); border: 1px solid var(--border); color: var(--text2);
  border-radius: 7px; padding: .45rem .9rem; cursor: pointer; font-size: .84rem;
  transition: all .15s;
}
.mods-tab.active { border-color: var(--accent-line); color: var(--accent); background: var(--accent-dim); }
.mods-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .65rem; }

.mod-card {
  display: flex; gap: .7rem; align-items: flex-start;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 9px; padding: .7rem .85rem;
}
.mod-icon { width: 40px; height: 40px; border-radius: 7px; object-fit: cover; flex: none; }
.mod-icon-ph { display: flex; align-items: center; justify-content: center; background: var(--accent-dim); font-size: 1.2rem; }
.mod-info { flex: 1; min-width: 0; }
.mod-name { font-weight: 600; font-size: .88rem; color: var(--text); word-break: break-word; }
.mod-desc { font-size: .78rem; color: var(--text2); margin: .2rem 0 .3rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mod-meta { font-size: .74rem; color: var(--text2); display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.mod-badge-on { color: var(--green); }
.mod-badge-off { color: var(--red); }
.mod-actions { display: flex; flex-direction: column; gap: .35rem; flex: none; }
.mod-actions .bk-act { white-space: nowrap; font-size: .78rem; }

/* ===== Metrics / charts ===== */
.metrics-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .65rem; gap: .5rem; }

.live-badge {
  display: inline-flex; align-items: center; gap: .35rem;
  background: var(--green-dim); border: 1px solid rgba(126, 216, 143, .4);
  color: var(--green); font-family: var(--font-mono);
  font-size: .68rem; font-weight: 500; letter-spacing: .08em;
  border-radius: 5px; padding: .2rem .6rem; transition: opacity .3s;
}

.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: livePulse 1.6s ease-in-out infinite; }
@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.metrics-range { display: flex; gap: .35rem; margin-bottom: .85rem; flex-wrap: wrap; }
.metrics-btn {
  background: var(--bg2); border: 1px solid var(--border); color: var(--text2);
  border-radius: 6px; padding: .3rem .7rem; cursor: pointer; font-size: .8rem; transition: all .15s;
  font-family: var(--font-sans);
}
.metrics-btn:hover { border-color: var(--accent-line); }
.metrics-btn.active { border-color: var(--accent-line); color: var(--accent); background: var(--accent-dim); }

.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .75rem; }
.metric-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 9px; padding: .7rem .9rem;
  transition: transform .15s ease, border-color .15s ease;
}
.metric-card:hover { transform: translateY(-2px); }
.metric-title {
  font-family: var(--font-mono);
  font-size: .7rem; color: var(--text2); text-transform: uppercase; letter-spacing: .08em;
  display: flex; align-items: center; gap: .4rem;
}
.mc-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.metric-now { font-size: 1.25rem; font-weight: 700; color: var(--text); margin: .2rem 0 .5rem; font-variant-numeric: tabular-nums; }
.metric-chart { width: 100%; height: 90px; display: block; }
.metrics-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .7rem; flex-wrap: wrap; }

/* ===== External storage ===== */
.ext-status { margin-bottom: 1rem; font-size: .88rem; }
.ext-ok { color: var(--green); font-weight: 700; }
.ext-bad { color: var(--red); font-weight: 700; }

.ext-setup-box {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 9px; padding: 1rem 1.2rem; margin-top: 1rem;
  font-size: .86rem; color: var(--text2);
}
.ext-setup-box ol { margin: .6rem 0 0 1.2rem; display: flex; flex-direction: column; gap: .4rem; }
.ext-setup-box code {
  background: var(--accent-dim); color: var(--accent2);
  padding: .1rem .4rem; border-radius: 4px; font-family: var(--font-mono);
}

/* ===== Responsive admin ===== */
@media (max-width: 1024px) {
  .gcfg-top { grid-template-columns: 1fr; }
  .gcfg-status-panel { position: static; }
}

@media (max-width: 768px) {
  .admin-wrap { padding-left: 0; }
  .admin-sidebar {
    width: 100%;
    position: relative;
    inset: auto;
    padding: .6rem;
    padding-bottom: calc(.6rem + env(safe-area-inset-bottom, 0px));
    flex-direction: column;
  }
  .admin-brand {
    width: 100%;
    padding: .25rem .5rem .5rem;
    margin-bottom: .4rem;
    font-size: .82rem;
  }
  .admin-user-chip { margin: .25rem 0 .6rem; padding: .5rem .75rem; }
  .admin-nav,
  .admin-footer-nav {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    padding: .25rem 0;
    border: 0;
    gap: .2rem;
  }
  .admin-footer-nav { border-top: 1px solid var(--border); padding-top: .5rem; margin-top: .4rem; }
  .admin-nav-item { flex: 0 0 auto; white-space: nowrap; padding: .6rem .8rem; }

  .admin-main {
    width: 100%;
    margin-left: 0;
    padding: 1rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  }
  .admin-page-title { font-size: 1.1rem; margin-bottom: 1.2rem; }
  .admin-form { padding: 1rem; }
  .server-status-card { gap: 1rem; padding: 1rem; flex-wrap: wrap; }
  .server-actions { gap: .55rem; }
  .btn-action { flex: 1 1 auto; padding: .75rem 1rem; }
  .admin-games-grid { grid-template-columns: 1fr; }
  .cfg-grid { grid-template-columns: minmax(0, 1fr); }
  .cfg-range-wrap { flex-wrap: wrap; }
  .gcfg-top { grid-template-columns: 1fr; }
  .gcfg-status-panel { position: static; }
  .gcfg-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    margin-inline: -1rem;
    border-radius: 0;
    border-inline: 0;
    padding: .45rem 1rem;
    position: sticky;
    top: 0;
  }
  .gcfg-tab { flex: 0 0 auto; padding: .65rem 1rem; min-height: 44px; }
  .metrics-grid { grid-template-columns: 1fr; }
  .mods-grid { grid-template-columns: 1fr; }
  .mod-card { flex-wrap: wrap; }
  .mod-actions { flex-direction: row; }
  .bk-act { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .metrics-btn { min-height: 40px; padding: .45rem .85rem; }
  .mods-tab { min-height: 40px; padding: .55rem 1rem; }
  .res-mini { min-height: 40px; padding: .5rem .9rem; }
  .autorestart-row { gap: .55rem; }
  .autorestart-row .form-input { min-width: 0; }
  .autorestart-row > .form-input { width: 100%; max-width: none !important; }
  .form-col .btn-primary { width: 100%; }
  .cfg-actions { flex-direction: column; align-items: stretch; }
  .cfg-actions .btn-primary, .cfg-actions .btn-secondary { width: 100%; }
  .metrics-foot { flex-direction: column; align-items: flex-start; }
  .leaderboard-table thead th,
  .leaderboard-table tbody td { padding: .7rem .9rem; white-space: nowrap; }
  .mc-console { max-height: 180px; }
}

@media (pointer: coarse) {
  .bk-act { min-width: 44px; min-height: 44px; }
  .metrics-btn, .mods-tab, .res-mini { min-height: 44px; }
  .gcfg-tab { min-height: 44px; }
}

@media (max-width: 400px) {
  .admin-main { padding: .75rem; }
  .admin-form { padding: .75rem; }
  .gcfg-header { flex-wrap: wrap; }
  .server-status-card { gap: .75rem; }
  .mc-console { font-size: .7rem; }
  .backup-item { flex-wrap: wrap; }
  .backup-actions { width: 100%; justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
