/* Shared responsive and interaction layer for every HikariPW page. */
:root {
  --site-gutter: clamp(16px, 4vw, 30px);
  --site-nav-height: 72px;
  --site-radius: 20px;
  --site-mobile-bg: rgba(10, 6, 14, 0.97);
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--site-nav-height) + 16px);
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
}

body {
  min-width: 320px;
  overflow-x: hidden;
}

img,
video,
iframe {
  max-width: 100%;
}

img,
video {
  height: auto;
}

button,
a,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
.timeline-item:focus-visible,
.premium-card:focus-visible {
  outline: 2px solid var(--theme-pink-light, #ff9bd1);
  outline-offset: 4px;
}

.content-area {
  width: min(1400px, calc(100% - (var(--site-gutter) * 2)));
}

.nav {
  background: linear-gradient(
    180deg,
    rgba(12, 7, 16, 0.96),
    rgba(7, 5, 10, 0.9)
  );
  border-bottom: 1px solid rgba(255, 79, 163, 0.18);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.18);
}

.nav .content-area {
  min-height: var(--site-nav-height);
}

.nav__open-links {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  margin-right: 14px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 79, 163, 0.25);
  border-radius: 13px;
  background: rgba(255, 79, 163, 0.06);
}

.nav__open-links::before,
.nav__open-links::after,
.nav__open-links-item {
  left: 10px;
  width: 22px;
}

.nav__open-links::after {
  top: 12px;
}

.nav__open-links::before {
  top: 30px;
}

.nav__open-links-item {
  top: 21px;
}

.nav__open-links.active::before,
.nav__open-links.active::after {
  top: 21px;
}

.nav__socials img {
  max-width: 22px;
  max-height: 22px;
}

.main-articles,
.main-info,
.hikari-roadmap,
.hikari-reviews,
.premium-shop,
.register-account,
.requirements,
.install-guide,
.downloads-extra,
.footer {
  content-visibility: auto;
  contain-intrinsic-size: auto 720px;
}

.discord-widget iframe,
.video-wrap iframe {
  display: block;
  width: 100%;
  border: 0;
}

.hikari-roadmap .roadmap-overlay,
.hikari-roadmap::before,
.hikari-roadmap::after,
.hikari-reviews::before {
  pointer-events: none;
}

.premium-shop::before {
  content: "❀";
}

.hikari-roadmap .container,
.hikari-roadmap .reviews-footer,
.hikari-roadmap .all-videos-btn {
  position: relative;
  z-index: 3;
  pointer-events: auto;
}

