/* ═══════════════════════════════════════════════════════════════
   FUZZYNUTS ARCADE — Premium Arcade Portal Styles
   Design: Dark theme, gold accents, glassmorphism, CRT touches
   ═══════════════════════════════════════════════════════════════ */

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

:root {
  --gold: #F5A623;
  --gold-light: #FFD777;
  --gold-dark: #C78415;
  --brown: #8B5E34;
  --brown-dark: #5C3D1F;
  --green: #2D6A4F;
  --green-dark: #1B4332;
  --bg: #0A0A0F;
  --bg-card: #13131A;
  --bg-card-hover: #1A1A24;
  --bg-glass: rgba(19, 19, 26, 0.75);
  --text: #F0EDE6;
  --text-muted: #9A9689;
  --glow: rgba(245, 166, 35, 0.3);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.3s ease;
}

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.6;
  min-height: 100vh;
}

/* ═══ ANIMATED BACKGROUND ═══ */
.bg-particles {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-particles::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(245,166,35,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(45,106,79,0.05) 0%, transparent 50%);
  animation: bgFloat 20s ease-in-out infinite;
}
@keyframes bgFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(30px, -30px) rotate(1deg); }
  66% { transform: translate(-20px, 20px) rotate(-1deg); }
}

/* ═══ HEADER ═══ */
.arcade-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.5rem;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(245,166,35,0.1);
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  color: var(--text);
}
.topbar-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  filter: drop-shadow(0 0 8px var(--glow));
}
.topbar-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.75rem;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(245,166,35,0.3);
  letter-spacing: 1px;
}
.topbar-back {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: color var(--transition);
}
.topbar-back:hover { color: var(--gold); }

/* ═══ WALLET BUTTON ═══ */
.wallet-area {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.wallet-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.2rem;
  border-radius: 50px;
  border: 1.5px solid rgba(245,166,35,0.3);
  background: rgba(245,166,35,0.08);
  color: var(--gold);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.wallet-btn:hover {
  background: rgba(245,166,35,0.18);
  border-color: rgba(245,166,35,0.5);
  box-shadow: 0 0 20px rgba(245,166,35,0.15);
  transform: translateY(-1px);
}
.wallet-btn.connected {
  border-color: rgba(45,106,79,0.5);
  background: rgba(45,106,79,0.12);
  color: #4ADE80;
}
.wallet-btn.connected:hover {
  background: rgba(45,106,79,0.2);
  box-shadow: 0 0 20px rgba(45,106,79,0.15);
}
.wallet-btn .wallet-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold);
  animation: dotPulse 2s ease-in-out infinite;
}
.wallet-btn.connected .wallet-dot {
  background: #4ADE80;
}
@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}
.wallet-address {
  font-family: 'Courier New', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.wallet-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.wallet-badge.trustline {
  background: rgba(45,106,79,0.15);
  color: #4ADE80;
  border: 1px solid rgba(45,106,79,0.3);
}
.wallet-badge.no-trustline {
  background: rgba(231,76,60,0.12);
  color: #FF6B6B;
  border: 1px solid rgba(231,76,60,0.3);
}

/* ═══ WALLET MODAL ═══ */
.wallet-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.wallet-modal-overlay.active {
  display: flex;
}
.wallet-modal {
  background: var(--bg-card);
  border: 1px solid rgba(245,166,35,0.2);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 420px;
  width: 90%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px rgba(245,166,35,0.08);
}
.wallet-modal h2 {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.8rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
  text-align: center;
}
.wallet-modal p {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  margin-bottom: 1.5rem;
}
.wallet-modal-close {
  position: absolute;
  top: 0.8rem; right: 0.8rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.3rem;
  transition: color var(--transition);
}
.wallet-modal-close:hover { color: var(--text); }
.wallet-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border: 1px solid rgba(245,166,35,0.1);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 0.7rem;
  background: rgba(245,166,35,0.03);
}
.wallet-option:hover {
  border-color: rgba(245,166,35,0.3);
  background: rgba(245,166,35,0.08);
  transform: translateX(4px);
}
.wallet-option:last-child { margin-bottom: 0; }
.wallet-option-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.wallet-option-info h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}
.wallet-option-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
  text-align: left;
}

