/* ─── The Cursed Land — Game Selection Hub ──────────────────────────────────
   Standalone stylesheet. Does not touch / depend on style.css so the
   existing POPU Market app (thecursedland.html) stays completely unaffected. */

:root {
  --hub-design-w: 1536px;
  --hub-design-h: 933px;
  --hub-stage-left: 0px;
  --hub-stage-top: 0px;
  --hub-stage-transform: scale(1);
  --hub-stage-scale: 1;
  --hub-bg: #07090b;
  --hub-gold: #d9a760;
  --hub-gold-deep: #7d5124;
  --hub-teal: #49bdc5;
  --hub-text: #f5f1e9;
  --hub-muted: #a9b0ad;
  --hub-green: #5ad58a;
  --hub-red: #e05757;
  --hub-line: rgba(198, 148, 78, 0.28);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--hub-bg);
  color: var(--hub-text);
  font-family: Arial, Helvetica, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

/* ── Background layers ──────────────────────────────────────────────────── */

.hub-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 55% at 50% 12%, rgba(217, 167, 96, 0.16) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 85% 85%, rgba(73, 189, 197, 0.12) 0%, transparent 65%),
    radial-gradient(ellipse 60% 50% at 10% 90%, rgba(125, 81, 36, 0.18) 0%, transparent 65%),
    linear-gradient(180deg, #0a0d10 0%, #07090b 45%, #050607 100%);
}

.hub-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("ui icons/03_background_center.png");
  background-size: cover;
  background-position: center;
  opacity: 0.14;
  mix-blend-mode: screen;
  filter: saturate(0.7) contrast(1.1);
}

.hub-vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 70% at 50% 50%, transparent 45%, rgba(0,0,0,0.55) 100%);
}

