@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap");
@import url("mobile.css");

/* ── Backdrop (catalog + in-game) ── */
.gi-backdrop,
.gi-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(6, 4, 14, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: "Outfit", system-ui, sans-serif;
}

.gi-backdrop:not(.hidden),
.gi-overlay.open {
  display: flex;
}

/* Normalize game overlays that reuse #startOverlay */
#startOverlay.gi-backdrop,
#symbolOverlay.gi-backdrop,
.overlay.gi-backdrop {
  z-index: 10002;
}

/* ── Panel shell ── */
.gi-shell {
  position: relative;
  width: min(100%, 440px);
  max-height: min(90vh, 620px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(165deg, #1e1230 0%, #110a1c 48%, #0c0612 100%);
  border: 1px solid rgba(167, 139, 250, 0.28);
  border-radius: 22px;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(167, 139, 250, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
  color: #f3eef8;
  animation: giSlideUp 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes giSlideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.gi-shell__header {
  padding: 22px 22px 0;
  flex-shrink: 0;
}

.gi-shell__scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 22px;
  overscroll-behavior: contain;
}

.gi-shell__scroll::-webkit-scrollbar { width: 5px; }
.gi-shell__scroll::-webkit-scrollbar-thumb {
  background: rgba(167, 139, 250, 0.35);
  border-radius: 99px;
}

.gi-shell__footer {
  flex-shrink: 0;
  padding: 14px 22px 20px;
  border-top: 1px solid rgba(167, 139, 250, 0.12);
  background: rgba(8, 4, 14, 0.5);
}

.gi-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(167, 139, 250, 0.22);
  border-radius: 10px;
  background: rgba(12, 6, 18, 0.85);
  color: #c4b5fd;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.gi-close:hover {
  background: rgba(167, 139, 250, 0.15);
  border-color: rgba(167, 139, 250, 0.4);
}

.gi-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #c4b5fd;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.22);
  padding: 5px 11px;
  border-radius: 99px;
  margin-bottom: 12px;
}

.gi-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a78bfa;
  box-shadow: 0 0 8px #a78bfa;
}

.gi-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 6px;
  color: #faf5ff;
  padding-right: 36px;
}

.gi-tagline {
  font-size: 14px;
  color: #9d8fb0;
  margin: 0;
  line-height: 1.5;
}

/* ── Step progress ── */
.gi-progress {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
}

.gi-progress__step {
  flex: 1;
  text-align: center;
}

.gi-progress__bar {
  height: 4px;
  border-radius: 99px;
  background: rgba(157, 143, 176, 0.2);
  margin-bottom: 6px;
  transition: background 0.3s;
}

.gi-progress__step.is-active .gi-progress__bar,
.gi-progress__step.is-done .gi-progress__bar {
  background: linear-gradient(90deg, #a78bfa, #7c3aed);
}

.gi-progress__step.is-done .gi-progress__bar {
  opacity: 0.55;
}

.gi-progress__label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b6080;
}

.gi-progress__step.is-active .gi-progress__label {
  color: #a78bfa;
}

.gi-step-heading {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 8px;
  color: #f3eef8;
}

.gi-step-body {
  font-size: 14px;
  color: #b8a9d4;
  line-height: 1.6;
  margin: 0 0 16px;
}

.gi-step-body strong {
  color: #e9d5ff;
  font-weight: 600;
}

/* ── Cards ── */
.gi-tip-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(167, 139, 250, 0.07);
  border: 1px solid rgba(167, 139, 250, 0.18);
  margin-bottom: 12px;
}

.gi-tip-card__icon {
  font-size: 26px;
  line-height: 1;
  flex-shrink: 0;
}

.gi-tip-card p {
  margin: 0;
  font-size: 13px;
  color: #d8ccf0;
  line-height: 1.55;
}

.gi-list {
  list-style: none;
  margin: 0 0 4px;
  padding: 0;
}

.gi-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  font-size: 13px;
  color: #d8ccf0;
  border-bottom: 1px solid rgba(167, 139, 250, 0.1);
}

.gi-list li:last-child { border-bottom: 0; }

.gi-list__num {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(167, 139, 250, 0.15);
  color: #a78bfa;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gi-gestures {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gi-gesture {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(12, 6, 18, 0.65);
  border: 1px solid rgba(167, 139, 250, 0.14);
  transition: border-color 0.2s, transform 0.15s;
}

.gi-gesture:hover {
  border-color: rgba(167, 139, 250, 0.35);
  transform: translateX(3px);
}

