/* =========================================================
   PLAYFORGE — Page-specific styles
   ========================================================= */

/* ---------- Hero (home) ---------- */

.hero {
  position: relative;
  padding: 72px 0 90px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -10% -10% auto -10%;
  height: 520px;
  background: var(--gradient-glow);
  pointer-events: none;
  z-index: 0;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}

@media (max-width: 920px) {
  .hero-inner { grid-template-columns: 1fr; }
}

.hero-copy .chip { margin-bottom: 20px; }

.hero-title {
  font-size: clamp(2.3rem, 6vw, 4.1rem);
  line-height: 1.04;
  margin-bottom: 20px;
}

.hero-sub {
  color: var(--ink-muted);
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  max-width: 480px;
  margin-bottom: 30px;
}

.hero-cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 36px; }

.hero-stats {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.hero-stat strong {
  font-family: var(--font-display);
  font-size: 1.5rem;
  display: block;
}
.hero-stat span { font-size: 0.8rem; color: var(--ink-muted); }

/* Floating world stack */
.world-stack {
  position: relative;
  height: 420px;
}
@media (max-width: 920px) { .world-stack { height: 300px; margin-top: 10px; } }

.world-card {
  position: absolute;
  width: 260px;
  border-radius: var(--radius-md);
  padding: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.65);
  transition: transform 0.4s ease;
}
.world-card:hover { transform: translateY(-6px) rotate(0deg) !important; }

.world-card h4 { font-size: 0.98rem; margin-bottom: 4px; color: #fff; }
.world-card span { font-size: 0.76rem; color: rgba(255,255,255,0.75); }

.world-card-1 { top: 10px; left: 6%; transform: rotate(-7deg); z-index: 1; }
.world-card-2 { top: 90px; left: 32%; transform: rotate(4deg); z-index: 2; }
.world-card-3 { top: 190px; left: 8%; transform: rotate(-3deg); z-index: 3; }

@media (max-width: 920px) {
  .world-card { width: 48%; }
  .world-card-1 { left: 0; top: 0; }
  .world-card-2 { left: 52%; top: 50px; }
  .world-card-3 { display: none; }
}

.world-glyph {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 40px;
}
.world-glyph svg { width: 18px; height: 18px; color: #fff; }

/* Neon particles — subtle, few, respects reduced motion */
.ember-particle {
  position: absolute;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8B5CF6, #60A5FA); box-shadow: 0 0 12px rgba(96,165,250,0.65);
  opacity: 0;
  animation: float-up 6s ease-in infinite;
  z-index: 0;
}
@keyframes float-up {
  0% { opacity: 0; transform: translateY(0) scale(0.6); }
  10% { opacity: 0.8; }
  80% { opacity: 0.4; }
  100% { opacity: 0; transform: translateY(-260px) scale(1); }
}

/* ---------- Category pills ---------- */

.category-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.category-row::-webkit-scrollbar { display: none; }

.category-pill {
  flex-shrink: 0;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-muted);
  display: flex; align-items: center; gap: 8px;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.category-pill:hover { color: var(--ink); border-color: #3a3b43; }
.category-pill.active {
  background: var(--gradient-ember);
  color: #ffffff;
  border-color: transparent;
}
.category-pill svg { width: 15px; height: 15px; }

/* ---------- Category showcase tiles (home) ---------- */

.cat-tile-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 880px) { .cat-tile-grid { grid-template-columns: repeat(2, 1fr); } }

.cat-tile {
  border-radius: var(--radius-md);
  padding: 22px 18px;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  min-height: 128px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.cat-tile:hover { transform: translateY(-3px); border-color: #3a3b43; }
.cat-tile h3 { font-size: 1.02rem; color: #fff; position: relative; z-index: 1; }
.cat-tile span { font-size: 0.78rem; color: rgba(255,255,255,0.7); position: relative; z-index: 1; }
.cat-tile svg { position: absolute; top: 16px; right: 16px; width: 26px; height: 26px; color: rgba(255,255,255,0.5); z-index: 1; }

/* ---------- Creator promo band ---------- */

.promo-band {
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, #171326 0%, #1D1A36 55%, #111B32 100%);
  border: 1px solid var(--border);
  padding: 48px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 32px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.promo-band::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(60% 80% at 100% 0%, rgba(96,165,250,0.16), transparent 60%), radial-gradient(55% 75% at 8% 100%, rgba(139,92,246,0.18), transparent 60%);
}
@media (max-width: 820px) {
  .promo-band { grid-template-columns: 1fr; padding: 32px 22px; }
}
.promo-band h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-bottom: 12px; position: relative; }
.promo-band p { color: var(--ink-muted); margin-bottom: 22px; max-width: 440px; position: relative; }
.promo-stats {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}
.promo-stat {
  display: flex; align-items: center; gap: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.promo-stat svg { width: 22px; height: 22px; color: var(--ember-hot); flex-shrink: 0; }
.promo-stat strong { display: block; font-family: var(--font-display); font-size: 1.05rem; }
.promo-stat span { font-size: 0.78rem; color: var(--ink-muted); }

/* =========================================================
   Discover page
   ========================================================= */

.discover-head { padding: 44px 0 10px; }
.discover-title { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 10px; }
.discover-sub { color: var(--ink-muted); max-width: 560px; }

.search-bar {
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 8px 6px 18px;
  max-width: 560px;
}
.search-bar svg { width: 18px; height: 18px; color: var(--ink-faint); flex-shrink: 0; }
.search-bar input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--ink);
  font-size: 0.95rem;
  padding: 10px 0;
}
.search-bar input::placeholder { color: var(--ink-faint); }

.discover-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 28px 0 22px;
  flex-wrap: wrap;
}

.sort-select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
}

.result-count { font-size: 0.86rem; color: var(--ink-muted); }

.tab-row {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 24px;
}
.tab-btn {
  background: none; border: none;
  padding: 12px 6px;
  margin-right: 22px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-muted);
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.tab-btn.active { color: var(--ink); border-color: #8B5CF6; }

.empty-state {
  text-align: center;
  padding: 70px 20px;
  color: var(--ink-muted);
}
.empty-state svg { width: 48px; height: 48px; margin: 0 auto 16px; color: var(--ink-faint); }
.empty-state h3 { color: var(--ink); margin-bottom: 8px; font-size: 1.1rem; }

/* =========================================================
   Create (dashboard)
   ========================================================= */

.dash-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  padding: 36px 0 80px;
}
@media (max-width: 860px) {
  .dash-shell { grid-template-columns: 1fr; }
}

.dash-side {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  align-self: start;
  position: sticky;
  top: calc(var(--nav-h) + 20px);
}
@media (max-width: 860px) { .dash-side { position: static; } }

.dash-side-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--ink-muted);
  font-weight: 500;
}
.dash-side-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.dash-side-item.active { background: var(--surface-raised); color: var(--ink); }

