/* Base styles */
:root {
  --bg: #0e0f13;
  --bg-soft: #141722;
  --card: #191c29;
  --text: #f0f4ff;
  --muted: #b4c0e3;
  --primary: #ff6a3d;
  --secondary: #ffd166;
  --accent: #6cffd1;
  --shadow: rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Baloo 2', system-ui, -apple-system, Segoe UI, Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

h1, h2, h3, .title, .brand span { font-family: 'Chewy', 'Baloo 2', cursive; }

.container { width: min(1200px, 92%); margin: 0 auto; }
.section { padding: 72px 0; }
.section-title { font-size: 2.4rem; margin: 0 0 8px; letter-spacing: 0.5px; }
.section-desc { margin: 0 0 24px; color: var(--muted); }

/* Nav */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(14,15,19,0.7); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(255,255,255,0.06); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 4%; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 1.4rem; }
.brand-logo { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; box-shadow: 0 6px 20px var(--shadow); }
.nav-links { list-style: none; display: flex; gap: 18px; margin: 0; padding: 0; }
.nav-links a { color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 10px; transition: background .2s, transform .2s; }
.nav-links a:hover { background: var(--bg-soft); transform: translateY(-1px); }
.nav-toggle { display: none; background: transparent; border: none; color: var(--text); font-size: 1.3rem; }

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav-links { position: absolute; top: 64px; right: 4%; background: var(--card); padding: 12px; border-radius: 12px; box-shadow: 0 20px 40px var(--shadow); flex-direction: column; display: none; }
  .nav-links.show { display: flex; }
}

/* Hero */
.hero { position: relative; min-height: 88vh; display: grid; place-items: center; text-align: center; overflow: clip; }
.hero-bg { position: absolute; inset: 0; background: url('images/background.png') center/cover no-repeat fixed, radial-gradient(1200px 600px at 50% 20%, rgba(255,255,255,0.07), transparent 60%); filter: saturate(1.1) brightness(.95); }
.hero-overlay { position: absolute; inset: 0; background: radial-gradient(circle at 50% 10%, rgba(255,218,185,0.08), transparent 40%), linear-gradient(to bottom, rgba(14,15,19,0.2), rgba(14,15,19,0.9)); }
.hero-content { position: relative; z-index: 1; padding: 48px 0; }
.hero-logo { width: 140px; height: 140px; border-radius: 28px; border: 3px solid rgba(255,255,255,0.12); box-shadow: 0 30px 60px var(--shadow); object-fit: cover; }
.title { font-size: clamp(2.2rem, 4.5vw, 4rem); margin: 16px 0 8px; text-shadow: 0 2px 0 rgba(0,0,0,0.2); }
.subtitle { color: var(--muted); margin: 0 0 18px; }
.hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 12px; border: 2px solid transparent; color: var(--text); text-decoration: none; cursor: pointer; font-weight: 700; transition: transform .15s, box-shadow .15s, background .2s; }
.btn.small { padding: 8px 12px; font-size: .95rem; }
.btn.primary { background: linear-gradient(135deg, var(--primary), #ff8e66); box-shadow: 0 12px 30px rgba(255,106,61,0.35); }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 14px 34px rgba(255,106,61,0.45); }
.btn.ghost { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.14); }
.btn.ghost:hover { background: rgba(255,255,255,0.12); }

/* Gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.gallery-item { margin: 0; border-radius: 14px; overflow: hidden; background: var(--card); border: 1px solid rgba(255,255,255,0.06); transition: transform .2s, box-shadow .2s; }
.gallery-item img { width: 100%; height: 160px; object-fit: cover; display: block; filter: saturate(1.1); }
.gallery-item:hover { transform: translateY(-2px); box-shadow: 0 14px 34px var(--shadow); }

/* Community */
.community-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.community-card { background: var(--card); border: 1px solid rgba(255,255,255,0.06); border-radius: 16px; padding: 16px; box-shadow: 0 20px 50px var(--shadow); }
.community-card h3 { margin: 0 0 12px; }
.embed-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.embed-form label { width: 100%; margin-bottom: 6px; color: var(--muted); font-size: .9rem; }
.embed-form input { flex: 1; min-width: 200px; padding: 10px 12px; border-radius: 10px; background: var(--bg); border: 1px solid rgba(255,255,255,0.08); color: var(--text); }
.ratio-16x9 { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 12px; }
.ratio-16x9 iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.twitter-container { min-height: 400px; border-radius: 12px; overflow: hidden; background: var(--bg); border: 1px solid rgba(255,255,255,0.06); padding: 8px; }

@media (max-width: 980px) {
  .community-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .community-grid { gap: 8px; }
  .community-card { padding: 8px; border-radius: 8px; }
  .community-card h3 { margin: 0 0 6px; font-size: 1rem; }
  .embed-form { flex-direction: column; align-items: stretch; gap: 4px; margin-bottom: 6px; }
  .embed-form label { margin-bottom: 3px; font-size: .8rem; }
  .embed-form input { min-width: unset; width: 100%; padding: 6px 8px; font-size: .85rem; }
  .embed-form button { width: 100%; padding: 6px 10px; font-size: .85rem; }
  .ratio-16x9 { padding-bottom: 55%; border-radius: 4px; }
  .twitter-container { min-height: 250px; border-radius: 4px; padding: 2px; }
}

/* PFP Editor */
.pfp-editor { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; align-items: start; }
.pfp-left { background: var(--card); border: 1px solid rgba(255,255,255,0.06); border-radius: 16px; padding: 12px; box-shadow: 0 20px 50px var(--shadow); }
.pfp-right { background: var(--card); border: 1px solid rgba(255,255,255,0.06); border-radius: 16px; padding: 16px; box-shadow: 0 20px 50px var(--shadow); }
#pfpCanvas { width: 100%; height: auto; display: block; border-radius: 12px; background: #000; touch-action: none; cursor: grab; }
.controls-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-top: 10px; }
.controls-row.wrap { flex-wrap: wrap; justify-content: flex-start; }
.controls-col { display: flex; flex-direction: column; gap: 8px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; user-select: none; }
.border-controls { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; }
.adjustments h3 { margin: 8px 0; }
.adjustments input[type="range"] { width: 100%; }
.uploader { margin-bottom: 12px; }
.bg-choices h3 { margin: 6px 0 10px; }
.bg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; }
.bg-item { padding: 0; border: 0; background: transparent; cursor: pointer; border-radius: 10px; overflow: hidden; border: 1px solid rgba(255,255,255,0.08); }
.bg-item img { width: 100%; height: 68px; object-fit: cover; display: block; }
.hint { color: var(--muted); font-size: .95rem; }

