/* ============================================================
   Block Puzzle Master — Global Styles  v2
   Prefix: bpm-
   ============================================================ */

/* Google Fonts loaded via <link> in HTML for better performance */

:root {
  --color-primary:      #5c35e8;
  --color-primary-dark: #4626c0;
  --color-accent:       #ff9f1c;
  --color-accent-dark:  #e88800;
  --color-green:        #22c55e;
  --color-bg:           #0f0e1a;
  --color-bg-surface:   #1a1830;
  --color-bg-card:      #231f3a;
  --color-text:         #f0eeff;
  --color-text-muted:   #9d97c0;
  --color-border:       rgba(255,255,255,0.08);
  --color-glow:         rgba(92,53,232,0.35);
  --font-base:          'Nunito', 'Segoe UI', Arial, sans-serif;
  --radius:             14px;
  --radius-sm:          8px;
  --shadow:             0 4px 20px rgba(0,0,0,0.4);
  --shadow-glow:        0 0 24px rgba(92,53,232,0.4);
  --header-h:           64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-base);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(92,53,232,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(255,159,28,0.06) 0%, transparent 50%);
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: #8a6ff0; text-decoration: none; }

img { max-width: 100%; display: block; }

/* ============================================================
   Header
   ============================================================ */
.bpm-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(15,14,26,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 1000;
  border-bottom: 1px solid var(--color-border);
}

.bpm-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--color-text);
  letter-spacing: -0.3px;
}

.bpm-header__brand span { color: var(--color-accent); }

.bpm-header__nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.bpm-header__nav a {
  color: var(--color-text-muted);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  transition: color 0.2s, background 0.2s;
}

.bpm-header__nav a:hover { color: var(--color-text); background: rgba(255,255,255,0.06); }
.bpm-header__nav a.active { color: #fff; background: var(--color-primary); }

/* ============================================================
   Page wrapper
   ============================================================ */
.bpm-page {
  padding-top: var(--header-h);
  min-height: 100vh;
}

/* ============================================================
   Hero section (index only)
   ============================================================ */
.bpm-hero {
  background: linear-gradient(135deg, #1a1244 0%, #0f0e1a 60%);
  border-bottom: 1px solid var(--color-border);
  padding: 36px 24px 0;
  position: relative;
  overflow: hidden;
}

.bpm-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle 400px at 20% 50%, rgba(92,53,232,0.2) 0%, transparent 70%),
    radial-gradient(circle 300px at 80% 20%, rgba(255,159,28,0.1) 0%, transparent 60%);
  pointer-events: none;
}

/* Decorative floating blocks */
.bpm-hero__deco {
  position: absolute;
  border-radius: 6px;
  opacity: 0.15;
  animation: floatBlock 6s ease-in-out infinite;
}

.bpm-hero__deco:nth-child(1) { width:40px;height:40px;background:#5c35e8;top:18%;left:5%;animation-delay:0s; }
.bpm-hero__deco:nth-child(2) { width:24px;height:24px;background:#ff9f1c;top:55%;left:8%;animation-delay:1.2s; }
.bpm-hero__deco:nth-child(3) { width:32px;height:32px;background:#22c55e;top:30%;right:6%;animation-delay:2.4s; }
.bpm-hero__deco:nth-child(4) { width:48px;height:16px;background:#e879f9;top:70%;right:4%;animation-delay:0.8s; }
.bpm-hero__deco:nth-child(5) { width:16px;height:48px;background:#38bdf8;top:10%;right:12%;animation-delay:3s; }

@keyframes floatBlock {
  0%,100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-12px) rotate(8deg); }
}

.bpm-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

/* ---- Portrait game column ---- */
.bpm-hero__game {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bpm-game-frame {
  width: 360px;
  border-radius: 20px 20px 0 0;
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 0 2px rgba(92,53,232,0.6), var(--shadow-glow), var(--shadow);
  position: relative;
}

/* Phone notch bar */
.bpm-game-frame::before {
  content: '';
  display: block;
  height: 8px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
}

.bpm-game-frame iframe {
  width: 360px;
  height: 640px;
  border: none;
  display: block;
}

.bpm-game-frame__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0a0814;
  padding: 10px 16px;
  border-top: 1px solid var(--color-border);
  border-radius: 0 0 20px 20px;
  gap: 8px;
}

.bpm-game-frame__label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text-muted);
  letter-spacing: 0.5px;
}

.bpm-game-frame__actions { display: flex; gap: 8px; }

.bpm-btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--color-text);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.bpm-btn-icon:hover { background: rgba(255,255,255,0.14); }

/* ---- Info column ---- */
.bpm-hero__info {
  flex: 1;
  min-width: 0;
  padding-bottom: 32px;
  padding-top: 8px;
}

.bpm-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(92,53,232,0.2);
  border: 1px solid rgba(92,53,232,0.4);
  color: #a78bfa;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.bpm-hero__title {
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.bpm-hero__title span { color: var(--color-accent); }

.bpm-hero__desc {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.8;
  margin-bottom: 20px;
  max-width: 480px;
}

.bpm-hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 20px;
}

