@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;800;900&family=Hind+Siliguri:wght@500;700&display=swap');

:root {
  --bg-dark: #070913;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  
  /* Neon Accents */
  --neon-cyan: #00f3ff;
  --neon-pink: #ff007f;
  --neon-purple: #9d00ff;
  --neon-green: #00ff88;
  
  /* Glassmorphism */
  --glass-bg: rgba(25, 30, 50, 0.4);
  --glass-border: rgba(255, 255, 255, 0.08);
}

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

body {
  font-family: 'Outfit', 'Hind Siliguri', sans-serif;
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(157, 0, 255, 0.08), transparent 50%),
    radial-gradient(circle at 90% 90%, rgba(0, 243, 255, 0.08), transparent 50%),
    radial-gradient(circle at 10% 90%, rgba(255, 0, 127, 0.08), transparent 50%),
    radial-gradient(circle at 90% 10%, rgba(0, 255, 136, 0.08), transparent 50%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
}

#app {
  width: 100%;
  max-width: 1200px;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

h1 {
  font-size: 4rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
  text-align: center;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple), var(--neon-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
  letter-spacing: 4px;
  filter: drop-shadow(0px 0px 15px rgba(157, 0, 255, 0.5));
  animation: glowText 3s infinite alternate;
}

@keyframes glowText {
  0% { filter: drop-shadow(0 0 15px rgba(157,0,255,0.4)); }
  100% { filter: drop-shadow(0 0 25px rgba(0,243,255,0.6)); }
}

.hub-desc {
  text-align: center; 
  color: var(--neon-cyan); 
  font-size: 1.2rem; 
  margin-bottom: 3.5rem; 
  font-weight: 600; 
  background: var(--glass-bg);
  padding: 10px 30px;
  border-radius: 50px;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.1);
  letter-spacing: 1px;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
  width: 100%;
  justify-items: center;
  padding: 1rem 0;
}

@media (min-width: 900px) {
  body {
    align-items: flex-start; /* Prevent vertical centering which pushes content off screen */
  }
  #app {
    padding: 1rem;
    min-height: auto;
  }
  h1 {
    font-size: 2.2rem;
    margin-bottom: 0;
  }
  .hub-desc {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    padding: 4px 15px;
  }
  .hub-grid {
    grid-template-columns: repeat(6, 1fr);
    max-width: 900px;
    gap: 1rem;
    padding: 0.5rem 0;
  }
  .game-card {
    max-width: 220px;
    padding: 1rem 0.8rem;
    grid-column: span 2;
  }
  .game-image-container {
    width: 80px;
    height: 80px;
    margin-bottom: 0.8rem;
    border-width: 2px;
  }
  .game-title {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
  }
  .game-desc {
    font-size: 0.75rem;
    margin-bottom: 0.8rem;
  }
  .play-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.8rem;
  }
  
  /* 2 games in the top row */
  .game-card:nth-child(1) {
    grid-column: 2 / 4;
  }
  .game-card:nth-child(2) {
    grid-column: 4 / 6;
  }
  /* 3 games in the bottom row */
  .game-card:nth-child(3) {
    grid-column: 1 / 3;
  }
  .game-card:nth-child(4) {
    grid-column: 3 / 5;
  }
  .game-card:nth-child(5) {
    grid-column: 5 / 7;
  }
}

@media (min-width: 1200px) {
  .hub-grid {
    grid-template-columns: repeat(6, 1fr);
    max-width: 1150px;
  }
  .game-card {
    max-width: 280px;
  }
}

/* SLEEK NEON CARDS */
.game-card {
  width: 100%;
  max-width: 300px;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.05);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

/* Hover glow effect */
.game-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 24px;
  padding: 2px;
  background: linear-gradient(135deg, var(--neon-cyan), transparent, var(--neon-pink));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.game-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.6), 0 0 30px rgba(157,0,255,0.2);
}

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

.game-image-container {
  width: 140px;
  height: 140px;
  margin: 0 auto 1.5rem auto;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
  border: 3px solid var(--neon-cyan);
  background: #111;
  position: relative;
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.game-card:hover .game-image-container {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 0 30px var(--neon-pink);
  border-color: var(--neon-pink);
}

.game-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.game-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: #fff;
  letter-spacing: 1px;
}

.game-desc {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.5;
  flex-grow: 1;
}

