/* ============================================
   DISC GAME CENTER - Hub Page Styles
   Premium dark theme, responsive game cards
   with CSS-generated art, stats bar, achievements
   ============================================ */

/* ---------- Achievement Toast (global, loaded with game-stats.js) ---------- */
.gs-achievement-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.gs-achievement-toast--visible {
  transform: translateX(0);
}

.gs-achievement-toast__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 24px;
  background: var(--bg-2);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(139, 92, 246, 0.25);
}

.gs-achievement-toast__icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.gs-achievement-toast__icon svg {
  width: 100%;
  height: 100%;
}

.gs-achievement-toast__title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 600;
}

.gs-achievement-toast__name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

/* ---------- Badge (inline) ---------- */
.gs-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gs-badge svg {
  width: 100%;
  height: 100%;
}

/* ---------- Hub Layout ---------- */
.hub-wrapper {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px 80px;
  min-height: calc(100vh - 72px);
}

/* ---------- Hero ---------- */
.hub-hero {
  text-align: center;
  padding: 48px 0 32px;
}

.hub-hero__title {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--disc-d), var(--disc-i), var(--disc-s), var(--disc-c));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
}

.hub-hero__sub {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ---------- Stats Bar ---------- */
.hub-stats {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 24px auto 40px;
  flex-wrap: wrap;
  max-width: 700px;
}

.hub-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-width: 120px;
  flex: 1;
}

.hub-stat__val {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
}

.hub-stat__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---------- Section Headings ---------- */
.hub-section {
  margin-bottom: 48px;
}

.hub-section__title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
  padding-left: 4px;
}

/* ---------- Game Cards Grid ---------- */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 860px) {
  .hub-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .hub-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ---------- Game Card ---------- */
.hub-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.hub-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* -- Card Art (CSS geometric patterns) -- */
.hub-card__art {
  position: relative;
  height: 140px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Base gradient backgrounds per game */
.hub-card__art--dash {
  background: linear-gradient(135deg, rgba(239,68,68,0.15), rgba(245,158,11,0.15));
}

.hub-card__art--profiler {
  background: linear-gradient(135deg, rgba(59,130,246,0.15), rgba(139,92,246,0.15));
}

.hub-card__art--dilemma {
  background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(239,68,68,0.15));
}

.hub-card__art--clash {
  background: linear-gradient(135deg, rgba(239,68,68,0.15), rgba(59,130,246,0.15));
}

.hub-card__art--blitz {
  background: linear-gradient(135deg, rgba(16,185,129,0.15), rgba(245,158,11,0.15));
}

.hub-card__art--translator {
  background: linear-gradient(135deg, rgba(139,92,246,0.15), rgba(16,185,129,0.15));
}

/* Geometric shapes for each game */
.hub-card__shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.5;
  transition: transform 0.4s ease;
}

.hub-card:hover .hub-card__shape {
  transform: scale(1.15);
}

/* Dash: 4 overlapping circles (the DISC types) */
.hub-card__art--dash .hub-card__shape:nth-child(1) {
  width: 60px; height: 60px; background: var(--disc-d); top: 20px; left: 25%;
  opacity: 0.4;
}
.hub-card__art--dash .hub-card__shape:nth-child(2) {
  width: 50px; height: 50px; background: var(--disc-i); top: 30px; left: 45%;
  opacity: 0.35;
}
.hub-card__art--dash .hub-card__shape:nth-child(3) {
  width: 55px; height: 55px; background: var(--disc-s); top: 50px; left: 35%;
  opacity: 0.3;
}
.hub-card__art--dash .hub-card__shape:nth-child(4) {
  width: 45px; height: 45px; background: var(--disc-c); top: 15px; left: 60%;
  opacity: 0.35;
}

/* Profiler: crosshair / target */
.hub-card__art--profiler .hub-card__shape:nth-child(1) {
  width: 100px; height: 100px; border: 2px solid var(--disc-c); background: none;
  top: 20px; left: calc(50% - 50px); opacity: 0.4;
}
.hub-card__art--profiler .hub-card__shape:nth-child(2) {
  width: 60px; height: 60px; border: 2px solid var(--accent); background: none;
  top: 40px; left: calc(50% - 30px); opacity: 0.5;
}
.hub-card__art--profiler .hub-card__shape:nth-child(3) {
  width: 20px; height: 20px; background: var(--accent);
  top: 60px; left: calc(50% - 10px); opacity: 0.6;
}