.bpm-tag {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--color-text-muted);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}

.bpm-hero__rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.bpm-hero__stars { color: var(--color-accent); font-size: 1.1rem; letter-spacing: 2px; }
.bpm-hero__score { font-size: 0.85rem; color: var(--color-text-muted); font-weight: 700; }

/* Stat pills */
.bpm-hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.bpm-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
}

.bpm-stat__icon { font-size: 1.2rem; }

.bpm-stat__body { line-height: 1.3; }

.bpm-stat__value { font-size: 0.95rem; font-weight: 800; color: var(--color-text); }

.bpm-stat__label { font-size: 0.72rem; color: var(--color-text-muted); font-weight: 600; }

/* CTA buttons */
.bpm-hero__cta { display: flex; flex-wrap: wrap; gap: 10px; }

/* ============================================================
   Main content area (below hero)
   ============================================================ */
.bpm-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px;
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

.bpm-content__main { flex: 1; min-width: 0; }

.bpm-content__side {
  width: 280px;
  flex-shrink: 0;
}

/* ============================================================
   Section title
   ============================================================ */
.bpm-section-title {
  font-size: 1.2rem;
  font-weight: 900;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text);
}

.bpm-section-title::before {
  content: '';
  width: 4px;
  height: 1.1em;
  background: linear-gradient(180deg, var(--color-primary), var(--color-accent));
  border-radius: 2px;
  display: inline-block;
  flex-shrink: 0;
}

/* ============================================================
   Content card
   ============================================================ */
.bpm-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}

.bpm-card__header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.02);
}

.bpm-card__body { padding: 18px 20px; }

/* ============================================================
   Steps
   ============================================================ */
.bpm-steps { list-style: none; counter-reset: steps; }

.bpm-steps li {
  counter-increment: steps;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 13px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.92rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

.bpm-steps li:last-child { border-bottom: none; }

.bpm-steps li::before {
  content: counter(steps);
  min-width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--color-primary), #7c5fe0);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 900;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(92,53,232,0.4);
}

/* ============================================================
   Feature grid
   ============================================================ */
.bpm-features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 4px;
}

.bpm-feature-item {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  transition: border-color 0.2s, transform 0.2s;
}

.bpm-feature-item:hover {
  border-color: rgba(92,53,232,0.5);
  transform: translateY(-2px);
}

.bpm-feature-item__icon { font-size: 1.8rem; margin-bottom: 10px; }

.bpm-feature-item__title {
  font-size: 0.88rem;
  font-weight: 800;
  margin-bottom: 5px;
  color: var(--color-text);
}

.bpm-feature-item__desc {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* ============================================================
   FAQ  (accordion style)
   ============================================================ */
.bpm-faq { list-style: none; }

.bpm-faq li {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
}

.bpm-faq__q {
  padding: 14px 18px;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-bg-card);
  color: var(--color-text);
  user-select: none;
}

.bpm-faq__q::after {
  content: '›';
  font-size: 1.2rem;
  color: var(--color-text-muted);
  transform: rotate(90deg);
  display: inline-block;
  flex-shrink: 0;
}

.bpm-faq li.open .bpm-faq__q::after { transform: rotate(-90deg); }

.bpm-faq__a {
  display: none;
  padding: 0 18px 14px;
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.75;
  background: var(--color-bg-card);
}

.bpm-faq li.open .bpm-faq__a { display: block; }

/* ============================================================
   Buttons
   ============================================================ */
.bpm-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 26px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.bpm-btn:hover { transform: translateY(-2px); opacity: 0.92; text-decoration: none; }

.bpm-btn--primary {
  background: linear-gradient(135deg, var(--color-primary), #7c5fe0);
  color: #fff;
  box-shadow: 0 4px 16px rgba(92,53,232,0.4);
}

.bpm-btn--accent {
  background: linear-gradient(135deg, var(--color-accent), #f97316);
  color: #fff;
  box-shadow: 0 4px 16px rgba(255,159,28,0.35);
}

.bpm-btn--ghost {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--color-text);
}

/* ============================================================
   Share buttons
   ============================================================ */
.bpm-share { display: flex; flex-wrap: wrap; gap: 10px; }

.bpm-share__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.2s;
}

.bpm-share__btn:hover { opacity: 0.85; transform: translateY(-1px); text-decoration: none; }