.dash-side-divider { height: 1px; background: var(--border-soft); margin: 14px 0; }

.dash-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; flex-wrap: wrap; gap: 14px;}
.dash-head h1 { font-size: clamp(1.5rem, 3vw, 2rem); }
.dash-head p { color: var(--ink-muted); font-size: 0.92rem; margin-top: 4px; }

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 40px;
}

.template-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
  text-align: left;
}
.template-card:hover { transform: translateY(-2px); border-color: #3a3b43; }
.template-card.selected {
  border-color: #8B5CF6;
  background: linear-gradient(180deg, rgba(139,92,246,0.12), rgba(59,130,246,0.04) 65%, transparent 100%);
}
.template-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.template-icon svg { width: 22px; height: 22px; color: #fff; }
.template-card h3 { font-size: 1rem; margin-bottom: 6px; }
.template-card p { color: var(--ink-muted); font-size: 0.84rem; line-height: 1.5; }

.new-project-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px;
  margin-bottom: 44px;
}
.new-project-panel h2 { font-size: 1.1rem; margin-bottom: 18px; }

.form-row { margin-bottom: 18px; }
.form-row label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 8px;
}
.form-row input, .form-row select, .form-row textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  color: var(--ink);
  font-size: 0.94rem;
  outline: none;
  transition: border-color 0.15s ease;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: var(--steel); }
.form-hint { font-size: 0.78rem; color: var(--ink-faint); margin-top: 6px; }
.form-error { font-size: 0.78rem; color: #FF8C7A; margin-top: 6px; display: none; }
.form-error.show { display: block; }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.project-thumb {
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.project-thumb svg { width: 34px; height: 34px; color: rgba(255,255,255,0.85); }
.project-body { padding: 16px; }
.project-body h3 { font-size: 0.98rem; margin-bottom: 4px; }
.project-body .template-label { font-size: 0.78rem; color: var(--ink-muted); margin-bottom: 14px; }
.project-actions { display: flex; gap: 8px; }
.project-actions .btn { flex: 1; }

.dash-empty {
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 50px 20px;
  text-align: center;
  color: var(--ink-muted);
}
.dash-empty svg { width: 40px; height: 40px; margin: 0 auto 14px; color: var(--ink-faint); }

/* =========================================================
   Login / signup
   ========================================================= */

.auth-shell {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px 20px;
  position: relative;
  overflow: hidden;
}
.auth-shell::before {
  content: "";
  position: absolute; inset: -20% -10% auto -10%;
  height: 500px;
  background: var(--gradient-glow);
  pointer-events: none;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  position: relative;
  z-index: 1;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-bottom: 22px;
}

.demo-banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--steel-dim);
  border: 1px solid #38498A;
  color: #D7E2FF;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  margin-bottom: 22px;
  line-height: 1.5;
}
.demo-banner svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; }

.auth-tabs {
  display: flex;
  background: var(--bg-elevated);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  background: none; border: none;
  color: var(--ink-muted);
  transition: background 0.18s ease, color 0.18s ease;
}
.auth-tab.active { background: var(--gradient-ember); color: #ffffff; box-shadow: 0 4px 16px rgba(139,92,246,0.22); }

.auth-title { text-align: center; font-size: 1.3rem; margin-bottom: 6px; }
.auth-subtitle { text-align: center; color: var(--ink-muted); font-size: 0.87rem; margin-bottom: 26px; }

.pw-strength {
  height: 4px;
  border-radius: 999px;
  background: var(--border);
  margin-top: 8px;
  overflow: hidden;
}
.pw-strength-bar { height: 100%; width: 0%; background: var(--gradient-ember); transition: width 0.25s ease, background 0.25s ease; }

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 22px 0;
  color: var(--ink-faint);
  font-size: 0.78rem;
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border-soft); }

.auth-social { display: flex; gap: 10px; }
.auth-social .btn { flex: 1; }

.auth-footnote { text-align: center; margin-top: 22px; font-size: 0.85rem; color: var(--ink-muted); }
.auth-footnote button { background: none; border: none; color: var(--steel); font-weight: 600; }

.success-panel { text-align: center; padding: 10px 0; }
.success-panel svg { width: 54px; height: 54px; color: #4ADE80; margin: 0 auto 16px; }
.success-panel h2 { font-size: 1.25rem; margin-bottom: 8px; }
.success-panel p { color: var(--ink-muted); font-size: 0.9rem; margin-bottom: 22px; }
