/* Campaign academies: a horizontal troop workshop, within the game viewport. */
#academy-view {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding: 8px 14px;
  color: #fff3cc;
}
#academy-view[hidden] {
  display: none;
}
.academy-banner {
  position: relative;
  min-height: 100px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  border: 2px solid #c79c43;
  border-radius: 22px;
  overflow: hidden;
  background: #294955;
  box-shadow:
    inset 0 2px #ffe9a4,
    0 5px #152e36;
}
.academy-camp-art {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, #173b48 2%, #173b48dc 60%, #173b4866),
    url('art/training-camp.webp') center 48% / cover;
}
.academy-banner-copy,
.academy-rank {
  position: relative;
}
.academy-banner-copy {
  flex: 1;
  min-width: 0;
}
.academy-banner .eyebrow {
  color: #ffdb7d;
  font-size: 12px;
}
.academy-banner h2 {
  font-size: clamp(23px, 3vw, 36px);
  line-height: 1.05;
  margin: 5px 0;
}
.academy-banner p {
  font-size: 14px;
  line-height: 1.3;
  margin: 0;
  max-width: 650px;
  color: #e6f3e4;
}
.academy-rank {
  display: grid;
  justify-items: center;
  flex-shrink: 0;
}
.academy-rank img {
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 3px 1px #122d39);
}
.academy-rank small {
  font-size: 11px;
}
.academy-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.academy-toolbar button {
  margin-left: auto;
  font-size: 15px;
  padding: 8px 12px;
}
.academy-wallet {
  display: flex;
  gap: 7px;
  align-items: center;
}
.academy-wallet img {
  width: 40px;
  height: 40px;
}
.academy-wallet span {
  display: grid;
}
.academy-wallet small {
  font-size: 10px;
  letter-spacing: 1px;
  color: #b6d9d8;
}
.academy-wallet b {
  font:
    28px 'Lilita One',
    sans-serif;
}
.academy-progress {
  display: grid;
  gap: 3px;
  font-size: 14px;
}
.academy-progress span {
  font-size: 12px;
  color: #b9d5d5;
}
.academy-tabs {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  margin: 0;
}
.academy-tabs button {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  padding: 7px 12px;
}
.academy-tabs img {
  width: 27px;
  height: 27px;
}
.academy-cards {
  display: flex;
  gap: 14px;
  flex: 1;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  padding: 5px 2px 10px;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
}
.academy-card {
  scroll-snap-align: start;
  flex: 0 0 260px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  padding: 12px;
  border: 2px solid #d0ab55;
  border-radius: 21px;
  background: linear-gradient(140deg, #fff6d7, #f0dda6);
  color: #214756;
  box-shadow:
    0 5px #8f7139,
    inset 0 2px #fffdf0;
}
.academy-portrait {
  position: relative;
  height: clamp(60px, 13vh, 130px);
  flex-shrink: 1;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: radial-gradient(ellipse at bottom, #54949b, #143d56 75%);
  overflow: hidden;
}
.academy-portrait > svg,
.academy-portrait > img {
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}
.academy-portrait > span {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 3px;
  background: #12384bdd;
  color: #fff5ca;
  font-size: 13px;
}
.academy-portrait > span img {
  width: 20px;
  height: 20px;
}
.academy-card h3,
.academy-history h3 {
  font-size: 24px;
  line-height: 1.05;
  margin: 0;
}
.academy-card > p {
  font-size: 13px;
  line-height: 1.3;
  margin: 0;
  min-height: 3.9em;
}
.academy-benefits {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.academy-benefits > span {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  column-gap: 4px;
  flex: 1;
}
.academy-benefits img {
  width: 26px;
  height: 26px;
  grid-row: 1/3;
}
.academy-benefits small {
  grid-column: 2/4;
  font-size: 11px;
}
.academy-benefits b {
  font:
    21px 'Lilita One',
    sans-serif;
}
.academy-benefits strong {
  color: #228359;
  font-size: 14px;
}
.academy-card-action {
  height: 90px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: end;
  gap: 6px;
  border-top: 1px solid #c8ad71;
  padding-top: 7px;
}
.academy-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  font-size: 11px;
}
.academy-price > span:first-child {
  font-size: 9px;
  max-width: 44px;
  font-weight: bold;
}
.academy-price b,
.academy-price > span:last-child {
  display: flex;
  align-items: center;
  gap: 3px;
}
.academy-price b {
  font-size: 22px;
}
.academy-price small {
  font-size: 11px;
}
.academy-price img {
  height: 23px;
  width: 23px;
}
.academy-price > span:last-child img {
  width: 16px;
  height: 16px;
}
.academy-card button {
  font-size: 19px;
  min-height: 45px;
  padding: 8px 5px;
}
.academy-timer,
.academy-ready {
  display: grid;
  gap: 7px;
  align-content: center;
  height: 100%;
  text-align: center;
  font-size: 16px;
}
.academy-timer span,
.academy-ready span {
  font-size: 12px;
}
.academy-timer progress {
  width: 100%;
  height: 14px;
  accent-color: #238a84;
}
.academy-ready img {
  height: 28px;
  margin: auto;
}
.academy-ready {
  color: #246c4f;
  gap: 3px;
}
.academy-card.is-ready {
  border-color: #88bb6c;
  background: linear-gradient(145deg, #fff8d9, #deebbc);
}
.academy-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.academy-footer button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 15px;
  padding: 10px;
  min-height: 46px;
}
.academy-footer img,
.academy-history span img {
  width: 26px;
  height: 26px;
  vertical-align: middle;
}
.academy-footer .primary {
  font-size: 22px;
  min-width: 200px;
}
.academy-status {
  font-size: 12px;
  text-align: center;
  margin: 0;
  min-height: 16px;
  color: #bfd9d6;
  flex-shrink: 0;
}
.academy-history {
  flex: 0 0 250px;
  padding: 20px;
  border: 1px solid #749fa0;
  background: #214b5b;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
}
.academy-history > img,
.academy-history > svg {
  height: 85px;
  width: auto;
  object-fit: contain;
}
.academy-history time {
  font-size: 12px;
  color: #b5d3d1;
}
.academy-history p {
  margin: 0;
}
.academy-empty {
  padding: 30px;
}
.academy-gem {
  width: 44px;
  height: 44px;
}
.recruit-costs {
  flex-wrap: wrap;
}
.recruit-costs .recruit-gem-price small {
  font-size: 10px;
  letter-spacing: 0.6px;
}
.recruit-costs .recruit-video-price {
  background: transparent;
  box-shadow: none;
  border: 0;
  font-size: 13px;
}
.recruit-terms {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-block: 1px solid #c5a46b;
}
.recruit-terms span {
  display: flex;
  align-items: center;
  gap: 8px;
}
.recruit-terms img {
  width: 30px;
  height: 30px;
}
.world-training-milestone {
  width: 100%;
  text-align: left;
}
.world-training-milestone small,
.world-training-milestone b {
  display: block;
}
@media (max-width: 620px) {
  #academy-view {
    padding: 5px 8px;
    gap: 7px;
  }
  .academy-banner {
    padding: 10px 12px;
    min-height: 88px;
    gap: 6px;
  }
  .academy-banner .eyebrow {
    font-size: 9px;
  }
  .academy-banner h2 {
    font-size: 24px;
  }
  .academy-banner p {
    font-size: 12px;
  }
  .academy-rank {
    display: none;
  }
  .academy-progress span {
    display: none;
  }
  .academy-toolbar {
    gap: 9px;
  }
  .academy-toolbar button {
    font-size: 13px;
    padding: 7px;
  }
  .academy-wallet img {
    width: 30px;
    height: 30px;
  }
  .academy-wallet b {
    font-size: 24px;
  }
  .academy-tabs button {
    font-size: 13px;
    padding: 5px 8px;
  }
  .academy-tabs img {
    width: 22px;
    height: 22px;
  }
  .academy-card {
    flex-basis: 250px;
    padding: 10px;
    gap: 6px;
  }
  .academy-footer {
    gap: 8px;
  }
  .academy-footer button {
    font-size: 11px;
    padding: 6px;
    gap: 3px;
  }
  .academy-footer img {
    width: 19px;
    height: 19px;
  }
  .academy-footer .primary {
    font-size: 17px;
    min-width: 125px;
  }
  .academy-status {
    font-size: 10px;
  }
}
@media (max-height: 800px) {
  .academy-banner {
    min-height: 62px;
    padding: 8px 12px;
  }
  .academy-banner p {
    display: none;
  }
  .academy-banner h2 {
    font-size: 24px;
  }
  .academy-rank img {
    width: 24px;
    height: 24px;
  }
  .academy-card {
    flex-basis: 300px;
    display: grid;
    grid-template-columns: 75px 1fr;
    grid-template-rows: auto minmax(min-content, 1fr) auto auto;
    gap: 5px 8px;
  }
  .academy-portrait {
    grid-row: 1/3;
    height: 100%;
    min-height: 65px;
  }
  .academy-portrait > span b {
    font-size: 10px;
  }
  .academy-portrait > span img {
    display: none;
  }
  .academy-card h3 {
    font-size: 21px;
    align-self: end;
  }
  .academy-card > p {
    font-size: 12px;
    min-height: 0;
    align-self: center;
  }
  .academy-benefits,
  .academy-card-action {
    grid-column: 1/3;
  }
  .academy-card-action {
    height: 78px;
  }
}
@media (max-height: 450px) and (min-width: 620px) {
  #academy-view {
    display: grid;
    grid-template-columns: 240px 1fr;
    grid-template-rows: 64px 36px 1fr 48px;
    gap: 5px 10px;
  }
  .academy-banner {
    grid-column: 1;
    grid-row: 1;
    padding: 7px;
  }
  .academy-banner h2 {
    font-size: 20px;
  }
  .academy-banner .eyebrow,
  .academy-rank {
    display: none;
  }
  .academy-toolbar {
    grid-column: 1;
    grid-row: 2/4;
    align-content: start;
    align-self: start;
    flex-wrap: wrap;
  }
  .academy-tabs {
    grid-column: 2;
    grid-row: 1;
    height: 36px;
    align-self: center;
  }
  .academy-cards {
    grid-column: 2;
    grid-row: 2/5;
    padding-top: 0;
    padding-bottom: 6px;
  }
  .academy-footer {
    grid-column: 1;
    grid-row: 4;
  }
  .academy-footer button {
    font-size: 10px;
    padding: 4px;
    min-height: 40px;
  }
  .academy-footer .primary {
    min-width: 100px;
    font-size: 15px;
  }
  .academy-footer img {
    width: 16px;
    height: 16px;
  }
  .academy-status {
    display: none;
  }
  .academy-card {
    flex-basis: 380px;
  }
}
#academy-view,
#academy-view * {
  box-sizing: border-box;
}
#academy-view {
  background: radial-gradient(ellipse at top, #315965, #122f43 75%);
  border-radius: 18px;
}
#academy-view .academy-tabs [role='tab'] {
  min-height: 36px;
  padding: 6px 9px;
  font-size: 14px;
  flex: 1;
  white-space: nowrap;
}
#academy-view .academy-toolbar button {
  background: #416a73;
  color: #fff2c4;
  border: 1px solid #93b6b5;
  border-radius: 9px;
}

