/* =============================================
   COBBLEVERSE — Design System
   Pokémon Neon Noir — Dark Violet Theme
   ============================================= */

:root {
  --bg: #050508;
  --bg-card: rgba(14, 14, 24, 0.85);
  --bg-card-hover: rgba(20, 20, 34, 0.92);
  --border: rgba(155, 48, 255, 0.18);
  --border-hover: rgba(155, 48, 255, 0.4);
  --border-glow: rgba(155, 48, 255, 0.55);
  --purple: #9B30FF;
  --purple-light: #c17aff;
  --purple-dark: #6b1fd4;
  --purple-glow: rgba(155, 48, 255, 0.35);
  --purple-glow-strong: rgba(155, 48, 255, 0.6);
  --text: #d4d4e2;
  --text-bright: #f0f0f8;
  --text-dim: #7e7e92;
  --text-muted: #5a5a6e;
  --white: #f4f4fb;
  --danger-bg: rgba(255, 70, 70, 0.12);
  --danger-border: rgba(255, 70, 70, 0.25);
  --danger-text: #ff6b6b;
  --success: #4ade80;
  --radius: 14px;
  --radius-sm: 8px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-display: 'Press Start 2P', monospace;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

::selection {
  background: rgba(155, 48, 255, 0.35);
  color: var(--white);
}

/* =============================================
   PARTICLES CANVAS
   ============================================= */
#particles-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* =============================================
   NAVIGATION BAR
   ============================================= */
.nav-bar{display:flex;justify-content:center;gap:.5rem;padding:.8rem 1rem;flex-wrap:wrap;border-bottom:1px solid rgba(155,48,255,0.1);background:rgba(8,8,16,0.9);position:sticky;top:0;z-index:10;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px)}
.nav-btn{padding:.5rem 1rem;border:1px solid var(--border);border-radius:8px;cursor:pointer;font-size:.78rem;font-weight:600;text-decoration:none;color:var(--dim);background:var(--bg-card);transition:all .3s;font-family:var(--font-body)}
.nav-btn:hover,.nav-btn.active{background:var(--purple);color:#fff;border-color:var(--purple);box-shadow:0 0 15px rgba(155,48,255,0.3)}
@media(max-width:500px){.nav-btn{font-size:.7rem;padding:.4rem .8rem}}

/* =============================================
   POKEMON — GIRATINA (right side, behind content)
   ============================================= */
.pokemon-giratina {
  position: fixed;
  right: -100px;
  top: 50%;
  transform: translateY(-50%);
  width: 600px;
  height: 600px;
  z-index: 0;
  pointer-events: none;
  opacity: 0.8;
}

.pokemon-giratina img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: giratinaFloat 8s ease-in-out infinite;
  filter: brightness(1.5) drop-shadow(0 0 50px rgba(220, 30, 30, 0.5)) drop-shadow(0 0 100px rgba(180, 10, 10, 0.25));
}

@keyframes giratinaFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-15px) rotate(1.5deg); }
  50% { transform: translateY(0) rotate(0deg); }
  75% { transform: translateY(10px) rotate(-1deg); }
}

.giratina-glow {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(160, 15, 15, 0.3) 0%, rgba(120, 10, 10, 0.15) 40%, transparent 70%);
  animation: giratinaGlow 5s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes giratinaGlow {
  0% { opacity: 0.4; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.25); }
}

/* =============================================
   POKEMON — CHARMANDER EVOLUTION (left side)
   ============================================= */
.pokemon-evolution {
  position: fixed;
  left: 30px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  pointer-events: none;
  text-align: center;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.pokemon-evolution.visible {
  opacity: 1;
}

.evo-stage {
  width: 200px;
  height: 200px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.evo-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.4s ease, transform 0.4s ease;
  filter: drop-shadow(0 0 20px rgba(255, 120, 30, 0.45)) drop-shadow(0 0 40px rgba(255, 80, 10, 0.2));
}

.evo-stage img.evo-out {
  opacity: 0;
  transform: scale(0.8);
}

.evo-name {
  margin-top: 0.6rem;
  font-family: var(--font-display);
  font-size: 0.62rem;
  color: var(--purple-light);
  text-shadow: 0 0 12px var(--purple-glow), 0 0 30px rgba(155,48,255,0.3);
  transition: opacity 0.3s ease;
  min-height: 1em;
}

.evo-name.evo-out {
  opacity: 0;
}

.evo-flash {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(255,200,100,0.5) 35%, transparent 70%);
  opacity: 0;
  pointer-events: none;
}

