/* ============================================================
   PALETTE + VARIABLES GLOBALES (UBISOFT/SONY)
   ============================================================ */

:root {
  --bg: #050608;
  --bg-alt: #10121a;
  --bg-card: #151823;
  --border: #262a3a;
  --text: #f5f7ff;
  --muted: #a5afcf;

  --accent: #ff7a1a;
  --accent-soft: rgba(255, 122, 26, 0.18);

  --radius: 18px;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.55);
}

/* ============================================================
   RESET & BASE
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at top, #15192d 0%, #050608 65%);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ============================================================
   TOPBAR / HEADER
   ============================================================ */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 2.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(5, 6, 8, 0.96);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.logo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
}

.brand {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav {
  display: flex;
  gap: 1rem;
}

.nav-link {
  text-decoration: none;
  color: var(--muted);
  padding: 0.35rem 1rem;
  border-radius: 999px;
  transition: 0.15s;
  font-size: 0.95rem;
}

.nav-link:hover {
  background: var(--bg-alt);
  color: var(--text);
  transform: translateY(-1px);
}

.nav-link.active {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ============================================================
   GLOBAL PAGE LAYOUT
   ============================================================ */

.page {
  max-width: 1150px;
  margin: 2rem auto 3rem;
  padding: 0 1.5rem;
}

.page-home {
  max-width: 1200px;
  margin: 2.5rem auto;
  padding: 0 1.5rem;
}

/* ============================================================
   ACCUEIL – LOGO CENTRÉ AAA
   ============================================================ */

.home-logo-section {
  text-align: center;
  margin-top: 1rem;
  margin-bottom: 2rem;
}

.home-logo-giant {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 1px solid var(--border);
  padding: 12px;
  background: radial-gradient(circle at 30% 30%, #ffffff10 0, #050608 80%);
  box-shadow: var(--shadow);
}

.home-title-centered {
  margin-top: 1rem;
  font-size: 2.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.home-description-section {
  display: flex;
  justify-content: center;
}

.home-description-box {
  max-width: 900px;
  background: var(--bg-card);
  padding: 2rem 2.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  line-height: 1.65;
  box-shadow: var(--shadow);
}

.home-description-box h3 {
  margin-top: 1.8rem;
  margin-bottom: 0.8rem;
  font-size: 1.1rem;
}

.home-bullets {
  list-style: none;
  padding-left: 0;
}

.home-bullets li {
  margin-bottom: 0.4rem;
}

.home-bullets li::before {
  content: "• ";
  color: var(--accent);
}

.home-conclusion {
  margin-top: 1rem;
  font-weight: 500;
  color: var(--accent);
}

/* ============================================================
   APERÇU DES JEUX (ACCUEIL)
   ============================================================ */

.home-games-preview {
  margin-top: 3.2rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
}

.section-header h2 {
  margin: 0;
}

.section-header .link {
  color: var(--accent);
  text-decoration: none;
}

.game-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.3rem;
}

/* ============================================================
   CARTES JEUX – STYLE UBISOFT PREMIUM
   ============================================================ */

.game-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: 0.2s ease;
}

.game-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-soft);
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.7);
}

