/* Majin League 3 - Styles jeu intégré site D.Majin */

.container-jeu {
  max-width: 720px;
  padding: 0 var(--space-md);
}

.jeu-page-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.5rem);
  letter-spacing: 0.08em;
  color: var(--blanc);
  text-align: center;
  margin-bottom: var(--space-xs);
}

.jeu-page-subtitle {
  text-align: center;
  color: var(--gris);
  font-size: 1rem;
  margin-bottom: var(--space-xl);
}

.jeu-embed-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 0 var(--space-xl);
}

.jeu-frame {
  width: 100%;
  max-width: 640px;
  padding: 12px;
  background: linear-gradient(145deg, #1a1a2e 0%, #0f3460 100%);
  border-radius: 12px;
  border: 3px solid rgba(0, 245, 212, 0.3);
  box-shadow:
    0 0 0 1px rgba(0, 245, 212, 0.1),
    0 0 40px rgba(0, 245, 212, 0.08),
    inset 0 0 60px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.jeu-iframe {
  width: 640px;
  height: 480px;
  max-width: 100%;
  aspect-ratio: 4 / 3;
  border: none;
  border-radius: 6px;
  display: block;
  background: #0a0a0b;
  overflow: hidden;
  touch-action: manipulation;
}

@media (max-width: 680px) {
  .section-jeu .container-jeu { padding: 0 4px; max-width: 100%; }
  .section-jeu .jeu-page-title { margin-bottom: 0.5rem; }
  .section-jeu .jeu-page-subtitle { margin-bottom: 0.5rem; font-size: 0.85rem; }
  .jeu-embed-wrapper { margin: 0; }
  .jeu-frame {
    padding: 2px;
    max-width: 100%;
    width: 100%;
  }
  .jeu-iframe {
    width: 100%;
    height: calc(100vh - 140px);
    min-height: 450px;
  }
}

.section-jeu .section-nav {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-top: var(--space-lg);
}

@media (max-width: 480px) {
  .jeu-frame { padding: 2px; }
  .jeu-iframe {
    min-height: 420px;
    height: calc(100vh - 120px);
  }
  .jeu-page-title { font-size: 1.3rem !important; }
  .jeu-page-subtitle { font-size: 0.85rem !important; }
  .section-nav .btn-page-link { font-size: 0.8rem; padding: 8px 12px; }
}

#game-container .hidden { display: none !important; }

#game-container {
  pointer-events: auto;
  width: 640px;
  height: 480px;
  background: #8b7355;
  border: 8px solid #5c4033;
  border-radius: 4px;
  box-shadow: inset 0 0 0 4px #a08060, inset 0 0 0 8px #5c4033, 0 0 20px rgba(0,0,0,0.5);
  overflow: hidden;
  position: relative;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

#game-container #title-screen {
  width: 100%; height: 100%;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  display: flex; align-items: center; justify-content: center; flex-direction: column;
}
#game-container .pixel-logo { text-align: center; color: #fff; }
#game-container .pixel-logo h1 { font-size: 24px; color: #ffd700; text-shadow: 3px 3px 0 #8b4513; margin-bottom: 20px; letter-spacing: 2px; }
#game-container .subtitle { font-size: 10px; color: #87ceeb; margin-bottom: 40px; }
#game-container .press-start { font-size: 8px; color: #ff6b6b; animation: jeu-blink 1s infinite; margin-bottom: 16px; }
#game-container .start-btn { margin-top: 8px; }
@keyframes jeu-blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0.3; } }

#game-container #world-map { width: 100%; height: 100%; background: #78c850; position: relative; }
#game-container .map-container { width: 100%; height: 100%; position: relative; overflow: hidden; image-rendering: pixelated; image-rendering: crisp-edges; }
#game-container #map-grid { width: 640px; height: 480px; background: #78c850; position: relative; }
#game-container #map-canvas { display: block; width: 100%; height: 100%; }
#game-container #player-sprite {
  position: absolute; width: 32px; height: 32px; background: transparent;
  background-image: url(assets/jeu/player_walk.png); background-position: 0 0; background-repeat: no-repeat; background-size: 128px 128px;
  image-rendering: pixelated; image-rendering: crisp-edges; top: 0; left: 0; overflow: hidden; transition: none; z-index: 10;
}
#game-container .npc-wrap { display: flex; align-items: center; }
#game-container .npc-sprite { position: relative; width: 32px; height: 32px; flex-shrink: 0; background: transparent; background-repeat: no-repeat; image-rendering: pixelated; image-rendering: crisp-edges; z-index: 6; }
#game-container .dialogue-box {
  position: absolute; bottom: 40px; left: 16px; right: 16px;
  background: rgba(0,0,0,0.9); border: 4px solid #ffd700; padding: 12px; z-index: 20;
}
#game-container .dialogue-box .dialogue-name { font-size: 8px; color: #ffd700; display: block; margin-bottom: 8px; }
#game-container .dialogue-box .dialogue-text { font-size: 8px; color: #fff; line-height: 1.5; margin-bottom: 8px; }
#game-container .dialogue-box .dialogue-hint { font-size: 6px; color: #888; }
#game-container .map-ui { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,0.7); padding: 8px; display: flex; justify-content: space-between; align-items: center; }
#game-container .day-counter { font-size: 8px; color: #fff; }
#game-container .artifacts-btn { font-size: 8px; color: #ffd700; cursor: pointer; padding: 6px 12px; border: 3px solid #5a4a8a; background: linear-gradient(145deg, #3a3550 0%, #2a2540 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 2px 4px rgba(0,0,0,0.3); }
#game-container .artifacts-btn:hover { background: linear-gradient(145deg, #4a4560 0%, #3a3550 100%); border-color: #ffd700; }

