/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f0f1a;
  --surface: #1a1a2e;
  --surface-hover: #22223a;
  --border: #2a2a4a;
  --text: #e0e0f0;
  --text-muted: #8888aa;
  --primary: #6c63ff;
  --primary-hover: #7b73ff;
  --primary-glow: rgba(108, 99, 255, 0.3);
  --success: #4ade80;
  --success-bg: rgba(74, 222, 128, 0.1);
  --danger: #f87171;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(108, 99, 255, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(74, 222, 128, 0.05) 0%, transparent 50%);
}

#app { width: 100%; max-width: 480px; margin-top: 40px; }

.view { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ===== CARD ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
}

/* ===== AUTH ===== */
.auth-card .logo { font-size: 48px; margin-bottom: 8px; }
.auth-card h1 { font-size: 24px; margin-bottom: 4px; }
.subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; line-height: 1.5; }

#auth-tabs { display: flex; gap: 0; margin-bottom: 20px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.tab {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
}
.tab.active { background: var(--primary); color: #fff; }
.tab:not(.active):hover { background: var(--surface-hover); color: var(--text); }

.field { margin-bottom: 14px; text-align: left; }
.field label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 4px; font-weight: 500; }
.field input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  transition: var(--transition);
  outline: none;
}
.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.field input::placeholder { color: var(--text-muted); opacity: 0.6; }

.error { color: var(--danger); font-size: 13px; margin-bottom: 12px; padding: 8px 12px; background: rgba(248, 113, 113, 0.1); border-radius: var(--radius-sm); }

.btn-primary {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { transform: scale(0.98); }

.demo-hint {
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 12px;
  background: rgba(108, 99, 255, 0.06);
  border-radius: var(--radius-sm);
}

/* ===== HEADER ===== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.user-greeting { font-size: 14px; font-weight: 500; }
.btn-text {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}
.btn-text:hover { color: var(--text); border-color: var(--text-muted); }

/* ===== CLICKER ===== */
.clicker-card { padding: 40px 32px; }

.badge-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  margin-bottom: 24px;
  background: var(--success-bg);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--success);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.2); } 50% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); } }
.badge-icon { font-size: 18px; }

.xp-display { margin-bottom: 16px; }
.xp-label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 2px; color: var(--text-muted); margin-bottom: 4px; }
.xp-value { font-size: 56px; font-weight: 800; color: var(--primary); line-height: 1; }
.xp-target { font-size: 20px; color: var(--text-muted); font-weight: 400; }

.progress-bar {
  position: relative;
  height: 12px;
  background: var(--bg);
  border-radius: 6px;
  margin-bottom: 28px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #a78bfa);
  border-radius: 6px;
  transition: width 0.4s ease;
  width: 0%;
}
.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
  text-shadow: 0 0 4px rgba(0,0,0,0.5);
  pointer-events: none;
}

.btn-click {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 4px 20px var(--primary-glow);
  user-select: none;
  -webkit-user-select: none;
}
.btn-click:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 6px 28px var(--primary-glow); }
.btn-click:active { transform: scale(0.96); box-shadow: 0 2px 12px var(--primary-glow); }
.btn-click.busy { opacity: 0.7; pointer-events: none; }
.click-icon { font-size: 24px; }

.click-hint { margin-top: 16px; font-size: 13px; color: var(--text-muted); line-height: 1.5; }

.btn-verified {
  margin-top: 20px;
  width: 100%;
  padding: 14px;
  background: var(--success);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-verified:hover { filter: brightness(1.1); }
.btn-verified:active { transform: scale(0.98); }

/* ===== VERIFIED VIEW ===== */
.verified-card { padding: 40px 32px; }
.verified-icon { font-size: 64px; margin-bottom: 12px; animation: bounce 1s infinite; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.verified-card h2 { font-size: 22px; margin-bottom: 8px; }
.verified-card > p { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; line-height: 1.5; }

.verified-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 28px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.stat { text-align: center; }
.stat-value { display: block; font-size: 24px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

.verified-content { text-align: left; }
.verified-content h3 { font-size: 16px; margin-bottom: 12px; }
.verified-content p { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; line-height: 1.5; }

.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.feature-item {
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
}

.verified-lore {
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 400px) {
  .card { padding: 20px; }
  .xp-value { font-size: 42px; }
  .feature-grid { grid-template-columns: 1fr; }
}
