/* ==========================================================================
   DAILY PUZZLE HUB - ROOT LANDING PAGE DESIGN SYSTEM
   Modern Dark Theme, Glassmorphism, Micro-Animations & Responsive Grid
   ========================================================================== */

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

:root {
  /* Color Tokens */
  --bg-main: #0a0b0e;
  --bg-surface: #12141a;
  --bg-card: rgba(22, 25, 34, 0.85);
  --bg-card-hover: rgba(28, 32, 44, 0.95);
  --bg-elevated: #1e2230;

  /* Borders & Glows */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-card: rgba(255, 255, 255, 0.12);
  --border-highlight: rgba(255, 255, 255, 0.25);

  /* Typography */
  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Accent Palettes */
  --sqordy-green: #1b9e3e;
  --sqordy-green-glow: rgba(27, 158, 62, 0.35);
  --sqordy-orange: #eaab3d;
  --sqordy-teal: #449e99;

  --oneshot-emerald: #10b981;
  --oneshot-emerald-glow: rgba(16, 185, 129, 0.35);
  --oneshot-amber: #f59e0b;
  --oneshot-purple: #8b5cf6;
  --oneshot-purple-glow: rgba(139, 92, 246, 0.35);

  /* Geometry & Transitions */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* Background Ambient Lighting */
.ambient-glow {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  max-width: 1200px;
  height: 600px;
  background: radial-gradient(circle at 50% 15%, rgba(68, 158, 153, 0.15), rgba(139, 92, 246, 0.08) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* App Container */
.hub-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px 60px;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* Header & Brand with 6174 Easter Egg */
.hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 36px;
  position: relative;
}

.header-left-action,
.header-right-action {
  flex: 0 0 40px;
  display: flex;
  align-items: center;
}

.header-left-action {
  justify-content: flex-start;
}

.header-right-action {
  justify-content: flex-end;
}

.hub-brand-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  user-select: none;
}

.hub-brand-text {
  text-decoration: none;
  color: #ffffff;
  display: flex;
  align-items: center;
}

.brand-box-wrapper {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
}

/* 7 Step Pips Bar (Above the 6174 Box) */
.step-pips-bar {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s ease-out;
  pointer-events: none;
}

.step-pips-bar.active {
  opacity: 1;
}

.pip-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pip-dot.filled {
  background: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
  transform: scale(1.25);
}

/* The Interactive 6174 Box */
.brand-6174-box {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  color: #ffffff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
  position: relative;
  height: 38px;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.brand-6174-box:hover {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.brand-6174-box.locked-in {
  animation: lockedFlash 0.4s ease 3 alternate;
  border-color: #ffffff;
}

@keyframes lockedFlash {
  0% {
    background-color: transparent;
    box-shadow: 0 0 4px #fff;
  }
  100% {
    background-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 24px #fff, inset 0 0 12px #fff;
  }
}

/* Fixed-width digit slot (16px) for perfect FLIP translation */
.digit-slot {
  display: inline-block;
  width: 16px;
  text-align: center;
  position: relative;
  will-change: transform;
}

/* Subtraction Row: Perfectly Grid-Aligned Underneath */
.subtraction-line {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  padding-left: 11px; /* 10px padding + 1px border */
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  display: flex;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease-out, transform 0.18s ease-out;
}

.subtraction-line.show {
  opacity: 1;
  transform: translateY(0);
}

.subtraction-line .minus-sign {
  position: absolute;
  right: calc(100% - 8px);
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
}

.brand-title {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #ffffff;
}

/* Kaprekar Prompt Inputs & Chips */
.kaprekar-digit-inputs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.kaprekar-input {
  width: 52px;
  height: 60px;
  background: #0d0f14;
  border: 2px solid #334155;
  border-radius: 10px;
  color: #ffffff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 28px;
  font-weight: 800;
  text-align: center;
  outline: none;
  transition: all 0.2s;
}

.kaprekar-input:focus {
  border-color: #ffffff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
}

.kaprekar-preset-chip {
  background: #222631;
  border: 1px solid #3d4356;
  color: #94a3b8;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.kaprekar-preset-chip:hover {
  color: #fff;
  border-color: #ffffff;
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 20px 0 44px;
}

.daily-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 20px;
  backdrop-filter: blur(8px);
}

.daily-badge .pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--sqordy-green);
  box-shadow: 0 0 10px var(--sqordy-green);
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.hero-title {
  font-size: clamp(32px, 5.5vw, 54px);
  font-weight: 900;
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 16px;
  color: #ffffff;
}

.hero-title .title-accent {
  color: #ffffff;
  font-weight: 900;
}

.hero-subtitle {
  font-size: clamp(15px, 2vw, 17px);
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto;
  font-weight: 400;
  line-height: 1.6;
}

/* Header Action Buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.header-icon-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-main);
  border-color: var(--border-highlight);
}

/* Modals */
.hub-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.hub-modal-backdrop.active {
  display: flex;
}

.hub-modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px 24px;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.hub-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.hub-modal-header h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}

