/* Google Fonts  */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Syne:wght@400;500;600;700;800&family=JetBrains+Mono:ital,wght@0,400;0,500;1,400&family=Playfair+Display:ital,wght@1,400;1,600&display=swap');

/* Design Tokens */
:root {
  --maxw: 1220px;

  /* Core neon palette */
  --neon-cyan:    #00e5ff;
  --neon-lime:    #b5ff3e;
  --neon-violet:  #c77dff;
  --neon-pink:    #ff5fa2;
  --neon-amber:   #ffd166;

  /* Light mode surfaces */
  --bg:           #f0f2f8;
  --surface:      #ffffff;
  --surface-2:    #f5f6fd;
  --surface-3:    #eaecf7;
  --surface-card: rgba(255,255,255,0.92);
  --glass:        rgba(255,255,255,0.68);

  /* Primary accent – electric cyan-teal */
  --ac:           #0066ff;
  --ac-2:         #00c6ff;
  --ac-glow:      rgba(0,102,255,0.16);
  --ac-ring:      rgba(0,102,255,0.26);
  --ac-soft:      rgba(0,102,255,0.07);

  /* Neon highlight used sparingly */
  --highlight:    #00e5ff;
  --hl-glow:      rgba(0,229,255,0.22);

  /* Text */
  --tx-1:         #0b0c14;
  --tx-2:         #3d3f5a;
  --tx-3:         #8a8cad;
  --tx-inv:       #ffffff;

  /* Borders */
  --bd:           rgba(0,102,255,0.12);
  --bd-soft:      rgba(0,102,255,0.07);
  --bd-mid:       rgba(0,102,255,0.20);
  --bd-px:        rgba(0,102,255,0.30);

  /* Shadows */
  --sh-xs:  0 1px 3px rgba(11,12,20,0.07), 0 1px 2px rgba(11,12,20,0.04);
  --sh-sm:  0 3px 12px rgba(11,12,20,0.08), 0 1px 4px rgba(11,12,20,0.05);
  --sh-md:  0 8px 32px rgba(11,12,20,0.10), 0 2px 8px rgba(11,12,20,0.06);
  --sh-lg:  0 20px 56px rgba(11,12,20,0.13), 0 6px 18px rgba(11,12,20,0.07);
  --sh-ac:  0 4px 24px rgba(0,102,255,0.28), 0 1px 6px rgba(0,102,255,0.16);
  --sh-neon:0 0 0 1px var(--highlight), 0 4px 28px rgba(0,229,255,0.30);
  --sh-in:  inset 0 1px 3px rgba(11,12,20,0.05);

  /* Radii */
  --r-xs:   4px;
  --r-sm:   8px;
  --r-md:   14px;
  --r-lg:   20px;
  --r-xl:   28px;
  --r-pill: 999px;

  /* Typography */
  --font-sans:    'Space Grotesk', system-ui, sans-serif;
  --font-display: 'Syne', system-ui, sans-serif;
  --font-serif:   'Playfair Display', Georgia, serif;
  --font-mono:    'JetBrains Mono', 'Cascadia Code', monospace;

  /* Easings */
  --ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out:     cubic-bezier(0.16, 1, 0.30, 1);
  --ease-smooth:  cubic-bezier(0.45, 0, 0.55, 1);

  /* Gradients */
  --grad-hero:    linear-gradient(135deg, #0b0c14 0%, #0e1128 50%, #111528 100%);
  --grad-ac:      linear-gradient(135deg, #0066ff 0%, #00c6ff 100%);
  --grad-neon:    linear-gradient(135deg, #00c6ff 0%, #b5ff3e 100%);
  --grad-card:    linear-gradient(160deg, rgba(0,229,255,0.04) 0%, transparent 60%);
  --grad-mesh:
    radial-gradient(ellipse at 15% 40%, rgba(0,102,255,0.06) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 15%, rgba(0,229,255,0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 55% 90%, rgba(181,255,62,0.03) 0%, transparent 45%);
}

/* Dark Mode */
.dark {
  --bg:           #06070f;
  --surface:      #0d0e1c;
  --surface-2:    #131426;
  --surface-3:    #1a1c32;
  --surface-card: rgba(13,14,28,0.92);
  --glass:        rgba(13,14,28,0.80);

  --tx-1:         #e8eaf8;
  --tx-2:         #9496c0;
  --tx-3:         #4e5080;

  --bd:           rgba(0,229,255,0.10);
  --bd-soft:      rgba(0,229,255,0.06);
  --bd-mid:       rgba(0,229,255,0.18);
  --bd-px:        rgba(0,229,255,0.28);

  --sh-xs:  0 1px 3px rgba(0,0,0,0.40);
  --sh-sm:  0 3px 12px rgba(0,0,0,0.50), 0 1px 4px rgba(0,0,0,0.30);
  --sh-md:  0 8px 32px rgba(0,0,0,0.60), 0 2px 8px rgba(0,0,0,0.36);
  --sh-lg:  0 20px 56px rgba(0,0,0,0.70), 0 6px 18px rgba(0,0,0,0.42);
  --sh-ac:  0 4px 24px rgba(0,229,255,0.36), 0 1px 6px rgba(0,229,255,0.20);
  --sh-neon:0 0 0 1px var(--highlight), 0 4px 32px rgba(0,229,255,0.40);

  --grad-mesh:
    radial-gradient(ellipse at 15% 40%, rgba(0,102,255,0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 15%, rgba(0,229,255,0.10) 0%, transparent 50%),
    radial-gradient(ellipse at 55% 90%, rgba(181,255,62,0.06) 0%, transparent 45%);
}

/* Global Reset  */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body { height: 100%; }
a { text-decoration: none; }

/* Theme Transition */
*, *::before, *::after {
  transition:
    background-color 0.24s ease,
    border-color 0.24s ease,
    color 0.16s ease,
    box-shadow 0.24s ease;
}

/* Never animate loaders */
.loader, .loader * { transition: none !important; }

/* Base Typography & Body */
body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--tx-1);
  background-color: var(--bg);
  background-image: var(--grad-mesh);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: 120px;
}

h1 {
  font-family: var(--font-serif);
  font-size: 2.1rem;
  font-weight: 600;
  font-style: italic;
  color: var(--tx-1);
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 0;
}

h2 {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--tx-3);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--tx-2);
}

/* Header */
header {
  background: var(--grad-hero);
  position: relative;
  z-index: 50;
  box-shadow: 0 1px 0 rgba(0,229,255,0.12), 0 6px 40px rgba(0,0,0,0.36);
}

/* Neon scan-line at bottom */
header::after {
  content: '';
  display: block;
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0,102,255,0.5) 20%,
    rgba(0,229,255,1) 50%,
    rgba(0,102,255,0.5) 80%,
    transparent 100%
  );
}

