:root {
  --accent: #ff9800;
  --accent-soft: #ffc07a;
  --muted: #1b1b1b;
  --surface: rgba(12, 12, 12, 0.78);
  --surface-strong: rgba(9, 9, 9, 0.92);
  --glass: rgba(8, 8, 8, 0.62);
  --border: rgba(255, 152, 0, 0.15);
  --text: #f0f0f0;
  --text-muted: #c8c8c8;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Press Start 2P', cursive;
  color: var(--text);
  background-color: #060606;
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.82));
  pointer-events: none;
  z-index: -1;
}

.bg-home { background-image: url('/Image/Fond_Ecran_Home.png'); }
.bg-season1 { background-image: url('/Image/Fond_Ecran_V1.png'); }
.bg-season2 { background-image: url('/Image/Fond_Ecran_V2.png'); }
.bg-season3 { background-image: url('/Image/Fond_Ecran_V3.png'); }
.bg-season4 { background-image: url('/Image/Fond_Ecran_V4.png'); }
.bg-crea-fond { background-image: url('/crea/fond_ecran.png'); }
.bg-survie-fond { background-image: url('/survie/fond_ecran.png'); }
.bg-dirt { background-image: url('/Maison_en_dirt/Image_maisondedirt/Fond_Ecran_V0.png'); }

button, .server-btn, .modal-btn, .back-btn, a {
  font-family: inherit;
}

a { color: inherit; }

a:hover { text-decoration: none; }

.top-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  backdrop-filter: blur(14px);
  background: rgba(6, 6, 6, 0.76);
  border-bottom: 1px solid rgba(255, 152, 0, 0.18);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
  position: sticky;
  top: 0;
  z-index: 20;
}

.top-status-item {
  color: #d9d9d9;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.top-status-item strong {
  color: #ffffff;
}

.top-status-item.is-online strong {
  color: #7dffb5;
}

.top-status-item.is-offline strong {
  color: #ff9f9f;
}

.top-right-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-self: center;
}

.top-bar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  justify-self: end;
}

.page-live-layout {
  width: min(1700px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1100px) minmax(0, 280px);
  gap: 24px;
  align-items: start;
  justify-content: center;
}

.page-live-layout .container {
  width: 100%;
  grid-column: 2;
  margin: 0;
}

.live-side-card {
  width: 100%;
  max-width: 280px;
  grid-column: 3;
  background: rgba(8, 8, 8, 0.56);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  backdrop-filter: blur(14px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  padding: 18px 16px;
}

.live-side-card h3 {
  margin: 0 0 12px;
  font-size: 0.86rem;
  color: #ffd760;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.live-side-meta {
  margin: 0 0 10px;
  color: #c9c9c9;
  font-size: 0.72rem;
  line-height: 1.4;
}

.live-player-list {
  display: grid;
  gap: 7px;
}

.live-player-item {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 6px 8px;
  color: #f2f2f2;
  font-size: 0.72rem;
}

.live-player-empty {
  color: #bdbdbd;
  font-size: 0.72rem;
}

.nav-hover-card {
  position: absolute;
  width: min(320px, calc(100vw - 28px));
  background: linear-gradient(180deg, rgba(12, 12, 12, 0.97), rgba(8, 8, 8, 0.98));
  border: 1px solid rgba(255, 153, 0, 0.25);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  padding: 12px 12px 11px;
  z-index: 999;
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  pointer-events: none;
  transition: opacity 130ms ease, transform 130ms ease;
}

.nav-hover-card.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.nav-hover-title {
  color: #ffe4ad;
  font-size: 0.82rem;
  margin-bottom: 9px;
}

.nav-hover-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #d8d8d8;
  font-size: 0.73rem;
  margin-bottom: 6px;
}

.nav-hover-row strong {
  color: #ffffff;
}

.nav-hover-row .state-online {
  color: #7dffb5;
}

.nav-hover-row .state-offline {
  color: #ff9f9f;
}

.nav-hover-players-list {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: #bfbfbf;
  font-size: 0.7rem;
  line-height: 1.45;
  min-height: 22px;
}

.player-name {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  padding: 2px 7px;
}

.top-left {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  color: #ffd460;
  font-weight: 700;
  justify-self: start;
}

.top-left small {
  display: block;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 400;
}

.admin-btn,
.modal-btn,
.back-btn,
.server-btn {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease, background 200ms ease;
}

.admin-btn,
.modal-btn,
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: linear-gradient(180deg, #3db266, #2b7e41);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.18);
}

.admin-btn:hover,
.modal-btn:hover,
.back-btn:hover,
.server-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.25);
}

.back-btn {
  background: rgba(255, 152, 0, 0.12);
  color: var(--accent);
  border-color: rgba(255, 152, 0, 0.25);
}