.premium-card.is-loot-open .loot-window {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.loot-window__close {
  display: none;
}

.footer__links a,
.footer-socials a {
  min-height: 44px;
}

@media (max-width: 1180px) {
  .nav__links li:not(:last-child) {
    margin-right: 16px;
  }

  .nav__links li a {
    font-size: 13px;
  }
}

@media (max-width: 1024px) {
  :root {
    --site-nav-height: 68px;
  }

  .wrapper {
    overflow: clip;
  }

  .nav {
    position: sticky;
    top: 0;
    z-index: 10000;
    padding-top: env(safe-area-inset-top);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .nav .content-area {
    display: flex;
    width: calc(100% - 24px);
    height: var(--site-nav-height);
    min-height: var(--site-nav-height);
    justify-content: space-between;
    align-items: center;
  }

  .nav__open-links {
    display: flex !important;
    position: relative;
    z-index: 4;
    margin-right: auto;
  }

  .nav__links {
    display: none !important;
    position: absolute;
    z-index: 3;
    top: calc(100% + 8px);
    left: 12px;
    width: calc(100% - 24px);
    max-height: calc(
      100dvh - var(--site-nav-height) - 28px - env(safe-area-inset-top)
    );
    margin: 0;
    padding: 12px;
    overflow-y: auto;
    overscroll-behavior: contain;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: 5px;
    border: 1px solid rgba(255, 79, 163, 0.38);
    border-radius: 18px;
    background: var(--site-mobile-bg) !important;
    box-shadow:
      0 22px 60px rgba(0, 0, 0, 0.7),
      0 0 34px rgba(255, 79, 163, 0.18);
    transform-origin: top center;
  }

  .nav__links.mobile-open {
    display: flex !important;
    animation: hikariMenuIn 0.18s ease-out both;
  }

  .nav__links li,
  .nav__links li:not(:last-child) {
    width: 100%;
    margin: 0;
    text-align: left;
  }

  .nav__links li::after {
    display: none;
  }

  .nav__links li a {
    display: flex;
    min-height: 48px;
    width: 100%;
    padding: 13px 16px;
    align-items: center;
    line-height: 1.35 !important;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 14px;
  }

  .nav__links li.active a,
  .nav__links li a:hover,
  .nav__links li a:focus-visible {
    border-color: rgba(255, 79, 163, 0.25);
    background: rgba(255, 79, 163, 0.09);
  }

  .nav__socials {
    display: flex !important;
    position: static;
    width: auto;
    height: auto;
    margin-left: auto;
    align-items: center;
    flex-wrap: nowrap;
  }

  .nav__socials li:not(:last-child) {
    margin-right: 12px;
  }

  .nav__socials li a {
    width: 40px;
    height: 40px;
  }

  body.nav-open::after {
    content: "";
    position: fixed;
    z-index: 9998;
    inset: calc(var(--site-nav-height) + env(safe-area-inset-top)) 0 0;
    background: rgba(2, 2, 4, 0.58);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }

  .header__content {
    width: 100%;
  }

  .header__button,
  .btn,
  .button,
  .all-videos-btn,
  .premium-card__btn {
    touch-action: manipulation;
  }

  .main-articles__items,
  .main-info__items,
  .premium-shop__items {
    gap: 24px !important;
  }

  .main-articles__item,
  .main-info__item,
  .premium-card {
    max-width: 100%;
  }

  .footer__items {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px 24px !important;
  }

  .footer__item,
  .footer-partners,
  .footer-divider {
    width: 100% !important;
    max-width: none !important;
  }

  .footer-partners,
  .footer-divider {
    grid-column: 1 / -1;
  }

  .footer-partners {
    align-items: center;
    margin: 10px 0 0;
  }

  .footer-age {
    right: 16px;
    bottom: 16px;
  }

  .loot-window {
    top: 50%;
    right: auto;
    left: 50%;
    width: min(92vw, 420px);
    max-height: min(78dvh, 680px);
    padding: 26px 22px;
    overflow-y: auto;
    transform: translate(-50%, -50%) scale(0.96);
  }

  .premium-card:hover .loot-window {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.96);
  }

  .premium-card.is-loot-open .loot-window,
  .premium-card.is-loot-open:hover .loot-window {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
  }

  .loot-window__close {
    display: inline-flex;
    position: sticky;
    z-index: 2;
    top: 0;
    float: right;
    width: 44px;
    height: 44px;
    margin: -10px -8px 4px 12px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 79, 163, 0.35);
    border-radius: 50%;
    background: #160b18;
    color: #fff;
    font:
      28px/1 Arial,
      sans-serif;
    cursor: pointer;
  }
}