.game-card-thumb {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.game-card-body {
  padding: 0.9rem 1rem;
}

.game-card-title {
  margin: 0;
  font-size: 1.05rem;
}

.game-card-meta {
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.game-card-price {
  margin-top: 0.45rem;
  font-weight: 600;
  color: var(--accent);
}

/* ============================================================
   PAGE AUTH / COMPTE
   ============================================================ */

.auth-page {
  display: flex;
  justify-content: center;
  margin-top: 3rem;
}

.auth-box {
  width: 420px;
  background: var(--bg-card);
  padding: 1.8rem 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.auth-header {
  text-align: center;
  margin-bottom: 1rem;
}

.auth-logo {
  width: 70px;
  border-radius: 50%;
  margin-bottom: 0.5rem;
}

.auth-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 600;
}

.auth-subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Boutons globaux */
.btn-primary,
.btn-outline {
  padding: 0.6rem 1.3rem;
  border-radius: 999px;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  font-weight: 500;
  display: inline-block;
}

.btn-primary {
  background: linear-gradient(135deg, #ff7a1a, #ffb347);
  color: #050608;
  border: none;
}

.btn-outline {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

/* Bouton danger (supprimer) */
.btn-danger {
  background: #ef5350;
  color: #fff;
  border: none;
  padding: 0.6rem 1.3rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
}

/* ============================================================
   ADMIN PAGE – MISE EN FORME
   ============================================================ */

.admin-page {
  display: flex;
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.admin-sidebar {
  width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.admin-tab-btn {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 0.7rem 1rem;
  border-radius: 0.6rem;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: 0.15s;
  font-size: 0.9rem;
}

.admin-tab-btn:hover {
  background: var(--bg-card);
  color: var(--text);
}

.admin-tab-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.admin-content {
  flex: 1;
  margin-left: 1.5rem;
}

.admin-panel {
  margin-bottom: 2.5rem;
}

.admin-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin-top: 1rem;
  box-shadow: var(--shadow);
}

.admin-form.hidden {
  display: none;
}

.admin-table {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  overflow: hidden;
}

.admin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
}

.admin-row:last-child {
  border-bottom: none;
}

.field {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.8rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

/* ============================================================
   ANNOUNCEMENTS (ACCUEIL)
   ============================================================ */

.home-announcements {
  margin-top: 3.2rem;
}

.announcement-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.announcement-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow);
}

.announcement-card h3 {
  margin-top: 0;
  margin-bottom: 0.4rem;
  font-size: 1.1rem;
}

.announcement-card p {
  margin: 0.4rem 0;
  color: var(--muted);
  line-height: 1.5;
}

.announcement-actions {
  margin-top: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.like-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 1.3rem;
  padding: 0;
  display: flex;
  align-items: center;
}

.like-count {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ============================================================
   CATALOGUE JEUX – REDESIGN
   ============================================================ */

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.6rem;
}

.game-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: 0.2s ease;
  display: flex;
  flex-direction: column;
}

.game-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-soft);
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.7);
}

.game-card-thumb {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.game-card-body {
  flex: 1;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.game-card-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.game-card-meta {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.game-card-price {
  margin-top: 0.55rem;
  font-weight: 600;
  color: var(--accent);
  font-size: 1rem;
}

.game-card-actions {
  margin-top: 0.7rem;
  display: flex;
  gap: 0.7rem;
}

.game-card-actions button {
  font-size: 1.2rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--accent);
  padding: 0;
  display: flex;
  align-items: center;
}

.game-card-actions button:hover {
  transform: scale(1.1);
}

/* ============================================================
   FEATURED GAME CARDS
   Les jeux en avant s'affichent plus grands et avec un accent
   ============================================================ */

.game-card.featured {
  border: 2px solid var(--accent);
  box-shadow: 0 24px 55px rgba(255, 122, 26, 0.35);
  /* occupe deux colonnes quand l'espace le permet */
  grid-column: span 2;
}

.game-card.featured .game-card-thumb {
  /* ratio plus large pour mettre en valeur l'image */
  aspect-ratio: 16/9;
}

.game-card.featured .game-card-title {
  font-size: 1.4rem;
}

.game-card.featured .game-card-price {
  font-size: 1.1rem;
}

/* Petites cartes pour les jeux standard : ratio carré */
.game-card .game-card-thumb {
  aspect-ratio: 4/3;
}

/* Ajuster la hauteur des images sur les navigateurs sans support d'aspect-ratio */
@supports not (aspect-ratio: 1) {
  .game-card .game-card-thumb {
    height: 160px;
  }
  .game-card.featured .game-card-thumb {
    height: 240px;
  }
}

/* ============================================================
   GAME DETAIL PAGE HERO
   Bandeau d'introduction du jeu
   ============================================================ */

.game-hero {
  position: relative;
  height: 480px;
  background-size: cover;
  background-position: center;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(5, 6, 8, 0.05) 0%, rgba(5, 6, 8, 0.85) 80%);
}

.game-hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.hero-tag {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
}

.game-hero-content h1 {
  margin: 0;
  font-size: 2.6rem;
  font-weight: 700;
}

.hero-meta {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.hero-chip {
  background: var(--bg-alt);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--muted);
  border: 1px solid var(--border);
}

.hero-price {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-soft);
}

