/* ============================================
   BROVERSE.COM - Retro Arcade Theme
   ============================================ */

/* --- Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Fredoka:wght@400;500;600;700&display=swap');

/* --- CSS Variables --- */
:root {
  --neon-pink: #ff5fad;
  --neon-cyan: #5ee8f5;
  --neon-yellow: #ffd84d;
  --neon-green: #5cef5c;
  --neon-purple: #c470ff;
  --neon-orange: #ff8a50;
  --dark-bg: #0c0c1e;
  --dark-card: #161630;
  --dark-card-hover: #1e1e40;
  --text-light: #e8e8f0;
  --text-muted: #a0a0be;
  --pixel-font: 'Press Start 2P', monospace;
  --body-font: 'Fredoka', sans-serif;
  --glow-pink: 0 0 8px #ff5fad60;
  --glow-cyan: 0 0 8px #5ee8f560;
  --glow-yellow: 0 0 8px #ffd84d60;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--body-font);
  background: var(--dark-bg);
  color: var(--text-light);
  overflow-x: hidden;
  line-height: 1.6;
}

/* Smooth gradient background instead of scanlines */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 15% 15%, rgba(94,232,245,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 80%, rgba(196,112,255,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(255,95,173,0.02) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--dark-bg);
}
::-webkit-scrollbar-thumb {
  background: var(--neon-pink);
  border-radius: 4px;
}

/* --- Navigation --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(12, 12, 30, 0.85);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(94,232,245,0.1);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.nav-logo {
  font-family: var(--pixel-font);
  font-size: 1.2rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: 2px;
}

.nav-logo span {
  color: var(--neon-pink);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 0.5rem;
}

.nav-links a {
  font-family: var(--pixel-font);
  font-size: 0.55rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  transition: all 0.25s ease;
  position: relative;
  letter-spacing: 0.5px;
}

.nav-links a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-links a.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(94,232,245,0.12), rgba(196,112,255,0.12));
  border: 1px solid rgba(94,232,245,0.15);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
}

.nav-toggle span {
  width: 25px;
  height: 3px;
  background: var(--neon-cyan);
  border-radius: 2px;
  transition: 0.3s;
}

/* --- Hero Section --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(176, 38, 255, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(0, 240, 255, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(255, 45, 149, 0.1) 0%, transparent 50%);
}

/* Animated pixel grid background */
.pixel-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
  0% { transform: translate(0, 0); }
  100% { transform: translate(40px, 40px); }
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.hero-avatar {
  width: 200px;
  height: 200px;
  margin: 0 auto 2rem;
  position: relative;
}

.hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--neon-cyan);
  box-shadow: 0 0 20px rgba(94, 232, 245, 0.25);
  image-rendering: auto;
}

.hero-avatar::after {
  content: '';
  position: absolute;
  top: -12px;
  left: -12px;
  right: -12px;
  bottom: -12px;
  border-radius: 50%;
  border: 2px dashed var(--neon-pink);
  animation: spin 10s linear infinite;
  opacity: 0.5;
}

.hero-avatar .digital-photo {
  animation: photoFloat 4s ease-in-out infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

.hero-title {
  font-family: var(--pixel-font);
  font-size: clamp(1.5rem, 5vw, 3rem);
  margin-bottom: 1rem;
  line-height: 1.4;
}

.hero-title .line1 {
  color: #fff;
  text-shadow: 0 0 30px rgba(94, 232, 245, 0.3);
  display: block;
}

.hero-title .line2 {
  color: var(--neon-pink);
  display: block;
  font-size: 0.6em;
  margin-top: 0.5rem;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: #c0c0d8;
  margin-bottom: 2rem;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  font-family: var(--body-font);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.85rem 1.8rem;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.3px;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 50%);
  border-radius: inherit;
  pointer-events: none;
}