.gi-gesture__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(167, 139, 250, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.gi-gesture__name {
  font-size: 15px;
  font-weight: 700;
  color: #faf5ff;
  margin-bottom: 2px;
}

.gi-gesture__desc {
  font-size: 12px;
  color: #9d8fb0;
  line-height: 1.45;
}

.gi-rules {
  margin: 0 0 14px;
  padding: 12px 14px 12px 32px;
  border-radius: 12px;
  background: rgba(251, 191, 36, 0.06);
  border: 1px solid rgba(251, 191, 36, 0.18);
  font-size: 13px;
  color: #fde68a;
  line-height: 1.55;
}

.gi-ready {
  text-align: center;
  padding: 18px 16px;
  border-radius: 14px;
  background: rgba(52, 211, 153, 0.06);
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.gi-ready__emoji {
  font-size: 32px;
  margin-bottom: 6px;
}

.gi-ready p {
  margin: 0;
  font-size: 14px;
  color: #a7f3d0;
}

.gi-hint {
  text-align: center;
  font-size: 13px;
  color: #9d8fb0;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.gi-hint__pinch {
  font-size: 18px;
  animation: giPinch 1.3s ease-in-out infinite;
}

@keyframes giPinch {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.85); }
}

/* ── Footer buttons ── */
.gi-actions {
  display: flex;
  gap: 10px;
}

.gi-actions--stack {
  flex-direction: column;
}

.gi-btn {
  flex: 1;
  padding: 13px 18px;
  border-radius: 12px;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

.gi-btn:active { transform: scale(0.98); }

.gi-btn--ghost {
  background: transparent;
  color: #a78bfa;
  border: 1px solid rgba(167, 139, 250, 0.32);
}

.gi-btn--ghost:hover {
  background: rgba(167, 139, 250, 0.08);
}

.gi-btn--primary {
  background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
  color: #fff;
  box-shadow: 0 8px 28px rgba(124, 58, 237, 0.35);
}

.gi-btn--primary:hover {
  filter: brightness(1.06);
  box-shadow: 0 10px 32px rgba(124, 58, 237, 0.45);
}

.gi-btn--x {
  background: linear-gradient(135deg, #67e8f9, #0891b2);
  color: #082f49;
}

.gi-btn--o {
  background: linear-gradient(135deg, #c4b5fd, #7c3aed);
  color: #fff;
}

@media (max-width: 480px) {
  .gi-shell { border-radius: 18px; }
  .gi-actions { flex-direction: column-reverse; }
  .gi-title { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  .gi-shell { animation: none; }
  .gi-hint__pinch { animation: none; }
}

/* ── Dedicated instruction page ── */
.hidden { display: none !important; }

.gi-page {
  min-height: 100vh;
  margin: 0;
  background: #0c0612;
  color: #f3eef8;
  font-family: "Outfit", system-ui, sans-serif;
}

.gi-page__bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(124, 58, 237, 0.28), transparent),
    radial-gradient(ellipse 55% 45% at 100% 100%, rgba(167, 139, 250, 0.1), transparent),
    #0c0612;
  pointer-events: none;
}

.gi-page__top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
}

.gi-page__back {
  color: #a78bfa;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: color 0.2s;
}

.gi-page__back:hover { color: #c4b5fd; }

.gi-page__logo {
  font-family: "Creepster", cursive;
  font-size: 18px;
  letter-spacing: 0.06em;
  color: rgba(167, 139, 250, 0.55);
}

.gi-page__main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 64px);
  padding: 8px 20px 48px;
}

.gi-page__missing {
  text-align: center;
  color: #9d8fb0;
  font-size: 15px;
}

.gi-page__missing a { color: #a78bfa; }

.gi-game-card {
  width: min(100%, 480px);
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(167, 139, 250, 0.32);
  box-shadow:
    0 28px 72px rgba(0, 0, 0, 0.55),
    0 0 48px rgba(124, 58, 237, 0.14);
  animation: giSlideUp 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.gi-game-card__hero {
  position: relative;
  height: 168px;
  background-color: #1a1028;
  background-size: cover;
  background-position: center;
}

.gi-game-card__hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(12, 6, 18, 0.15) 0%,
    rgba(12, 6, 18, 0.55) 55%,
    #110a1c 100%
  );
}

.gi-game-card__pill {
  position: absolute;
  top: 14px;
  left: 16px;
  z-index: 1;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #e9d5ff;
  background: rgba(12, 6, 18, 0.72);
  border: 1px solid rgba(167, 139, 250, 0.35);
  padding: 5px 12px;
  border-radius: 99px;
  backdrop-filter: blur(8px);
}

.gi-shell--page {
  width: 100%;
  max-height: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  animation: none;
}

.gi-btn--link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  text-align: center;
}