/* Crash Game */
.wallet-section { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.wallet-info { display: flex; flex-direction: column; gap: 4px; }
.wallet-address { color: var(--accent); font-weight: 700; font-family: 'Courier New', monospace; font-size: .9rem; }
.wallet-balance { color: var(--muted); font-size: .85rem; }
.wallet-status { color: var(--secondary); font-size: .9rem; font-weight: 500; }
.crash-game-wrap { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; align-items: start; }
.crash-canvas-wrap { position: relative; background: var(--card); border: 1px solid rgba(255,255,255,0.06); border-radius: 14px; padding: 10px; box-shadow: 0 20px 50px var(--shadow); width: 100%; }
#crashCanvas { width: 100%; height: auto; display: block; border-radius: 10px; background: #05060a; }
.crash-overlay { position: absolute; inset: 10px; pointer-events: none; display: flex; flex-direction: column; justify-content: space-between; }
.crash-multiplier { font-family: 'Chewy', cursive; font-size: 2rem; color: var(--secondary); text-shadow: 0 2px 10px rgba(0,0,0,.4); align-self: flex-end; }
.crash-status { color: var(--muted); }
.bet-form { background: var(--card); border: 1px solid rgba(255,255,255,0.06); border-radius: 14px; padding: 12px; display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; }
.bet-form label { color: var(--muted); }
.bet-form input { padding: 10px 12px; border-radius: 10px; background: var(--bg); border: 1px solid rgba(255,255,255,0.08); color: var(--text); }
.bet-result { color: var(--accent); font-weight: 700; }
.crash-history { margin-top: 12px; }
.crash-history-list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; gap: 8px; flex-wrap: wrap; }
.crash-history-list li { background: var(--card); border: 1px solid rgba(255,255,255,0.06); padding: 6px 10px; border-radius: 10px; }