.btn-primary {
  background: linear-gradient(135deg, #ff5fad, #e04090);
  color: #fff;
  box-shadow: 0 4px 15px rgba(255, 95, 173, 0.25);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(255, 95, 173, 0.35);
}

.btn-secondary {
  background: transparent;
  color: var(--neon-cyan);
  border: 2px solid rgba(94, 232, 245, 0.35);
}

.btn-secondary:hover {
  background: rgba(94, 232, 245, 0.08);
  transform: translateY(-3px);
  border-color: rgba(94, 232, 245, 0.6);
}

.btn-yellow {
  background: linear-gradient(135deg, #ffd84d, #e0b830);
  color: var(--dark-bg);
  box-shadow: 0 4px 15px rgba(255, 216, 77, 0.2);
}

.btn-yellow:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(255, 216, 77, 0.35);
}

/* --- Section Styles --- */
.section {
  padding: 5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title {
  font-family: var(--body-font);
  font-weight: 700;
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin-bottom: 0.8rem;
  letter-spacing: -0.3px;
}

.section-title.pink { color: var(--neon-pink); }
.section-title.cyan { color: var(--neon-cyan); }
.section-title.yellow { color: var(--neon-yellow); }

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

/* --- Featured Games Section --- */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.game-card {
  background: linear-gradient(165deg, rgba(22,22,48,0.9), rgba(16,16,36,0.95));
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
  backdrop-filter: blur(5px);
}

.game-card:hover {
  border-color: rgba(94, 232, 245, 0.25);
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45), 0 0 30px rgba(94,232,245,0.06);
}

.game-card-image {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  position: relative;
  overflow: hidden;
}

.game-card-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.2);
  opacity: 0;
  transition: 0.3s;
}

.game-card:hover .game-card-image::before {
  opacity: 1;
}

.game-card-image::after {
  content: '\\25B6  PLAY';
  position: absolute;
  font-family: var(--pixel-font);
  font-size: 1rem;
  color: #fff;
  opacity: 0;
  transition: 0.3s;
  background: rgba(0,0,0,0.5);
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
}

.game-card:hover .game-card-image::after {
  opacity: 1;
}

.game-card-info {
  padding: 1.5rem;
}

.game-card-title {
  font-family: var(--pixel-font);
  font-size: 0.75rem;
  color: #fff;
  margin-bottom: 0.5rem;
}

.game-card-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.game-badge {
  display: inline-block;
  font-family: var(--body-font);
  font-weight: 700;
  font-size: 0.65rem;
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  margin-top: 0.8rem;
  letter-spacing: 0.5px;
}

.badge-new {
  background: linear-gradient(135deg, #5cef5c, #40cc40);
  color: var(--dark-bg);
}

.badge-coming {
  background: linear-gradient(135deg, #ff8a50, #dd6830);
  color: #fff;
}

/* --- Story Preview --- */
.story-preview {
  background: var(--dark-card);
  border-radius: 20px;
  padding: 3rem;
  border: 2px solid rgba(196, 112, 255, 0.25);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 3rem;
  flex-wrap: wrap;
}

.story-preview::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at 30% 50%, rgba(176, 38, 255, 0.1) 0%, transparent 60%);
}

.story-text {
  flex: 1;
  min-width: 280px;
  position: relative;
  z-index: 1;
}

.story-text h3 {
  font-family: var(--pixel-font);
  font-size: 1rem;
  color: var(--neon-purple);
  margin-bottom: 1rem;
}

.story-text p {
  color: #b8b8d0;
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
  line-height: 1.8;
}

