/* ============================================================
   VARIABLES & RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sidebar-w:     200px;
  --sidebar-w-col: 64px;

  /* Charte Rosaelia — noir / blanc tranchés par le rouge esport */
  --purple-dark:   #0c0a0d;
  --purple-mid:    #150e10;
  --purple-hover:  #2a1215;
  --accent:        #da2a37;
  --accent-light:  #ea4a53;
  --green:         #4ade80;
  --red:           #da2a37;
  --gold:          #b5555f;
  --bg-main:       #0a0909;
  --border:        #2e2226;
  --text:          #e7dfe0;
  --text-muted:    #8a7778;

  --font-display: 'Cinzel', serif;
  --font-body:    'Oswald', sans-serif;
}

html, body { height: 100%; }

body {
  font-family: var(--font-body);
  font-weight: 400;
  background: var(--bg-main);
  color: var(--text);
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w-col);
  background: linear-gradient(180deg, var(--purple-dark) 0%, var(--purple-mid) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.2rem 0;
  border-right: 1px solid var(--border);
  transition: width 0.25s ease;
  overflow: hidden;
  z-index: 100;
}

.sidebar:hover { width: var(--sidebar-w); }

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0 1rem;
  margin-bottom: 1.8rem;
  overflow: hidden;
  text-decoration: none;
  flex-shrink: 0;
}

.sidebar-logo-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  image-rendering: pixelated;
}

.sidebar-logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.5px;
  color: #fff;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease 0.05s;
}

.sidebar:hover .sidebar-logo-text { opacity: 1; }

/* Nav list */
.nav-list {
  list-style: none;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.1rem;
  color: #a08e8f;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  position: relative;
}

.nav-item a:hover,
.nav-item.active a {
  background: var(--purple-hover);
  color: #fff;
}

.nav-item.active a::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent-light);
  border-radius: 0 2px 2px 0;
}

.nav-icon  { width: 20px; height: 20px; flex-shrink: 0; opacity: 0.75; }
.nav-label { opacity: 0; transition: opacity 0.2s ease 0.05s; }
.sidebar:hover .nav-label { opacity: 1; }

/* Auth buttons */
.sidebar-auth {
  width: 100%;
  padding: 0 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow: hidden;
}

.btn-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.btn-auth:hover { opacity: 0.85; }
.btn-login    { background: var(--purple-hover); color: #e2cfd0; border: 1px solid var(--border); }
.btn-register { background: var(--accent-light); color: #fff; border: none; }

.btn-auth .btn-label {
  opacity: 0; max-width: 0; overflow: hidden;
  transition: opacity 0.2s ease 0.05s, max-width 0.2s ease 0.05s;
}

.sidebar:hover .btn-auth .btn-label { opacity: 1; max-width: 120px; }

/* ============================================================
   LAYOUT
   ============================================================ */
.page {
  margin-left: var(--sidebar-w-col);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.content {
  flex: 1;
  padding: 2.5rem 3rem;
  max-width: 860px;
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  background: linear-gradient(135deg, #1c1112 0%, #120c0d 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem 2.5rem;
  margin-bottom: 1.5rem;
}

.section-title {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 3px;
}

/* Hero */
.hero-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1rem;
  line-height: 1.3;
  letter-spacing: 0.3px;
}

.hero-body p {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.hero-body p:last-child { margin-bottom: 0; }
.hero-body p strong { color: #fff; }

/* ============================================================
   SERVER STATUS
   ============================================================ */
.status-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 1.4rem;
}

.dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
  animation: pulse 2s ease-in-out infinite;
}

.dot.online  { background: var(--green); color: var(--green); }
.dot.offline { background: var(--red);   color: var(--red); animation: none; }
.dot.loading { background: #6b5a8a;      color: #6b5a8a; }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(1.4); }
}

.status-text.online  { color: var(--green); }
.status-text.offline { color: var(--red); }
.status-text.loading { color: #6b5a8a; }

/* ============================================================
   PLAYERS BLOCK
   ============================================================ */
.players-block {
  background: #0d0909;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.3rem 1.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}

.players-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.players-count {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.players-count .sep { color: var(--text-muted); font-weight: 300; margin: 0 0.2em; font-size: 1.4rem; }
.players-count .max { color: var(--gold); }

.pct-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-light);
  line-height: 1;
  text-align: right;
}

/* Progress bar */
.players-bar-wrap {
  height: 4px;
  background: #201517;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 1.4rem;
}

.players-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 2px;
  transition: width 0.8s ease;
  width: 0%;
}

/* ============================================================
   IP BUTTON
   ============================================================ */
.ip-block { display: flex; flex-direction: column; gap: 0.4rem; }

.ip-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
}

.ip-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: #1a0f3a;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1.3rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gold);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  position: relative;
  user-select: none;
  width: fit-content;
  letter-spacing: 0.3px;
}

.ip-btn:hover  { background: #251560; border-color: var(--accent); }
.ip-btn:active { transform: scale(0.98); }
.ip-btn svg { width: 14px; height: 14px; flex-shrink: 0; fill: var(--text-muted); transition: fill 0.15s; }
.ip-btn:hover svg { fill: var(--gold); }

.copy-toast {
  position: absolute;
  top: -2rem; left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: var(--green);
  color: #071a0d;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
}

.copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.motd {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.75rem;
  min-height: 1em;
}

/* ============================================================
   LINK
   ============================================================ */
.link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent-light);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.15s;
}