.main-content,
.container {
  width: min(1100px, 100%);
  margin: 0 auto;
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.header-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 20px;
  text-align: center;
  width: 100%;
  margin-bottom: 22px;
}

.container .desc {
  width: min(860px, 100%);
  text-align: center;
}

.actions {
  justify-content: center;
}

/* Ensure standalone page containers use the same panel styling as content-box */
.container[role="main"],
.container {
  background: rgba(8, 8, 8, 0.56);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  backdrop-filter: blur(14px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 28px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.45);
  padding: 28px 26px;
  background-clip: padding-box;
  color: var(--text);
}

.content-box {
  width: auto;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 44px 28px 32px;
  gap: 32px;
}

.layout-row {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: center;
  width: 100%;
  align-items: flex-start;
}

.layout-row > * {
  flex: 1 1 300px;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.layout-row .content-box {
  flex: 2 1 560px;
  min-width: 380px;
  max-width: 860px;
}

.layout-row .side-box {
  flex: 0 1 320px;
  min-width: 240px;
  max-width: 380px;
  align-self: flex-start;
  align-items: flex-start;
  padding: 32px 28px;
  font-size: 0.95rem;
  line-height: 1.45;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.layout-row .content-box,
.layout-row .side-box {
  /* semi-transparent panels so wallpaper shows through */
  background: rgba(8, 8, 8, 0.56);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  backdrop-filter: blur(14px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 30px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.45);
  padding: 44px 36px;
  background-clip: padding-box;
  text-align: center;
}

/* Ensure links and text inside panels are visible and buttons inherit correct styles */
.container a,
.layout-row .content-box a,
.layout-row .side-box a {
  color: inherit;
}

.container p,
.layout-row .content-box p,
.layout-row .side-box p,
.container .desc p {
  color: #d8d8d8;
}

/* Side boxes (news, mods) should adapt to their content and read left-to-right */
.layout-row .side-box {
  padding: 28px 24px;
  text-align: left;
}

.content-box {
  gap: 28px;
}

.hero-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-subtitle {
  color: #c8d8ff;
  font-size: 1rem;
  line-height: 1.6;
  max-width: 720px;
  margin: 0;
}

.content-box h1 {
  font-size: clamp(2.4rem, 3.6vw, 4rem);
  line-height: 1.05;
  margin: 0;
  letter-spacing: 0.03em;
  color: #fff;
  text-shadow: 0 4px 18px rgba(0,0,0,0.35);
  font-weight: 700;
  text-transform: uppercase;
}

.content-box .description {
  margin: 0;
  line-height: 1.95;
  color: #e6e6e6;
  font-size: 1rem;
}

.section-title {
  font-size: 1.12rem;
  color: #e5f4ff;
  margin: 30px 0 20px;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.36);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.section-title::before,
.section-title::after {
  content: '';
  flex: 1 1 40%;
  max-width: 140px;
  height: 1px;
  background: rgba(255, 255, 255, 0.10);
  margin: 0 12px;
}

.side-box h3 {
  margin: 0 0 18px;
  font-size: 1.14rem;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #ffd760;
  font-weight: 700;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0,0,0,0.25);
}

.side-box p,
.news-item,
.mods-list {
  margin-bottom: 16px;
}

.news-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.news-list {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 152, 0, 0.7) rgba(255, 255, 255, 0.08);
}

.news-list::-webkit-scrollbar {
  width: 10px;
}

.news-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
}

.news-list::-webkit-scrollbar-thumb {
  background: rgba(255, 152, 0, 0.7);
  border-radius: 999px;
}

.side-box p {
  color: #c6c6c6;
}

.live-error {
  margin: 0;
  color: #ff8f8f;
  font-size: 0.72rem;
}

.button-container,
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  justify-content: center;
  margin-top: 14px;
  margin-bottom: 10px;
}

.button-container a,
.actions a {
  flex: 0 1 auto;
  min-width: 0;
  width: auto;
  display: inline-flex;
  white-space: nowrap;
  max-width: max-content;
}