.bpm-share__btn--twitter  { background: #111; color: #fff; border: 1px solid #333; }
.bpm-share__btn--facebook { background: #1877f2; color: #fff; }
.bpm-share__btn--copy     { background: rgba(255,255,255,0.08); border: 1px solid var(--color-border); color: var(--color-text); }

/* ============================================================
   Prose pages (how-to-play, privacy, etc.)
   ============================================================ */
.bpm-prose {
  max-width: 820px;
  margin: 0 auto;
  padding: 44px 24px;
}

.bpm-prose h1 {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.bpm-prose h2 {
  font-size: 1.1rem;
  font-weight: 800;
  margin: 30px 0 10px;
  color: var(--color-text);
  padding-left: 12px;
  border-left: 3px solid var(--color-primary);
}

.bpm-prose p {
  font-size: 0.93rem;
  color: var(--color-text-muted);
  margin-bottom: 12px;
  line-height: 1.85;
}

.bpm-prose ul { padding-left: 20px; margin-bottom: 12px; }

.bpm-prose ul li {
  font-size: 0.93rem;
  color: var(--color-text-muted);
  margin-bottom: 7px;
  line-height: 1.7;
}

.bpm-prose a { color: #a78bfa; }
.bpm-prose a:hover { color: #c4b5fd; }

.bpm-prose__meta {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 32px;
}

/* Steps inside prose */
.bpm-prose .bpm-steps li { color: var(--color-text-muted); font-size: 0.92rem; }

/* ============================================================
   Breadcrumb
   ============================================================ */
.bpm-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 20px;
}

.bpm-breadcrumb a { color: #a78bfa; }
.bpm-breadcrumb span { color: var(--color-text-muted); }

/* ============================================================
   Contact form
   ============================================================ */
.bpm-contact-form {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 28px;
  margin: 24px 0 32px;
}

.bpm-form-group { margin-bottom: 20px; }

.bpm-form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 7px;
  color: var(--color-text);
}

.bpm-form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font-base);
  background: var(--color-bg-surface);
  color: var(--color-text);
  transition: border-color 0.2s;
}

.bpm-form-input::placeholder { color: #4a4670; }

.bpm-form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(92,53,232,0.2);
}

.bpm-form-textarea { resize: vertical; min-height: 130px; }

/* ============================================================
   Footer
   ============================================================ */
.bpm-footer {
  background: var(--color-bg-surface);
  border-top: 1px solid var(--color-border);
  text-align: center;
  padding: 32px 16px;
  font-size: 0.85rem;
}

.bpm-footer__nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-bottom: 14px;
}

.bpm-footer__nav a {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  transition: color 0.2s;
}

.bpm-footer__nav a:hover { color: var(--color-text); }

.bpm-footer__copy { color: #4a4670; font-size: 0.8rem; }

/* ============================================================
   Focus visible — keyboard navigation accessibility
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.bpm-btn:focus-visible,
.bpm-btn-icon:focus-visible,
.bpm-share__btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* ============================================================
   Screenshot Gallery
   ============================================================ */
.bpm-gallery-section { margin-bottom: 36px; }

.bpm-gallery {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.bpm-gallery__item {
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-bg-card);
  cursor: pointer;
  padding: 0;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.bpm-gallery__item:hover {
  border-color: rgba(92,53,232,0.6);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(92,53,232,0.3);
}

.bpm-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}

.bpm-gallery__item:hover img { transform: scale(1.04); }

/* Lightbox */
.bpm-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.92);
  align-items: center;
  justify-content: center;
}

.bpm-lightbox.open { display: flex; }

.bpm-lightbox__stage {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bpm-lightbox__img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: var(--radius);
  box-shadow: 0 8px 48px rgba(0,0,0,0.8);
  display: block;
  object-fit: contain;
}

.bpm-lightbox__close,
.bpm-lightbox__prev,
.bpm-lightbox__next {
  position: fixed;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  transition: background 0.2s;
  z-index: 2001;
}

.bpm-lightbox__close:hover,
.bpm-lightbox__prev:hover,
.bpm-lightbox__next:hover { background: rgba(255,255,255,0.22); }

.bpm-lightbox__close { top: 18px; right: 18px; font-size: 1rem; }
.bpm-lightbox__prev  { left: 16px; top: 50%; transform: translateY(-50%); }
.bpm-lightbox__next  { right: 16px; top: 50%; transform: translateY(-50%); }

.bpm-lightbox__counter {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
  font-weight: 700;
  letter-spacing: 1px;
}

@media (max-width: 640px) {
  .bpm-gallery { grid-template-columns: repeat(3, 1fr); }
  .bpm-lightbox__prev { left: 6px; }
  .bpm-lightbox__next { right: 6px; }
}

/* ============================================================
   AdSense ad slots
   ============================================================ */
.bpm-ad-slot {
  width: 100%;
  overflow: hidden;
  text-align: center;
  background: transparent;
}

.bpm-ad-slot--horizontal {
  min-height: 90px;
  margin: 0 0 28px;
}

.bpm-ad-slot--rect {
  min-height: 250px;
  margin-bottom: 20px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 960px) {
  .bpm-hero__inner { flex-direction: column; align-items: center; }
  .bpm-hero__info  { padding-bottom: 0; text-align: center; }
  .bpm-hero__desc  { max-width: 100%; }
  .bpm-hero__tags, .bpm-hero__rating, .bpm-hero__stats, .bpm-hero__cta { justify-content: center; }
  .bpm-content__side { display: none; }
}

@media (max-width: 640px) {
  .bpm-header__nav { display: none; }
  .bpm-hero { padding: 24px 16px 0; }
  .bpm-hero__title { font-size: 1.7rem; }
  .bpm-game-frame, .bpm-game-frame iframe { width: 100%; max-width: 360px; }
  .bpm-content { padding: 24px 16px; }
  .bpm-prose { padding: 28px 16px; }
}