.evo-flash.active {
  animation: evoFlash 0.65s ease-out forwards;
}

@keyframes evoFlash {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.2); }
  25% { opacity: 1; transform: translate(-50%, -50%) scale(1.3); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(2); }
}

/* =============================================
   HERO
   ============================================= */
.hero {
  position: relative;
  text-align: center;
  padding: 4rem 1.5rem 3rem;
  overflow: hidden;
  z-index: 1;
}

.hero-glow {
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(155,48,255,0.12) 0%, transparent 70%);
  pointer-events: none;
  animation: heroPulse 4s ease-in-out infinite;
}

@keyframes heroPulse {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.15); }
}

.hero-icon {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  box-shadow: 0 0 50px rgba(155, 48, 255, 0.4), 0 0 100px rgba(155, 48, 255, 0.15);
  animation: iconFloat 3s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5vw, 2.8rem);
  font-weight: 400;
  color: var(--white);
  margin-top: 1.5rem;
  text-shadow: 0 0 30px var(--purple-glow), 0 0 60px var(--purple-glow), 0 0 100px rgba(155,48,255,0.2);
  animation: titleGlow 3s ease-in-out infinite alternate;
  position: relative;
  z-index: 1;
}

@keyframes titleGlow {
  0% { text-shadow: 0 0 30px var(--purple-glow), 0 0 60px var(--purple-glow); }
  100% { text-shadow: 0 0 50px var(--purple-glow-strong), 0 0 100px var(--purple-glow-strong), 0 0 150px rgba(155,48,255,0.3); }
}

.hero-subtitle {
  color: var(--text-dim);
  font-size: 1.05rem;
  margin-top: 0.5rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  position: relative;
  z-index: 1;
}

.hero-dot {
  color: var(--purple-light);
}

.hero-pokeballs {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 2rem;
  position: relative;
  z-index: 1;
}

.mini-pokeball {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(to bottom, rgba(130,40,220,0.5) 0%, rgba(130,40,220,0.5) 46%, rgba(200,160,255,0.4) 46%, rgba(200,160,255,0.4) 54%, rgba(200,190,220,0.3) 54%, rgba(200,190,220,0.3) 100%);
  position: relative;
  animation: pokeballSpin 8s linear infinite;
}

.pb-1 { animation-delay: 0s; }
.pb-2 { animation-delay: -2.6s; }
.pb-3 { animation-delay: -5.2s; }

.mini-pokeball::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid rgba(180,140,255,0.5);
}

@keyframes pokeballSpin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.3); }
  100% { transform: rotate(360deg) scale(1); }
}

/* =============================================
   CONTAINER & LAYOUT
   ============================================= */
.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
  position: relative;
  z-index: 2;
}

/* =============================================
   TABS
   ============================================= */
.tabs {
  display: flex;
  margin-bottom: 2.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  padding: 5px;
  position: relative;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.tab-btn {
  flex: 1;
  padding: 0.85rem 1.2rem;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  background: transparent;
  color: var(--text-dim);
  border-radius: 9px;
  transition: color var(--transition);
  position: relative;
  z-index: 1;
  font-family: var(--font-body);
  letter-spacing: 0.02em;
}

.tab-btn.active { color: #fff; }

.tab-btn:hover:not(.active) { color: var(--text); }

.tab-badge { margin-right: 4px; }

.tab-slider {
  position: absolute;
  top: 5px; left: 5px;
  width: calc(50% - 5px);
  height: calc(100% - 10px);
  background: var(--purple);
  border-radius: 9px;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 20px var(--purple-glow), 0 0 40px rgba(155,48,255,0.15);
  z-index: 0;
}

.tabs.nopremium .tab-slider { transform: translateX(100%); }

/* =============================================
   TAB CONTENT
   ============================================= */
.tab-content { display: none; animation: fadeSlideIn 0.45s ease; }
.tab-content.active { display: block; }

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =============================================
   CARDS
   ============================================= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 40px rgba(155, 48, 255, 0.08), 0 0 0 1px rgba(155, 48, 255, 0.05);
}

.card-accent {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--purple) 30%, var(--purple-light) 70%, transparent 100%);
  opacity: 0;
  transition: opacity var(--transition);
}