header .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  height: 62px;
}

header a {
  color: rgba(200,210,255,0.55);
  padding: 6px 13px;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  border-radius: var(--r-sm);
  transition: color 0.18s, background 0.18s;
  cursor: pointer;
}

header a:hover {
  color: var(--highlight);
  background: rgba(0,229,255,0.08);
}

/* Entry header — page title area */
.entry-header {
  width: 100%;
  text-align: center;
  padding: 12px 0 4px;
}

.entry-header p {
  color: var(--tx-2);
  font-size: 0.9rem;
}

.dark .entry-header p {
  color: var(--tx-2);
}

/* Theme Toggle  */
#themeToggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border-radius: var(--r-pill);
  border: 1.5px solid rgba(0,102,255,0.35);
  background: var(--bg);
  background-image: var(--grad-mesh);
  backdrop-filter: blur(10px);
  color: #1a1f3c;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.22s var(--ease-out);
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 2px 16px rgba(0,102,255,0.18), 0 1px 4px rgba(0,0,0,0.10);
}

#themeToggle:hover {
  background: #f0f8ff;
  border-color: var(--highlight);
  color: #0044cc;
  box-shadow: 0 0 20px rgba(0,229,255,0.32), 0 2px 12px rgba(0,102,255,0.22);
}

/* Dark mode — unchanged */
.dark #themeToggle {
  background: rgba(0,229,255,0.06);
  border-color: rgba(0,229,255,0.28);
  color: rgba(0,229,255,0.75);
  box-shadow: none;
}

.dark #themeToggle:hover {
  background: rgba(0,229,255,0.14);
  border-color: var(--highlight);
  color: var(--highlight);
  box-shadow: 0 0 18px rgba(0,229,255,0.26);
}

/* Light → show moon; Dark → show sun */
#themeToggle .icon-moon { display: inline; }
#themeToggle .icon-sun  { display: none; }
#themeToggle .label-dark  { display: inline; }
#themeToggle .label-light { display: none; }

.dark #themeToggle .icon-moon  { display: none; }
.dark #themeToggle .icon-sun   { display: inline; }
.dark #themeToggle .label-dark { display: none; }
.dark #themeToggle .label-light{ display: inline; }

.dark #themeToggle {
  border-color: rgba(0,229,255,0.28);
  color: rgba(0,229,255,0.75);
}

/* Container */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

/* Input Wrapper Card (Fix) */
.input-section-wrapper,
.search-wrapper,
.top-search-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  border: 1px solid var(--bd);
  box-shadow: var(--sh-sm);
  padding: 18px 20px 14px;
  margin-bottom: 4px;
}