.link:hover { color: #fff; text-decoration: underline; }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  border-top: 1px solid var(--border);
  padding: 1.4rem 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
}

.social-btn {
  width: 38px; height: 38px;
  background: #1c1214;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.social-btn:hover { background: var(--purple-hover); color: #fff; border-color: var(--accent); }

/* ============================================================
   DOWNLOAD PAGE
   ============================================================ */
#page-modpack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

#page-modpack .dl-header,
#page-modpack .dl-cards {
  width: 100%;
  max-width: 680px;
}

.dl-header {
  text-align: center;
  margin-bottom: 2.5rem;
  padding-top: 0.5rem;
}

.dl-edition {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 1rem;
}

.dl-subtitle {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text);
  max-width: 520px;
  margin: 0 auto;
}

.dl-subtitle strong { color: #fff; }

.dl-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.dl-card {
  background: linear-gradient(145deg, #1c1113 0%, #110b0c 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.8rem 1.8rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
}

.dl-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    135deg,
    transparent,
    transparent 18px,
    rgba(255,255,255,0.012) 18px,
    rgba(255,255,255,0.012) 19px
  );
  pointer-events: none;
}

.dl-card.featured {
  border-color: #a3242f;
  box-shadow: 0 0 0 1px #a3242f44, inset 0 1px 0 #da2a3722;
}

/* Tags */
.dl-tag {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 0.25em 0.7em;
  border-radius: 4px;
  width: fit-content;
}

.dl-tag--purple { background: #2e1416; color: var(--accent-light); border: 1px solid #a3242f66; }
.dl-tag--gold   { background: #2e1416; color: var(--gold);         border: 1px solid #b5555f55; }

/* Card content */
.dl-card-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.dl-card-desc {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text);
  flex: 1;
}

.dl-card-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: monospace;
}

.dl-card-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Buttons */
.dl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
  margin-top: 0.3rem;
}

.dl-btn:hover  { opacity: 0.88; }
.dl-btn:active { transform: scale(0.97); }

.dl-btn--purple { background: var(--accent); color: #fff; }
.dl-btn--gold   { background: var(--gold);   color: #fff; }

@media (max-width: 640px) {
  .dl-cards { grid-template-columns: 1fr; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
  .content { padding: 1.5rem 1.2rem; }
  .players-block { flex-direction: column; align-items: flex-start; gap: 0.8rem; }
  footer { padding: 1.2rem; }
}

/* ============================================================
   MODPACK PAGE ONLY
   ============================================================ */

#modpack {
  width: 100%;
  max-width: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#modpack .dl-header,
#modpack .dl-cards {
  width: 100%;
  max-width: 680px;
}

#modpack .dl-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}