*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:      #5B8DB8;
  --blue-dark: #2E5F84;
  --blue-deep: #1A3A52;
  --gold:      #C9961D;
  --gold-light:#E8B840;
  --gold-pale: #F5D97A;
  --white:     #F8F9FA;
  --shadow:    rgba(30, 60, 90, 0.25);
}

body {
  min-height: 100vh;
  background: linear-gradient(160deg, var(--blue-deep) 0%, #0d2235 40%, #1a1a2e 100%);
  font-family: 'Raleway', sans-serif;
  color: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
}

/* ── Chess-board background pattern ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    repeating-conic-gradient(rgba(255,255,255,0.03) 0% 25%, transparent 0% 50%);
  background-size: 60px 60px;
  pointer-events: none;
}

/* ── Animated gold border top ── */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--gold), var(--gold-light), var(--gold), transparent);
  animation: shimmer 3s linear infinite;
}
@keyframes shimmer {
  0%   { opacity: 0.6; }
  50%  { opacity: 1; }
  100% { opacity: 0.6; }
}

/* ── Logo & header ── */
header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 48px;
  position: relative;
  z-index: 1;
}

.logo-ring {
  width: 140px; height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #ffffff 0%, #d0e8f5 60%, #a8cce0 100%);
  padding: 10px;
  box-shadow:
    0 0 0 3px var(--gold),
    0 0 0 6px rgba(201,150,29,0.3),
    0 8px 32px var(--shadow);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.logo-ring:hover {
  transform: scale(1.05) rotate(3deg);
  box-shadow:
    0 0 0 3px var(--gold-light),
    0 0 0 8px rgba(232,184,64,0.4),
    0 12px 40px rgba(30,60,90,0.4);
}
.logo-ring img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: contain;
}

h1 {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, var(--gold-pale) 0%, var(--gold-light) 50%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 2px 8px rgba(201,150,29,0.4));
}

.subtitle {
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--blue);
  opacity: 0.8;
}

/* ── Gold divider ── */
.divider {
  width: 120px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 4px auto 0;
}

/* ── Cards grid ── */
nav {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.card {
  width: 220px;
  background: linear-gradient(145deg, rgba(91,141,184,0.15), rgba(26,58,82,0.6));
  border: 1px solid rgba(91,141,184,0.3);
  border-radius: 16px;
  padding: 36px 24px 28px;
  text-decoration: none;
  color: var(--white);
  text-align: center;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 32px var(--shadow), inset 0 1px 0 rgba(255,255,255,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
  overflow: hidden;
}

/* Gold corner accent */
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 80px; height: 80px;
  background: radial-gradient(circle at 0% 0%, rgba(201,150,29,0.25), transparent 70%);
  pointer-events: none;
}
/* Bottom shine line */
.card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 10%; right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  border-radius: 1px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 20px 48px rgba(30,60,90,0.5), 0 0 0 1px var(--gold), inset 0 1px 0 rgba(255,255,255,0.12);
  border-color: var(--gold);
}
.card:hover::after { opacity: 1; }

.card-icon {
  font-size: 3.2rem;
  line-height: 1;
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 8px rgba(201,150,29,0.4));
  transition: transform 0.3s ease;
}
.card:hover .card-icon { transform: scale(1.15) rotate(-5deg); }

.card-icon--memory {
  display: flex;
  justify-content: center;
  gap: 4px;
  font-size: 0;
}
.card-icon--memory img {
  width: 45px;
  height: 45px;
  filter: drop-shadow(0 3px 6px rgba(201,150,29,0.5));
}

.card-title {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--gold-light);
  margin-bottom: 8px;
}

.card-desc {
  font-size: 0.78rem;
  color: rgba(200,220,240,0.7);
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.card-arrow {
  display: inline-block;
  margin-top: 18px;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.card:hover .card-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ── Pseudo modal ── */
.pseudo-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 40, 0.92);
  z-index: 200;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(6px);
}
.pseudo-modal.open { display: flex; }

.pseudo-panel {
  background: linear-gradient(145deg, rgba(30,70,110,0.95), rgba(10,25,45,0.98));
  border: 1px solid rgba(201,150,29,0.35);
  border-radius: 20px;
  padding: 48px 40px 40px;
  text-align: center;
  max-width: 340px;
  width: 90%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05);
}
.pseudo-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 8px rgba(201,150,29,0.5));
}
.pseudo-panel h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  color: var(--gold-light);
  margin-bottom: 8px;
}
.pseudo-subtitle {
  font-size: 0.82rem;
  color: rgba(200,220,240,0.65);
  margin-bottom: 24px;
}
.pseudo-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid rgba(91,141,184,0.4);
  background: rgba(255,255,255,0.07);
  color: white;
  font-size: 1rem;
  font-family: 'Raleway', sans-serif;
  text-align: center;
  outline: none;
  margin-bottom: 20px;
  transition: border-color 0.2s;
}
.pseudo-input:focus { border-color: var(--gold); }
.pseudo-counter {
  font-size: 0.72rem;
  color: rgba(200,220,240,0.35);
  text-align: right;
  margin-top: -14px;
  margin-bottom: 18px;
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 0.05em;
}
.pseudo-btn {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--blue-deep);
  border: none;
  border-radius: 10px;
  padding: 12px 32px;
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: transform 0.2s, box-shadow 0.2s;
}
.pseudo-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(201,150,29,0.4);
}

/* ── Player badge ── */
.player-badge {
  display: none;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid rgba(201,150,29,0.3);
  background: rgba(201,150,29,0.08);
  font-size: 0.8rem;
  color: var(--gold-light);
  transition: background 0.2s, border-color 0.2s;
  margin-top: 4px;
}
.player-badge:hover {
  background: rgba(201,150,29,0.16);
  border-color: var(--gold);
}
.player-badge-icon { font-size: 1rem; }
.player-badge-edit { opacity: 0.5; font-size: 0.75rem; }

/* ── Trophées card variant ── */
.card--trophees {
  background: linear-gradient(145deg, rgba(201,150,29,0.18), rgba(26,18,4,0.65));
  border-color: rgba(201,150,29,0.4);
}
.card--trophees::before {
  background: radial-gradient(circle at 0% 0%, rgba(201,150,29,0.4), transparent 70%);
}
.card--trophees:hover {
  box-shadow: 0 20px 48px rgba(90,50,0,0.5), 0 0 0 1px var(--gold-light), inset 0 1px 0 rgba(255,255,255,0.12);
  border-color: var(--gold-light);
}

/* ── Footer ── */
footer {
  margin-top: 56px;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(91,141,184,0.5);
  position: relative;
  z-index: 1;
}

/* ── Floating chess pieces decoration ── */
.chess-deco {
  position: fixed;
  font-size: 5rem;
  opacity: 0.04;
  pointer-events: none;
  animation: float 14s ease-in-out infinite;
  user-select: none;
}
.chess-deco:nth-child(1) { top: 8%;  left: 5%;  animation-delay: 0s; }
.chess-deco:nth-child(2) { top: 65%; left: 3%;  animation-delay: -4s; font-size: 3.5rem; }
.chess-deco:nth-child(3) { top: 15%; right: 5%; animation-delay: -7s; font-size: 4rem; }
.chess-deco:nth-child(4) { top: 70%; right: 4%; animation-delay: -2s; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33%       { transform: translateY(-20px) rotate(5deg); }
  66%       { transform: translateY(10px) rotate(-3deg); }
}