.dark .input-section-wrapper,
.dark .search-wrapper,
.dark .top-search-card {
  background: var(--surface);
  border-color: var(--bd-mid);
  box-shadow: var(--sh-md);
}

/* Top Menu — Category Pills */
#topMenu {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 18px 0;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

#topMenu::-webkit-scrollbar { display: none; }

#topMenu a {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--tx-2);
  border: 1px solid var(--bd-mid);
  background: var(--surface);
  box-shadow: var(--sh-xs);
  transition: all 0.2s var(--ease-out);
  white-space: nowrap;
}

#topMenu a:hover {
  color: var(--ac);
  background: var(--ac-soft);
  border-color: var(--ac);
  transform: translateY(-1px);
  box-shadow: var(--sh-ac);
}

#topMenu a.active {
  color: #fff;
  background: var(--grad-ac);
  border-color: transparent;
  box-shadow: var(--sh-ac);
}

#topMenu h3 {
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--tx-3);
  text-transform: uppercase;
  letter-spacing: 0.20em;
  margin: 0 6px;
  white-space: nowrap;
  opacity: 0.55;
}

.dark #topMenu a {
  background: var(--surface);
  border-color: var(--bd-mid);
  color: var(--tx-2);
}

.dark #topMenu a:hover {
  color: var(--highlight);
  background: rgba(0,229,255,0.08);
  border-color: rgba(0,229,255,0.40);
}

.dark #topMenu a.active {
  color: var(--tx-1);
  background: var(--grad-neon);
  border-color: transparent;
  box-shadow: var(--sh-neon);
}

/* Input Section — Sticky Search Bar */
.input-section {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 14px 0 16px;
  gap: 10px;
  align-items: center;
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(1.8);
  -webkit-backdrop-filter: blur(22px) saturate(1.8);
  border-bottom: 1px solid var(--bd);
  margin-left: -28px;
  margin-right: -28px;
  padding-left: 28px;
  padding-right: 28px;
}

.input-section div {
  width: 100%;
  position: relative;
}

.input-section input {
  width: 100%;
  padding: 14px 52px 14px 22px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--bd-mid);
  background: var(--surface);
  font-family: var(--font-sans);
  font-size: 0.98rem;
  font-weight: 400;
  color: var(--tx-1);
  outline: none;
  box-shadow: var(--sh-sm), var(--sh-in);
  letter-spacing: 0.01em;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.input-section input::placeholder {
  color: var(--tx-3);
  font-weight: 400;
}

.input-section input:focus {
  border-color: var(--highlight);
  box-shadow:
    0 0 0 3px var(--hl-glow),
    0 0 16px rgba(0,229,255,0.18),
    var(--sh-sm);
  transform: translateY(-1px);
}

#input-count {
  position: absolute;
  right: 24px;
  bottom: 3px;
  font-size: 9px;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--tx-3);
  letter-spacing: 0.06em;
  opacity: 0.55;
}

.clear-overlay {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--tx-3);
  z-index: 10;
  transition: color 0.18s, background 0.18s;
}

.clear-overlay:hover {
  color: var(--highlight);
  background: var(--hl-glow);
}

.dark .input-section {
  background: rgba(6,7,15,0.82);
  border-color: var(--bd);
}

.dark .input-section input {
  background: var(--surface);
  color: var(--tx-1);
  border-color: var(--bd-mid);
}

.dark .input-section input:focus {
  border-color: var(--highlight);
  box-shadow:
    0 0 0 3px rgba(0,229,255,0.18),
    0 0 24px rgba(0,229,255,0.22),
    var(--sh-sm);
}

/* Buttons */
button,
#othertools a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  background: transparent;
  font-size: 16px;
  line-height: 1;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  font-family: var(--font-sans);
}

button:hover { opacity: 0.90; }

/* Primary button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 26px;
  border-radius: var(--r-pill);
  border: 1.5px solid transparent;
  font-family: var(--font-display);
  font-size: 0.70rem;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  cursor: pointer;
  background: var(--grad-ac);
  color: #fff;
  box-shadow: var(--sh-ac);
  white-space: nowrap;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s, opacity 0.18s;
}

.btn:hover {
  transform: translateY(-2px) scale(1.018);
  box-shadow:
    0 8px 32px rgba(0,102,255,0.38),
    0 0 0 1px rgba(0,229,255,0.40),
    0 4px 12px rgba(0,102,255,0.22);
  opacity: 1;
}

.btn:active { transform: scale(0.97); }

/* Secondary button */
.btn.secondary {
  background: var(--surface);
  color: var(--tx-2);
  border-color: var(--bd-mid);
  box-shadow: var(--sh-xs);
}

.btn.secondary:hover {
  border-color: var(--highlight);
  color: var(--ac);
  background: var(--ac-soft);
  box-shadow: 0 4px 18px var(--hl-glow);
}