/* ═══ MAIN CONTENT ═══ */
.arcade-main {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ═══ PRIZE BANNER ═══ */
.prize-banner {
  background: linear-gradient(135deg, rgba(245,166,35,0.08), rgba(45,106,79,0.08));
  border: 1.5px solid rgba(245,166,35,0.2);
  border-radius: var(--radius);
  padding: 1.8rem 2rem;
  text-align: center;
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
}
.prize-banner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), #FF6B35, var(--gold));
}
.prize-banner::after {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.03) 50%, transparent 60%);
  animation: prizeShine 6s ease-in-out infinite;
}
@keyframes prizeShine {
  0% { transform: translateX(-100%) rotate(45deg); }
  100% { transform: translateX(100%) rotate(45deg); }
}
.prize-badge {
  display: inline-block;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  color: var(--gold);
  background: rgba(245,166,35,0.12);
  border: 1px solid rgba(245,166,35,0.25);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
  position: relative;
  z-index: 1;
}
.prize-title {
  font-size: 1.6rem;
  font-weight: 900;
  margin-bottom: 0.4rem;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  z-index: 1;
}
.prize-tiers {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin: 1rem 0 0.6rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.prize-tier {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 0.95rem;
}
.prize-tier .medal { font-size: 1.2rem; }
.prize-tier .amount { color: var(--gold-light); }
.prize-countdown {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  position: relative;
  z-index: 1;
}

/* ═══ SECTION HEADERS ═══ */
.section-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}
.section-header h2 {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.75rem;
  color: var(--gold);
  letter-spacing: 1px;
}
.section-header .section-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(245,166,35,0.3), transparent);
}

/* ═══ GAME GRID ═══ */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}
.game-card {
  background: var(--bg-card);
  border: 1px solid rgba(245,166,35,0.1);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
  position: relative;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}
.game-card:hover {
  transform: translateY(-6px);
  border-color: rgba(245,166,35,0.35);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 30px rgba(245,166,35,0.08);
}
.game-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--green));
  opacity: 0;
  transition: opacity var(--transition);
}
.game-card:hover::before { opacity: 1; }

.game-thumb {
  width: 100%;
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, #1a1a24, #0e0e18);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.game-thumb .game-icon {
  font-size: 4rem;
  filter: drop-shadow(0 0 20px rgba(245,166,35,0.3));
  z-index: 1;
}
.game-thumb::after {
  content: '▶ PLAY';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  color: var(--gold-light);
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: 2px;
  opacity: 0;
  transition: opacity var(--transition);
}
.game-card:hover .game-thumb::after { opacity: 1; }