@media (max-height: 700px) and (max-width: 620px) {
  #academy-view {
    gap: 5px;
  }
  #academy-view .academy-banner {
    height: 51px;
    min-height: 51px;
    padding: 7px 10px;
  }
  #academy-view .academy-banner h2 {
    font-size: 22px;
  }
  #academy-view .academy-banner .eyebrow {
    font-size: 8px;
  }
  #academy-view .academy-toolbar {
    height: 33px;
  }
  #academy-view .academy-wallet b {
    font-size: 20px;
  }
  #academy-view .academy-wallet small {
    font-size: 8px;
  }
  #academy-view .academy-progress {
    font-size: 11px;
  }
  #academy-view .academy-tabs {
    height: 34px;
  }
  #academy-view .academy-tabs [role='tab'] {
    font-size: 12px;
    min-height: 34px;
    padding: 5px;
    gap: 4px;
  }
  #academy-view .academy-tabs img {
    width: 19px;
    height: 19px;
  }
  #academy-view .academy-footer {
    height: 42px;
  }
  #academy-view .academy-footer button {
    min-height: 40px;
    font-size: 10px;
  }
  #academy-view .academy-footer .primary {
    font-size: 16px;
  }
  #academy-view .academy-status {
    display: none;
  }
}
@media (max-height: 450px) and (min-width: 620px) {
  #academy-view {
    grid-template-rows: 36px 30px 1fr 42px;
  }
  #academy-view .academy-banner {
    height: 66px;
    grid-row: 1/3;
  }
  #academy-view .academy-toolbar {
    grid-row: 3;
  }
  #academy-view .academy-card {
    padding: 8px;
    gap: 4px 7px;
  }
  #academy-view .academy-card-action {
    height: 74px;
  }
}
@media (max-height: 450px) and (min-width: 620px) {
  #academy-view {
    grid-template-rows: 36px 30px minmax(0, 1fr) 42px;
  }
  #academy-view .academy-toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    height: auto;
  }
  #academy-view .academy-progress {
    grid-column: 1/3;
    grid-row: 2;
    font-size: 12px;
  }
  #academy-view .academy-toolbar button {
    grid-column: 2;
    grid-row: 1;
    font-size: 12px;
    padding: 7px;
  }
  #academy-view .academy-progress span {
    font-size: 11px;
  }
}
@media (max-height: 800px) {
  .academy-history {
    display: grid;
    grid-template-columns: 60px 1fr;
    grid-template-rows: 18px 24px 22px auto 25px 30px;
    gap: 4px 8px;
    padding: 10px;
    align-content: center;
  }
  .academy-history > img,
  .academy-history > svg {
    grid-column: 1;
    grid-row: 1/4;
    width: 60px;
    height: 68px;
  }
  .academy-history > .eyebrow {
    font-size: 9px;
    grid-column: 2;
    grid-row: 1;
  }
  .academy-history h3 {
    font-size: 21px;
    grid-column: 2;
    grid-row: 2;
  }
  .academy-history > b {
    font-size: 14px;
    grid-column: 2;
    grid-row: 3;
  }
  .academy-history p {
    font-size: 13px;
    grid-column: 1/3;
  }
  .academy-history > span:not(.eyebrow),
  .academy-history time {
    grid-column: 1/3;
  }
  .academy-history time {
    font-size: 11px;
  }
}
@media (max-height: 500px) and (min-width: 601px) {
  #modal[data-variant='recruit'] .recruit-terms {
    grid-column: 2;
    gap: 4px;
    padding: 6px;
    font-size: 13px;
    line-height: 1.2;
  }
  #modal[data-variant='recruit'] .recruit-terms > strong {
    font-size: 14px;
  }
  #modal[data-variant='recruit'] .recruit-terms img {
    width: 20px;
    height: 20px;
  }
}
@media (max-height: 500px) and (min-width: 601px) {
  #modal[data-variant='recruit'] .modal-body {
    row-gap: 6px;
  }
  #modal[data-variant='recruit'] .recruit-terms {
    padding-block: 4px;
  }
}

@media (max-height: 700px) and (max-width: 620px) {
  #academy-view .academy-cards {
    padding-top: 0;
    padding-bottom: 5px;
  }
}

/* Currency lives in the persistent header; training owns the available space. */
#academy-view .academy-footer {
  justify-content: flex-end;
}
#academy-view .academy-footer #academy-next {
  flex: 1;
}