/* Close/danger button */
button.btn.closeit {
  background: #0d0024;
  color: #ff5fa2;
  border-color: rgba(255,95,162,0.25);
}

/* Menu toggle */
button#menu {
  font-size: 1.15rem;
  height: 42px;
  width: 42px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--bd-mid);
  background: var(--surface);
  box-shadow: var(--sh-xs);
  color: var(--tx-2);
  transition: all 0.2s var(--ease-out);
}

button#menu:hover {
  border-color: var(--highlight);
  background: rgba(0,229,255,0.06);
  color: var(--highlight);
  box-shadow: 0 0 14px var(--hl-glow);
}

.dark .btn { background: var(--grad-ac); color: #fff; }
.dark .btn:hover {
  box-shadow:
    0 8px 36px rgba(0,229,255,0.36),
    0 0 0 1px var(--highlight);
}

.dark .btn.secondary {
  background: var(--surface);
  color: var(--tx-2);
  border-color: var(--bd-mid);
}

.dark .btn.secondary:hover {
  background: rgba(0,229,255,0.08);
  color: var(--highlight);
  border-color: rgba(0,229,255,0.40);
}

.dark button#menu {
  background: var(--surface);
  border-color: var(--bd-mid);
  color: var(--tx-2);
}

.dark button#menu:hover {
  background: rgba(0,229,255,0.08);
  border-color: rgba(0,229,255,0.40);
  color: var(--highlight);
}

/* Other Tools Links */
#othertools a {
  padding: 8px 16px;
  background: var(--surface);
  color: var(--tx-2);
  border-radius: var(--r-sm);
  font-family: var(--font-display);
  font-size: 0.70rem;
  font-weight: 700;
  border: 1px solid var(--bd-soft);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  transition: all 0.2s var(--ease-out);
  box-shadow: var(--sh-xs);
}

#othertools a:hover {
  background: var(--grad-ac);
  color: #fff;
  border-color: transparent;
  transform: translateY(-1px);
  box-shadow: var(--sh-ac);
}

.dark #othertools a {
  background: var(--surface);
  color: var(--tx-2);
  border-color: var(--bd-soft);
}

.dark #othertools a:hover {
  background: var(--grad-neon);
  color: var(--tx-1);
  border-color: transparent;
  box-shadow: var(--sh-neon);
}

/* SVG Icons */
svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
}

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Random Cloud  */
#randomcloud {
  text-align: center;
  width: 100%;
  overflow: auto;
  scrollbar-width: none;
}

#randomcloud::-webkit-scrollbar { display: none; }

#randomcloud li {
  background: transparent;
  border: none;
  box-shadow: none;
}

#randomcloud p {
  color: var(--tx-2);
  background: transparent;
  text-align: center;
  border: none;
  font-size: 26px !important;
  padding: 10px 0 0;
  margin: 0;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: color 0.18s, transform 0.22s var(--ease-spring), text-shadow 0.22s;
}

#randomcloud p:hover {
  color: var(--highlight);
  transform: scale(1.14);
  text-shadow: 0 0 20px rgba(0,229,255,0.50);
}

.dark #randomcloud p { color: var(--tx-2); }
.dark #randomcloud p:hover {
  color: var(--highlight);
  text-shadow: 0 0 28px rgba(0,229,255,0.65);
}

/* Random button */
#randombutton {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--r-pill);
  padding: 13px 30px;
  margin-top: 14px;
  background: var(--grad-neon);
  color: #0b0c14;
  font-family: var(--font-serif);
  font-weight: 600;
  font-style: italic;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(0,229,255,0.32);
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s;
}

#randombutton:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 40px rgba(0,229,255,0.44);
}

/* Font Size Controller */
.font-size-controller {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: flex-end;
  padding: 10px 0;
}

.font-size-controller label {
  font-size: 0.62rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--tx-3);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.font-size-controller input[type="range"] {
  width: 200px;
  height: 4px;
  background: linear-gradient(to right, var(--highlight), var(--ac));
  border-radius: var(--r-pill);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  border: none;
}

.font-size-controller input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--surface);
  border: 2.5px solid var(--highlight);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(0,229,255,0.40);
  cursor: grab;
  transition: transform 0.15s var(--ease-spring), box-shadow 0.15s;
}

.font-size-controller input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.32);
  box-shadow: 0 0 20px rgba(0,229,255,0.60);
}

/* Results Grid — Font Cards */
#results { width: 100%; }

.grid ul {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 10px;
  grid-template-columns: repeat(3, 1fr);
  list-style: none;
}