.game-info {
  padding: 1.2rem 1.4rem;
}
.game-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.65rem;
  color: var(--gold);
  margin-bottom: 0.4rem;
  line-height: 1.6;
}
.game-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.8rem;
}
.game-stats {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.game-stat {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.game-stat .stat-val {
  font-weight: 700;
  color: var(--gold-light);
}

/* Coming Soon Card */
.game-card.coming-soon {
  cursor: default;
  opacity: 0.5;
}
.game-card.coming-soon:hover {
  transform: none;
  border-color: rgba(245,166,35,0.1);
  box-shadow: none;
}
.game-card.coming-soon .game-thumb::after {
  content: 'COMING SOON';
  opacity: 0.6;
  font-size: 0.7rem;
  letter-spacing: 3px;
  background: rgba(0,0,0,0.4);
}
.game-card.coming-soon:hover .game-thumb::after { opacity: 0.6; }

/* ═══ LEADERBOARD ═══ */
.leaderboard-section {
  margin-bottom: 3rem;
}
.leaderboard-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(245,166,35,0.12);
  border-radius: var(--radius);
  padding: 1.5rem;
  overflow: hidden;
  position: relative;
}
.leaderboard-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), #FF6B35, var(--gold));
}
.lb-tabs {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 1.2rem;
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  padding: 3px;
}
.lb-tab {
  flex: 1;
  padding: 0.5rem 0.8rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  border-radius: 6px;
  transition: all var(--transition);
}
.lb-tab.active {
  background: rgba(245,166,35,0.15);
  color: var(--gold);
}
.lb-tab:hover:not(.active) {
  color: var(--text);
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
}
.lb-table th {
  text-align: left;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid rgba(245,166,35,0.08);
  font-weight: 600;
}
.lb-table th:last-child,
.lb-table td:last-child {
  text-align: right;
}
.lb-table td {
  padding: 0.65rem 0.7rem;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: background var(--transition);
}
.lb-table tr:hover td {
  background: rgba(245,166,35,0.04);
}
.lb-rank {
  font-weight: 900;
  width: 36px;
}
.lb-rank.gold { color: #FFD700; }
.lb-rank.silver { color: #C0C0C0; }
.lb-rank.bronze { color: #CD7F32; }
.lb-player {
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
}
.lb-player .you-tag {
  font-family: 'Outfit', sans-serif;
  font-size: 0.65rem;
  background: rgba(245,166,35,0.15);
  color: var(--gold);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.4rem;
  font-weight: 700;
}
.lb-score {
  font-weight: 700;
  color: var(--gold-light);
  font-family: 'Courier New', monospace;
}
.lb-empty {
  text-align: center;
  padding: 2rem !important;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ═══ HOW TO PLAY ═══ */
.howto-section {
  margin-bottom: 3rem;
}
.howto-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.howto-step {
  background: var(--bg-card);
  border: 1px solid rgba(245,166,35,0.08);
  border-radius: var(--radius-sm);
  padding: 1.5rem 1.2rem;
  text-align: center;
  transition: all var(--transition);
  position: relative;
}
.howto-step:hover {
  transform: translateY(-3px);
  border-color: rgba(245,166,35,0.2);
}
.howto-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #0A0A0F;
  font-weight: 900;
  font-size: 1rem;
  border-radius: 50%;
  margin: 0 auto 0.8rem;
}
.howto-step h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.howto-step p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ═══ TRUSTLINE CTA (appears when connected without trustline) ═══ */
.trustline-cta {
  display: none;
  background: linear-gradient(135deg, rgba(231,76,60,0.08), rgba(245,166,35,0.08));
  border: 1.5px solid rgba(231,76,60,0.3);
  border-radius: var(--radius-sm);
  padding: 1.2rem 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}
.trustline-cta.visible { display: block; }
.trustline-cta p {
  color: var(--text);
  font-size: 0.9rem;
  margin-bottom: 0.8rem;
}
.trustline-cta .btn-trustline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.4rem;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  transition: all var(--transition);
}
.trustline-cta .btn-trustline:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(45,106,79,0.4);
}

/* ═══ FOOTER ═══ */
.arcade-footer {
  text-align: center;
  padding: 2rem 1.5rem;
  border-top: 1px solid rgba(245,166,35,0.06);
  color: var(--text-muted);
  font-size: 0.8rem;
}
.arcade-footer .footer-links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-bottom: 1rem;
}
.arcade-footer .footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition);
}
.arcade-footer .footer-links a:hover { color: var(--gold); }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
  .arcade-topbar {
    padding: 0.6rem 1rem;
  }
  .topbar-title {
    font-size: 0.6rem;
  }
  .game-grid {
    grid-template-columns: 1fr;
  }
  .prize-tiers {
    flex-direction: column;
    gap: 0.6rem;
  }
  .howto-steps {
    grid-template-columns: 1fr 1fr;
  }
  .wallet-btn {
    padding: 0.45rem 0.8rem;
    font-size: 0.78rem;
  }
}

@media (max-width: 480px) {
  .howto-steps {
    grid-template-columns: 1fr;
  }
  .arcade-main {
    padding: 1.5rem 1rem 3rem;
  }
  .prize-title {
    font-size: 1.3rem;
  }
}

/* ═══ ANIMATIONS ═══ */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Game card stagger animation */
.game-card:nth-child(1) { animation-delay: 0s; }
.game-card:nth-child(2) { animation-delay: 0.1s; }
.game-card:nth-child(3) { animation-delay: 0.2s; }
.game-card:nth-child(4) { animation-delay: 0.3s; }

@keyframes cardSlideIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
.game-card {
  animation: cardSlideIn 0.5s ease forwards;
}
