/* Hub — каталог игр */
.hub-page {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.hub-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 0.85rem var(--pad);
  background: rgba(18, 21, 28, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.hub-header .logo {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
}

.hub-header .logo-sub {
  max-width: none;
  white-space: nowrap;
  font-size: 0.62rem;
  line-height: 1;
}

.hub-nav {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 1.25rem;
  white-space: nowrap;
}

.hub-nav a {
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fog);
  transition: color 0.25s;
}

.hub-nav a:hover {
  color: var(--paper-bright);
}

.hub-main {
  flex: 1;
  padding: clamp(2.5rem, 6vh, 4rem) var(--pad) clamp(3rem, 8vh, 5rem);
}

.hub-intro {
  max-width: 40rem;
  margin: 0 auto clamp(2.5rem, 6vw, 4rem);
  text-align: center;
}

.hub-intro h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--paper-bright);
  margin-bottom: 0.75rem;
}

.hub-intro p {
  color: var(--fog);
  max-width: 36ch;
  margin: 0 auto;
}

.hub-case-grid {
  max-width: 1100px;
  margin: 0 auto;
}

.hub-case-grid .case-tile h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  margin-bottom: 0.75rem;
  color: var(--paper-bright);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: clamp(1.25rem, 3vw, 2rem);
  max-width: 1100px;
  margin: 0 auto;
}

.game-card {
  display: flex;
  flex-direction: column;
  background: rgba(28, 33, 43, 0.72);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: rgba(185, 28, 44, 0.45);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.4);
}

.game-card-cover {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.game-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.05);
  transition: transform 0.6s var(--ease);
}

.game-card:hover .game-card-cover img {
  transform: scale(1.04);
}

.game-card-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(18, 21, 28, 0.75), transparent 55%);
  pointer-events: none;
}

.game-card-code {
  position: absolute;
  left: 0.85rem;
  bottom: 0.85rem;
  z-index: 1;
  font-family: var(--font-stamp);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--paper-bright);
  background: rgba(18, 21, 28, 0.78);
  border: 1px solid rgba(185, 28, 44, 0.45);
  padding: 0.3rem 0.55rem;
}

.game-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.15rem 1.15rem 1.25rem;
  gap: 0.65rem;
}

.game-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--steel);
}

.diff-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(196, 163, 90, 0.55);
  background: linear-gradient(180deg, rgba(196, 163, 90, 0.22), rgba(196, 163, 90, 0.08));
  color: #e6d3a0;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.game-card-body h2 {
  font-size: 1.35rem;
  color: var(--paper-bright);
}

.game-card-desc {
  flex: 1;
  color: var(--fog);
  font-size: 0.92rem;
  line-height: 1.5;
}

.game-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.game-card-tags li {
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fog);
  border: 1px solid var(--line);
  background: rgba(12, 16, 24, 0.55);
  padding: 0.28rem 0.5rem;
  border-radius: 4px;
}

.game-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.35rem;
}

.game-card-actions .btn {
  width: 100%;
}

.game-card-link {
  text-align: center;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--fog);
  transition: color 0.25s;
}

.game-card-link:hover {
  color: var(--paper-bright);
}

.hub-footer {
  padding: 1.75rem var(--pad) 2.5rem;
  border-top: 1px solid var(--line);
  text-align: center;
}

.hub-footer p {
  color: var(--fog);
  font-size: 0.8rem;
}

.hub-footer p + p {
  margin-top: 0.35rem;
}

.hub-footer a {
  color: var(--paper);
  border-bottom: 1px solid var(--line);
}

.hub-disclaimer {
  max-width: 36rem;
  margin: 0.75rem auto 0;
  font-size: 0.75rem;
  line-height: 1.45;
  opacity: 0.8;
}

@media (max-width: 640px) {
  .hub-header {
    gap: 0.75rem;
    padding: 0.75rem 1rem;
  }

  .hub-header .logo-sub {
    font-size: 0.5rem;
    letter-spacing: 0.08em;
  }

  .hub-nav {
    gap: 0.85rem;
  }

  .hub-nav a {
    font-size: 0.72rem;
  }
}

/* PIN popup */
body.pin-open {
  overflow: hidden;
}

.pin-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background:
    radial-gradient(ellipse 60% 40% at 50% 20%, rgba(185, 28, 44, 0.12), transparent 55%),
    rgba(6, 8, 12, 0.86);
  backdrop-filter: blur(10px);
}

.pin-overlay.is-open {
  display: flex;
  animation: pinFade 0.22s var(--ease);
}

@keyframes pinFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.pin-dialog {
  position: relative;
  width: min(100%, 400px);
  padding: 1.85rem 1.6rem 1.55rem;
  background:
    linear-gradient(165deg, rgba(36, 42, 54, 0.98) 0%, rgba(18, 22, 30, 0.98) 100%);
  border: 1px solid rgba(217, 212, 200, 0.18);
  border-radius: 14px;
  box-shadow:
    0 0 0 1px rgba(185, 28, 44, 0.12),
    0 28px 70px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: pinUp 0.28s var(--ease);
}

@keyframes pinUp {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.pin-dialog::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--stamp), transparent);
}

.pin-stamp {
  position: absolute;
  top: 1.1rem;
  right: 2.6rem;
  width: 54px;
  height: 54px;
  border: 2px solid rgba(185, 28, 44, 0.55);
  border-radius: 50%;
  color: rgba(185, 28, 44, 0.7);
  font-family: var(--font-stamp);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-12deg);
  pointer-events: none;
  opacity: 0.85;
}

.pin-close {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--fog);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.pin-close:hover {
  color: var(--paper-bright);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.pin-kicker {
  margin: 0 0 0.4rem;
  font-family: var(--font-stamp);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stamp);
}

.pin-dialog h2 {
  margin: 0 0 0.4rem;
  font-size: 1.45rem;
  color: var(--paper-bright);
}

.pin-case {
  margin: 0 0 1.25rem;
  color: var(--fog);
  font-size: 0.88rem;
  line-height: 1.35;
  max-width: 16rem;
}

.pin-label {
  display: block;
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--steel);
}

.pin-field {
  margin: 0 0 0.55rem;
}

.pin-input {
  width: 100%;
  box-sizing: border-box;
  padding: 1rem 1.05rem;
  border: 1px solid rgba(168, 178, 196, 0.28);
  border-radius: 10px;
  background: rgba(8, 10, 14, 0.92);
  color: #b8f0c4;
  font-family: ui-monospace, "Cascadia Code", "IBM Plex Mono", monospace;
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0.42em;
  text-align: center;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pin-input::placeholder {
  color: rgba(154, 168, 184, 0.35);
  letter-spacing: 0.42em;
}

.pin-input:focus {
  border-color: rgba(125, 206, 160, 0.55);
  box-shadow: 0 0 0 3px rgba(125, 206, 160, 0.12);
}

.pin-hint {
  margin: 0 0 1rem;
  font-size: 0.78rem;
  color: var(--steel);
  line-height: 1.4;
}

.pin-error {
  margin: -0.35rem 0 0.9rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  background: rgba(176, 48, 48, 0.14);
  border: 1px solid rgba(240, 128, 128, 0.35);
  color: #f0a0a0;
  font-size: 0.86rem;
  line-height: 1.35;
}

.pin-error[hidden] {
  display: none;
}

.pin-submit {
  width: 100%;
  min-height: 48px;
}
