/* Panneau admin — Shevar'
   Polices, couleurs et composants repris de GUIDE-STYLE.md (dépôt
   wiki-shevar) pour rester cohérent avec le reste du site. */

:root {
  --accent: #30efc9;
  --border: rgba(48,239,201,0.25);
  --bg: #14171b;
  --panel: #0f141ed9;
  --text: #f9f9f9;
  --text-dim: rgba(249,249,249,0.55);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  font-family: 'Aldrich', sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0 1.5rem 3rem;
  max-width: 1100px;
  margin-inline: auto;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--border);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

h1 {
  font-family: 'Audiowide', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
  text-shadow: 0 0 12px rgba(48,239,201,0.3);
}

#whoami {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.button, button, input, select {
  font: inherit;
}

.button, button[type="submit"] {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: #0b0d10;
  border: none;
  font-family: 'Audiowide', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.65rem 1.3rem;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  box-shadow: 0 0 12px rgba(48,239,201,0.25);
}
.button:hover, button[type="submit"]:hover {
  box-shadow: 0 0 18px rgba(48,239,201,0.5);
}

.button-ghost {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  box-shadow: none;
}
.button-ghost:hover {
  background: rgba(48,239,201,0.1);
  box-shadow: 0 0 12px rgba(48,239,201,0.3);
}

.gate {
  text-align: center;
  margin-top: 5rem;
}
.gate p { color: var(--text-dim); margin-bottom: 1.4rem; }

/* ─── Onglets (façon "chips") ─── */
.tabs {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.8rem;
  padding-bottom: 1rem;
  flex-wrap: wrap;
}

.tab-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.tab-btn:hover { border-color: var(--accent); color: var(--text); }

.tab-btn.active {
  background: var(--accent);
  color: #0b0d10;
  border-color: var(--accent);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── Séparateur de section (motif du guide de style) ─── */
.sect-eyebrow{
  display:flex; align-items:center; gap:1rem; margin:2rem 0 1rem;
  font-weight:normal;
}
.sect-eyebrow .sep-diamond{
  width:9px; height:9px; background:var(--accent); transform:rotate(45deg); flex-shrink:0;
  box-shadow:0 0 8px rgba(48,239,201,0.6); transition:transform 0.3s ease, box-shadow 0.3s ease;
}
.sect-eyebrow .sep-label{
  font-family:'Audiowide',sans-serif; font-size:0.7rem; letter-spacing:0.18em; text-transform:uppercase;
  color:rgba(48,239,201,0.85); white-space:nowrap; transition:letter-spacing 0.3s ease, color 0.3s ease;
}
.sect-eyebrow .sep-line{ flex:1; height:2px; position:relative; overflow:hidden; background:var(--border); border-radius:2px; max-width:3rem; }
.sect-eyebrow .sep-line::after{
  content:''; position:absolute; top:0; bottom:0; width:40%;
  background:linear-gradient(90deg, transparent, var(--accent), transparent);
}
.sect-eyebrow .sep-line.left::after{ animation:sepSweepLeft 3.2s linear infinite; }
.sect-eyebrow .sep-line.right::after{ animation:sepSweepRight 3.2s linear infinite; }
@keyframes sepSweepLeft{ from{ left:-40%; } to{ left:100%; } }
@keyframes sepSweepRight{ from{ left:100%; } to{ left:-40%; } }
.sect-eyebrow:hover .sep-diamond{ transform:rotate(45deg) scale(1.4); box-shadow:0 0 14px rgba(48,239,201,0.9); }
.sect-eyebrow:hover .sep-label{ letter-spacing:0.24em; color:var(--accent); }
.sect-eyebrow:hover .sep-line::after{ animation-duration:1.3s; }

h3.sect-eyebrow .sep-label{ font-size:0.65rem; color:rgba(249,249,249,0.6); }

.tab-help {
  color: var(--text-dim);
  font-size: 0.82rem;
  line-height: 1.6;
  max-width: 700px;
  margin: 0 0 0.5rem;
}

/* ─── Popularité SNews (onglet News) ─── */
.popularity-block {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
  margin: 0.5rem 0 1rem;
  max-width: 700px;
}
.popularity-block > label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(48,239,201,0.65);
}
.popularity-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0.5rem 0;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  color: var(--text);
}
.popularity-row input[type="range"] {
  flex: 1;
  accent-color: #30efc9;
  padding: 0;
}
#news-popularity-value {
  min-width: 1.2em;
  text-align: right;
  color: #30efc9;
  font-weight: bold;
}

/* ─── Tableaux ─── */
.table-wrap{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: auto;
  margin-top: 0.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 0.7rem 0.9rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(48,239,201,0.65);
  border-bottom: 1px solid var(--border);
  background: rgba(48,239,201,0.04);
}

td {
  text-align: left;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid rgba(48,239,201,0.1);
  font-size: 0.85rem;
}