#game-container #building-screen {
  width: 100%; height: 100%;
  background: repeating-linear-gradient(90deg, #3a3550 0px, #3a3550 8px, #2a2540 8px, #2a2540 16px), repeating-linear-gradient(0deg, #3a3550 0px, #3a3550 8px, #2a2540 8px, #2a2540 16px);
  background-color: #2a2540; display: flex; align-items: center; justify-content: center;
}
#game-container .building-interior { background: linear-gradient(145deg, #4a4058 0%, #3a3550 50%, #2a2540 100%); border: 6px solid #6a5a8a; padding: 20px; max-width: 90%; text-align: center; box-shadow: inset 0 0 0 2px #8a7aba, 0 0 20px rgba(0,0,0,0.4); }
#game-container .building-interior h2 { font-size: 14px; color: #ffd700; margin-bottom: 10px; }
#game-container .building-desc { font-size: 8px; color: #ccc; margin-bottom: 20px; }
#game-container #trainers-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
#game-container .trainer-option { background: #4a3728; border: 3px solid #6b5344; padding: 12px; cursor: pointer; transition: all 0.2s; display: flex; flex-direction: column; align-items: center; gap: 4px; }
#game-container .trainer-option:hover { background: #5c4636; border-color: #ffd700; transform: scale(1.02); }
#game-container .trainer-option:disabled { opacity: 0.5; cursor: not-allowed; }
#game-container .trainer-option:disabled:hover { transform: none; }
#game-container .trainer-icon { width: 32px; height: 32px; background-size: 384px 192px; background-repeat: no-repeat; image-rendering: pixelated; image-rendering: crisp-edges; display: block; margin: 0 auto 4px; }
#game-container .trainer-option span:nth-child(2) { font-size: 8px; color: #fff; }
#game-container .trainer-theme { font-size: 6px !important; color: #87ceeb !important; }

#game-container #battle-screen { width: 100%; height: 100%; position: relative; overflow: hidden; }
#game-container .battle-bg { position: absolute; width: 100%; height: 100%; background: linear-gradient(180deg, #88d0a8 0%, #88d0a8 45%, #78c850 45%, #78c850 100%); background-color: #78c850; }
#game-container .battle-container { position: relative; z-index: 1; width: 100%; height: 100%; padding: 16px; display: flex; flex-direction: column; }
#game-container .battle-sprites-area { flex: 1; display: flex; flex-direction: column; justify-content: space-around; min-height: 180px; }
#game-container .battle-enemy, #game-container .battle-player { display: flex; align-items: center; gap: 16px; }
#game-container .enemy-sprite, #game-container .player-sprite-battle {
  width: 120px; height: 120px; min-width: 120px; min-height: 120px; background: transparent;
  background-image: url(assets/jeu/sprites_player.png); background-repeat: no-repeat;
  background-size: 1440px 720px; image-rendering: pixelated; image-rendering: crisp-edges; flex-shrink: 0;
}
#game-container .player-sprite-battle { background-image: url(assets/jeu/player_walk.png); background-size: 480px 480px; }
#game-container .enemy-info span, #game-container .player-info span { font-size: 8px; color: #fff; display: block; margin-bottom: 4px; }
#game-container .hp-bar-container { background: #333; border: 2px solid #000; height: 16px; position: relative; }
#game-container .hp-bar { height: 100%; transition: width 0.3s; }
#game-container .enemy-hp { background: #ff4444; }
#game-container .player-hp { background: #44ff44; }
#game-container .hp-text { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font-size: 6px; color: #fff; }
#game-container .battle-message { background: #2c3e6a; border: 4px solid #1a2a4a; padding: 12px; margin: 10px 0; font-size: 8px; color: #fff; min-height: 48px; }
#game-container .battle-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#game-container .choice-btn {
  font-family: 'Press Start 2P', cursive; font-size: 8px; padding: 12px;
  background: linear-gradient(180deg, #5aa0e8 0%, #3a70b8 50%, #2d5a8a 100%); border: 3px solid #2d5a8a;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 2px 4px rgba(0,0,0,0.3); color: #fff; cursor: pointer; transition: all 0.2s; image-rendering: pixelated;
}
#game-container .choice-btn:hover { background: linear-gradient(180deg, #6ab0f8 0%, #4a80c8 50%, #3d6a9a 100%); filter: brightness(1.1); }
#game-container .choice-btn:disabled { opacity: 0.6; cursor: not-allowed; }