/* Font card */
.nombresdefreefirelist li {
  display: flex;
  align-items: stretch;
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--bd);
  background: var(--surface-card);
  box-shadow: var(--sh-xs);
  transition:
    transform 0.22s var(--ease-spring),
    box-shadow 0.22s,
    border-color 0.18s;
}

/* Subtle neon top-line accent */
.nombresdefreefirelist li::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1.5px;
  background: var(--grad-neon);
  opacity: 0;
  transition: opacity 0.22s;
}

.nombresdefreefirelist li:hover::before { opacity: 1; }

.nombresdefreefirelist li:hover {
  border-color: rgba(0,229,255,0.40);
  transform: translateY(-4px);
  box-shadow:
    var(--sh-md),
    0 0 0 1px rgba(0,229,255,0.28),
    0 6px 28px rgba(0,229,255,0.12);
}

.nombresdefreefirelist li p {
  background: transparent;
  padding: 16px 0 28px 16px;
  margin: 0;
  color: var(--tx-1);
  cursor: pointer;
  user-select: none;
  text-align: left;
  width: 100%;
  position: relative;
  white-space: normal;
  word-break: break-word;
  font-family: var(--font-sans);
  overflow: hidden;
  border: none;
  line-height: 1.55;
  transition: background 0.18s;
}

.nombresdefreefirelist li p:hover,
.nombresdefreefirelist li p:focus {
  outline: none;
  background: var(--surface-2);
}

/* Card label */
.nombresdefreefirelist li i,
#flourishList li i {
  position: absolute;
  bottom: 5px;
  left: 16px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  color: var(--tx-3);
  z-index: 2;
  display: flex;
  align-items: baseline;
  gap: 4px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-style: normal;
  opacity: 0.60;
}

/* Copy button inside card */
.nombresdefreefirelist li button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  padding: 8px 14px 8px 10px;
  gap: 4px;
  color: var(--tx-3);
  background: var(--surface-2);
  border: none;
  border-left: 1px solid var(--bd);
  cursor: pointer;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  transition: background 0.18s, color 0.18s;
}

.nombresdefreefirelist li button:hover {
  background: var(--grad-ac);
  color: #fff;
}

/* Dark card overrides */
.dark .nombresdefreefirelist li {
  background: var(--surface-card);
  border-color: var(--bd);
}

.dark .nombresdefreefirelist li:hover {
  border-color: rgba(0,229,255,0.40);
  box-shadow:
    var(--sh-md),
    0 0 0 1px rgba(0,229,255,0.30),
    0 0 32px rgba(0,229,255,0.12);
}

.dark .nombresdefreefirelist li p {
  background: var(--surface-card);
  color: var(--tx-1);
}

.dark .nombresdefreefirelist li p:hover,
.dark .nombresdefreefirelist li p:focus {
  background: var(--surface-2);
}

.dark .nombresdefreefirelist li button {
  background: var(--surface-2);
  color: var(--tx-3);
  border-color: var(--bd-soft);
}

.dark .nombresdefreefirelist li button:hover {
  background: var(--grad-neon);
  color: #0b0c14;
}

/* Section group */
.nombresdefreefirelist {
  margin-bottom: 36px;
}

.nombresdefreefirelist h2 {
  color: var(--tx-3);
  margin-bottom: 12px;
  font-size: 0.66rem;
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: 0.14em;
}

.nombresdefreefirelist h2::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--bd-mid), transparent);
}

/* Floating Action Buttons */
.buttons {
  position: fixed;
  right: 18px;
  bottom: 90px;
  z-index: 99;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
}

.buttons button {
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--bd-mid);
  box-shadow: var(--sh-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--tx-2);
  transition: all 0.2s var(--ease-spring);
}

.buttons button:hover {
  background: var(--grad-ac);
  color: #fff;
  border-color: transparent;
  transform: scale(1.12) translateY(-2px);
  box-shadow: var(--sh-ac);
}

#bulbBtn svg { stroke: var(--ac); }
#bulbBtn:hover svg { stroke: #fff; }

.dark .buttons button {
  background: var(--surface-2);
  color: var(--tx-2);
  border-color: rgba(0,229,255,0.22);
}

.dark .buttons button:hover {
  background: var(--grad-neon);
  color: #0b0c14;
  border-color: transparent;
  box-shadow: var(--sh-neon);
}

/* Side Drawer  */
.f-m {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--bd-mid);
  box-shadow: -20px 0 72px rgba(0,0,0,0.14);
  z-index: 9999;
  display: none;
  overflow-y: auto;
  padding: 24px 20px;
}

.floatmenu h3 {
  font-family: var(--font-display);
  color: var(--tx-3);
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.20em;
  font-weight: 700;
  margin-bottom: 8px;
}