.hub-particles {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.hub-particle {
  position: absolute;
  bottom: -10px;
  border-radius: 50%;
  background: var(--hub-gold);
  box-shadow: 0 0 6px 1px rgba(217, 167, 96, 0.8);
  opacity: 0;
  animation-name: hub-float-up;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
.hub-particle.teal {
  background: var(--hub-teal);
  box-shadow: 0 0 6px 1px rgba(73, 189, 197, 0.8);
}

@keyframes hub-float-up {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  8%   { opacity: 0.85; }
  85%  { opacity: 0.5; }
  100% { transform: translateY(-105vh) translateX(var(--hub-drift, 20px)); opacity: 0; }
}

/* ── Page scaffold ───────────────────────────────────────────────────────── */

.hub-page {
  position: fixed;
  z-index: 3;
  left: var(--hub-stage-left);
  top: var(--hub-stage-top);
  width: var(--hub-design-w);
  height: var(--hub-design-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 34px 54px 24px;
  gap: 28px;
  overflow: hidden;
  transform: var(--hub-stage-transform);
  transform-origin: top left;
  will-change: transform, left, top;
}

.hub-header {
  text-align: center;
  opacity: 0;
  transform: translateY(-14px);
  animation: hub-fade-in 0.7s ease forwards;
  animation-delay: 0.05s;
}

.hub-logo {
  width: 220px;
  margin: 0 auto 14px;
  display: block;
  filter: drop-shadow(0 0 28px rgba(217, 167, 96, 0.45));
}

.hub-title {
  font-size: clamp(24px, 4.2vw, 38px);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--hub-gold);
  text-shadow: 0 0 28px rgba(217, 167, 96, 0.45), 0 2px 8px rgba(0,0,0,0.6);
  margin: 0 0 8px;
}

.hub-subtitle {
  font-size: 17px;
  color: var(--hub-muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 0;
}

/* ── Card grid ───────────────────────────────────────────────────────────── */

.hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 42px;
  width: min(1720px, calc(100% - 96px));
  justify-content: center;
}

.hub-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  height: 560px;
  border: 1px solid var(--hub-line);
  background:
    linear-gradient(180deg, rgba(20,14,6,0.35) 0%, rgba(6,5,3,0.92) 78%),
    linear-gradient(135deg, #1c1a22 0%, #0c0c10 100%);
  box-shadow: 0 18px 42px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateY(24px) scale(0.97);
  animation: hub-fade-in 0.7s ease forwards;
  transition: transform 0.32s cubic-bezier(.2,.9,.25,1), box-shadow 0.32s ease, border-color 0.32s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.hub-grid .hub-card:nth-child(1) { animation-delay: 0.15s; }
.hub-grid .hub-card:nth-child(2) { animation-delay: 0.28s; }
.hub-grid .hub-card:nth-child(3) { animation-delay: 0.41s; }

@keyframes hub-fade-in {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Card artwork backdrop */
.hub-card-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.5s ease, filter 0.4s ease;
}

.hub-card-body {
  position: relative;
  z-index: 1;
  padding: 24px 26px 28px;
}

.hub-card-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

.hub-card-name {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 6px;
  letter-spacing: 0.01em;
}

.hub-card-desc {
  font-size: 15px;
  color: var(--hub-muted);
  line-height: 1.45;
  margin: 0 0 16px;
}

/* ── Card #1 — The Cursed Land (ONLINE / playable) ──────────────────────── */

.hub-card--online {
  border-color: rgba(217, 167, 96, 0.45);
  cursor: pointer;
}
.hub-card--online .hub-card-art {
  background-color: #120a18;
  background-image:
    linear-gradient(180deg, transparent 0%, transparent 34%, rgba(8,5,12,0.6) 50%, rgba(6,5,3,0.97) 68%),
    url("images/thecursedland.jpg");
  background-size: 100% 100%, 100% auto;
  background-position: center, top center;
  background-repeat: no-repeat, no-repeat;
  filter: saturate(1.05) contrast(1.05);
}
.hub-card--online .hub-card-name { color: var(--hub-gold); }
.hub-card--online .hub-card-badge {
  background: rgba(90, 213, 138, 0.18);
  color: var(--hub-green);
  border: 1px solid rgba(90, 213, 138, 0.55);
  box-shadow: 0 0 14px rgba(90, 213, 138, 0.35);
}
.hub-card--online .hub-card-badge::before {
  content: "●";
  margin-right: 5px;
  font-size: 8px;
  animation: hub-pulse 1.6s ease-in-out infinite;
}

.hub-card--online:hover,
.hub-card--online:focus-visible {
  transform: translateY(-8px) scale(1.035);
  box-shadow: 0 26px 60px rgba(217, 167, 96, 0.28), 0 0 0 1px rgba(217,167,96,0.6);
  border-color: rgba(217, 167, 96, 0.85);
}
.hub-card--online:hover .hub-card-art { transform: scale(1.07); }

.hub-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: center;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 9px;
  border: 1px solid rgba(217, 167, 96, 0.55);
  background: linear-gradient(180deg, rgba(217,167,96,0.95) 0%, rgba(157,112,49,0.95) 100%);
  color: #1a1206;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: filter 0.15s, transform 0.15s;
}
.hub-card--online:hover .hub-play-btn { filter: brightness(1.12); transform: translateY(-1px); }

@keyframes hub-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.hub-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  padding: 11px 18px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
/* ── Card #2 — New Game (COMING SOON) ────────────────────────────────────── */

.hub-card--soon {
  cursor: not-allowed;
}
.hub-card--soon .hub-card-art {
  background:
    radial-gradient(ellipse 70% 55% at 50% 25%, rgba(73, 189, 197, 0.22) 0%, transparent 65%),
    linear-gradient(160deg, #11181c 0%, #07090b 75%);
}
.hub-card--soon .hub-card-badge {
  background: rgba(73, 189, 197, 0.16);
  color: var(--hub-teal);
  border: 1px solid rgba(73, 189, 197, 0.45);
}
.hub-card--soon .hub-card-name { color: #d6eef0; }
.hub-card--soon:hover { transform: translateY(-2px); border-color: rgba(73,189,197,0.4); }

.hub-mystery-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  z-index: 1;
  font-size: 66px;
  font-weight: 800;
  color: rgba(73, 189, 197, 0.55);
  text-shadow: 0 0 22px rgba(73, 189, 197, 0.5);
  animation: hub-mystery-glow 2.4s ease-in-out infinite;
}
@keyframes hub-mystery-glow {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 0.95; }
}

.hub-card--soon .hub-status-pill {
  background: rgba(73,189,197,0.08);
  border: 1px solid rgba(73,189,197,0.3);
  color: var(--hub-teal);
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

.hub-footer {
  text-align: center;
  font-size: 12px;
  color: var(--hub-muted);
  letter-spacing: 0.03em;
  opacity: 0;
  animation: hub-fade-in 0.7s ease forwards;
  animation-delay: 0.5s;
}

.pwa-install-popup {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom, 0px));
  z-index: 20;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: min(520px, calc(100vw - 28px));
  min-height: 78px;
  padding: 14px 16px;
  padding-right: 48px;
  border: 1px solid rgba(217, 167, 96, 0.45);
  border-radius: 10px;
  background:
    radial-gradient(circle at 14% 0, rgba(217, 167, 96, 0.18), transparent 34%),
    linear-gradient(160deg, rgba(18, 14, 8, 0.96), rgba(4, 8, 9, 0.98));
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.66),
    inset 0 1px 0 rgba(255, 221, 148, 0.14);
  color: var(--hub-text);
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.pwa-install-popup.show {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

.pwa-install-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 0 18px rgba(217, 167, 96, 0.22);
}

.pwa-install-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.pwa-install-copy b {
  color: #fff;
  font-size: 15px;
  line-height: 1.15;
}

.pwa-install-action {
  height: 38px;
  padding: 0 18px;
  border: 1px solid rgba(217, 167, 96, 0.46);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(181, 122, 54, 0.92), rgba(95, 61, 26, 0.94));
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
  box-shadow: inset 0 1px 0 rgba(255, 235, 172, 0.18);
}

.pwa-install-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(217, 167, 96, 0.35);
  border-radius: 6px;
  background: rgba(4, 6, 7, 0.66);
  color: rgba(245, 241, 233, 0.86);
  font-size: 13px;
  font-weight: 900;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 880px) {
  .hub-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .hub-card { height: 560px; }
  .hub-mystery-icon { transform: translate(-50%, -60%); }
}

@media (prefers-reduced-motion: reduce) {
  .hub-card, .hub-header, .hub-footer, .hub-particle {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