#game-container #artifacts-screen {
  width: 100%; height: 100%;
  background: repeating-linear-gradient(90deg, #2a3560 0px, #2a3560 8px, #1e2850 8px, #1e2850 16px), repeating-linear-gradient(0deg, #2a3560 0px, #2a3560 8px, #1e2850 8px, #1e2850 16px);
  background-color: #1e2850; display: flex; align-items: center; justify-content: center;
}
#game-container .artifacts-container { background: linear-gradient(145deg, #3d3560 0%, #2a2548 50%, #1e1a38 100%); border: 6px solid #6a5a9a; border-radius: 8px; padding: 24px; text-align: center; box-shadow: inset 0 0 0 4px #8a7aba, inset 0 0 40px rgba(100, 80, 140, 0.3), 0 0 20px rgba(0, 0, 0, 0.5); }
#game-container .artifacts-container h2 { font-size: 12px; color: #ffd700; margin-bottom: 20px; }
#game-container #artifacts-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
#game-container .artifact-slot {
  width: 80px; height: 80px; background: linear-gradient(145deg, #3a3550 0%, #2a2540 100%); border: 3px solid #5a4a8a;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.4), inset 0 0 0 1px rgba(255,255,255,0.05);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
#game-container .artifact-slot.obtained { background: linear-gradient(145deg, #4a5c3a 0%, #3a4c2a 100%); border-color: #ffd700; box-shadow: inset 0 0 0 2px #ffd700, inset 0 0 20px rgba(255, 215, 0, 0.2); }
#game-container .artifact-slot.obtained .artifact-icon { color: #ffd700; }
#game-container .artifact-icon { font-size: 24px; color: #666; }
#game-container .artifact-name { font-size: 6px; color: #888; }
#game-container .artifact-slot.obtained .artifact-name { color: #ffd700; }

#game-container .pixel-btn { font-family: 'Press Start 2P', cursive; font-size: 8px; padding: 10px 20px; background: #4a90d9; border: 3px solid #2d5a8a; color: #fff; cursor: pointer; transition: all 0.2s; }
#game-container .pixel-btn:hover { background: #6aa8f0; }

#game-container #result-screen { width: 100%; height: 100%; background: rgba(0,0,0,0.9); display: flex; align-items: center; justify-content: center; position: absolute; top: 0; left: 0; }
#game-container .result-content { background: #2d2d44; border: 6px solid #ffd700; padding: 30px; text-align: center; }
#game-container .result-content h2 { font-size: 16px; margin-bottom: 16px; }
#game-container .result-content.victory h2 { color: #44ff44; }
#game-container .result-content.defeat h2 { color: #ff4444; }
#game-container #result-message { font-size: 8px; color: #ccc; margin-bottom: 20px; line-height: 1.6; }

.section-leaderboard-page {
  position: relative;
}

.container-leaderboard {
  max-width: 980px;
}

.leaderboard-hero {
  margin: 0 0 var(--space-lg);
  border-radius: 18px;
  border: 1px solid rgba(0, 245, 212, 0.28);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(0, 245, 212, 0.2), transparent 55%),
    radial-gradient(100% 120% at 100% 0%, rgba(245, 158, 11, 0.2), transparent 60%),
    linear-gradient(160deg, rgba(10, 18, 32, 0.95), rgba(10, 14, 20, 0.95));
  padding: clamp(1rem, 3vw, 1.5rem);
}

.leaderboard-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.8rem;
}

.leaderboard-kpi {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.85rem;
}

.leaderboard-kpi-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gris, #9ca3af);
}

.leaderboard-kpi-value {
  display: block;
  margin-top: 0.25rem;
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: #fff;
}

.leaderboard-legend {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.lb-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #0a0e14;
}

.lb-common { background: #22c55e; }
.lb-rare { background: #3b82f6; color: #f8fafc; }
.lb-epic { background: #a855f7; color: #f8fafc; }
.lb-legendary { background: #f59e0b; }

.lb-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.lb-breakdown-item {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.18rem 0.48rem;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}

.leaderboard-status {
  margin: 0.75rem 0 0;
  min-height: 1.2em;
  color: var(--gris, #9ca3af);
  font-size: 0.85rem;
}

.leaderboard-status.error {
  color: #f87171;
}

.leaderboard-card {
  border-radius: 16px;
  border: 1px solid rgba(0, 245, 212, 0.2);
  overflow: hidden;
  background: rgba(10, 14, 20, 0.9);
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 0.8rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.9rem;
}

.leaderboard-table th {
  background: rgba(0, 245, 212, 0.08);
  color: #e5e7eb;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
}

.leaderboard-row-top {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.12), transparent 55%);
}

.leaderboard-rank {
  font-family: var(--font-display);
  letter-spacing: 0.04em;
}

.leaderboard-player {
  font-weight: 600;
}

.leaderboard-points {
  color: #00f5d4;
  font-weight: 700;
}

.leaderboard-empty {
  text-align: center !important;
  color: var(--gris, #9ca3af);
}