.floatmenu a,
.right-menu a {
  display: inline-block;
  padding: 7px 14px;
  border-radius: var(--r-sm);
  font-family: var(--font-sans);
  font-size: 0.80rem;
  font-weight: 500;
  color: var(--tx-2);
  background: var(--surface-2);
  border: 1px solid var(--bd-soft);
  margin: 3px;
  white-space: nowrap;
  transition: all 0.18s var(--ease-out);
}

.floatmenu a:hover,
.right-menu a:hover {
  color: var(--highlight);
  background: rgba(0,229,255,0.06);
  border-color: rgba(0,229,255,0.35);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--hl-glow);
}

.dark .f-m {
  background: var(--surface);
  border-color: var(--bd-mid);
  box-shadow: -20px 0 72px rgba(0,0,0,0.50);
}

.dark .floatmenu a,
.dark .right-menu a {
  background: var(--surface-2);
  color: var(--tx-2);
  border-color: var(--bd-soft);
}

.dark .floatmenu a:hover,
.dark .right-menu a:hover {
  background: rgba(0,229,255,0.08);
  color: var(--highlight);
  border-color: rgba(0,229,255,0.35);
}

#fMN { overflow: auto; }
.fAr { display: none; }
#menu { color: var(--tx-2); }

/* Close Button (drawer) */
.close-button {
  position: fixed;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 16px;
  border: 1px solid var(--bd-mid);
  border-radius: var(--r-md);
  color: var(--tx-2);
  background: var(--surface);
  box-shadow: var(--sh-sm);
  cursor: pointer;
  z-index: 10000;
  padding: 0;
  transition: all 0.18s var(--ease-out);
}

.close-button:hover {
  border-color: var(--highlight);
  background: rgba(0,229,255,0.06);
  color: var(--highlight);
  box-shadow: 0 0 16px var(--hl-glow);
}

.dark .close-button {
  background: var(--surface);
  border-color: var(--bd-mid);
  color: var(--tx-2);
}

.dark .close-button:hover {
  background: rgba(0,229,255,0.08);
  color: var(--highlight);
  border-color: rgba(0,229,255,0.40);
}

/* Copied Toast  */
.copied {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  position: fixed;
  top: 12%;
  right: 0;
  z-index: 9999;
  width: 218px;
  background: #06070f;
  color: #7de8ff;
  border-radius: var(--r-lg) 0 0 var(--r-lg);
  border: 1px solid rgba(0,229,255,0.28);
  border-right: none;
  box-shadow:
    -8px 8px 40px rgba(0,0,0,0.40),
    0 0 28px rgba(0,229,255,0.12);
  animation: slideIn 0.26s var(--ease-spring);
}

@keyframes slideIn {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

.copied textarea {
  background: transparent;
  border: none;
  color: rgba(125,232,255,0.72);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  resize: none;
  outline: none;
  padding: 6px;
}

.copied-btn {
  position: absolute;
  top: 8px;
  left: 10px;
  background: var(--grad-neon);
  color: #0b0c14;
  border-radius: var(--r-pill);
  padding: 3px 10px;
  font-family: var(--font-display);
  font-size: 0.64rem;
  font-weight: 700;
  border: none;
  cursor: default;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  box-shadow: 0 0 12px rgba(0,229,255,0.40);
}

/* Loader */
.loader {
  width: 36px;
  height: 36px;
  border: 2px solid var(--surface-3);
  border-top-color: var(--highlight);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  box-shadow: 0 0 14px rgba(0,229,255,0.30);
}

@keyframes spin { to { transform: rotate(360deg); } }

.page-load-status,
.aryapage {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 24px 0;
}

.loadmore {
  text-align: center;
  padding: 16px 0;
}

/* Popup Modal  */
.flourish-popup {
  position: fixed;
  inset: 0;
  background: rgba(6,7,15,0.60);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.flourish-popup.hidden { display: none; }

.popup-box {
  background: var(--surface);
  width: 92%;
  max-width: 460px;
  max-height: 72vh;
  border-radius: var(--r-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow:
    var(--sh-xl),
    0 0 0 1px var(--bd-mid),
    0 0 60px rgba(0,229,255,0.10);
  animation: popIn 0.28s var(--ease-spring);
}

/* Neon gradient top bar */
.popup-box::before {
  content: '';
  display: block;
  height: 2.5px;
  background: var(--grad-neon);
  flex-shrink: 0;
  box-shadow: 0 0 14px rgba(0,229,255,0.50);
}

@keyframes popIn {
  from { transform: scale(0.92) translateY(16px); opacity: 0; }
  to   { transform: scale(1) translateY(0);       opacity: 1; }
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-2);
  border-bottom: 1px solid var(--bd);
  padding: 4px 16px;
}

.popup-header h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  font-style: italic;
  color: var(--tx-1);
  padding: 12px 0;
  margin: 0;
}

.popup-header button {
  background: none;
  border: none;
  color: var(--tx-3);
  cursor: pointer;
  font-size: 16px;
  padding: 14px;
  border-radius: var(--r-sm);
  transition: background 0.18s, color 0.18s;
}

.popup-header button:hover {
  background: rgba(0,229,255,0.08);
  color: var(--highlight);
}

.dark .popup-box {
  background: var(--surface);
  box-shadow:
    var(--sh-lg),
    0 0 0 1px var(--bd-mid),
    0 0 80px rgba(0,229,255,0.14);
}

.dark .popup-header {
  background: var(--surface-2);
  border-color: var(--bd);
}

.dark .popup-header h3 { color: var(--tx-1); }

.dark .popup-header button:hover {
  background: rgba(0,229,255,0.10);
  color: var(--highlight);
}

/* Flourish List (inside popup) */
#flourishList {
  padding: 14px;
  overflow-y: auto;
  list-style: none;
  flex: 1;
}