.hub-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.hub-modal-close:hover {
  color: var(--text-main);
}

/* Live Session Status Strip */
.player-status-strip {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 14px 24px;
  margin-bottom: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.status-stat-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-icon-bubble {
  font-size: 18px;
  color: #eaab3d;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-val {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
}

.stat-lbl {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Games Grid Showcase */
.games-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
  margin-bottom: 50px;
}

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(16px);
  transition: all var(--transition-normal);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  text-decoration: none;
  color: inherit;
}

.game-card:hover {
  transform: translateY(-6px);
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.35);
}

.game-card.sqordy:hover {
  box-shadow: 0 18px 40px rgba(27, 158, 62, 0.2), 0 0 12px rgba(255, 255, 255, 0.2);
}

.game-card.oneshot:hover {
  box-shadow: 0 18px 40px rgba(245, 158, 11, 0.2), 0 0 12px rgba(255, 255, 255, 0.2);
}

.game-card:hover .game-title,
.game-title:hover,
.brand-title:hover,
.sqordy-title:hover {
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.7), 0 0 2px #ffffff;
  transition: text-shadow 0.25s ease-out;
}

.game-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.game-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.game-card.sqordy .game-badge {
  background: rgba(68, 158, 153, 0.15);
  color: #5eead4;
  border: 1px solid rgba(68, 158, 153, 0.3);
}

.game-card.oneshot .game-badge {
  background: rgba(139, 92, 246, 0.15);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.game-status-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.game-status-tag.won {
  color: #4ade80;
}

.game-title {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
  color: var(--text-main);
  text-align: center;
}

.game-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

/* Mini Preview Grids inside Cards */
.mini-preview-board {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 130px;
}

/* Sqordy Mini Grid (5x5) */
.sqordy-mini-grid {
  display: grid;
  grid-template-columns: repeat(5, 24px);
  gap: 4px;
}

.sqordy-mini-cell {
  width: 24px;
  height: 24px;
  background: #252830;
  border: 1px solid #3d4252;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: #fff;
}

.sqordy-mini-cell.g { background: #1b9e3e; border-color: #1b9e3e; }
.sqordy-mini-cell.o { background: #eaab3d; border-color: #eaab3d; }
.sqordy-mini-cell.t { background: #449e99; border-color: #449e99; }

/* One Shot Mini Clue Rows */
.oneshot-mini-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 220px;
}

.oneshot-mini-row {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}

.oneshot-mini-cell {
  width: 32px;
  height: 26px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: #fff;
}

.oneshot-mini-cell.c-grey { background: #3f3f46; }
.oneshot-mini-cell.c-yellow { background: #f59e0b; }
.oneshot-mini-cell.c-green { background: #10b981; }
/* Play CTA Button */
.btn-play-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  margin-top: auto;
}

.game-card.sqordy .btn-play-cta {
  background: #1b9e3e;
  color: #ffffff;
}

.game-card.sqordy .btn-play-cta:hover {
  background: #22c55e;
  box-shadow: 0 4px 16px rgba(27, 158, 62, 0.4);
}

.game-card.oneshot .btn-play-cta {
  background: #d97706;
  color: #ffffff;
}

.game-card.oneshot .btn-play-cta:hover {
  background: #f59e0b;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
}

/* Footer */
.hub-footer {
  text-align: center;
  padding: 30px 0 10px;
  border-top: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--text-main);
}

/* Responsive Breakpoints */
@media (max-width: 640px) {
  .hub-wrapper {
    padding: 0 14px 40px;
  }

  .hub-header {
    padding: 16px 0;
    margin-bottom: 24px;
  }

  .hero-section {
    padding: 10px 0 28px;
  }

  .player-status-strip {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 14px 16px;
  }

  .games-showcase {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .game-card {
    padding: 20px 16px;
  }
}

/* Settings Toggle Sliders */
.settings-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #374151;
  transition: 0.25s;
  border-radius: 24px;
}

.settings-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s;
  border-radius: 50%;
}

input:checked + .settings-slider:before {
  transform: translateX(20px);
}

/* Info & FAQ Sections (SEO & Discovery) */
.hub-info-section, .hub-faq-section {
  margin-top: 48px;
}

.section-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
  margin-bottom: 20px;
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.section-text {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.75;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-text strong {
  color: var(--text-main);
}

.section-text em {
  color: #f59e0b;
  font-style: normal;
  font-weight: 600;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.faq-item:hover {
  transform: translateY(-2px);
  border-color: var(--border-highlight);
}

.faq-item h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 10px;
}

.faq-item p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}


/* Chirality Game Card & Coming Soon */
.game-card.coming-soon {
  opacity: 0.65;
  filter: grayscale(0.2);
  cursor: default;
}
.game-card.coming-soon:hover {
  transform: none;
  border-color: var(--border-card);
  box-shadow: none;
}
.game-card.coming-soon .btn-play-cta.disabled {
  background: #334155;
  color: #94a3b8;
  cursor: not-allowed;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.coming-soon-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
  margin-bottom: 12px;
}