.play-btn {
  background: linear-gradient(90deg, var(--neon-purple), var(--neon-pink));
  color: white;
  border: none;
  padding: 0.9rem 2rem;
  border-radius: 100px;
  font-size: 1rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(255, 0, 127, 0.4);
  transition: all 0.3s ease;
  width: 100%;
  text-transform: uppercase;
  letter-spacing: 2px;
  position: relative;
  overflow: hidden;
}

.play-btn::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
}

.game-card:hover .play-btn::after {
  left: 150%;
}

.game-card:hover .play-btn {
  transform: scale(1.05);
  box-shadow: 0 0 25px var(--neon-pink);
}

.play-btn:active {
  transform: scale(0.95);
}

.score-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(0, 255, 136, 0.1);
  color: var(--neon-green);
  border: 1px solid var(--neon-green);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 800;
  z-index: 10;
  box-shadow: 0 0 10px rgba(0,255,136,0.2);
  backdrop-filter: blur(5px);
}

/* Game View Container */
.game-container {
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 30px;
  padding: 2.5rem;
  box-shadow: 0 25px 50px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(255,255,255,0.05);
  animation: modalEnter 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes modalEnter {
  from { opacity: 0; transform: translateY(40px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.game-header h2 {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(0,243,255,0.4);
}

.back-btn {
  background: rgba(255,255,255,0.05);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 0.8rem 1.5rem;
  border-radius: 100px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.back-btn:hover {
  background: var(--neon-cyan);
  color: #000;
  border-color: var(--neon-cyan);
  transform: translateX(-5px);
  box-shadow: 0 0 15px var(--neon-cyan);
}

.level-indicator {
  font-weight: 900;
  color: #000;
  background: var(--neon-green);
  padding: 0.6rem 1.5rem;
  border-radius: 100px;
  font-size: 1rem;
  box-shadow: 0 0 15px rgba(0,255,136,0.4);
}

.game-content {
  min-height: 450px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.game-content canvas {
  background: #000 !important;
  border-radius: 20px !important;
  border: 2px solid var(--glass-border) !important;
  box-shadow: 0 0 30px rgba(0,0,0,0.8), 0 0 10px var(--neon-cyan) !important;
}

#bg-canvas {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Game Start Overlay Styles */
.game-start-overlay {
  background: var(--bg-dark); border-radius: 30px; padding: 2rem 1rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center; 
  z-index: 100;
}
.overlay-image-container {
  width: 150px; height: 150px; margin-bottom: 2rem; 
  box-shadow: 0 0 40px var(--neon-cyan); border: 4px solid var(--neon-cyan);
}
.overlay-game-title {
  font-size: 2.5rem; color: var(--neon-cyan); text-shadow: 0 0 15px var(--neon-cyan); 
  margin-bottom: 2rem; text-align: center; font-weight: 900;
}
.overlay-lets-go-btn {
  width: auto; padding: 1.2rem 4rem; font-size: 1.5rem; box-shadow: 0 0 25px var(--neon-pink);
}
.overlay-back-btn {
  margin-top: 2rem; border: none; background: transparent; text-decoration: underline; box-shadow: none;
}

@media (max-width: 600px) {
  h1 { font-size: 2.2rem; }
  .hub-desc { font-size: 0.9rem; padding: 8px 20px; margin-bottom: 2rem; }
  .hub-grid { grid-template-columns: 1fr; gap: 1.5rem; padding: 0.5rem; }
  
  .game-card { 
    max-width: 95%; 
    padding: 1.5rem 1.2rem; 
    border-radius: 20px;
  }
  .game-image-container { 
    width: 110px; 
    height: 110px; 
    margin-bottom: 1rem; 
  }
  .game-title { font-size: 1.25rem; }
  .game-desc { font-size: 0.85rem; margin-bottom: 1.5rem; }
  .play-btn { 
    padding: 0.5rem 1.2rem; 
    font-size: 0.8rem; 
    width: auto;
    letter-spacing: 1px;
  }
  .score-badge { top: 10px; right: 10px; font-size: 0.75rem; padding: 4px 10px; }

  .game-container { 
    padding: 1.2rem; 
    border-radius: 20px 20px 0 0; 
    flex-grow: 1;
    display: flex;
    flex-direction: column;
  }
  .game-content { min-height: auto; display: flex; flex-grow: 1; flex-direction: column; justify-content: center; align-items: center; }
  .game-header { 
    flex-direction: row; 
    justify-content: space-between; 
    align-items: center; 
    gap: 5px; 
    margin-bottom: 0.3rem; 
    padding-bottom: 0.3rem;
    border-bottom: none;
  }
  .game-header h2 { 
    font-size: 1.1rem; 
    margin: 0; 
    flex: 1; 
    text-align: left; 
    margin-left: 5px; 
  }
  .back-btn { 
    padding: 0.5rem 0.8rem; 
    font-size: 0.8rem; 
  }
  
  /* Mobile Game Start Overlay Overrides */
  .game-start-overlay { flex-grow: 1; border-radius: 20px; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
  .overlay-image-container {
    width: 110px; height: 110px; margin-bottom: 1.2rem; border-width: 2px;
  }
  .overlay-game-title {
    font-size: 1.8rem; margin-bottom: 1.5rem;
  }
  .overlay-lets-go-btn {
    padding: 0.8rem 3rem; font-size: 1.2rem;
  }
  .overlay-back-btn {
    margin-top: 1.2rem; font-size: 0.9rem;
  }
}

/* TOP BAR */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 1rem 2rem;
  margin-bottom: 2rem;
  background: rgba(15, 20, 35, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 243, 255, 0.2);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.platform-name {
  font-size: 2.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple), var(--neon-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
  letter-spacing: 2px;
  filter: drop-shadow(0px 0px 10px rgba(157, 0, 255, 0.4));
  animation: glowText 3s infinite alternate;
}

.faq-btn {
  background: rgba(25, 30, 50, 0.6);
  color: var(--neon-cyan);
  border: 1px solid var(--neon-cyan);
  padding: 0.8rem 1.5rem;
  border-radius: 100px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
  backdrop-filter: blur(10px);
}

.faq-btn:hover {
  background: var(--neon-cyan);
  color: #000;
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.6);
  transform: translateY(-2px);
}

/* FAQ Modal */
.faq-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.faq-content {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 50px rgba(0,0,0,0.8), inset 0 0 0 1px rgba(255,255,255,0.05);
  color: var(--text-main);
}

.close-faq {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 2rem;
  cursor: pointer;
  transition: color 0.3s;
}

.close-faq:hover {
  color: var(--neon-pink);
}

.faq-content h2 {
  font-size: 2rem;
  color: var(--neon-pink);
  margin-bottom: 2rem;
  text-align: center;
}

.faq-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.faq-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.faq-section h3 {
  color: var(--neon-cyan);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.faq-section p {
  margin-bottom: 0.5rem;
  line-height: 1.6;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.faq-section p strong {
  color: #fff;
}

.faq-section .highlight {
  color: var(--neon-green);
  font-weight: 700;
  margin-top: 1rem;
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(0, 255, 136, 0.1);
  border-radius: 8px;
}

/* Scrollbar for FAQ */
.faq-content::-webkit-scrollbar {
  width: 8px;
}
.faq-content::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.2);
  border-radius: 4px;
}
.faq-content::-webkit-scrollbar-thumb {
  background: var(--neon-cyan);
  border-radius: 4px;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.subscribe-btn {
  background: linear-gradient(90deg, var(--neon-purple), var(--neon-pink));
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 100px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(255, 0, 127, 0.4);
  transition: all 0.3s ease;
  white-space: nowrap;
}

.profile-btn {
  background: rgba(25, 30, 50, 0.6);
  color: var(--neon-cyan);
  border: 1px solid var(--neon-cyan);
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
  backdrop-filter: blur(10px);
}

.profile-btn:hover {
  background: var(--neon-cyan);
  color: #000;
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.6);
  transform: translateY(-2px);
}

.subscribe-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px var(--neon-pink);
}

@media (max-width: 600px) {
  .top-bar {
    padding: 0.6rem 1rem;
    margin-bottom: 1.5rem;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 5px;
  }
  .top-actions {
    width: auto;
    justify-content: flex-end;
    gap: 5px;
  }
  .platform-name {
    font-size: 1.3rem;
    white-space: nowrap;
  }
  .subscribe-btn, .faq-btn {
    padding: 0.5rem 0.6rem;
    font-size: 0.75rem;
    white-space: nowrap;
  }
  
  /* Mobile FAQ Modal Adjustments */
  .faq-content {
    padding: 2rem 1.2rem;
    max-height: 90vh;
  }
  .faq-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1.2rem;
  }
  .faq-section h3 {
    font-size: 1.05rem;
    margin-bottom: 0.8rem;
  }
  .faq-section p {
    font-size: 0.85rem;
    line-height: 1.5;
  }
  .close-faq {
    top: 1rem;
    right: 1.2rem;
    font-size: 1.5rem;
  }
  .faq-section .highlight {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    margin-top: 0.8rem;
  }
}
