/* ==========================================================================
   Cobblemon Academy — compléments « famille Pixelcraft »
   (family.css apporte le menu Pixelcraft et la visite animée ; on garde ici
   la palette marine de l'Academy et les scènes propres à The Rise)
   ========================================================================== */

body { background: var(--navy-950); }
.footer { background: #040b1b; }
.tour--rise .tour__tab.is-active { background: linear-gradient(180deg, #2a1256, #1b0c3a); }
.tour--rise .stage { background: radial-gradient(70% 60% at 50% 110%, rgba(142, 75, 255, .5), transparent 70%), linear-gradient(180deg, #231046, #150a2e); }

/* Scène : capture */
.catch { position: relative; display: grid; place-items: center; width: 320px; height: 250px; }
.catch > * { grid-area: 1 / 1; }
.catch__wild {
  width: 120px; height: 100px; border-radius: 50% 50% 44% 44% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 35% 35%, #7a6aa8, #3b2e66 70%);
  box-shadow: 0 0 40px rgba(200, 162, 255, .5);
  transform: translateY(-30px); opacity: 0;
}
.catch__wild::before, .catch__wild::after {
  content: ""; position: absolute; top: -18px; width: 26px; height: 40px; border-radius: 50% 50% 0 0; background: #3b2e66;
}
.catch__wild::before { left: 18px; transform: rotate(-18deg); }
.catch__wild::after { right: 18px; transform: rotate(18deg); }
.pokeball {
  position: relative; width: 64px; height: 64px; border-radius: 50%; overflow: hidden;
  background: linear-gradient(180deg, #e8574c 0 46%, #1b1b1b 46% 54%, #f4f4f4 54%);
  border: 4px solid #1b1b1b; box-shadow: 0 10px 18px rgba(0, 0, 0, .45);
  transform: translateY(40px);
}
.pokeball i {
  position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%;
  background: #f4f4f4; border: 4px solid #1b1b1b;
}
.catch__star {
  width: 14px; height: 14px; background: var(--gold); opacity: 0;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}
.catch__done {
  align-self: start; padding: 6px 16px; border-radius: 12px; background: var(--gold); color: var(--gold-ink);
  border: 2px solid var(--gold-edge); box-shadow: 0 4px 0 var(--gold-edge); font-family: var(--font-display); font-size: 22px;
}
.scene--catch.is-active .catch__wild { animation: wild 1.3s ease both; }
.scene--catch.is-active .pokeball { animation: throwBall .8s cubic-bezier(.3, .6, .4, 1) .3s both, wobble 1.6s ease 1.3s both; }
.scene--catch.is-active .pokeball i { animation: blink .3s ease 2.9s 2 both; }
.scene--catch.is-active .catch__star { animation: starOut .8s ease calc(3s + var(--d, 0s)) both; }
.scene--catch.is-active .catch__done { animation: popIn .5s cubic-bezier(.2, .9, .3, 1.5) 3.1s both; }
@keyframes wild {
  0% { opacity: 0; transform: translateY(-10px) scale(.6); }
  30%, 70% { opacity: 1; transform: translateY(-30px) scale(1); filter: none; }
  85% { opacity: 1; filter: brightness(3); transform: translateY(30px) scale(.4); }
  100% { opacity: 0; transform: translateY(40px) scale(.1); }
}
@keyframes throwBall {
  from { transform: translate(-150px, 120px) rotate(-360deg) scale(.7); }
  60% { transform: translate(-30px, -60px) rotate(-60deg); }
  to { transform: translateY(40px); }
}
@keyframes wobble {
  0%, 100% { transform: translateY(40px); }
  15% { transform: translateY(40px) rotate(-22deg); } 30% { transform: translateY(40px) rotate(18deg); }
  50% { transform: translateY(40px) rotate(-14deg); } 65% { transform: translateY(40px) rotate(10deg); }
  80% { transform: translateY(40px) rotate(-4deg); }
}
@keyframes blink { 50% { background: #ffe07a; box-shadow: 0 0 12px #ffd54f; } }
@keyframes starOut { from { opacity: 1; transform: translate(0, 30px) scale(.4); } to { opacity: 0; transform: translate(var(--x), calc(var(--y) + 30px)) scale(1.2) rotate(90deg); } }

/* Scène : Maisons */
.houses { display: flex; align-items: end; justify-content: center; gap: 22px; height: 250px; }
.house { position: relative; display: grid; justify-items: center; gap: 6px; width: 96px; height: 100%; align-content: end; }
.house__bar { position: relative; width: 70px; height: 160px; border-radius: 14px 14px 6px 6px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); overflow: hidden; }
.house__bar i { position: absolute; left: 0; right: 0; bottom: 0; height: var(--h); background: linear-gradient(180deg, color-mix(in srgb, var(--c) 70%, white), var(--c)); border-radius: 12px 12px 0 0; }
.house__crest {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; margin-top: -30px; z-index: 1;
  background: var(--c); color: #fff; border: 3px solid rgba(0, 0, 0, .35); box-shadow: 0 4px 0 rgba(0, 0, 0, .35);
}
.house__crest svg { width: 24px; height: 24px; }
.house small { font-weight: 900; letter-spacing: .06em; text-transform: uppercase; font-size: 12px; color: var(--text-soft); }
.house__pts { font-size: 13px; font-weight: 900; color: #fff; }
.house--you .house__bar { border: 2px solid var(--gold); }
.house__plus {
  position: absolute; top: 20px; padding: 3px 10px; border-radius: 9px; background: var(--gold); color: var(--gold-ink);
  border: 2px solid var(--gold-edge); font-weight: 900; opacity: 0;
}
.scene--houses.is-active .house__bar i { animation: grow 1.2s cubic-bezier(.3, .8, .3, 1) var(--d) both; }
.scene--houses.is-active .house--you .house__bar i { animation: grow 1.2s cubic-bezier(.3, .8, .3, 1) var(--d) both, bump .6s ease 2.4s both; }
.scene--houses.is-active .house__plus { animation: plusUp 1.4s ease 2.2s both; }
@keyframes grow { from { height: 0; } }
@keyframes bump { from { height: calc(var(--h) - 8%); } }
@keyframes plusUp { 0% { opacity: 0; transform: translateY(20px); } 25%, 70% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-20px); } }

/* Scène : quêtes du jour */
.quests { display: grid; gap: 10px; width: min(100%, 430px); }
.quests__head { display: flex; justify-content: space-between; align-items: baseline; }
.quests__head b { font-family: var(--font-display); font-weight: 400; font-size: 22px; text-transform: uppercase; }
.quests__head span { color: var(--rise-300); font-size: 12px; font-weight: 900; }
.quest {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center;
  padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(200, 162, 255, .3);
}
.quest b { display: block; font-size: 14px; margin-bottom: 6px; }
.quest__ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: rgba(142, 75, 255, .25); color: var(--rise-300); }
.quest__ico svg { width: 20px; height: 20px; }
.quest__bar { height: 8px; border-radius: 8px; background: rgba(0, 0, 0, .35); overflow: hidden; }
.quest__bar i { display: block; height: 100%; width: var(--p); background: linear-gradient(90deg, #8e4bff, #c8a2ff); border-radius: 8px; }
.quest__ok { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #16361c; border: 2px solid #46a84b; color: #8be98f; }
.quest__ok svg { width: 16px; height: 16px; }
.quest__count { font-weight: 900; color: var(--rise-300); font-size: 13px; }
.quest:not(.quest--open) { border-color: #46a84b; }
.quest:not(.quest--open) .quest__bar i { background: linear-gradient(90deg, #3c9e45, #8be98f); }
.scene--quests.is-active .quest { animation: slideIn .5s ease calc(var(--d) - .2s) both; }
.scene--quests.is-active .quest__bar i { animation: fillW .7s ease var(--d) both; }
.scene--quests.is-active .quest__ok { animation: popIn .4s cubic-bezier(.2, .9, .3, 1.6) calc(var(--d) + .7s) both; }
@keyframes fillW { from { width: 0; } }

/* Scène : World Boss */
.boss { display: grid; gap: 14px; width: min(100%, 440px); }
.boss__head { display: flex; align-items: center; gap: 10px; }
.boss__head b { font-family: var(--font-display); font-weight: 400; font-size: 26px; }
.boss__hp { position: relative; height: 30px; border-radius: 10px; background: #2a0f12; border: 2px solid #7a1c14; overflow: hidden; }
.boss__hp i { position: absolute; inset: 0; right: 100%; background: linear-gradient(180deg, #ff8a80, #e8574c 50%, #b8352c); }
.boss__hp span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; text-shadow: 0 1px 2px #000; }
.boss__hits { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.boss__hits span {
  display: flex; align-items: center; justify-content: center; gap: 6px; padding: 6px; border-radius: 12px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 138, 128, .35); color: #ff8a80; font-weight: 900; font-size: 15px;
}
.boss__hits img { width: 28px; height: 28px; border-radius: 7px; image-rendering: pixelated; }
.boss__win { justify-self: center; padding: 8px 18px; border-radius: 14px; background: #16361c; border: 2px solid #46a84b; color: #8be98f; font-weight: 900; }
.scene--boss.is-active .boss__hp i { animation: bossHp 2.4s steps(1, end) .4s both; }
.scene--boss.is-active .boss__hits span { animation: popIn .4s cubic-bezier(.2, .9, .3, 1.5) var(--d) both; }
.scene--boss.is-active .boss__win { animation: popIn .5s cubic-bezier(.2, .9, .3, 1.5) 2.9s both; }
@keyframes bossHp { 0% { right: 0; } 25% { right: 18%; } 45% { right: 42%; } 65% { right: 73%; } 85%, 100% { right: 100%; } }

/* Menu plus chargé depuis l'ajout du menu Pixelcraft : le compteur en ligne passe au-dessus de 1480 px seulement */
@media (max-width: 1480px) { .nav__online { display: none; } }
/* Au-delà, la barre s'élargit pour que le compteur tienne sur une ligne à côté de tous les liens */
@media (min-width: 1481px) { .nav__bar { width: min(1340px, 100% - 32px); } }

@media (max-width: 520px) {
  .scene { padding: 18px; }
  .houses { gap: 12px; }
  .house { width: 78px; }
  .house__bar { width: 58px; }
  .catch { width: 100%; }
}