/* Dilemma: forked path (two rectangles diverging) */
.hub-card__art--dilemma .hub-card__shape:nth-child(1) {
  width: 4px; height: 80px; background: var(--disc-i); border-radius: 2px;
  top: 30px; left: calc(50% - 2px); opacity: 0.5;
}
.hub-card__art--dilemma .hub-card__shape:nth-child(2) {
  width: 40px; height: 4px; background: var(--disc-d); border-radius: 2px;
  top: 50px; left: calc(50% - 40px); opacity: 0.5; transform: rotate(-30deg);
}
.hub-card__art--dilemma .hub-card__shape:nth-child(3) {
  width: 40px; height: 4px; background: var(--disc-s); border-radius: 2px;
  top: 50px; left: calc(50%); opacity: 0.5; transform: rotate(30deg);
}
.hub-card__art--dilemma .hub-card__shape:nth-child(4) {
  width: 16px; height: 16px; background: var(--disc-i);
  top: 36px; left: calc(50% - 8px); opacity: 0.6;
}

/* Clash: two opposing arrows */
.hub-card__art--clash .hub-card__shape:nth-child(1) {
  width: 70px; height: 6px; background: var(--disc-d); border-radius: 3px;
  top: 55px; left: 15%; opacity: 0.5;
}
.hub-card__art--clash .hub-card__shape:nth-child(2) {
  width: 70px; height: 6px; background: var(--disc-c); border-radius: 3px;
  top: 75px; left: 45%; opacity: 0.5;
}
.hub-card__art--clash .hub-card__shape:nth-child(3) {
  width: 20px; height: 20px; background: var(--disc-d); border-radius: 3px;
  top: 47px; left: calc(15% + 60px); opacity: 0.5; transform: rotate(45deg);
}
.hub-card__art--clash .hub-card__shape:nth-child(4) {
  width: 20px; height: 20px; background: var(--disc-c); border-radius: 3px;
  top: 67px; left: calc(45% - 10px); opacity: 0.5; transform: rotate(45deg);
}

/* Blitz: lightning bolt / starburst */
.hub-card__art--blitz .hub-card__shape:nth-child(1) {
  width: 8px; height: 60px; background: var(--disc-s); border-radius: 4px;
  top: 20px; left: calc(50% - 4px); opacity: 0.5; transform: rotate(15deg);
}
.hub-card__art--blitz .hub-card__shape:nth-child(2) {
  width: 8px; height: 60px; background: var(--disc-i); border-radius: 4px;
  top: 30px; left: calc(50% + 10px); opacity: 0.4; transform: rotate(-25deg);
}
.hub-card__art--blitz .hub-card__shape:nth-child(3) {
  width: 30px; height: 30px; background: var(--disc-s);
  top: 55px; left: calc(50% - 15px); opacity: 0.4;
}
.hub-card__art--blitz .hub-card__shape:nth-child(4) {
  width: 8px; height: 40px; background: var(--disc-d); border-radius: 4px;
  top: 40px; left: calc(50% - 20px); opacity: 0.3; transform: rotate(40deg);
}

/* Translator: speech bubbles */
.hub-card__art--translator .hub-card__shape:nth-child(1) {
  width: 60px; height: 40px; background: rgba(139,92,246,0.2); border-radius: 12px;
  top: 30px; left: 20%; opacity: 0.6; border: 1px solid rgba(139,92,246,0.3);
}
.hub-card__art--translator .hub-card__shape:nth-child(2) {
  width: 60px; height: 40px; background: rgba(16,185,129,0.2); border-radius: 12px;
  top: 60px; left: 50%; opacity: 0.6; border: 1px solid rgba(16,185,129,0.3);
}
.hub-card__art--translator .hub-card__shape:nth-child(3) {
  width: 30px; height: 4px; background: var(--accent); border-radius: 2px;
  top: 50px; left: calc(50% - 15px); opacity: 0.5;
}