#flourishList li {
  margin-bottom: 8px;
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--bd-soft);
  background: var(--surface-2);
  transition:
    transform 0.18s var(--ease-spring),
    border-color 0.18s,
    box-shadow 0.18s;
}

#flourishList li:hover {
  border-color: rgba(0,229,255,0.40);
  transform: translateY(-2px);
  box-shadow: 0 6px 22px var(--hl-glow);
}

#flourishList .count {
  display: flex;
  justify-content: flex-end;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--tx-3);
  padding: 2px 8px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

#flourishList li p {
  font-size: 1rem !important;
  color: var(--tx-1);
  border-radius: 0;
  border: none;
  background: transparent;
  text-align: center;
  padding: 12px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: color 0.15s;
}

#flourishList li:hover p { color: var(--highlight); }

.dark #flourishList li {
  background: var(--surface-2);
  border-color: var(--bd-soft);
}

.dark #flourishList li:hover {
  border-color: rgba(0,229,255,0.40);
  box-shadow: 0 6px 22px rgba(0,229,255,0.18);
}

.dark #flourishList li p { color: var(--tx-1); }
.dark #flourishList li:hover p { color: var(--highlight); }

/* Flourish Footer (popup) */
.flourishit {
  padding: 14px 18px;
  text-align: center;
  border-top: 1px solid var(--bd);
  background: var(--surface-2);
}

.dark .flourishit {
  background: var(--surface-2);
  border-color: var(--bd);
}

.select-flourish {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.select-flourish label {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--tx-2);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

#flourishSelect {
  appearance: none;
  padding: 9px 28px 9px 14px;
  font-size: 0.84rem;
  font-family: var(--font-sans);
  font-weight: 500;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--bd-mid);
  background: var(--surface);
  color: var(--tx-1);
  cursor: pointer;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

#flourishSelect:focus {
  border-color: var(--highlight);
  box-shadow: 0 0 0 3px var(--hl-glow);
}

.dark #flourishSelect {
  background: var(--surface);
  color: var(--tx-1);
  border-color: var(--bd-mid);
}

#flourishRegenerate {
  padding: 11px 28px;
  border-radius: var(--r-pill);
  background: var(--grad-neon);
  color: #0b0c14;
  font-family: var(--font-serif);
  font-weight: 600;
  font-style: italic;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(0,229,255,0.28);
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s;
}

#flourishRegenerate:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 36px rgba(0,229,255,0.42);
}

#flourishRegenerate:active { transform: scale(0.97); }

/* Ads Placeholder */
.ads {
  grid-column: 1 / -1;
  display: block;
  width: 100%;
  margin: 14px 0;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1.5px dashed var(--bd-mid);
  overflow: hidden;
}

.dark .ads {
  background: var(--surface-2);
  border-color: var(--bd-mid);
}

/* Footer */
footer {
  margin-top: 72px;
  background: var(--grad-hero);
  padding: 32px 0;
  position: relative;
}

/* Neon top line */
footer::before {
  content: '';
  display: block;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0,102,255,0.45) 20%,
    rgba(0,229,255,0.90) 50%,
    rgba(0,102,255,0.45) 80%,
    transparent 100%
  );
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

footer .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

footer a {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.05rem;
  color: rgba(0,229,255,0.75);
  transition: color 0.18s, text-shadow 0.18s;
}

footer a:hover {
  color: var(--highlight);
  text-shadow: 0 0 18px rgba(0,229,255,0.55);
}

