/* Дополнительные стили для улучшений */

/* Loyalty level icons: generated console art keeps the rank identity visible. */
.level-icon {
  display: block;
  width: 100%;
  height: 96px;
  object-fit: contain;
  object-position: center;
  margin: 8px 0 6px;
  image-rendering: auto;
  filter: drop-shadow(3px 3px 0 #090817);
}

.rank-console {
  display: grid;
  place-items: center;
  overflow: hidden;
}

.rank-console img {
  width: 42px;
  height: 34px;
  object-fit: contain;
  image-rendering: auto;
  filter: drop-shadow(2px 2px 0 #6f152b);
}

.session-rank-icon {
  width: 58px;
  height: 48px;
  margin-left: 14px;
  object-fit: contain;
  image-rendering: auto;
  filter: drop-shadow(3px 3px 0 #090817);
}

/* Account recovery keeps a single clear action below the login form. */
.auth-utility {
  min-height: 44px;
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--cyan);
  font-family: var(--font-pixel);
  font-size: 8px;
  text-align: left;
}

.auth-utility:hover,
.auth-utility:focus-visible {
  color: var(--yellow);
}

.modal-copy {
  margin: 16px 0 20px;
  color: var(--muted);
  line-height: 1.2;
}

.form-feedback {
  min-height: 19px;
  margin: -3px 0 0;
  color: var(--yellow);
  font-size: 17px;
  line-height: 1.1;
}

.account-email-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid #51446f;
  background: #121121;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.1;
}

.account-email-status strong {
  color: var(--cyan);
  font-family: var(--font-pixel);
  font-size: 8px;
}

.account-email-status button {
  min-height: 38px;
  border: 1px solid var(--violet);
  background: #292344;
  color: var(--ink);
  padding: 0 10px;
  font-family: var(--font-pixel);
  font-size: 7px;
}

.provider-connected,
.logout-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 49px;
  border: 1px solid #3c7f82;
  background: linear-gradient(110deg, #142b36, #121121);
  color: var(--ink);
  padding: 10px;
  font-family: var(--font-pixel);
  font-size: 7px;
}

.provider-connected b { color: var(--cyan); }

.logout-btn {
  justify-content: center;
  border-color: #a73c59;
  background: #3a1830;
  color: #fff;
  cursor: pointer;
}

.logout-btn:hover,
.logout-btn:focus-visible { background: #5a1e3e; border-color: var(--pink); }

@media (max-width: 650px) {
  .account-email-status { align-items: flex-start; flex-direction: column; }
  .account-email-status button { width: 100%; }
}

/* Scanlines оптимизация - PNG паттерн вместо градиента */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  opacity: .14;
  background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAECAYAAABP2FU6AAAAFklEQVQIHWNgYGD4z8DAwMDAxAAFAA4oAQO2OMrTAAAAAElFTkSuQmCC') repeat;
  will-change: transform;
  transform: translateZ(0);
}

/* Поддержка backdrop-filter fallback */
@supports not (backdrop-filter: blur(3px)) {
  .scrim {
    background: rgba(4,3,11,0.95) !important;
  }
}

/* Улучшенные кнопки с ripple эффектом */
.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary:active::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.3);
  animation: ripple 0.6s ease-out;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* Улучшенная кнопка "КУПИТЬ СЕЙЧАС" */
.buy-now-btn {
  background: var(--pink) !important;
  border-color: var(--pink) !important;
  box-shadow: 4px 4px 0 #70152c;
  font-size: 9px;
  padding: 0 18px;
  min-height: 44px;
}

.buy-now-btn:hover {
  background: #FF7B9A !important;
  transform: translate(-2px,-2px);
  box-shadow: 7px 7px 0 #70152c;
}

/* Улучшенные detail-actions в карточке */
.detail-actions {
  grid-column: 1/-1;
  padding: 12px 0 8px;
}

/* Мобильная типографика - увеличиваем для читаемости */
@media(max-width:650px){
  body {
    font-size: 21px !important; /* Было 20px */
  }

  .product-content h3 {
    font-size: 11px; /* Было 10px */
  }

  .quest-card h2 {
    font-size: 16px; /* Было 14px, поднимаем для лучшей видимости */
    letter-spacing: -0.5px;
  }
}

