/* Training has a visible forge phase, then a player-controlled, full-screen reveal. */
.academy-card.is-training {
  border-color: #70e0e9;
  background: linear-gradient(140deg, #1e5069, #102c43);
  color: #ecf6dd;
  box-shadow:
    inset 0 0 0 2px #348ca0,
    0 5px #092338,
    0 0 18px #58ddec33;
}
.academy-card.is-training > p {
  color: #c7dedb;
}
.academy-card.is-training .academy-benefits {
  color: #f3f6db;
}
.academy-card.is-training .academy-benefits strong {
  color: #c4f7a2;
}
.academy-card.is-training .academy-benefits small {
  color: #c1dddd;
}
.academy-card.is-training .academy-portrait {
  background: radial-gradient(ellipse, #4fbab5, #16394f 75%);
}
.academy-card.is-training .academy-portrait::after {
  content: '';
  position: absolute;
  inset: -30% -80%;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 40%, #c9ffff77 48%, transparent 56%);
  animation: training-polish 2.4s ease-in-out infinite;
}
.academy-timer {
  gap: 8px;
  padding: 10px;
  border: 1px solid #66bac0;
  border-radius: 14px;
  background: #0c293b;
  color: #d7f5ef;
}
.training-forge-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.training-forge-label img {
  width: 29px;
  height: 29px;
  animation: training-hammer 0.9s ease-in-out infinite alternate;
}
.training-forge-label b {
  font:
    18px/1.1 'Lilita One',
    sans-serif;
  color: #ffe6a1;
}
.training-countdown {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.academy-timer .training-countdown span {
  font:
    18px 'Lilita One',
    sans-serif;
  color: #b1fcff;
}
.training-countdown strong {
  font:
    20px 'Lilita One',
    sans-serif;
  color: #ffe291;
}
.training-countdown i {
  font-style: normal;
  color: #89b6c3;
}
.academy-timer small {
  font-size: 12px;
  color: #b4d4d7;
}
.academy-timer progress {
  appearance: none;
  -webkit-appearance: none;
  height: 17px;
  border: 1px solid #619dad;
  background: #081e30;
  border-radius: 9px;
  overflow: hidden;
}
.academy-timer progress::-webkit-progress-bar {
  background: #081e30;
  border-radius: 9px;
}
.academy-timer progress::-webkit-progress-value {
  background: repeating-linear-gradient(115deg, #f8e78c 0 10px, #d4ab43 10px 18px);
  border-radius: 8px;
  box-shadow: inset 0 3px #fff7bd88;
  transition: width 0.5s linear;
}
.academy-timer progress::-moz-progress-bar {
  background: repeating-linear-gradient(115deg, #f8e78c 0 10px, #d4ab43 10px 18px);
  border-radius: 8px;
}
#training-reveal {
  transform: none;
  border-radius: 0;
  box-shadow: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  color: #fff1bf;
  background: radial-gradient(ellipse at 50% 40%, #287888 0%, #133b56 36%, #081c33 77%);
}
#training-reveal::backdrop {
  background: #081c33;
}
.training-triumph {
  overflow: hidden;
  position: relative;
  isolation: isolate;
  height: 100%;
  padding: max(18px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  box-sizing: border-box;
}
.training-triumph::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: 0.12;
  background: url('art/training-camp.webp') center/cover;
  mask-image: linear-gradient(transparent, #000 45%, transparent);
  -webkit-mask-image: linear-gradient(transparent, #000 45%, transparent);
}
.training-halo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(900px, 130vw);
  aspect-ratio: 1;
  z-index: -1;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(from 10deg, #b9edbb22 0deg 9deg, transparent 9deg 27deg);
  mask-image: radial-gradient(#000, transparent 68%);
  -webkit-mask-image: radial-gradient(#000, transparent 68%);
}
.training-complete-kicker {
  font:
    900 13px 'Nunito',
    sans-serif;
  color: #91ede9;
  letter-spacing: 3px;
}
#training-reveal h2 {
  margin: 6px 0 0;
  font:
    clamp(28px, 6vw, 42px) / 1 'Lilita One',
    sans-serif;
  font-weight: 400;
  color: #fef0bd;
  text-shadow:
    0 3px #72502b,
    0 6px 15px #00172b;
}
#training-reveal h2 span {
  display: block;
  margin-top: 5px;
  font-size: clamp(36px, 8vw, 58px);
  color: #ffe18c;
}
.training-champion {
  position: relative;
  display: grid;
  place-items: center;
  width: 230px;
  height: clamp(170px, 28dvh, 320px);
  flex-shrink: 1;
  min-height: 130px;
}
.training-champion > svg {
  height: 100%;
  max-width: 100%;
  width: auto;
  aspect-ratio: 5/6;
  border: 4px solid #ffe897;
  border-radius: 28px;
  background: #12344b;
  box-shadow:
    0 7px #997139,
    0 0 0 3px #cc963f,
    0 0 50px #7afbf06b;
  transform: rotate(-4deg);
}
.training-champion-glow {
  position: absolute;
  inset: -20%;
  z-index: -1;
  background: radial-gradient(ellipse, #d7ffff80, transparent 67%);
}
.training-rank-seal {
  position: absolute;
  bottom: -7px;
  right: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 74px;
  padding: 7px 14px;
  color: #684320;
  border: 3px solid #fff1b4;
  border-radius: 18px;
  background: linear-gradient(#ffeda6, #e8b14b);
  box-shadow:
    0 5px #895c2e,
    0 0 20px #ffe7a94d;
  transform: rotate(4deg);
}
.training-rank-seal small {
  font:
    1000 11px 'Nunito',
    sans-serif;
}
.training-rank-seal b {
  font:
    44px/1 'Lilita One',
    sans-serif;
  grid-column: 1;
  grid-row: 2;
  transition:
    opacity 0.25s,
    transform 0.45s;
}
.rank-earned {
  opacity: 0;
  transform: translateY(20px) scale(0.5);
}
.rank-revealed .rank-was {
  opacity: 0;
  transform: translateY(-20px) scale(0.8);
}
.rank-revealed .rank-earned {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.training-triumph-details {
  width: min(550px, 100%);
}
.training-triumph-copy {
  color: #d3e8e6;
  font:
    700 15px/1.35 'Nunito',
    sans-serif;
  margin: 4px auto 12px;
  max-width: 480px;
}
.training-reveal-stats {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin: 0 auto;
}
.training-reveal-stat {
  flex: 1;
  min-width: 0;
}
.training-reveal-stat > img {
  width: 42px;
  height: 44px;
  filter: drop-shadow(0 3px 2px #092135);
}
.training-reveal-stat > span {
  display: block;
  font:
    18px 'Lilita One',
    sans-serif;
  color: #e2e8d4;
}
.training-reveal-stat > div:not(.reveal-power-track) {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.training-reveal-stat small {
  color: #8eafb9;
  text-decoration: line-through;
  font:
    18px 'Lilita One',
    sans-serif;
}
.training-reveal-stat strong {
  font:
    36px 'Lilita One',
    sans-serif;
  color: #d6ffff;
  text-shadow: 0 3px #17536b;
}
.training-reveal-stat b {
  color: #baf79d;
  font:
    900 14px 'Nunito',
    sans-serif;
}
.reveal-power-track {
  height: 7px;
  background: #041b2c;
  border: 1px solid #488393;
  border-radius: 9px;
  overflow: hidden;
  margin-top: 7px;
}
.reveal-power-track i {
  display: block;
  height: 100%;
  width: var(--new-strength);
  background: linear-gradient(#e0ffa7, #7cdac7);
  border-radius: 8px;
}
.training-ready-copy {
  color: #c8eac5;
  font:
    800 14px 'Nunito',
    sans-serif;
  margin: 14px 0 10px;
}
#training-reveal-next {
  width: min(440px, 100%);
  min-height: 56px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: auto;
  padding: 10px 14px;
  border: 2px solid #fff1b1;
  border-radius: 18px;
  background: linear-gradient(#ffe89b 48%, #efbb47 49%);
  color: #69451e;
  font:
    25px/1.1 'Lilita One',
    sans-serif;
  box-shadow:
    inset 0 3px #fff5bf,
    0 5px #90602c,
    0 12px 25px #00192d;
}
#training-reveal-next img {
  width: 32px;
  height: 34px;
}
.training-sparks {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.training-sparks i {
  position: absolute;
  left: 50%;
  top: 44%;
  width: 5px;
  height: 12px;
  border-radius: 3px;
  background: #ffecad;
  transform: rotate(calc(var(--spark) * 22.5deg)) translateY(-150px);
  opacity: 0;
}
@media (prefers-reduced-motion: no-preference) {
  #training-reveal[open] header {
    animation: training-title 0.55s both;
  }
  #training-reveal[open] .training-champion {
    animation: training-arrive 0.8s cubic-bezier(0.16, 0.8, 0.24, 1.2) both;
  }
  #training-reveal[open] .training-champion-glow {
    animation: training-flash 1.2s 0.6s both;
  }
  #training-reveal[open] .training-sparks i {
    animation: training-spark 1.4s calc(0.65s + var(--spark) * 0.025s) both;
  }
  #training-reveal[open] .training-reveal-stats {
    animation: training-title 0.6s 0.75s both;
  }
  #training-reveal[open] .reveal-power-track i {
    animation: training-strength 1.35s 0.85s both;
  }
  @keyframes training-arrive {
    from {
      opacity: 0;
      transform: translateY(50px) scale(0.55) rotate(-12deg);
    }
    70% {
      opacity: 1;
      transform: scale(1.06) rotate(2deg);
    }
    to {
      transform: scale(1) rotate(0);
    }
  }
  @keyframes training-title {
    from {
      opacity: 0;
      transform: translateY(15px) scale(0.94);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
  @keyframes training-spark {
    0% {
      opacity: 0;
      transform: rotate(calc(var(--spark) * 22.5deg)) translateY(-70px) scale(0.3);
    }
    30% {
      opacity: 1;
    }
    100% {
      opacity: 0;
      transform: rotate(calc(var(--spark) * 22.5deg)) translateY(-340px) scale(0.5);
    }
  }
  @keyframes training-strength {
    from {
      width: var(--old-strength);
    }
    to {
      width: var(--new-strength);
    }
  }
  @keyframes training-flash {
    0%,
    100% {
      opacity: 0.5;
      transform: scale(0.8);
    }
    35% {
      opacity: 1;
      transform: scale(1.7);
    }
  }
}
@keyframes training-polish {
  from {
    transform: translateX(-30%);
  }
  to {
    transform: translateX(50%);
  }
}
@keyframes training-hammer {
  from {
    transform: rotate(-15deg);
  }
  to {
    transform: rotate(10deg);
  }
}
@media (max-height: 700px) and (orientation: portrait) {
  .training-triumph {
    padding: 12px 16px 18px;
    gap: 8px;
  }
  .training-complete-kicker {
    font-size: 11px;
  }
  #training-reveal h2 {
    font-size: 25px;
  }
  #training-reveal h2 span {
    font-size: 35px;
  }
  .training-champion {
    height: 150px;
    width: 185px;
  }
  .training-rank-seal {
    min-width: 55px;
    padding: 5px 10px;
  }
  .training-rank-seal b {
    font-size: 32px;
  }
  .training-triumph-copy {
    font-size: 12px;
    margin: 4px 0 7px;
  }
  .training-reveal-stats {
    gap: 12px;
  }
  .training-reveal-stat > img {
    width: 30px;
    height: 32px;
  }
  .training-reveal-stat > span {
    font-size: 16px;
  }
  .training-reveal-stat > div:not(.reveal-power-track) {
    gap: 4px;
  }
  .training-reveal-stat strong {
    font-size: 27px;
  }
  .training-reveal-stat small {
    font-size: 13px;
  }
  .training-reveal-stat b {
    font-size: 12px;
  }
  .training-ready-copy {
    margin: 8px 0;
    font-size: 12px;
  }
  #training-reveal-next {
    min-height: 48px;
    font-size: 21px;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  .training-triumph {
    display: grid;
    grid-template-columns: 40% 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px 30px;
    padding: 16px 30px;
  }
  .training-triumph header {
    grid-column: 1;
  }
  #training-reveal h2 {
    font-size: 23px;
  }
  #training-reveal h2 span {
    font-size: 31px;
  }
  .training-complete-kicker {
    font-size: 10px;
  }
  .training-champion {
    grid-column: 1;
    width: 190px;
    height: 100%;
    max-height: 220px;
    justify-self: center;
  }
  .training-triumph-details {
    grid-column: 2;
    grid-row: 1/3;
  }
  .training-triumph-copy {
    font-size: 13px;
  }
  .training-reveal-stats {
    gap: 12px;
  }
  .training-reveal-stat strong {
    font-size: 30px;
  }
  .training-reveal-stat > div:not(.reveal-power-track) {
    gap: 4px;
  }
  #training-reveal-next {
    font-size: 22px;
    min-height: 48px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #training-reveal *,
  .academy-card.is-training *,
  .academy-card.is-training ::after {
    animation: none !important;
    transition: none !important;
  }
}
@media (max-height: 700px) {
  .academy-card.is-training .academy-timer {
    height: auto;
    min-height: 0;
    gap: 3px;
    padding: 5px 7px;
  }
  .training-forge-label {
    gap: 4px;
  }
  .training-forge-label b {
    font-size: 13px;
  }
  .training-forge-label img {
    width: 18px;
    height: 18px;
  }
  .academy-timer .training-countdown span {
    font-size: 15px;
  }
  .training-countdown strong {
    font-size: 16px;
  }
  .academy-timer progress {
    height: 12px;
  }
  .academy-timer > small {
    display: none;
  }
}
/* The heading receives announcement focus; keyboard action focus stays visible. */
#training-reveal-title:focus {
  outline: none;
}