@media (max-width: 768px) {
  .content-area {
    width: calc(100% - 32px);
  }

  .header {
    padding-top: 18px;
  }

  .header br {
    display: none;
  }

  .header__content {
    padding: 36px 0 54px;
  }

  .header__info-title {
    font-size: clamp(24px, 8vw, 34px);
    line-height: 1.15;
  }

  .timer__title {
    font-size: clamp(17px, 5vw, 22px);
    line-height: 1.55;
  }

  .header__button,
  .btn-dropdown-wrapper,
  .btn-dropdown-wrapper .btn,
  .btn,
  .button,
  .all-videos-btn,
  .register-btn,
  .premium-card__btn {
    width: 100% !important;
    max-width: 420px;
    box-sizing: border-box;
    justify-content: center;
    text-align: center;
  }

  .countdown-status {
    font-size: clamp(20px, 6vw, 27px);
  }

  .countdown-timer {
    gap: 9px;
  }

  .count-item {
    width: calc(50% - 5px);
    max-width: 128px;
    height: 96px;
  }

  .count-item span {
    font-size: 34px;
  }

  .main-articles__items,
  .main-info__items,
  .premium-shop__items {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .main-articles__item,
  .main-info__item,
  .review-card,
  .premium-card {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .main-articles__item-content,
  .review-content,
  .premium-card {
    padding-left: 20px;
    padding-right: 20px;
  }

  .discord-widget,
  .discord-widget iframe {
    min-height: 420px;
    height: 420px;
  }

  .premium-shop,
  .hikari-roadmap,
  .hikari-reviews {
    padding-top: 78px;
    padding-bottom: 78px;
  }

  .premium-title,
  .reviews-header h2,
  .roadmap-header h2,
  .roadmap-page-header h1,
  .download-hero h1,
  .section-header h2,
  .register-left h2 {
    overflow-wrap: anywhere;
    font-size: clamp(30px, 9vw, 44px) !important;
    line-height: 1.12;
  }

  .premium-title,
  .reviews-header,
  .roadmap-header {
    margin-bottom: 42px;
  }

  .reviews-grid {
    width: calc(100% - 32px);
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .review-content h3 {
    font-size: 21px;
  }

  .author-top {
    align-items: flex-start;
    gap: 8px;
  }

  .author-name {
    font-size: 18px;
  }

  .timeline {
    display: flex !important;
    margin: 0 -16px 52px !important;
    padding: 8px 16px 22px;
    flex-wrap: nowrap !important;
    justify-content: flex-start;
    gap: 14px !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: var(--theme-pink, #ff4fa3) rgba(255, 255, 255, 0.05);
  }

  .timeline::before,
  .timeline-progress {
    display: none;
  }

  .timeline-item {
    flex: 0 0 min(72vw, 260px);
    width: auto !important;
    min-width: 220px;
    padding: 18px 12px;
    scroll-snap-align: center;
    border: 1px solid rgba(255, 79, 163, 0.14);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.025);
  }

  .roadmap-card {
    padding: 34px 20px;
    border-radius: 24px;
  }

  .roadmap-card h3 {
    font-size: clamp(28px, 8vw, 38px);
  }

  .roadmap-card p {
    font-size: 17px;
  }

  .roadmap-page {
    padding: 58px 16px 72px;
  }

  .roadmap-page-header {
    margin-bottom: 42px;
  }

  .roadmap-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .month-card {
    padding: 24px 20px;
  }

  .download-hero {
    padding: 66px 16px 58px;
  }

  .download-hero > p {
    margin-bottom: 38px;
    font-size: 16px;
  }

  .file-meta {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 16px;
  }

  .file-meta-item {
    min-width: 0;
    justify-content: flex-start;
    text-align: left;
  }

  .download-cards,
  .requirements-grid,
  .guide-steps,
  .register-content {
    grid-template-columns: minmax(0, 1fr);
  }

  .register-account,
  .requirements,
  .install-guide,
  .downloads-extra {
    margin-top: 78px;
    margin-bottom: 78px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .register-left,
  .register-card,
  .req-card,
  .guide-step {
    padding: 28px 22px;
  }

  .register-benefits {
    grid-template-columns: minmax(0, 1fr);
  }

  .extra-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer {
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
  }

  .footer__items {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px !important;
  }

  .footer-partners,
  .footer-divider {
    grid-column: auto;
  }

  .footer__item,
  .footer__item-title,
  .footer__copyright,
  .footer__links {
    text-align: center;
  }

  .footer__item-title::after {
    margin-left: auto;
    margin-right: auto;
  }

  .footer__links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
  }

  .footer-socials {
    gap: 10px;
    flex-wrap: wrap;
  }

  .footer-socials a {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .nav__socials li:not(:last-child) {
    margin-right: 7px;
  }

  .nav__socials li a {
    width: 36px;
    height: 36px;
  }

  .nav__socials img {
    max-width: 19px;
    max-height: 19px;
  }

  .file-meta,
  .extra-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .dl-card {
    padding: 24px 20px;
  }

  .dl-card-footer,
  .req-item {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .dl-card-btn,
  .alt-dl-btn,
  .register-btn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }

  .alt-downloads {
    align-items: stretch;
  }

  .review-author,
  .author-top {
    align-items: flex-start;
  }

  .author-top {
    flex-direction: column;
  }

  .video-date {
    white-space: normal;
  }
}

@media (hover: none) {
  .premium-card:hover,
  .review-card:hover,
  .month-card:hover,
  .dl-card:hover,
  .guide-step:hover,
  .req-card:hover,
  .extra-card:hover {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .sakura-container,
  .stars {
    display: none !important;
  }
}

@keyframes hikariMenuIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