.card:hover .card-accent { opacity: 1; }

.card-title {
  color: var(--text-bright);
  font-size: 1.08rem;
  font-weight: 700;
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.card-subtitle { font-weight: 400; color: var(--text-dim); font-size: 0.9rem; }
.card-note { color: var(--text-dim); margin-bottom: 0.8rem; font-size: 0.92rem; }

/* =============================================
   BADGES
   ============================================= */
.badge {
  display: inline-block;
  padding: 0.2em 0.65em;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(155, 48, 255, 0.15);
  color: var(--purple-light);
  border: 1px solid rgba(155, 48, 255, 0.25);
}

.badge-recommended {
  background: rgba(74, 222, 128, 0.12);
  color: var(--success);
  border-color: rgba(74, 222, 128, 0.25);
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.3); }
  50% { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); }
}

.badge-warn {
  background: var(--danger-bg);
  color: var(--danger-text);
  border-color: var(--danger-border);
}

/* =============================================
   STEPS
   ============================================= */
.step {
  display: flex;
  gap: 0.9rem;
  margin-bottom: 1rem;
  align-items: flex-start;
}

.step-num {
  flex-shrink: 0;
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  box-shadow: 0 0 12px rgba(155, 48, 255, 0.3);
  font-family: var(--font-mono);
}

.step-body p { margin-top: 0.2rem; line-height: 1.55; }

.step-link {
  color: var(--purple-light);
  font-size: 0.88rem;
  text-decoration: none;
  display: inline-block;
  margin-top: 0.15rem;
  transition: color var(--transition);
}

.step-link:hover { color: #d9b3ff; text-decoration: underline; }
.step-link.mb { margin-bottom: 0.8rem; }

/* =============================================
   DOWNLOAD BUTTONS
   ============================================= */
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.8rem;
  background: linear-gradient(135deg, var(--purple), #7a20d0);
  color: #fff;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.93rem;
  letter-spacing: 0.02em;
  margin-top: 0.5rem;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 20px rgba(155, 48, 255, 0.3);
}

.btn-download::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left 0.6s;
}

.btn-download:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 35px rgba(155, 48, 255, 0.5), 0 0 60px rgba(155, 48, 255, 0.2);
}

.btn-download:hover::before { left: 100%; }
.btn-download:active { transform: translateY(0) scale(0.98); }
.btn-icon { font-size: 1.1rem; }

.btn-eevee {
  height: 32px;
  width: auto;
  margin-left: 0.2rem;
  vertical-align: middle;
  transition: transform var(--transition);
}

.btn-download:hover .btn-eevee {
  transform: scale(1.15) rotate(-5deg);
}

/* =============================================
   ALERT / WARNING
   ============================================= */
.alert {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.1rem;
  margin-top: 0.8rem;
  font-size: 0.9rem;
  color: #fca5a5;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.alert-icon { font-size: 1.1rem; flex-shrink: 0; }

/* =============================================
   CONNECT CARD
   ============================================= */
.connect-card { text-align: center; }

.connect-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(16, 16, 28, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem 0.65rem 1.2rem;
  margin-top: 0.5rem;
  transition: border-color var(--transition);
}

.connect-box:focus-within { border-color: var(--border-glow); }

.connect-host {
  flex: 1;
  background: transparent;
  color: var(--purple-light);
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  word-break: break-all;
  user-select: all;
}

.btn-copy {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 1rem;
  background: rgba(155, 48, 255, 0.2);
  border: 1px solid rgba(155, 48, 255, 0.3);
  color: var(--purple-light);
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font-body);
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-copy:hover {
  background: rgba(155, 48, 255, 0.35);
  border-color: var(--border-glow);
}

.copy-icon { font-size: 0.95rem; }

.copy-feedback {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--success);
  font-weight: 600;
  opacity: 0;
  transform: translateY(4px);
  transition: all 0.3s ease;
}