/* Central game icon (SVG rendered as text) */
.hub-card__icon {
  position: relative;
  z-index: 2;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-2);
  border: 2px solid var(--border);
  border-radius: 14px;
  color: var(--text);
}

.hub-card__icon svg {
  width: 28px;
  height: 28px;
}

/* -- Card Body -- */
.hub-card__body {
  padding: 18px 18px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.hub-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.hub-card__desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
  flex: 1;
}

/* -- Difficulty Stars -- */
.hub-card__difficulty {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.hub-card__diff-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.hub-card__stars {
  display: flex;
  gap: 2px;
}

.hub-card__star {
  width: 12px;
  height: 12px;
  color: var(--text-muted);
}

.hub-card__star--filled {
  color: var(--disc-i);
}

.hub-card__star svg {
  width: 100%;
  height: 100%;
}

/* -- Card Footer Stats -- */
.hub-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.1);
}

.hub-card__fstat {
  text-align: center;
}

.hub-card__fstat-val {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.hub-card__fstat-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* -- Play Button -- */
.hub-card__play {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hub-card__play:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}

.hub-card__play svg {
  width: 14px;
  height: 14px;
}

/* -- Coming Soon Overlay -- */
.hub-card--coming-soon {
  opacity: 0.65;
  pointer-events: auto;
  cursor: default;
}

.hub-card--coming-soon:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border);
}

.hub-card__soon-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  z-index: 3;
}

/* ---------- Achievements Section ---------- */
.hub-achievements {
  margin-bottom: 48px;
}

.hub-ach-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

@media (max-width: 700px) {
  .hub-ach-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 440px) {
  .hub-ach-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.hub-ach-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s ease;
}

.hub-ach-card--earned {
  border-color: var(--accent);
  background: rgba(139, 92, 246, 0.05);
}

.hub-ach-card__icon {
  width: 36px;
  height: 36px;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.hub-ach-card--earned .hub-ach-card__icon {
  color: var(--accent);
}

.hub-ach-card__icon svg {
  width: 100%;
  height: 100%;
}

.hub-ach-card__name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.hub-ach-card--locked .hub-ach-card__name {
  color: var(--text-muted);
}

.hub-ach-card__desc {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ---------- Challenge Banner ---------- */
.hub-challenge {
  background: linear-gradient(135deg, rgba(239,68,68,0.08), rgba(245,158,11,0.08), rgba(16,185,129,0.08), rgba(59,130,246,0.08));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  margin-bottom: 48px;
}

.hub-challenge__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.hub-challenge__desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.hub-challenge__score {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
}

.hub-challenge__game {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.hub-challenge__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--disc-d), #b91c1c);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hub-challenge__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
}

/* ---------- Ambient Orbs (re-use from main site) ---------- */
.hub-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.hub-ambient__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.12;
  animation: hubFloat 20s ease-in-out infinite;
}

.hub-ambient__orb--d {
  width: 300px; height: 300px;
  background: var(--disc-d);
  top: -100px; left: -50px;
  animation-delay: 0s;
}

.hub-ambient__orb--i {
  width: 250px; height: 250px;
  background: var(--disc-i);
  top: 30%; right: -80px;
  animation-delay: -5s;
}

.hub-ambient__orb--s {
  width: 280px; height: 280px;
  background: var(--disc-s);
  bottom: -60px; left: 30%;
  animation-delay: -10s;
}

.hub-ambient__orb--c {
  width: 220px; height: 220px;
  background: var(--disc-c);
  bottom: 20%; right: 20%;
  animation-delay: -15s;
}

@keyframes hubFloat {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(30px, -20px); }
  50% { transform: translate(-15px, 25px); }
  75% { transform: translate(20px, 10px); }
}

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .hub-hero {
    padding: 32px 0 20px;
  }

  .hub-hero__title {
    font-size: 2rem;
  }

  .hub-stats {
    gap: 6px;
    margin: 16px auto 28px;
  }

  .hub-stat {
    padding: 10px 12px;
    min-width: 0;
  }

  .hub-stat__val {
    font-size: 1.2rem;
  }

  .hub-card__art {
    height: 110px;
  }

  .hub-card__body {
    padding: 14px 14px 10px;
  }

  .hub-card__footer {
    padding: 10px 14px;
  }
}
