/* ============================================
   WANDERLUST — Global Styles
   ============================================ */



:root {
  --night: #0a0e1a;
  --deep: #0f1628;
  --card: #141c2e;
  --card2: #1a2340;
  --border: rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.12);
  --text: #e8eaf0;
  --sub: #6b7a9e;
  --gold: #f0b429;
  --gold2: #e09d1a;
  --teal: #00d4aa;
  --teal2: #00b892;
  --coral: #ff6b6b;
  --sky: #4fc3f7;
  --purple: #9b59ff;
  --font-display: Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif, sans-serif;
  --font-mono: 'Courier New', monospace;
  --radius: 1.5rem;
  --radius-sm: 0.75rem;
  --shadow: 0 8px 40px rgba(0,0,0,0.4);
  --shadow-lg: 0 20px 80px rgba(0,0,0,0.6);
  --glow-gold: 0 0 30px rgba(240,180,41,0.3);
  --glow-teal: 0 0 30px rgba(0,212,170,0.3);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--night);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ===== BACKGROUND STARS ===== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 60%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 50% 10%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 40%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 85% 80%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 15% 85%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 75%, rgba(255,255,255,0.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 15%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 45% 50%, rgba(255,255,255,0.2) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 25% 35%, rgba(255,255,255,0.3) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* ===== NAV ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 70px;
  background: rgba(10,14,26,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 1000;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  font-style: italic;
  background: linear-gradient(135deg, var(--gold), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}

.nav-tabs {
  display: flex;
  gap: 4px;
  background: var(--card);
  border-radius: 999px;
  padding: 4px;
  border: 1px solid var(--border);
}

.nav-tab {
  padding: 8px 20px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--sub);
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}

.nav-tab.active, .nav-tab:hover {
  background: linear-gradient(135deg, var(--gold), var(--teal));
  color: var(--night);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ===== MAIN WRAPPER ===== */
.main {
  padding-top: 70px;
  position: relative;
  z-index: 1;
}

/* ===== SECTION HERO ===== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 50%, rgba(240,180,41,0.08) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 20% 80%, rgba(0,212,170,0.06) 0%, transparent 60%);
  pointer-events: none;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: var(--gold);
  margin-bottom: 1.5rem;
  opacity: 0.8;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(4rem, 10vw, 9rem);
  font-weight: 900;
  font-style: italic;
  line-height: 0.9;
  letter-spacing: -2px;
  background: linear-gradient(135deg, #fff 0%, var(--gold) 50%, var(--teal) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.5rem;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--sub);
  max-width: 500px;
  margin: 0 auto 3rem;
  font-weight: 300;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  border: none;
  transition: all 0.25s;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: var(--night);
  box-shadow: var(--glow-gold);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 50px rgba(240,180,41,0.4); }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border2);
}
.btn-secondary:hover { background: var(--card); border-color: var(--teal); color: var(--teal); }

.btn-teal {
  background: linear-gradient(135deg, var(--teal), var(--teal2));
  color: var(--night);
  box-shadow: var(--glow-teal);
}
.btn-teal:hover { transform: translateY(-2px); }

.btn-sm {
  padding: 8px 16px;
  font-size: 11px;
}

/* ===== SECTION ===== */
.section {
  padding: 6rem 2rem;
  max-width: 1300px;
  margin: 0 auto;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  font-style: italic;
  margin-bottom: 0.5rem;
}

.section-sub {
  color: var(--sub);
  font-size: 0.9rem;
  margin-bottom: 3rem;
}

/* ===== CARDS ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s;
}

.card:hover {
  border-color: var(--border2);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

/* ===== GAME CARDS ===== */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.game-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  display: block;
  color: var(--text);
}

.game-card:hover {
  border-color: var(--gold);
  transform: translateY(-6px);
  box-shadow: var(--shadow), var(--glow-gold);
}

.game-card-thumb {
  width: 100%;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  position: relative;
  overflow: hidden;
}

.game-card-body {
  padding: 1.25rem 1.5rem 1.5rem;
}

.game-card-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.game-card-desc {
  font-size: 0.8rem;
  color: var(--sub);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.game-card-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid;
}

/* ===== VOYAGE TOOLS ===== */
.voyage-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.25rem;
}

.voyage-tool {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s;
  overflow: hidden;
  position: relative;
}

.voyage-tool:hover {
  border-color: var(--teal);
  box-shadow: var(--glow-teal);
  transform: translateY(-3px);
}

.voyage-tool.large { grid-column: span 8; min-height: 320px; }
.voyage-tool.medium { grid-column: span 4; min-height: 200px; }
.voyage-tool.small { grid-column: span 4; min-height: 160px; }
.voyage-tool.full { grid-column: span 12; }

@media (max-width: 900px) {
  .voyage-tool.large, .voyage-tool.medium, .voyage-tool.small, .voyage-tool.full {
    grid-column: span 12;
  }
  .voyage-grid { grid-template-columns: 1fr; }
}

.tool-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.tool-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}
.tool-desc { font-size: 0.75rem; color: var(--sub); }

/* ===== TOOL MODAL ===== */
.tool-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(20px);
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.tool-modal.open { display: flex; }

.tool-modal-box {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  width: 90%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  scrollbar-width: none;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.3s cubic-bezier(.34,1.56,.64,1);
}

