/* Пять улучшений главной: помощник класса, галерея, прогресс, умная загрузка и reveal. */
.home-class-guide {
  display: grid;
  grid-template-columns: minmax(190px, .8fr) 1.5fr;
  gap: 18px 28px;
  align-items: center;
  margin: 30px 0 26px;
  padding: 18px 22px;
  border: 1px solid rgb(218 173 77 / 34%);
  background: linear-gradient(100deg, rgb(8 13 20 / 96%), rgb(24 15 13 / 88%));
  box-shadow: inset 0 0 35px rgb(78 43 14 / 22%);
}

.home-class-guide__copy { display: grid; gap: 3px; }
.home-class-guide__copy strong { color: #f6d884; font-size: 1.05rem; }
.home-class-guide__copy span { color: rgb(245 238 223 / 68%); font-size: .88rem; }
.home-class-guide__choices { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.home-class-guide__choices button {
  min-height: 38px;
  padding: 7px 14px;
  border: 1px solid rgb(220 180 94 / 34%);
  border-radius: 999px;
  color: #eadfca;
  background: rgb(3 7 12 / 72%);
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.home-class-guide__choices button:hover,
.home-class-guide__choices button:focus-visible,
.home-class-guide__choices button.is-selected {
  outline: none;
  color: #fff3c2;
  border-color: #dfb350;
  box-shadow: 0 0 18px rgb(255 194 56 / 34%);
  transform: translateY(-1px);
}
.home-class-guide__result { grid-column: 1 / -1; min-height: 1.4em; margin: 0; color: #fff0c1; text-align: center; }
.home-class.is-recommended { border-color: #f7cf67; box-shadow: 0 0 0 2px rgb(255 218 111 / 62%), 0 18px 55px rgb(0 0 0 / 64%); }

.home-gallery__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.home-gallery__item {
  position: relative;
  min-height: 310px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgb(218 173 77 / 38%);
  color: #fff;
  background: #05080d;
  cursor: zoom-in;
  text-align: left;
  box-shadow: 0 18px 48px rgb(0 0 0 / 45%);
}
.home-gallery__item img { width: 100%; height: 100%; object-fit: cover; transition: filter 320ms ease, transform 600ms ease; }
.home-gallery__copy {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  gap: 4px;
  padding: 46px 22px 20px;
  background: linear-gradient(transparent, rgb(2 5 9 / 96%) 58%);
}
.home-gallery__copy strong { color: #f6d687; font: 400 1.5rem/1.1 var(--font-fantasy); }
.home-gallery__copy span { color: rgb(255 247 229 / 76%); font-size: .92rem; }
.home-gallery__item:hover img,
.home-gallery__item:focus-visible img { filter: brightness(1.15) saturate(1.1); transform: scale(1.035); }
.home-gallery__item:focus-visible { outline: 2px solid #f4cf72; outline-offset: 3px; }

.home-gallery-dialog {
  width: min(1180px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid #c99b45;
  color: #fff1ce;
  background: #030609;
  box-shadow: 0 28px 100px #000;
}
.home-gallery-dialog::backdrop { background: rgb(0 0 0 / 84%); backdrop-filter: blur(5px); }
.home-gallery-dialog figure { margin: 0; }
.home-gallery-dialog img { display: block; width: 100%; max-height: 78vh; object-fit: contain; }
.home-gallery-dialog figcaption { padding: 14px 20px; color: #f4d687; font: 400 1.2rem var(--font-fantasy); }
.home-gallery-dialog__close {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  width: 42px;
  height: 42px;
  border: 1px solid rgb(242 202 103 / 66%);
  border-radius: 50%;
  color: #fff0c2;
  background: rgb(3 6 10 / 88%);
  cursor: pointer;
  font-size: 1.6rem;
}

.home-progress { position: fixed; z-index: 100; top: 0; left: 0; width: 100%; height: 3px; pointer-events: none; }
.home-progress__bar { display: block; width: 100%; height: 100%; background: linear-gradient(90deg, #8f1f18, #efb936, #43b7df); box-shadow: 0 0 10px #f2bf4e; transform: scaleX(0); transform-origin: left; }
.home-progress__label { position: absolute; top: 96px; right: 18px; max-width: 260px; padding: 5px 10px; overflow: hidden; color: rgb(255 238 194 / 76%); background: rgb(4 7 12 / 76%); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }

.home-action-orbit {
  --orbit-core: 82px;
  --orbit-action: 202px;
  --orbit-action-height: 118px;
  --orbit-shift: 53px;
  position: fixed;
  z-index: 58;
  left: 50%;
  bottom: max(24px, calc(env(safe-area-inset-bottom) + 16px));
  width: var(--orbit-core);
  height: var(--orbit-core);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 24px);
  transition: opacity 200ms ease, transform 200ms ease;
}
.home-action-orbit.is-visible { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.home-action-orbit__sr { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); border: 0; white-space: nowrap; }
.home-action-orbit__hint { position: absolute; right: 50%; bottom: calc(100% + 7px); padding: 5px 10px; border: 1px solid rgb(227 198 110 / 45%); border-radius: 10px; color: #f7e8bd; background: rgb(9 11 14 / 92%); box-shadow: 0 6px 18px rgb(0 0 0 / 35%); font: 400 12px/1.2 var(--font-accent); opacity: 0; pointer-events: none; text-shadow: 0 2px 3px #000; transform: translate(50%, 5px); transition: opacity 160ms ease, transform 160ms ease; white-space: nowrap; }
.home-action-orbit:not(.is-open):hover .home-action-orbit__hint,
.home-action-orbit:not(.is-open):focus-within .home-action-orbit__hint { opacity: 1; transform: translate(50%, 0); }
.home-action-orbit__core { position: relative; z-index: 2; width: var(--orbit-core); height: var(--orbit-core); padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; filter: drop-shadow(0 6px 18px rgb(0 0 0 / 72%)); transition: filter 220ms ease, transform 220ms ease; }
.home-action-orbit__core img { display: block; width: 100%; height: 100%; object-fit: contain; }
.home-action-orbit__core:hover,
.home-action-orbit__core:focus-visible,
.home-action-orbit.is-open .home-action-orbit__core { outline: none; filter: drop-shadow(0 0 16px rgb(255 199 66 / 72%)) drop-shadow(0 7px 16px rgb(0 0 0 / 70%)); transform: rotate(3deg) scale(1.045); }
.home-action-orbit__core:focus-visible { outline: 2px solid var(--color-accent-light); outline-offset: 3px; }
.home-action-orbit__core:active { transform: scale(.96); }
.home-action-orbit__action { position: absolute; top: calc((var(--orbit-core) - var(--orbit-action-height)) / 2); z-index: 1; display: flex; width: var(--orbit-action); height: var(--orbit-action-height); align-items: center; justify-content: center; padding: 7px 28px; color: #fff1ca; background-color: transparent; background-position: center; background-repeat: no-repeat; background-size: 100% 100%; opacity: 0; pointer-events: none; text-align: center; text-shadow: 0 2px 3px #000; transition: opacity 180ms ease, transform 280ms cubic-bezier(.2,.85,.25,1.12), filter 180ms ease; }
.home-action-orbit__action span { display: grid; align-content: center; }
.home-action-orbit__action strong { color: inherit; font: 400 18px/1.1 var(--font-accent); }
.home-action-orbit__action small { margin-top: 7px; color: rgb(238 231 215 / 78%); font: 400 13px/1.15 var(--font-accent); white-space: nowrap; }
.home-action-orbit__action--donate { right: calc(var(--orbit-core) / 2); background-image: url('../../assets/img/home/action-orbit-donate-frame.webp'); transform: translateX(38px) scale(.76); }
.home-action-orbit__action--play { left: calc(var(--orbit-core) / 2); background-image: url('../../assets/img/home/action-orbit-play-frame.webp'); transform: translateX(-38px) scale(.76); transition-delay: 45ms; }
.home-action-orbit.is-open .home-action-orbit__action { opacity: 1; pointer-events: auto; }
.home-action-orbit.is-open .home-action-orbit__action--donate { transform: translateX(calc(-1 * var(--orbit-shift))) scale(1); }
.home-action-orbit.is-open .home-action-orbit__action--play { transform: translateX(var(--orbit-shift)) scale(1); }
.home-action-orbit__action:hover,
.home-action-orbit__action:focus-visible { color: #fff8dc; filter: drop-shadow(0 0 13px rgb(247 191 61 / 72%)) brightness(1.16); }
.home-action-orbit__action:focus-visible { outline: 2px solid var(--color-accent-light); outline-offset: 2px; }
.home-action-orbit__action:active { filter: brightness(.86); }

.home-reveal { opacity: 0; transform: translateY(26px); transition: opacity 700ms ease, transform 700ms ease; }
.home-reveal.is-visible { opacity: 1; transform: none; }

@media (max-width: 800px) {
  .home-class-guide { grid-template-columns: 1fr; }
  .home-class-guide__choices { justify-content: flex-start; }
  .home-gallery__grid { grid-template-columns: 1fr; }
  .home-gallery__item { min-height: 260px; }
  .home-progress__label { display: none; }
  .home-action-orbit { --orbit-core: 72px; --orbit-action: clamp(136px, calc((100vw - var(--orbit-core) - 46px) / 2), 202px); --orbit-action-height: 112px; --orbit-shift: 48px; bottom: max(16px, calc(env(safe-area-inset-bottom) + 10px)); }
  .home-action-orbit__action { padding: 6px 18px; }
  .home-action-orbit__action strong { font-size: 16px; }
  .home-action-orbit__action small { font-size: 12px; }
}

@media (max-width: 360px) {
  .home-action-orbit { --orbit-core: 64px; --orbit-action: 112px; --orbit-action-height: 106px; --orbit-shift: 40px; }
  .home-action-orbit__action { padding: 5px 12px; }
  .home-action-orbit__action strong { font-size: 13px; }
  .home-action-orbit__action small { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .home-class-guide__choices button,
  .home-gallery__item img,
  .home-action-orbit,
  .home-action-orbit__core,
  .home-action-orbit__action,
  .home-reveal { transition: none; }
  .home-reveal { opacity: 1; transform: none; }
}