@media (max-width: 980px) {
  .crash-game-wrap { grid-template-columns: 1fr; }
  .bet-form { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .crash-overlay { inset: 8px; }
  .wallet-section { flex-direction: column; align-items: flex-start; }
  .wallet-info { align-items: flex-start; }
}

@media (max-width: 1024px) {
  .pfp-editor { grid-template-columns: 1fr; }
}

/* Mobile tweaks */
@media (max-width: 640px) {
  .section { padding: 40px 0; }
  .section-title { font-size: 1.8rem; }
  .section-desc { margin: 0 0 16px; font-size: .9rem; }
  .nav { padding: 10px 4%; }
  .hero { min-height: 78vh; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .gallery-item img { height: 120px; }
  #pfpCanvas { border-radius: 10px; }
  .pfp-left { padding: 10px; }
  .pfp-right { padding: 12px; }
  .controls-row { gap: 8px; flex-wrap: wrap; justify-content: flex-start; }
  .controls-row label { font-size: .95rem; }
  .controls-row input[type="range"] { flex: 1 1 100%; max-width: 100%; }
  .btn.small { padding: 7px 10px; }
  .hero-ctas .btn { width: 100%; }
  .bg-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .bg-item img { height: 60px; }
}

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.8); display: none; align-items: center; justify-content: center; z-index: 100; }
.lightbox.show { display: flex; }
.lightbox img { max-width: 90vw; max-height: 86vh; border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,0.6); }
.lightbox-close { position: absolute; top: 14px; right: 14px; background: rgba(255,255,255,0.1); border: 0; color: #fff; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 1.1rem; }

/* Animations */
.floaty { animation: floaty 4s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-10px) } }
.fade-in { animation: fadein .6s ease both; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px) } to { opacity: 1; transform: none } }

/* Floating Pump.fun Button */
.float-button {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  text-decoration: none;
  background: linear-gradient(145deg, var(--primary), var(--secondary));
  box-shadow: 0 8px 32px rgba(255, 106, 61, 0.4), 
              0 4px 16px rgba(0, 0, 0, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: float-bounce 3s ease-in-out infinite;
}

.float-button img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  z-index: 2;
}

.float-button:hover {
  transform: scale(1.1) translateY(-3px);
  box-shadow: 0 12px 48px rgba(255, 106, 61, 0.6), 
              0 8px 24px rgba(0, 0, 0, 0.4);
}

.float-pulse {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 106, 61, 0.3), transparent 70%);
  animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.float-glow {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(255, 106, 61, 0.2), rgba(255, 209, 102, 0.2));
  animation: glow-rotate 4s linear infinite;
}

@keyframes float-bounce {
  0%, 100% { transform: translateY(0px); }
  25% { transform: translateY(-8px); }
  50% { transform: translateY(-4px); }
  75% { transform: translateY(-12px); }
}

@keyframes pulse-ring {
  0% { transform: scale(0.8); opacity: 1; }
  80% { transform: scale(1.4); opacity: 0; }
  100% { transform: scale(1.4); opacity: 0; }
}

@keyframes glow-rotate {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.05); }
  100% { transform: rotate(360deg) scale(1); }
}

/* Float Button Mobile Responsive */
@media (max-width: 640px) {
  .float-button {
    width: 60px;
    height: 60px;
    bottom: 20px;
    right: 20px;
  }
  
  .float-button img {
    width: 34px;
    height: 34px;
  }
}

@media (max-width: 480px) {
  .float-button {
    width: 55px;
    height: 55px;
    bottom: 16px;
    right: 16px;
  }
  
  .float-button img {
    width: 30px;
    height: 30px;
  }
}

/* Footer */
.footer { padding: 28px 0; border-top: 1px solid rgba(255,255,255,0.06); background: #0b0c10; margin-top: 56px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; }
.to-top { color: var(--text); text-decoration: none; background: rgba(255,255,255,0.08); padding: 8px 10px; border-radius: 10px; }