/* Trust badges стили */
.trust-badges {
  display: flex;
  gap: 24px;
  align-items: center;
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--muted);
  margin-top: 16px;
}

.trust-badges span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.trust-badges svg {
  color: var(--cyan);
}

/* Spacing система - единообразные отступы */
.hero {
  padding: var(--space-lg) 0 var(--space-md);
}

.categories {
  margin-bottom: var(--space-xl);
}

.loyalty {
  margin-bottom: var(--space-xl);
}

.signal-zone {
  margin-bottom: var(--space-xl);
}

.guild {
  margin-bottom: var(--space-xl);
}

/* Оптимизация производительности */
.product-card,
.btn,
.category-card,
.level {
  will-change: transform;
}

/* Accessibility - улучшенный focus visible */
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
  z-index: 1;
}

/* Reduced motion support */
@media(prefers-reduced-motion: reduce){
  *,*:before,*:after{
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }

  .scanlines,
  .stars,
  .invaders,
  .laser,
  .ship {
    animation: none !important;
  }
}

/* Preload критичных ресурсов */
@font-face {
  font-family: 'Press Start 2P';
  font-display: swap;
  src: local('Press Start 2P');
}

/* Pixel Invaders: единый объёмный корпус; интерактивная кнопка совпадает с кнопкой на арте. */
.arcade-zone { perspective: 1200px; }
.cabinet.cabinet-3d {
  width: min(100%, 500px);
  max-width: none;
  margin: -12px auto 0;
  position: relative;
  isolation: isolate;
  aspect-ratio: 0.865;
  filter: drop-shadow(22px 28px 28px rgba(0, 0, 0, .62));
}
.cabinet.cabinet-3d::before,
.cabinet.cabinet-3d::after { content: none; }
.cabinet-3d-art { display: block; width: 100%; height: 100%; object-fit: contain; }
.cabinet-3d-marquee {
  position: absolute;
  z-index: 2;
  top: 11.7%;
  left: 19%;
  width: 62%;
  color: #fff28a;
  font: 14px var(--font-pixel);
  letter-spacing: .08em;
  text-align: center;
  text-shadow: 0 3px #a40072, 0 0 16px rgba(255, 242, 138, .72);
}
.cabinet-3d-screen {
  position: absolute;
  z-index: 1;
  top: 28.6%;
  left: 21.3%;
  display: grid;
  place-items: center;
  width: 57.4%;
  height: 34.4%;
  overflow: hidden;
  border-radius: 16% / 13%;
  background: #050b1d;
}
#arcadePreviewCanvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  image-rendering: pixelated;
}
.cabinet-3d-screen-glass {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,.13), transparent 23%, transparent 63%, rgba(44,232,232,.08));
  box-shadow: inset 0 0 30px rgba(44, 232, 232, .12);
}
.arcade-play {
  position: absolute;
  z-index: 3;
  top: 78.4%;
  left: 51.8%;
  width: 15.5%;
  aspect-ratio: 1.9;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  box-shadow: none;
}
.arcade-play:hover { filter: brightness(1.14); }
.arcade-play:focus-visible { outline: 3px solid #fff28a; outline-offset: 4px; }
.arcade-play:active { transform: translateY(3px); }
@media (max-width: 650px) {
  .cabinet.cabinet-3d { width: min(100%, 410px); margin-top: 8px; }
  .cabinet-3d-marquee { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) { .arcade-play { transition: none; } }
.game-modal { width:min(520px,calc(100% - 24px)); text-align:center; }
#invaderCanvas { width:min(420px,100%); height:auto; background:#070715; border:4px solid #25294b; outline:2px solid var(--cyan); image-rendering:pixelated; box-shadow:inset 0 0 36px #000, 0 0 28px rgba(44,232,232,.24); }
.game-scorebar,.game-controls { display:flex; justify-content:space-between; gap:12px; margin:14px auto; max-width:420px; font:8px var(--font-pixel); color:var(--yellow); }
.game-controls button { flex:1; min-height:46px; border:1px solid var(--cyan); background:#151427; color:var(--cyan); font:9px var(--font-pixel); cursor:pointer; }

@font-face {
  font-family: 'VT323';
  font-display: swap;
  src: local('VT323');
}