.copy-feedback.show { opacity: 1; transform: translateY(0); }

/* =============================================
   COMMAND TABLE
   ============================================= */
.section-heading {
  color: var(--purple-light);
  margin: 1.4rem 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hint { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 0.5rem; }

kbd {
  background: rgba(155, 48, 255, 0.15);
  border: 1px solid rgba(155, 48, 255, 0.3);
  border-radius: 4px;
  padding: 0.1em 0.45em;
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--purple-light);
}

.cmd-table { width: 100%; border-collapse: separate; border-spacing: 0; margin-bottom: 0.4rem; }

.cmd-table tr { transition: background var(--transition); }
.cmd-table tr:hover { background: rgba(155, 48, 255, 0.06); }

.cmd-table td {
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid rgba(155, 48, 255, 0.07);
  font-size: 0.88rem;
}

.cmd-table td:first-child { font-family: var(--font-mono); font-size: 0.8rem; }
.cmd-table td:last-child { color: var(--text-dim); font-size: 0.84rem; }

/* =============================================
   CODE
   ============================================= */
code {
  background: rgba(155, 48, 255, 0.1);
  color: var(--purple-light);
  padding: 0.15em 0.5em;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.88em;
  font-weight: 500;
  border: 1px solid rgba(155, 48, 255, 0.12);
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
  text-align: center;
  padding: 2rem 1.5rem 3rem;
  position: relative;
  z-index: 1;
}

.footer-line {
  width: 60px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--purple), transparent);
  margin: 0 auto 1.2rem;
  border-radius: 1px;
}

.footer-text { color: var(--text-muted); font-size: 0.82rem; letter-spacing: 0.04em; }
.footer-dot { color: var(--purple-light); opacity: 0.5; }

/* =============================================
   SCROLL REVEAL ANIMATIONS
   ============================================= */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.revealed { opacity: 1; transform: translateY(0); }

.card:nth-child(1).reveal { transition-delay: 0.05s; }
.card:nth-child(2).reveal { transition-delay: 0.15s; }

.tab-content .reveal:nth-child(1) { transition-delay: 0.05s; }
.tab-content .reveal:nth-child(2) { transition-delay: 0.18s; }

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(155, 48, 255, 0.25); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(155, 48, 255, 0.45); }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 640px) {
  .hero { padding: 2.5rem 1rem 2rem; }
  .hero-icon { width: 60px; height: 60px; border-radius: 14px; }
  .hero-title { font-size: 1.3rem; }
  .hero-subtitle { font-size: 0.9rem; }
  .container { padding: 0 1rem 3rem; }
  .card { padding: 1.2rem; }

  .tabs { flex-direction: column; gap: 4px; }
  .tab-slider { width: 100% !important; height: calc(50% - 6px); }
  .tabs.nopremium .tab-slider { transform: translateY(100%); }

  .btn-download { width: 100%; justify-content: center; font-size: 0.85rem; padding: 0.8rem 1rem; }
  .connect-box { flex-direction: column; align-items: stretch; gap: 0.5rem; }
  .btn-copy { justify-content: center; }

  .cmd-table td { padding: 0.45rem 0.4rem; font-size: 0.78rem; }
  .cmd-table td:first-child { font-size: 0.72rem; }

  .pokemon-giratina { width: 240px; height: 240px; right: -30px; opacity: 0.4; }
  .pokemon-evolution { left: 10px; }
  .evo-stage { width: 100px; height: 100px; }
  .evo-flash { width: 120px; height: 120px; }
}

@media (min-width: 641px) and (max-width: 1100px) {
  .hero-title { font-size: 2rem; }
  .pokemon-giratina { width: 400px; height: 400px; right: -30px; }
  .pokemon-evolution { left: 20px; }
  .evo-stage { width: 150px; height: 150px; }
  .evo-flash { width: 170px; height: 170px; }
}

/* =============================================
   REDUCED MOTION
   ============================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