.hero-description {
  max-width: 700px;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

/* ============================================================
   GAME DETAIL LAYOUT
   ============================================================ */

.game-detail-section {
  margin-top: 2rem;
}

.game-detail-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.game-detail-main {
  flex: 2;
  min-width: 280px;
}

.game-detail-side {
  flex: 1;
  min-width: 220px;
}

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.8rem;
}

.screenshot-grid img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  object-fit: cover;
  box-shadow: var(--shadow);
}

@media (max-width: 900px) {
  .admin-page {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    white-space: nowrap;
  }
  .admin-content {
    margin-left: 0;
    margin-top: 1rem;
  }
}

/* ============================================================
   INPUT & AUTH PAGE FORM FIELDS STYLING
   ============================================================ */

/* Global input styling for dark theme (used in forms, search bars, etc.) */
.input {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.6rem 0.8rem;
  color: var(--text);
  font-size: 0.9rem;
  width: 100%;
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

/* Labels within auth forms */
.auth-form label {
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}

/* Layout for password row containing input and toggle */
.password-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.password-row .input {
  flex: 1;
}

/* Password show/hide toggle button */
.pw-toggle {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 0.8rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.8rem;
}

.pw-toggle:hover {
  background: var(--bg-card);
}

/* Strength bar container */
.pw-strength {
  width: 100%;
  height: 6px;
  background: var(--bg-alt);
  border-radius: 0.5rem;
  margin: 0.4rem 0 0.6rem;
  overflow: hidden;
}

/* Actual bar that grows based on password strength */
.pw-bar {
  height: 100%;
  width: 0%;
  background: red;
  transition: width 0.3s ease;
}

/* Tabs container on auth page */
.auth-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
}

/* Individual tab buttons */
.auth-tab {
  flex: 1;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.6rem 0;
  text-align: center;
  border-radius: 0.6rem;
  cursor: pointer;
  transition: 0.15s;
  font-weight: 500;
}

.auth-tab:hover {
  background: var(--bg-card);
  color: var(--text);
}

/* Active tab state */
.auth-tab.active {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  color: var(--accent);
}

/* Hide inactive forms by default */
.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

/* Small text styling for errors and success messages */
.auth-error {
  color: #ef5350;
  font-size: 0.8rem;
  margin-top: 0.4rem;
}

.auth-success {
  color: #32ff8d;
  font-size: 0.8rem;
  margin-top: 0.4rem;
}

/* ============================================================
   PROFIL – SYSTÈME D'AMIS ET CHAT
   ============================================================ */

.friend-search {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.friend-requests,
.friend-list,
.chat-section {
  margin-top: 1rem;
}

.friend-requests .friend-item,
.friend-list .friend-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.friend-item:last-child {
  border-bottom: none;
}

.friend-item button {
  margin-left: 0.4rem;
}

.chat-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.chat-messages {
  max-height: 250px;
  overflow-y: auto;
  margin-bottom: 0.5rem;
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 0.8rem;
  border: 1px solid var(--border);
}

.chat-message {
  margin-bottom: 0.4rem;
}

.chat-message.me {
  text-align: right;
  color: var(--accent);
}

.chat-input {
  display: flex;
  gap: 0.5rem;
}
