
:root{
  --bg:#F4F8FF;
  --panel:#FFFFFF;
  --panel2:#F0F5FF;
  --text:#0B1020;
  --muted:#4A587A;
  --accent:#5B8CFF;
  --accent2:#7ED7C1;
  /* Gender accent (set by body.gender-*) */
  --gender:#5B8CFF;
  --gender-rgb: 91,140,255;
  --border:rgba(12,20,44,.12);
  --shadow:0 18px 50px rgba(12,20,44,.12);
  --radius:18px;
}

body.gender-girl{ --gender:#FF6FB1; --gender-rgb: 255,111,177; }
body.gender-boy{ --gender:#5B8CFF; --gender-rgb: 91,140,255; }
body.gender-any{ --gender:#5B8CFF; --gender-rgb: 91,140,255; }
body.dark{
  --bg:#0b1020;
  --panel:#111a33;
  --panel2:#0f1730;
  --text:#eaf0ff;
  --muted:#a9b5d6;
  --accent:#5B8CFF;
  --accent2:#7ED7C1;
  --border:rgba(255,255,255,.10);
  --shadow:0 18px 50px rgba(0,0,0,.45);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: radial-gradient(1200px 700px at 20% 10%, rgba(var(--gender-rgb),.22), transparent 55%),
              radial-gradient(900px 600px at 80% 20%, rgba(126,215,193,.18), transparent 55%),
              radial-gradient(900px 600px at 50% 90%, rgba(var(--gender-rgb),.10), transparent 55%),
              var(--bg);
  color:var(--text);
}
a{color:inherit;text-decoration:none}
a:hover{opacity:.9}

.topbar{
  position:sticky; top:0; z-index:50;
  backdrop-filter: blur(14px);
  background: rgba(255,255,255,.75);
  border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 18px;
}
body.dark .topbar{
  background: linear-gradient(to bottom, rgba(11,16,32,.85), rgba(11,16,32,.55));
}
.brand{display:flex; gap:12px; align-items:center}
.logo{width:44px;height:44px;border-radius:12px;border:1px solid var(--border); background:rgba(255,255,255,.06)}
.brand-name{font-weight:800; letter-spacing:.2px}
.brand-sub{font-size:12px;color:var(--muted);margin-top:2px}

.toplinks{display:flex; gap:16px; font-size:16px; font-weight:600; color:var(--muted)}
.toplinks a{padding:8px 10px;border-radius:12px}
.toplinks a:hover{background:rgba(255,255,255,.06); color:var(--text)}

.wrap{max-width:1100px;margin:0 auto;padding:22px 18px 40px}

.hero{
  display:grid;
  grid-template-columns: 1.1fr .9fr;
  gap:18px;
  align-items:start;
}
.hero-left, .hero-right{
  /* Light mode: clean bright cards */
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(240,245,255,.92));
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow: var(--shadow);
}
body.dark .hero-left,
body.dark .hero-right{
  background: linear-gradient(180deg, rgba(17,26,51,.82), rgba(15,23,48,.78));
}
.hero-left{padding:22px}
.hero-right{
  padding:12px;
  display:flex;
  align-items:flex-start;
  justify-content:flex-end;
  justify-self:end;
  width:fit-content;
  max-width:420px;
}

h1{margin:0 0 10px; font-size:40px; line-height:1.1}
.accent{color:var(--gender)}
.lead{margin:0 0 14px; color:var(--muted); font-size:16px}

.controls{display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin:12px 0 16px}
.segmented{
  display:flex; background:rgba(255,255,255,.06); border:1px solid var(--border);
  border-radius:16px; padding:4px;
}
.segbtn{
  border:0; background:transparent; color:var(--muted);
  padding:10px 12px; border-radius:12px; cursor:pointer; font-weight:700;
}
.segbtn.active{background:rgba(var(--gender-rgb),.18); color:var(--text); border:1px solid rgba(var(--gender-rgb),.32)}
.checkbox{display:flex; align-items:center; gap:10px; color:var(--muted); user-select:none}
.checkbox input{transform: scale(1.1)}

.namecard{
  background: rgba(255,255,255,.70);
  border:1px solid var(--border);
  border-radius: 18px;
  padding:14px;
}
body.dark .namecard{ background: rgba(255,255,255,.05); }

.preview{padding:6px 8px 12px;
}
.preview-line{
  font-size:28px;
  font-weight:900;
  letter-spacing:.2px;
  padding:10px 12px;
  border-radius:16px;
  background:rgba(255,255,255,.78);
  border:1px solid rgba(12,20,44,.10);
}
body.dark .preview-line{
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
}
.preview-chips{display:flex; gap:10px; flex-wrap:wrap; margin-top:10px}
.chip{
  padding:10px 12px;
  border-radius:999px;
  background:rgba(var(--gender-rgb),.14);
  border:1px solid rgba(var(--gender-rgb),.22);
  font-weight:850;
}
body.dark .chip{ background:rgba(0,0,0,.18); border:1px solid rgba(255,255,255,.12); }
.row{display:grid; grid-template-columns: 1fr auto; gap:12px; align-items:center; padding:10px 8px}
.row + .row{border-top:1px solid rgba(255,255,255,.08)}
.row-last{grid-template-columns: 1fr auto; padding-bottom:14px}
.label{font-size:12px;color:var(--muted); margin-bottom:6px}
.value{font-size:26px; font-weight:850; letter-spacing:.2px}

.nameinput{
  font-size:22px;
  font-weight:900;
  letter-spacing:.2px;
  padding:12px 12px;
}
.lockcol{display:flex; align-items:center; justify-content:flex-end}
.lock{
  width:46px;height:42px;border-radius:14px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  cursor:pointer; font-size:18px;
}
.lock[aria-pressed="true"]{background:rgba(126,215,193,.18); border-color:rgba(126,215,193,.35)}

.text{
  width:100%;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.86);
  color:var(--text);
  padding:12px 12px;
  outline:none;
}
body.dark .text{ background:rgba(0,0,0,.22); }
.text:focus{border-color:rgba(91,140,255,.45); box-shadow:0 0 0 3px rgba(91,140,255,.18)}

.actions{display:flex; gap:10px; padding:10px 6px 6px}
.btn{
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  color:var(--text);
  padding:12px 14px;
  border-radius:16px;
  cursor:pointer;
  font-weight:800;
}
.btn:hover{transform: translateY(-1px)}
.btn:active{transform: translateY(0px)}
.btn.primary{background:rgba(var(--gender-rgb),.22); border-color:rgba(var(--gender-rgb),.40)}
.btn.ghost{background:transparent}
.btn.mini{padding:10px 12px;border-radius:14px}
.botwrap{position:relative; display:inline-block; width:fit-content; max-width:360px; padding:8px}
.bot{
  width:320px;
  max-width:100%;
  height:auto;
  object-fit:contain;
  filter: drop-shadow(0 20px 50px rgba(0,0,0,.55));
}
.bubble{
  position:absolute;
  left:10px;
  top:10px;
  right:auto;
  width:fit-content;
  max-width:260px;
}
.bubble-inner{
  max-width: 260px;
  background: rgba(255,255,255,.94);
  border:1px solid rgba(11,16,32,.12);
  border-radius:18px;
  padding:12px 12px;
  box-shadow:0 14px 40px rgba(0,0,0,.35);
}
#bubbleText{color:#0b1020; font-weight:700; line-height:1.35}
.typing{display:none; gap:6px; margin-bottom:8px}
.typing span{
  width:8px;height:8px;border-radius:999px;
  background: rgba(11,16,32,.28);
  display:inline-block;
  animation: bounce 1.1s infinite;
}
.typing span:nth-child(2){animation-delay:.15s}
.typing span:nth-child(3){animation-delay:.3s}
@keyframes bounce{0%,100%{transform: translateY(0)}50%{transform: translateY(-6px)}}

.panel{
  margin-top:18px;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(240,245,255,.92));
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow: var(--shadow);
  padding:18px;
}
body.dark .panel{
  background: linear-gradient(180deg, rgba(17,26,51,.75), rgba(15,23,48,.72));
}
.panel-head{display:flex; align-items:center; justify-content:space-between; gap:12px}
h2{margin:0 0 10px; font-size:22px}
.muted{color:var(--muted); margin-top:8px}

