@import url('https://fonts.googleapis.com/css2?family=Noto+Color+Emoji&display=swap');

/* =========================================================
   Browser Buddy — themes
   ========================================================= */
body.theme-dark { --bg: #1a2233; --surface: #252c44; --ink: #e8ecf7; --muted: #aab3cc; --line: #3a4468; --primary: #6b8aff; --primary-dark: #4a6ad4; --good: #2ecc71; --bad: #e74c3c; --shadow: 0 2px 10px rgba(0,0,0,.3); }
body.theme-retro { --bg: #c0c0c0; --surface: #fff; --ink: #000; --muted: #404040; --line: #808080; --primary: #000080; --primary-dark: #000040; --radius: 0px; --shadow: 2px 2px 0 #808080; }
body.theme-neon { --bg: #0a0a1a; --surface: #1a1a2e; --ink: #00ffcc; --muted: #00ccaa; --line: #00ffcc; --primary: #ff00ff; --primary-dark: #cc00cc; --good: #00ff00; --bad: #ff0040; --shadow: 0 0 10px rgba(0,255,204,.3); }
body.cursor-big { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cpolygon points='0,0 0,32 12,24 20,32 24,28 16,20 32,20' fill='black' stroke='white' stroke-width='1'/%3E%3C/svg%3E") 0 0, auto; }
body.cursor-star { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Ctext y='20' font-size='20'>⭐</text%3E%3C/svg%3E") 0 0, auto; }
body.cursor-heart { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Ctext y='20' font-size='20'>❤️</text%3E%3C/svg%3E") 0 0, auto; }

/* =========================================================
   Browser Buddy — micro-interactions & animations
   ========================================================= */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scale-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.module-card { animation: fade-in-up .4s ease both; }
.module-card:nth-child(2) { animation-delay: .05s; }
.module-card:nth-child(3) { animation-delay: .1s; }
.module-card:nth-child(4) { animation-delay: .15s; }
.module-card:nth-child(5) { animation-delay: .2s; }
.btn { transition: all .2s cubic-bezier(.4, 0, .2, 1); }
.btn:active { transform: scale(0.97); }
.id-tile, .mission-item, .scam-option { transition: transform .15s ease, box-shadow .15s ease; }
.id-tile:active, .mission-item:active { transform: scale(0.98); }

/* =========================================================
   Browser Buddy — shared styles (home page, header, toast, hints)
   ========================================================= */

* { box-sizing: border-box; }

:root {
  /* 60-30-10 color rule */
  --bg: #f0f2f5;        /* 60% - dominant background */
  --surface: #ffffff;    /* 30% - secondary surface/cards */
  --ink: #1a1a2e;        /* text */
  --muted: #6b7280;      /* muted text */
  --line: #e5e7eb;       /* borders */
  --primary: #3b5bfd;    /* 10% - accent (primary actions) */
  --primary-dark: #2a45c9;
  --accent: #ffb020;     /* accent highlight */
  --good: #178a4c;
  --bad: #c93a3a;
  --hint: #ff7a00;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(23, 32, 58, .06);
  --shadow-lg: 0 8px 28px rgba(23, 32, 58, .12);
}

html { font-size: 18px; }

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #eef2f9 0%, #e8ecf7 50%, #f0f4fb 100%);
  color: var(--ink);
  line-height: 1.5;
  font-variant-emoji: emoji;
  min-height: 100vh;
}

/* Animated background orbs */
body::before {
  content: "";
  position: fixed;
  top: -20%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(59, 91, 253, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: float 20s ease-in-out infinite;
}
body::after {
  content: "";
  position: fixed;
  bottom: -20%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(23, 138, 76, 0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: float 25s ease-in-out infinite reverse;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(30px, -30px); }
}
.module-icon, .brand-mark {
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Twemoji Mozilla", system-ui, sans-serif;
  font-variant-emoji: emoji;
}

h1, h2, h3 { line-height: 1.25; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }

[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 6px; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 20px rgba(23, 32, 58, .08);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(223, 229, 240, .5);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark { font-size: 1.5rem; }
.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.progress-chip {
  background: #e8edff;
  color: var(--primary-dark);
  border-radius: 99px;
  padding: 6px 14px;
  font-size: .85rem;
  font-weight: 700;
}
.settings-link {
  color: var(--muted);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 10px;
  transition: background .15s, color .15s;
}
.settings-link:hover { background: #eef2fb; color: var(--primary-dark); }

/* ---------- Zero-jargon toggle ---------- */
.jargon-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .9rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.jargon-toggle input {
  appearance: none;
  width: 44px;
  height: 26px;
  border-radius: 99px;
  background: #c9d2e4;
  position: relative;
  cursor: pointer;
  transition: background .2s;
  flex-shrink: 0;
  margin: 0;
}
.jargon-toggle input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: left .2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.jargon-toggle input:checked { background: var(--good); }
.jargon-toggle input:checked::after { left: 21px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s cubic-bezier(.4,0,.2,1);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.2), transparent);
  opacity: 0;
  transition: opacity .2s;
}
.btn:hover::after { opacity: 1; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; box-shadow: 0 4px 15px rgba(59,91,253,.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(59,91,253,.4); }
.btn-ghost { background: #e8edf7; border-color: #c9d2e4; color: var(--primary-dark); font-weight: 600; }
.btn-ghost:hover { background: #dce3f5; border-color: var(--primary); color: var(--primary-dark); transform: translateY(-1px); }
.btn-big { padding: 14px 24px; font-size: 1.05rem; }
.btn-disabled { opacity: .55; cursor: not-allowed; }
.btn-disabled:hover { border-color: var(--line); color: var(--ink); }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 44px 20px 28px; position: relative; }
.hero h1 { font-size: 2.6rem; margin: 0 0 10px; background: linear-gradient(135deg, var(--primary), #9b59b6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; font-weight: 800; }
.hero p { color: var(--muted); font-size: 1.1rem; margin: 0 auto; max-width: 620px; }

/* ---------- Module grid ---------- */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 20px;
  padding: 12px 24px 48px;
  max-width: 1180px;
  margin: 0 auto;
}
.module-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(23, 32, 58, .06);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid rgba(223, 229, 240, .6);
  transition: transform .25s cubic-bezier(.4,0,.2,1), box-shadow .25s, border-color .25s;
  position: relative;
  overflow: hidden;
}
.module-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), #9b59b6, var(--good));
  opacity: 0;
  transition: opacity .25s;
}
.module-card.available:hover {
  border-color: var(--primary);
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 12px 40px rgba(59, 91, 253, .15);
}
.module-card.available:hover::before { opacity: 1; }
.module-card .module-icon {
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.module-card.available:hover .module-icon { transform: scale(1.2) rotate(5deg); }
.module-card.coming-soon { opacity: .8; }
.module-icon { font-size: 2.2rem; line-height: 1; font-family: "EmojiFont", "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; }
.module-card h2 { margin: 0; font-size: 1.25rem; }
.module-card > p { margin: 0; color: var(--muted); font-size: .95rem; flex: 1; }
.badge-soon {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--line);
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.progress-track {
  height: 10px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--good);
  border-radius: 99px;
  transition: width .4s ease;
}
.progress-label { font-size: .85rem; color: var(--muted); font-weight: 600; }
.module-card .btn { align-self: flex-start; }

/* ---------- Coming soon page ---------- */
.soon-wrap {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.soon-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
  max-width: 520px;
  text-align: center;
}
.soon-card .module-icon { font-size: 3rem; }
.soon-card h1 { margin: 10px 0; }
.soon-card p { color: var(--muted); }
.soon-card .btn { margin-top: 10px; }

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
  padding: 24px 20px 40px;
}

/* ---------- Toast ---------- */
#toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(16px);
  background: #222a44;
  color: #fff;
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 10000;
  max-width: 90vw;
  text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.good { background: var(--good); }
#toast.warn { background: var(--bad); }
#toast.info { background: var(--primary); }

/* ---------- Hint ring ---------- */
#hint-ring {
  position: fixed;
  border: 4px solid var(--hint);
  border-radius: 16px;
  box-shadow: 0 0 0 4px rgba(255, 122, 0, .22), 0 0 28px rgba(255, 122, 0, .5);
  pointer-events: none;
  z-index: 9999;
  display: none;
  animation: hint-pulse 1.1s ease-in-out infinite;
}
#hint-ring .hint-label {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--hint);
  color: #fff;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: .85rem;
  font-weight: 700;
  max-width: 260px;
  text-align: center;
  box-shadow: var(--shadow);
}
@keyframes hint-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  html { font-size: 17px; }
  .hero h1 { font-size: 1.8rem; }
  .topbar { padding: 10px 16px; }
  .module-grid { padding: 12px 16px 40px; }
}