@keyframes modalIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.tool-modal-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tool-modal-body { padding: 2rem; }

/* ===== GAME PAGE ===== */
.game-page {
  min-height: 100vh;
  padding-top: 70px;
  display: flex;
  flex-direction: column;
}

.game-header {
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--deep);
}

.game-back {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  font-size: 1.2rem;
  transition: all 0.2s;
  flex-shrink: 0;
}
.game-back:hover { background: var(--card2); border-color: var(--gold); color: var(--gold); }

.game-title-bar {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  font-style: italic;
}

.game-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

/* ===== INPUTS ===== */
.input {
  width: 100%;
  background: var(--deep);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.input:focus { border-color: var(--teal); }
.input::placeholder { color: var(--sub); }

select.input { cursor: pointer; }

.label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--sub);
  margin-bottom: 6px;
}

/* ===== SCORE BADGE ===== */
.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
}

/* ===== DIVIDER ===== */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ===== BADGE ===== */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.badge-gold { background: rgba(240,180,41,0.15); color: var(--gold); border: 1px solid rgba(240,180,41,0.3); }
.badge-teal { background: rgba(0,212,170,0.15); color: var(--teal); border: 1px solid rgba(0,212,170,0.3); }
.badge-coral { background: rgba(255,107,107,0.15); color: var(--coral); border: 1px solid rgba(255,107,107,0.3); }
.badge-sky { background: rgba(79,195,247,0.15); color: var(--sky); border: 1px solid rgba(79,195,247,0.3); }

/* ===== TOAST ===== */
#toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: 999px;
  padding: 12px 24px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  z-index: 9999;
  transition: transform 0.3s cubic-bezier(.34,1.56,.64,1);
  white-space: nowrap;
}
#toast.show { transform: translateX(-50%) translateY(0); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--night); }
::-webkit-scrollbar-thumb { background: var(--card2); border-radius: 3px; }

/* ===== ANIM UTILS ===== */
@keyframes fadeIn { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.5} }
@keyframes spin { to{transform:rotate(360deg)} }
@keyframes shimmer {
  0%{background-position:-200% 0}
  100%{background-position:200% 0}
}

.fade-in { animation: fadeIn 0.6s ease forwards; }
.fade-in-delay-1 { animation: fadeIn 0.6s 0.1s ease forwards; opacity: 0; }
.fade-in-delay-2 { animation: fadeIn 0.6s 0.2s ease forwards; opacity: 0; }
.fade-in-delay-3 { animation: fadeIn 0.6s 0.3s ease forwards; opacity: 0; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav { padding: 0 0.75rem; height: 60px; }
  .nav-logo { font-size: 1.1rem; }
  .nav-tabs { gap: 2px; }
  .nav-tab { padding: 5px 8px; font-size: 9px; letter-spacing: 0; }
  .nav-right { gap: 6px; }
  .nav-right .btn { padding: 6px 10px; font-size: 10px; }
  .main { padding-top: 60px; }
  .section { padding: 3rem 0.75rem; }
  .hero { padding: 1.5rem 1rem; min-height: 80vh; }
  .hero-title { font-size: clamp(3rem, 15vw, 6rem); }
  .hero-ctas { flex-direction: column; align-items: center; gap: 0.75rem; }
  .hero-ctas .btn { width: 100%; max-width: 280px; justify-content: center; }
  .game-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
  .game-card-thumb { height: 120px; }
  .game-card-title { font-size: 1rem; }
  .voyage-tool.large { grid-column: span 12; min-height: 200px; }
  .voyage-tool.medium { grid-column: span 12; min-height: 150px; }
  .voyage-tool.small { grid-column: span 12; min-height: 120px; }
  /* Auth screen mobile */
  .auth-card { padding: 1.5rem; border-radius: 1.5rem; }
  /* Profile screen */
  .profile-hero { padding: 3rem 1rem 2rem; }
  /* Tool modals */
  .tool-modal-box { border-radius: 1rem; }
  .tool-modal-body { padding: 1.25rem; }
}

@media (max-width: 480px) {
  .nav-tabs { display: none; } /* Cache les tabs nav sur très petit écran */
  .nav-logo { font-size: 1.2rem; }
  .game-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .game-card-thumb { height: 100px; font-size: 3rem !important; }
  .game-card-body { padding: 0.75rem 1rem 1rem; }
  .game-card-title { font-size: 0.9rem; }
  .hero-title { font-size: clamp(2.5rem, 18vw, 5rem); }
  .section-title { font-size: clamp(1.5rem, 8vw, 2.5rem); }
}

/* Bouton connexion toujours visible */
@media (max-width: 380px) {
  .nav-right .btn { padding: 5px 8px; font-size: 9px; }
  .points-badge { display: none; } /* Cache les points sur très petit écran */
}

/* ===== LOADING SPINNER ===== */
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border2);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ===== WORLD MAP TOOL ===== */
#world-map-svg path {
  fill: var(--card2);
  stroke: var(--border);
  stroke-width: 0.5;
  cursor: pointer;
  transition: fill 0.2s;
}
#world-map-svg path:hover { fill: var(--teal); }
#world-map-svg path.selected { fill: var(--gold); }