.favlist{display:grid; grid-template-columns: repeat(3, 1fr); gap:12px; margin-top:12px}
.fav{
  border:1px solid var(--border);
  background:rgba(255,255,255,.05);
  border-radius:18px;
padding:12px;
  display:flex; flex-direction:column; gap:10px;
}
.fav strong{font-size:18px}
.fav .sub{font-size:12px;color:var(--muted)}
.fav .fav-actions{display:flex; gap:8px; margin-top:auto}
.empty{margin-top:14px; color:var(--muted); border:1px dashed rgba(255,255,255,.18); border-radius:18px; padding:14px}

.linksgrid{display:grid; grid-template-columns: repeat(4, 1fr); gap:12px; margin-top:12px}
.cardlink{
  border:1px solid var(--border);
  background:rgba(255,255,255,.05);
  border-radius:18px;
  padding:14px;
  font-weight:850;
}
.cardlink:hover{background:rgba(255,255,255,.08)}

.footer{margin-top:18px; text-align:center; color:var(--muted)}
.footrow{display:flex; gap:10px; justify-content:center; align-items:center; flex-wrap:wrap}
.dot{opacity:.6}

.toast{
  position:fixed;
  left:50%;
  bottom:20px;
  transform: translateX(-50%);
  background: rgba(0,0,0,.55);
  border:1px solid rgba(255,255,255,.14);
  padding:10px 12px;
  border-radius:14px;
  display:none;
  color:var(--text);
  box-shadow:0 18px 50px rgba(0,0,0,.55);
}

