/* Password Hero — ChildSafe Online */

:root {
  --bg: #0F1923;
  --bg-card: #172A3A;
  --bg-input: #1E3648;
  --text: #E8F1F8;
  --text-dim: #8BA4B8;
  --accent-cyan: #00E5FF;
  --accent-green: #39FF14;
  --accent-yellow: #FFD600;
  --accent-orange: #FF9100;
  --accent-red: #FF1744;
  --accent-purple: #D500F9;
  --glow-cyan: 0 0 20px rgba(0,229,255,0.3);
  --glow-green: 0 0 20px rgba(57,255,20,0.3);
  --glow-red: 0 0 20px rgba(255,23,68,0.3);
}

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

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

/* === ANIMATED BACKGROUND === */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,229,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}
.bg-orb:nth-child(1) { width:400px;height:400px;background:var(--accent-cyan);top:-100px;right:-100px;animation:orbFloat 20s ease-in-out infinite; }
.bg-orb:nth-child(2) { width:300px;height:300px;background:var(--accent-purple);bottom:-50px;left:-80px;animation:orbFloat 25s ease-in-out infinite reverse; }
.bg-orb:nth-child(3) { width:200px;height:200px;background:var(--accent-green);top:50%;left:50%;animation:orbFloat 18s ease-in-out infinite 5s; }

@keyframes orbFloat {
  0%,100% { transform:translate(0,0) scale(1); }
  33% { transform:translate(40px,-60px) scale(1.1); }
  66% { transform:translate(-30px,40px) scale(0.9); }
}

/* === LAYOUT === */
.container {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

/* === HEADER === */
.header {
  text-align: center;
  margin-bottom: 28px;
}
.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  background: rgba(0,229,255,0.1);
  border: 1px solid rgba(0,229,255,0.2);
  border-radius: 50px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}
.header h1 {
  font-family: 'Lilita One', cursive;
  font-size: 42px;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}
.header p {
  font-size: 15px;
  color: var(--text-dim);
  max-width: 420px;
  margin: 0 auto;
  line-height: 1.5;
}

/* === HERO LEVEL DISPLAY === */
.hero-display {
  text-align: center;
  margin-bottom: 24px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.hero-shield {
  width: 80px;
  height: 80px;
  position: relative;
  margin: 0 auto 8px;
  transition: all 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
.hero-shield svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(var(--glow-cyan));
  transition: filter 0.5s;
}
.hero-level {
  font-family: 'Lilita One', cursive;
  font-size: 20px;
  transition: color 0.3s;
  color: var(--accent-cyan);
}
.hero-subtitle {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* === INPUT SECTION === */
.input-section {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 20px;
}
.input-wrapper {
  position: relative;
  margin-bottom: 16px;
}
.input-wrapper input {
  width: 100%;
  padding: 14px 50px 14px 18px;
  background: var(--bg-input);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  font-family: 'Nunito', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  outline: none;
  letter-spacing: 1px;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.input-wrapper input:focus {
  border-color: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
}
.input-wrapper input::placeholder {
  font-weight: 400;
  letter-spacing: 0;
  color: #5A7A8F;
  font-size: 15px;
}
.toggle-vis {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 20px;
  padding: 4px;
  transition: color 0.2s;
}
.toggle-vis:hover { color: var(--accent-cyan); }

/* === STRENGTH BAR === */
.strength-bar-track {
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}
.strength-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  transition: width 0.4s cubic-bezier(0.34,1.56,0.64,1), background 0.3s;
  background: var(--accent-red);
}
.strength-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
}
.strength-text { transition: color 0.3s; }
.crack-time { color: var(--text-dim); font-weight: 600; }

/* === CHECKLIST === */
.checklist {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 18px;
}
.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  transition: all 0.3s;
}
.check-item.pass {
  background: rgba(57,255,20,0.06);
  color: var(--accent-green);
}
.check-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 10px;
  transition: all 0.3s;
}
.check-item.pass .check-icon {
  border-color: var(--accent-green);
  background: rgba(57,255,20,0.15);
}

/* === TIPS SECTION === */
.tips-section {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px 24px;
  border: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 20px;
}
.tips-title {
  font-family: 'Lilita One', cursive;
  font-size: 18px;
  color: var(--accent-cyan);
  margin-bottom: 12px;
}
.tip-card {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(0,229,255,0.04);
  border-radius: 10px;
  margin-bottom: 8px;
  border-left: 3px solid var(--accent-cyan);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-dim);
}
.tip-card:last-child { margin-bottom: 0; }
.tip-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }

/* === GENERATOR === */
.generator {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px 24px;
  border: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 20px;
}
.gen-title {
  font-family: 'Lilita One', cursive;
  font-size: 18px;
  color: var(--accent-purple);
  margin-bottom: 12px;
}
.gen-options {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.gen-opt {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1.5px solid rgba(213,0,249,0.2);
  background: rgba(213,0,249,0.05);
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-purple);
  cursor: pointer;
  transition: all 0.2s;
}
.gen-opt:hover, .gen-opt.active {
  background: rgba(213,0,249,0.15);
  border-color: var(--accent-purple);
}
.gen-output {
  display: flex;
  align-items: center;
  gap: 8px;
}
.gen-password {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-input);
  border-radius: 8px;
  font-family: 'Nunito', monospace;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-green);
  letter-spacing: 0.5px;
  word-break: break-all;
  min-height: 42px;
}
.gen-btn {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-generate {
  background: var(--accent-purple);
  color: white;
}
.btn-generate:hover { filter: brightness(1.2); transform: translateY(-1px); }
.btn-copy {
  background: rgba(255,255,255,0.08);
  color: var(--text);
}
.btn-copy:hover { background: rgba(255,255,255,0.15); }
.btn-copy.copied { background: rgba(57,255,20,0.15); color: var(--accent-green); }

/* === ACHIEVEMENTS === */
.achievements {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px 24px;
  border: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 20px;
}
.ach-title {
  font-family: 'Lilita One', cursive;
  font-size: 18px;
  color: var(--accent-yellow);
  margin-bottom: 12px;
}
.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.ach-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  background: rgba(255,255,255,0.02);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.04);
  text-align: center;
  opacity: 0.35;
  filter: grayscale(1);
  transition: all 0.4s;
}
.ach-badge.unlocked {
  opacity: 1;
  filter: grayscale(0);
  background: rgba(255,214,0,0.05);
  border-color: rgba(255,214,0,0.15);
  animation: badgeUnlock 0.6s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes badgeUnlock {
  0% { transform: scale(0.8) rotate(-5deg); }
  50% { transform: scale(1.15) rotate(2deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.ach-icon { font-size: 28px; margin-bottom: 4px; }
.ach-name { font-size: 11px; font-weight: 700; color: var(--text); }
.ach-desc { font-size: 10px; color: var(--text-dim); margin-top: 2px; }

/* === FOOTER === */
.footer {
  text-align: center;
  padding: 20px;
  font-size: 12px;
  color: var(--text-dim);
}
.footer a {
  color: var(--accent-cyan);
  text-decoration: none;
}
.footer a:hover { text-decoration: underline; }

/* === RESPONSIVE === */
@media (max-width: 500px) {
  .header h1 { font-size: 32px; }
  .checklist { grid-template-columns: 1fr; }
  .input-wrapper input { font-size: 16px; }
  .container { padding: 16px 12px 32px; }
  .ach-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}

/* === PARTICLE BURST ON LEVEL UP === */
.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
}
.particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: particleFly 1s ease-out forwards;
}
@keyframes particleFly {
  0% { transform: translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}