.story-values {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.value-tag {
  font-family: var(--body-font);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  border: 1px solid;
  letter-spacing: 0.5px;
}

.value-tag:nth-child(1) { color: var(--neon-pink); border-color: var(--neon-pink); }
.value-tag:nth-child(2) { color: var(--neon-cyan); border-color: var(--neon-cyan); }
.value-tag:nth-child(3) { color: var(--neon-yellow); border-color: var(--neon-yellow); }
.value-tag:nth-child(4) { color: var(--neon-green); border-color: var(--neon-green); }
.value-tag:nth-child(5) { color: var(--neon-purple); border-color: var(--neon-purple); }

.story-avatar {
  width: 250px;
  height: 250px;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.story-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
  border: 3px solid var(--neon-purple);
}

/* --- Merch Preview --- */
.merch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.merch-card {
  background: linear-gradient(165deg, rgba(22,22,48,0.9), rgba(16,16,36,0.95));
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  text-align: center;
}

.merch-card:hover {
  border-color: rgba(255, 216, 77, 0.2);
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

.merch-image {
  width: 100%;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  position: relative;
}

.merch-image.tee { background: linear-gradient(135deg, #1a1a3e, #2a1a4e); }
.merch-image.hoodie { background: linear-gradient(135deg, #1a2a3e, #1a1a4e); }
.merch-image.cap { background: linear-gradient(135deg, #2a1a1e, #3a1a2e); }

.merch-info {
  padding: 1.5rem;
}

.merch-name {
  font-family: var(--pixel-font);
  font-size: 0.7rem;
  color: var(--neon-yellow);
  margin-bottom: 0.5rem;
}

.merch-price {
  color: var(--neon-green);
  font-family: var(--pixel-font);
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

/* --- Floating Pixels (decorative) --- */
.floating-pixels {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.pixel {
  position: absolute;
  width: 6px;
  height: 6px;
  opacity: 0.4;
  animation: floatPixel linear infinite;
}

@keyframes floatPixel {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10% { opacity: 0.4; }
  90% { opacity: 0.4; }
  100% { transform: translateY(-10vh) rotate(720deg); opacity: 0; }
}

/* --- Footer --- */
.footer {
  text-align: center;
  padding: 3rem 2rem;
  border-top: 1px solid rgba(94,232,245,0.1);
  background: linear-gradient(180deg, var(--dark-bg), #080816);
}

.footer-logo {
  font-family: var(--pixel-font);
  font-size: 1rem;
  color: var(--neon-cyan);
  margin-bottom: 1rem;
}

.footer-logo span {
  color: var(--neon-pink);
}

.footer-text {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--pixel-font);
  font-size: 0.55rem;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: var(--neon-yellow);
}

/* --- Ticker / Marquee --- */
.ticker {
  background: linear-gradient(90deg, rgba(255,95,173,0.15), rgba(196,112,255,0.15), rgba(94,232,245,0.15));
  color: #b8b8d0;
  font-family: var(--body-font);
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.55rem 0;
  overflow: hidden;
  white-space: nowrap;
  margin-top: 64px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.ticker-content {
  display: inline-block;
  animation: ticker 20s linear infinite;
}

@keyframes ticker {
  0% { transform: translateX(100vw); }
  100% { transform: translateX(-100%); }
}

/* --- Coin Counter (fun interactive element) --- */
.coin-counter {
  position: fixed;
  top: 74px;
  right: 20px;
  z-index: 999;
  background: rgba(22,22,48,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,216,77,0.2);
  border-radius: 12px;
  padding: 0.45rem 0.9rem;
  font-family: var(--body-font);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--neon-yellow);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.coin-counter:hover {
  transform: scale(1.05);
}

.coin-icon {
  font-size: 1rem;
  animation: coinBounce 1s ease-in-out infinite;
}

@keyframes coinBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* --- Typing cursor effect --- */
.typing-cursor {
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--neon-cyan);
  margin-left: 4px;
  animation: blink 0.8s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* --- Achievement Popup --- */
.achievement {
  position: fixed;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--dark-card);
  border: 2px solid var(--neon-green);
  border-radius: 12px;
  padding: 1rem 2rem;
  font-family: var(--pixel-font);
  font-size: 0.6rem;
  color: var(--neon-green);
  z-index: 10000;
  transition: bottom 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 0 20px rgba(57, 255, 20, 0.3);
}

.achievement.show {
  bottom: 30px;
}

.achievement-icon {
  font-size: 1.5rem;
}

/* --- Page-specific: Arcade --- */
.arcade-container {
  max-width: 900px;
  margin: 0 auto;
  padding-top: 100px;
}

.game-frame-wrapper {
  background: var(--dark-card);
  border-radius: 16px;
  border: 2px solid rgba(94, 232, 245, 0.4);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.game-frame-header {
  background: rgba(0, 240, 255, 0.1);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--neon-cyan);
}

.game-frame-title {
  font-family: var(--pixel-font);
  font-size: 0.8rem;
  color: var(--neon-cyan);
}

.game-canvas-area {
  width: 100%;
  min-height: 500px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-canvas-area canvas {
  display: block;
  max-width: 100%;
}

.game-controls-info {
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.control-key {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.key {
  font-family: var(--pixel-font);
  font-size: 0.6rem;
  background: var(--dark-card);
  border: 2px solid var(--neon-cyan);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  color: var(--neon-cyan);
}

/* Game selector grid */
.game-selector {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.game-select-card {
  background: var(--dark-card);
  border: 2px solid var(--neon-purple);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  color: inherit;
}

.game-select-card:hover,
.game-select-card.active {
  border-color: var(--neon-cyan);
  background: var(--dark-card-hover);
  transform: translateY(-3px);
}

.game-select-icon {
  font-size: 2.5rem;
  margin-bottom: 0.8rem;
}

.game-select-name {
  font-family: var(--pixel-font);
  font-size: 0.6rem;
  color: var(--neon-yellow);
}

/* --- Page-specific: Story --- */
.story-page {
  padding-top: 100px;
}

.story-chapter {
  background: var(--dark-card);
  border-radius: 16px;
  padding: 3rem;
  margin-bottom: 2rem;
  border-left: 4px solid;
  position: relative;
  overflow: hidden;
}

.story-chapter:nth-child(1) { border-color: var(--neon-pink); }
.story-chapter:nth-child(2) { border-color: var(--neon-cyan); }
.story-chapter:nth-child(3) { border-color: var(--neon-yellow); }
.story-chapter:nth-child(4) { border-color: var(--neon-green); }
.story-chapter:nth-child(5) { border-color: var(--neon-purple); }

.chapter-number {
  font-family: var(--pixel-font);
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.chapter-title {
  font-family: var(--pixel-font);
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.story-chapter:nth-child(1) .chapter-title { color: var(--neon-pink); }
.story-chapter:nth-child(2) .chapter-title { color: var(--neon-cyan); }
.story-chapter:nth-child(3) .chapter-title { color: var(--neon-yellow); }
.story-chapter:nth-child(4) .chapter-title { color: var(--neon-green); }
.story-chapter:nth-child(5) .chapter-title { color: var(--neon-purple); }

.chapter-text {
  color: #b8b8d0;
  font-size: 1.05rem;
  line-height: 1.9;
  max-width: 700px;
}

.chapter-text strong {
  color: var(--text-light);
}

.chapter-emoji {
  position: absolute;
  top: 2rem;
  right: 2rem;
  font-size: 3rem;
  opacity: 0.3;
}

/* --- Page-specific: Merch --- */
.merch-page {
  padding-top: 100px;
}

.merch-hero {
  text-align: center;
  padding: 3rem 0;
}

/* --- Page-specific: About --- */
.about-page {
  padding-top: 100px;
}

.about-hero {
  display: flex;
  align-items: center;
  gap: 3rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.about-photo {
  width: 300px;
  height: 300px;
  flex-shrink: 0;
}

.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
  border: 3px solid var(--neon-cyan);
  box-shadow: var(--glow-cyan);
}

.about-info {
  flex: 1;
  min-width: 280px;
}

.about-info h2 {
  font-family: var(--pixel-font);
  font-size: 1.2rem;
  color: var(--neon-pink);
  margin-bottom: 1rem;
}

.about-info p {
  color: #b8b8d0;
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.stats-row {
  display: flex;
  gap: 2rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.stat-box {
  text-align: center;
  background: var(--dark-card);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  border: 2px solid var(--neon-purple);
  min-width: 120px;
}

.stat-number {
  font-family: var(--pixel-font);
  font-size: 1.5rem;
  color: var(--neon-yellow);
}

.stat-label {
  font-family: var(--pixel-font);
  font-size: 0.5rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* --- Digital Photo Enhancement --- */
.digital-photo {
  filter: contrast(1.15) brightness(1.06) saturate(1.2);
  transition: filter 0.4s ease, transform 0.4s ease;
  animation: photoFloat 4s ease-in-out infinite;
}

.digital-photo:hover {
  filter: contrast(1.22) brightness(1.1) saturate(1.35);
  transform: scale(1.06);
  animation-play-state: paused;
}

@keyframes photoFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.02); }
}

/* Neon border glow frame */
.photo-frame {
  position: relative;
  display: inline-block;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--neon-cyan);
  animation: borderGlow 3s ease-in-out infinite alternate;
}

@keyframes borderGlow {
  0% { border-color: var(--neon-cyan); box-shadow: 0 0 15px rgba(94, 232, 245, 0.25), 0 0 30px rgba(94, 232, 245, 0.1); }
  33% { border-color: var(--neon-pink); box-shadow: 0 0 15px rgba(255, 95, 173, 0.25), 0 0 30px rgba(255, 95, 173, 0.1); }
  66% { border-color: var(--neon-purple); box-shadow: 0 0 15px rgba(196, 112, 255, 0.25), 0 0 30px rgba(196, 112, 255, 0.1); }
  100% { border-color: var(--neon-yellow); box-shadow: 0 0 15px rgba(255, 216, 77, 0.25), 0 0 30px rgba(255, 216, 77, 0.1); }
}

.photo-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 30px rgba(0,0,0,0.35);
  pointer-events: none;
}

.photo-frame-square {
  border-radius: 16px;
  border: 3px solid var(--neon-purple);
  animation: borderGlowSquare 4s ease-in-out infinite alternate;
}

@keyframes borderGlowSquare {
  0% { border-color: var(--neon-purple); box-shadow: 0 0 20px rgba(196, 112, 255, 0.2); }
  50% { border-color: var(--neon-cyan); box-shadow: 0 0 20px rgba(94, 232, 245, 0.2); }
  100% { border-color: var(--neon-pink); box-shadow: 0 0 20px rgba(255, 95, 173, 0.2); }
}

.photo-frame-square::after {
  border-radius: 16px;
}

/* Gradient overlay for digital feel */
.photo-overlay {
  position: relative;
  overflow: hidden;
}

.photo-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(94, 232, 245, 0.1) 0%,
    transparent 30%,
    transparent 70%,
    rgba(255, 95, 173, 0.1) 100%
  );
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
  animation: overlayShift 5s ease-in-out infinite alternate;
}

@keyframes overlayShift {
  0% { background: linear-gradient(135deg, rgba(94,232,245,0.1) 0%, transparent 30%, transparent 70%, rgba(255,95,173,0.1) 100%); }
  50% { background: linear-gradient(225deg, rgba(196,112,255,0.1) 0%, transparent 30%, transparent 70%, rgba(255,216,77,0.08) 100%); }
  100% { background: linear-gradient(315deg, rgba(255,95,173,0.1) 0%, transparent 30%, transparent 70%, rgba(94,232,245,0.1) 100%); }
}

/* Animated particle ring around hero photo */
.hero-avatar.photo-frame::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  border-radius: 50%;
  border: 2px dashed var(--neon-pink);
  animation: spin 12s linear infinite;
  opacity: 0.4;
  z-index: -1;
}

/* Second spinning ring */
.hero-avatar.photo-frame .digital-photo {
  position: relative;
}

/* Pulsing glow behind photo on about/story pages */
.about-photo.photo-frame-square::before,
.story-intro-avatar.photo-frame::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  background: conic-gradient(
    var(--neon-cyan),
    var(--neon-pink),
    var(--neon-purple),
    var(--neon-yellow),
    var(--neon-cyan)
  );
  animation: spinGradient 4s linear infinite;
  z-index: -1;
  opacity: 0.5;
}

@keyframes spinGradient {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.story-avatar.photo-frame-square {
  animation: borderGlowSquare 4s ease-in-out infinite alternate;
}

.story-avatar.photo-frame-square .digital-photo {
  animation: photoFloat 5s ease-in-out infinite;
}

/* --- Responsive --- */
/* ==================== TABLET (max 1024px) ==================== */
@media (max-width: 1024px) {
  .games-grid, .pz-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .featured-game { padding: 1.5rem; }
  .featured-icon { font-size: 4rem; width: 80px; }
  .brain-compare { grid-template-columns: 1fr; }
}

/* ==================== TABLET / iPAD (768px – 1024px) ==================== */
@media (min-width: 768px) and (max-width: 1024px) {
  /* Two-column grids for game/puzzle cards on tablets */
  .games-grid, .pz-grid { grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
  .merch-grid, .merch-page-grid { grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
  .char-grid { grid-template-columns: repeat(2, 1fr); }
  .tips-grid { grid-template-columns: repeat(2, 1fr); }

  /* Featured game row — side-by-side but smaller */
  .featured-game { padding: 1.5rem; gap: 1.5rem; }
  .featured-icon { font-size: 4rem; width: 90px; }

  /* Hero layout comfort */
  .hero { padding: 2rem 1.5rem; }
  .hero-avatar { width: 160px; height: 160px; }

  /* Larger tap targets for touch tablets */
  .nav-links a { padding: 0.8rem 1rem; }
  .btn { padding: 0.9rem 1.8rem; min-height: 48px; }

  /* Game iframe taller on tablet */
  .game-iframe { height: 500px; }

  /* Avatar creator side-by-side still works but tighter */
  .creator { gap: 1.5rem; }
  .preview-panel { min-width: 240px; }

  /* About page */
  .about-hero { gap: 1.5rem; }
  .about-photo { width: 180px; height: 180px; }
  .stats-row { gap: 1rem; }

  /* Story */
  .story-preview { padding: 2rem; }

  /* Coin counter & widgets */
  .coin-counter { font-size: 0.75rem; }
  #quest-widget { width: 200px; }

  /* Autism page interactive elements */
  .scenario-card { padding: 1.5rem; }
}

/* iPad Pro landscape & large tablets */
@media (min-width: 1024px) and (max-width: 1180px) {
  .games-grid, .pz-grid { grid-template-columns: repeat(3, 1fr); }
  .merch-grid, .merch-page-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ==================== MOBILE (max 768px) ==================== */
@media (max-width: 768px) {
  /* Nav - hamburger menu */
  .nav-links {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 26, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 1.5rem;
    gap: 0.3rem;
    overflow-y: auto;
    z-index: 999;
  }
  .nav-links.open { display: flex; }
  .nav-links a { font-size: 0.7rem; padding: 0.8rem 1rem; }
  .nav-toggle { display: flex; }
  .navbar { height: 56px; padding: 0 1rem; }

  /* Hero */
  .hero { padding: 1rem; min-height: auto; }
  .hero-title { font-size: clamp(1.2rem, 5vw, 2rem); }
  .hero-avatar { width: 120px; height: 120px; }
  .hero-buttons { flex-direction: column; align-items: center; gap: 0.6rem; }
  .hero-buttons .btn { width: 100%; max-width: 280px; justify-content: center; }

  /* Sections */
  .section { padding: 2rem 1rem; }
  .section-title { font-size: 1.4rem; }

  /* Game/puzzle cards */
  .games-grid, .pz-grid { grid-template-columns: 1fr; max-width: 400px; margin-left: auto; margin-right: auto; }
  .game-card-v2 .card-preview, .pz-card .pz-icon { height: 120px; font-size: 3rem; }
  .featured-game { flex-direction: column; text-align: center; }
  .featured-icon { width: 100%; font-size: 3.5rem; }
  .featured-tags { justify-content: center; }
  .featured-info { text-align: center; }
  .featured-badge { position: static; display: inline-block; margin-bottom: 0.5rem; }

  /* Story */
  .story-preview { padding: 1.5rem; flex-direction: column; }
  .story-avatar { width: 150px; height: 150px; margin: 0 auto; }

  /* About */
  .about-hero { flex-direction: column; text-align: center; }
  .about-photo { width: 150px; height: 150px; margin: 0 auto; }
  .stats-row { justify-content: center; }

  /* Coin counter */
  .coin-counter { top: auto; bottom: 12px; right: 12px; font-size: 0.7rem; padding: 0.35rem 0.7rem; }

  /* Game frame */
  .game-frame-wrapper { border-radius: 12px; }
  .game-iframe { height: 400px; }

  /* Merch grid */
  .merch-grid, .merch-page-grid { grid-template-columns: 1fr; max-width: 350px; margin-left: auto; margin-right: auto; }

  /* Tips */
  .game-tabs { gap: 0.4rem; }
  .game-tab { font-size: 0.5rem; padding: 0.5rem 0.8rem; }
  .tip-card { padding: 1.2rem; }

  /* Characters */
  .char-grid { grid-template-columns: 1fr; }

  /* Avatar creator */
  .creator { flex-direction: column; }
  .preview-panel { position: static; }

  /* Scenario cards */
  .scenario-card { padding: 1.2rem; }
  .tips-grid { grid-template-columns: 1fr; }

  /* Footer */
  .footer { padding: 2rem 1rem; }
  .footer-links { gap: 0.8rem; }
  .footer-links a { font-size: 0.5rem; }

  /* Quest widget */
  #quest-widget { bottom: 50px; right: 8px; width: 180px; font-size: 0.85em; }

  /* Level badge */
  #bv-level-badge { top: 66px; right: 100px; font-size: 0.45rem; }

  /* Loading screen */
  .loading-bar-container { width: 200px; }
}

/* ==================== SMALL PHONE (max 480px) ==================== */
@media (max-width: 480px) {
  .navbar { padding: 0 0.8rem; }
  .nav-logo { font-size: 1rem; }
  .section { padding: 1.5rem 0.8rem; }
  .hero-avatar { width: 100px; height: 100px; }
  .game-iframe { height: 300px; }
  .game-card-v2 .card-preview, .pz-card .pz-icon { height: 100px; font-size: 2.5rem; }
  .game-card-v2 .card-body, .pz-card .pz-body { padding: 0.8rem; }
  .about-photo { width: 120px; height: 120px; }
  .stat-box { padding: 1rem; min-width: 90px; }
  .coin-counter { font-size: 0.65rem; padding: 0.3rem 0.6rem; }
  #quest-widget { display: none; } /* hide on very small screens */
  .footer-links a { font-size: 0.45rem; }
}

/* ==================== TOUCH DEVICE HELPERS ==================== */
@media (hover: none) {
  /* Remove hover effects that don't work on touch */
  .game-card-v2:hover, .pz-card:hover { transform: none; }
  .game-card-v2 .card-preview::after, .pz-card .pz-icon::after { display: none; }
  /* Make tap targets bigger */
  .nav-links a { padding: 1rem; font-size: 0.75rem; }
  .btn { padding: 1rem 2rem; }
}

/* ==================== LANDSCAPE PHONE ==================== */
@media (max-height: 500px) and (orientation: landscape) {
  .hero { min-height: auto; padding: 0.5rem; }
  .hero-avatar { width: 80px; height: 80px; }
  .game-iframe { height: 280px; }
  .navbar { height: 48px; }
  .nav-links { top: 48px; }
}

/* ==================== SAFE AREA (notch phones) ==================== */
@supports (padding: env(safe-area-inset-top)) {
  .navbar { padding-top: env(safe-area-inset-top); }
  .footer { padding-bottom: env(safe-area-inset-bottom); }
}

/* --- Easter Egg: Konami Code Effect --- */
.konami-active {
  animation: rainbow 2s linear infinite;
}

@keyframes rainbow {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

/* --- Loading Screen --- */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--dark-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.5s, visibility 0.5s;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-bar-container {
  width: 300px;
  height: 20px;
  background: var(--dark-card);
  border: 2px solid var(--neon-cyan);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 2rem;
}

.loading-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple), var(--neon-pink));
  width: 0%;
  animation: loadBar 1.5s ease-out forwards;
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(94,232,245,0.4);
}

@keyframes loadBar {
  0% { width: 0%; }
  50% { width: 70%; }
  100% { width: 100%; }
}

.loading-text {
  font-family: var(--pixel-font);
  font-size: 0.7rem;
  color: var(--neon-cyan);
  margin-top: 1rem;
  animation: blink 1s step-end infinite;
}