.news-row-popularity {
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #0d1116;
  color: var(--text);
  margin-right: 0.4rem;
}
tr:last-child td { border-bottom: none; }

/* ─── Formulaires ─── */
form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  max-width: 420px;
  margin-top: 1rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-dim);
}

input, select, textarea {
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #0d1116;
  color: var(--text);
  transition: border-color 0.2s ease;
  resize: vertical;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.delete-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  color: var(--text-dim);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.68rem;
  padding: 0.3rem 0.8rem;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.delete-btn:hover {
  border-color: #ff8080;
  color: #ff8080;
  background: rgba(255,92,92,0.08);
}

.error {
  color: #ff8080;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
}

.empty-note {
  color: var(--text-dim);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  padding: 0.8rem 0;
}

/* ─── Avatars & badges ─── */
.row-avatar {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--border); display: block;
}

.inline-badge {
  display: inline-block;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(48,239,201,0.1);
  border: 1px solid var(--border);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}
.inline-badge-warn {
  color: #ff8080;
  background: rgba(255,92,92,0.1);
  border-color: rgba(255,128,128,0.35);
}

.page-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.page-link:hover { color: #4ffbe0; }

/* ─── Statut en ligne ─── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--text-dim);
}
.status-pill.online { color: var(--accent); }
.status-pill.online .status-dot {
  background: var(--accent);
  box-shadow: 0 0 6px rgba(48,239,201,0.8);
}
.status-pill.offline { color: var(--text-dim); }

/* ─── Vues des pages : liste de joueurs dépliable ─── */
.viewer-list {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  max-width: 320px;
}

/* ─── Détail d'un joueur ─── */
.detail-panel {
  margin-top: 1.5rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem 1.4rem 1.6rem;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.detail-header-info { flex: 1; }

.detail-avatar {
  width: 56px; height: 56px; border-radius: 50%; object-fit: cover;
  border: 2px solid rgba(48,239,201,0.6);
  box-shadow: 0 0 12px rgba(48,239,201,0.3);
}

.detail-name {
  font-family: 'Audiowide', sans-serif;
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

/* ─── Stats (réutilisé du gabarit profil du site) ─── */
.profil-stats {
  display: flex;
  gap: 1rem;
  margin: 1.4rem 0 0.6rem;
  flex-wrap: wrap;
}
.stat-tile {
  flex: 1; min-width: 150px;
  background: #0d1116;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
}
.stat-value {
  font-family: 'Audiowide', sans-serif;
  font-size: 1.4rem;
  color: var(--accent);
}
.stat-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

/* ─── Succès (réutilisé du gabarit profil du site) ─── */
.achv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.9rem;
}
.achv-card {
  background: #0d1116;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
}
.achv-name {
  font-family: 'Audiowide', sans-serif;
  font-size: 0.8rem;
  margin-bottom: 0.35rem;
}
.achv-desc {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.55;
  margin-bottom: 0.4rem;
}
.achv-date {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.62rem;
  color: rgba(48,239,201,0.6);
}

/* ─── Activité récente d'un joueur ─── */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.activity-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.8rem;
  background: #0d1116;
  border: 1px solid rgba(48,239,201,0.12);
  border-radius: 8px;
  font-size: 0.8rem;
}
.activity-date {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

/* ─── Menu latéral (arbre glisser-déposer) ─── */
.menu-tree-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.menu-tree-actions .button { padding: 0.4rem 0.9rem; font-size: 0.62rem; }

.menu-tree {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.6rem;
  margin-top: 0.6rem;
}

.menu-children {
  padding-left: 1.1rem;
  border-left: 1px dashed var(--border);
  margin-left: 0.85rem;
}
.menu-children.collapsed { display: none; }

.menu-collapse-btn {
  flex-shrink: 0;
  width: 1.4rem;
  height: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s ease, color 0.15s ease;
}
.menu-collapse-btn:hover { background: rgba(48,239,201,0.12); color: var(--accent); }
.menu-collapse-btn-empty { visibility: hidden; cursor: default; }

.menu-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: default;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.menu-row:hover { background: rgba(48,239,201,0.05); }
.menu-row.dragging { opacity: 0.4; }

.menu-row.drop-inside {
  background: rgba(48,239,201,0.14);
  border-color: var(--accent);
}
.menu-row.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.menu-row.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }

.menu-drag-handle {
  flex-shrink: 0;
  cursor: grab;
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1;
  padding: 0.2rem;
  touch-action: none;
}
.menu-drag-handle:active { cursor: grabbing; }

.menu-row-info { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.menu-row-label { font-size: 0.85rem; }
.menu-row-href {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-dim);
}

.menu-row-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }

.menu-form-actions { display: flex; gap: 0.7rem; align-items: center; }

@media (max-width: 640px) {
  header { padding: 1.2rem 0; }
  .detail-header { flex-direction: column; align-items: flex-start; }
}