/* Action buttons used on season pages */
.action-btn {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin: 6px 6px;
  background: linear-gradient(180deg, #3db266, #2b7e41);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.18);
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.action-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 28px rgba(0,0,0,0.25); }

/* Force Font Awesome glyphs inside action buttons to use the FA font (in case of overrides) */
.action-btn i,
.action-btn .fa,
.action-btn .fas,
.action-btn .far,
.action-btn .fal,
.action-btn .fab {
  font-family: "Font Awesome 6 Free","Font Awesome 6 Brands" !important;
  font-weight: 900 !important;
  speak: none;
}

.news-item {
  margin-bottom: 16px;
  padding: 16px 18px;
  font-size: 0.98rem;
  line-height: 1.6;
  border-radius: 14px;
}

.container .desc p,
.layout-row .side-box p {
  font-size: 0.98rem;
  line-height: 1.7;
  color: #e4e4e4;
}

@media (max-width: 1100px) {
  .layout-row .content-box {
    max-width: 100%;
  }
}

@media (max-width: 980px) {
  .layout-row {
    flex-direction: column;
  }

  .layout-row > * {
    max-width: 100%;
    width: 100%;
  }

  .news-list {
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
  }

  .page-live-layout {
    flex-direction: column;
    width: 100%;
    display: flex;
  }

  .live-side-card {
    width: 100%;
    flex: 1 1 auto;
    max-width: none;
  }
}

.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

.server-btn {
  background: linear-gradient(180deg, #ff7e1c, #c74407);
  box-shadow: 0 16px 32px rgba(255, 87, 34, 0.2);
  color: #fff;
  padding: 14px 22px;
  font-size: 0.95rem;
  text-decoration: none;
}

.server-btn:hover {
  background: linear-gradient(180deg, #ffa652, #d85b1d);
}

.news-item {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 14px 16px;
  text-align: left;
}

.thumb {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.thumb img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
  transition: transform 350ms ease;
}

.thumb:hover img {
  transform: scale(1.05);
}

.lightbox,
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  padding: 20px;
  z-index: 9999;
}

.lightbox.show,
.modal.show {
  display: flex;
}

.gallery {
  margin-top: 16px;
}

.upload-panel {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 18px;
  margin-top: 20px;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 150px;
  border: 2px dashed rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 200ms ease, background-color 200ms ease;
}

.dropzone.is-dragover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.35);
}

.dropzone input[type="file"] {
  display: none;
}

.dropzone strong {
  display: block;
  margin-bottom: 8px;
  color: #fff;
}

.dropzone p {
  margin: 2px 0;
  color: rgba(255, 255, 255, 0.75);
}

.thumb {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.thumb img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
  transition: transform 350ms ease;
}

.thumb:hover img { transform: scale(1.05); }

.lightbox,
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  padding: 20px;
  z-index: 9999;
}

.lightbox.show,
.modal.show { display: flex; }

.lightbox img {
  max-width: calc(100% - 40px);
  max-height: calc(100% - 80px);
  border-radius: 18px;
  box-shadow: 0 18px 65px rgba(0, 0, 0, 0.55);
}

.lightbox .close-lb,
.close {
  position: absolute;
  right: 18px;
  top: 18px;
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
}

.modal-content {
  position: relative;
  width: min(420px, 100%);
  background: rgba(11, 11, 11, 0.96);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  text-align: center;
  color: #eee;
  border: 1px solid rgba(255, 152, 0, 0.15);
  transform: translateY(18px) scale(0.96);
  opacity: 0;
  transition: transform 240ms ease, opacity 240ms ease;
}

.modal.show .modal-content { transform: translateY(0) scale(1); opacity: 1; }

.modal-content h2 { margin: 0 0 14px; font-size: 1.1rem; color: var(--accent); }

.modal-buttons { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 18px; }

footer {
  background: rgba(13, 13, 13, 0.82);
  text-align: center;
  padding: 14px 16px;
  font-size: 0.78rem;
  color: #bdbdbd;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

@media (max-width: 860px) {
  .top-bar {
    padding: 18px 16px;
    grid-template-columns: 1fr;
  }
  .top-left, .top-right-controls, .top-bar-actions {
    width: 100%;
    justify-content: center;
    justify-self: center;
  }

  .top-right-controls {
    gap: 8px;
  }

  .top-status-item {
    font-size: 0.72rem;
    padding: 7px 9px;
  }

  .top-left strong {
    font-size: 0.9rem;
  }

  .top-left small {
    font-size: 0.62rem;
  }

  .admin-btn, .back-btn, .server-btn, .action-btn { width: 100%; justify-content: center; }
}

@media (max-width: 720px) {
  main { padding: 24px 16px 32px; }
  .container, .content-box { padding: 26px 22px; border-radius: 20px; }
  .section-title { margin: 18px 0 10px; }
  .thumb img { height: 120px; }
  .nav-hover-card { display: none; }

  .top-bar {
    padding: 14px 10px;
    gap: 10px;
  }

  .top-status-item {
    font-size: 0.68rem;
    padding: 6px 8px;
    gap: 6px;
  }

  .top-bar-actions {
    gap: 8px;
  }

  .admin-btn,
  .back-btn {
    padding: 10px 12px;
    font-size: 0.72rem;
  }

  .live-side-card {
    padding: 14px 12px;
    border-radius: 18px;
  }

  .live-player-item,
  .live-player-empty,
  .live-side-meta {
    font-size: 0.66rem;
  }
}