@media (max-width: 940px){
  .hero{grid-template-columns: 1fr}
  .bubble{left:10px; top:10px}
  h1{font-size:34px}
  .favlist{grid-template-columns: 1fr 1fr}
  .linksgrid{grid-template-columns: 1fr 1fr}
  .toplinks{display:none}
}
@media (max-width: 520px){
  .favlist{grid-template-columns: 1fr}
  .linksgrid{grid-template-columns: 1fr}
  .value{font-size:24px}
}


.top-actions{display:flex; align-items:center; gap:10px}
.iconbtn{
  border:1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  width:40px; height:40px;
  border-radius:12px;
  display:inline-flex; align-items:center; justify-content:center;
  cursor:pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,.06);
}
.iconbtn:hover{transform: translateY(-1px)}


/* Select */
.select{
  width:100%;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid var(--stroke);
  background: var(--card);
  color: var(--text);
  font: inherit;
  outline:none;
}
.select:focus{
  box-shadow: 0 0 0 4px rgba(91,140,255,0.18);
}


/* Browse page */
.names-grid{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}
.chip{
  border:1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding:10px 12px;
  border-radius:999px;
  font-weight:700;
  cursor:pointer;
}
.chip:hover{ transform: translateY(-1px); }
.toast{
  position:fixed;
  left:50%;
  bottom:22px;
  transform:translateX(-50%);
  background: rgba(0,0,0,.85);
  color:white;
  padding:10px 14px;
  border-radius:12px;
  font-weight:700;
  opacity:0;
  pointer-events:none;
  transition:opacity .2s ease, transform .2s ease;
}
.toast.show{ opacity:1; transform:translateX(-50%) translateY(-2px); }
:root[data-theme="light"] .toast{ background: rgba(20, 32, 60, .92); }