footer p,
footer span {
  color: rgba(200,210,255,0.35);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

/* Info / Article Block */
.info-text {
  font-family: var(--font-sans);
  line-height: 1.82;
  color: var(--tx-2);
  padding: 56px 52px;
  background: var(--surface);
  margin-top: 36px;
  border-radius: var(--r-xl);
  border: 1px solid var(--bd-soft);
  box-shadow: var(--sh-sm);
  white-space: normal;
  word-break: break-word;
  position: relative;
  overflow: hidden;
}

/* Subtle neon glow corner */
.info-text::after {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  background: radial-gradient(ellipse, rgba(0,229,255,0.07) 0%, transparent 70%);
  pointer-events: none;
}

.info-text h1 {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-style: italic;
  font-weight: 600;
  color: var(--tx-1);
  text-align: center;
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--bd);
  letter-spacing: -0.01em;
  background: none;
  -webkit-text-fill-color: var(--tx-1);
  line-height: 1.18;
}

.info-text h2 {
  font-family: var(--font-display);
  font-size: 1.30rem;
  font-weight: 700;
  color: var(--tx-1);
  margin-top: 48px;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
  text-transform: none;
  font-style: normal;
  position: relative;
  padding-left: 18px;
}

/* Neon left bar on headings */
.info-text h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: var(--grad-neon);
  border-radius: 3px;
  box-shadow: 0 0 8px rgba(0,229,255,0.50);
}

.info-text h3 {
  font-family: var(--font-sans);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--tx-1);
  margin-top: 28px;
  margin-bottom: 8px;
  font-style: normal;
}

.info-text p {
  font-size: 1rem;
  margin-bottom: 18px;
  text-align: justify;
  color: var(--tx-2);
}

.info-text ul,
.info-text ol {
  margin-bottom: 24px;
  padding-left: 22px;
}

.info-text li {
  font-size: 1rem;
  margin-bottom: 8px;
}

.info-text strong {
  color: var(--tx-1);
  font-weight: 600;
}

.info-text code {
  background: var(--surface-2);
  color: var(--highlight);
  padding: 2px 8px;
  border-radius: var(--r-xs);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  word-break: break-all;
  display: inline-block;
  margin: 1px;
  border: 1px solid var(--bd-soft);
}

.info-text img {
  max-width: 100%;
  border-radius: var(--r-md);
}

.info-text ul { overflow: auto; }

.info-text .example-box {
  background: var(--surface-2);
  border-left: 3px solid var(--highlight);
  border-radius: var(--r-md);
  padding: 20px 24px;
  margin: 24px 0;
  box-shadow: 0 2px 14px rgba(0,229,255,0.06);
}

.info-text .example-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.70rem;
  color: var(--highlight);
  margin-top: 14px;
  margin-bottom: 8px;
  letter-spacing: 0.12em;
  font-style: normal;
  text-transform: uppercase;
}

.info-text .example-title:first-child { margin-top: 0; }

.info-text .example-box ol {
  list-style-type: decimal;
  margin-bottom: 12px;
}

.info-text .example-box li {
  font-size: 1.04rem;
  letter-spacing: 0.02em;
  color: var(--tx-1);
  background: var(--surface);
  padding: 9px 14px;
  margin-bottom: 5px;
  border-radius: var(--r-sm);
  border: 1px solid var(--bd-soft);
}

.copyright-area { color: #fff; }

/* Dark info-text overrides */
.dark .info-text {
  background: var(--surface);
  border-color: var(--bd-soft);
}

.dark .info-text h1 {
  color: var(--tx-1);
  -webkit-text-fill-color: var(--tx-1);
  border-color: var(--bd);
}

.dark .info-text h2 { color: var(--tx-1); }
.dark .info-text h3 { color: var(--tx-2); }
.dark .info-text p  { color: var(--tx-2); }
.dark .info-text strong { color: var(--tx-1); }

.dark .info-text code {
  background: var(--surface-3);
  color: var(--highlight);
  border-color: var(--bd-soft);
}

.dark .info-text .example-box { background: var(--surface-2); }

.dark .info-text .example-box li {
  background: var(--surface-3);
  border-color: var(--bd-soft);
  color: var(--tx-1);
}

/* Dark header override */
.dark header {
  background: linear-gradient(135deg, #020308 0%, #06070f 55%, #0a0b18 100%);
}

/* Responsive — Tablet */
@media (max-width: 940px) {
  .grid ul { grid-template-columns: repeat(2, 1fr); }
}

/* Responsive — Mobile */
@media (max-width: 640px) {
  h1 { font-size: 1.6rem; }

  .container {
    padding: 0 16px;
    max-width: 100%;
  }

  .input-section {
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .f-m { width: 100%; }

  .font-size-controller input[type="range"] { width: 130px; }

  .grid ul { grid-template-columns: 1fr; }

  .info-text {
    padding: 28px 20px;
    border-radius: var(--r-lg);
  }

  .info-text h1 { font-size: 1.75rem; }
  .info-text h2 { font-size: 1.15rem; }

  .floatmenu a { display: block; }
}

/* Accessibility — Reduce Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}