/* ManySmile — emoji bring the color; the chrome stays quiet & warm */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Hanken+Grotesk:wght@400;500;600;700&display=swap');

:root{
  --bg:#FBFAF6; --surface:#FFFFFF; --ink:#211D17; --muted:#8A8378;
  --line:#ECE7DD; --line-2:#E3DCCE;
  --accent:#FFC83D; --accent-deep:#F2A900; --accent-ink:#2A2200;
  --ok:#2F9E6B;
  --shadow:0 1px 2px rgba(33,29,23,.04), 0 8px 24px rgba(33,29,23,.06);
  --shadow-lg:0 12px 40px rgba(33,29,23,.14);
  --radius:16px; --radius-sm:10px;
  --display:'Bricolage Grotesque',system-ui,sans-serif;
  --ui:'Hanken Grotesk',system-ui,-apple-system,sans-serif;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--bg); color:var(--ink); font-family:var(--ui);
  font-size:16px; line-height:1.45; -webkit-font-smoothing:antialiased;
  min-height:100vh;
}
button{font-family:inherit; cursor:pointer}
::selection{background:var(--accent); color:var(--accent-ink)}

/* ---------- top bar ---------- */
.topbar{
  position:sticky; top:0; z-index:40;
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:14px 20px; background:rgba(251,250,246,.82);
  backdrop-filter:saturate(140%) blur(10px); border-bottom:1px solid var(--line);
}
.brand{display:flex; align-items:center; gap:10px; font-family:var(--display);
  font-weight:800; font-size:20px; letter-spacing:-.02em; color:var(--ink); text-decoration:none}
.brand .mark{
  display:grid; place-items:center; width:30px; height:30px; border-radius:9px;
  background:var(--accent); font-size:18px; line-height:1; transform:rotate(-6deg);
  box-shadow:inset 0 -2px 0 rgba(0,0,0,.06);
}
.brand b{color:var(--accent-deep)}

.langwrap{position:relative}
.langbtn{
  display:flex; align-items:center; gap:8px; padding:8px 12px; border-radius:999px;
  border:1px solid var(--line-2); background:var(--surface); color:var(--ink);
  font-weight:600; font-size:14px; box-shadow:var(--shadow);
}
.langbtn:hover{border-color:var(--accent-deep)}
.langbtn .chev{font-size:11px; color:var(--muted)}
.langmenu{
  position:absolute; right:0; top:calc(100% + 8px); width:230px; max-height:62vh; overflow:auto;
  background:var(--surface); border:1px solid var(--line-2); border-radius:14px;
  box-shadow:var(--shadow-lg); padding:6px; display:none;
}
.langmenu.open{display:block}
.langmenu input{
  width:100%; padding:9px 11px; margin-bottom:6px; border:1px solid var(--line);
  border-radius:9px; font-family:inherit; font-size:14px; background:var(--bg); color:var(--ink);
}
.langmenu button{
  display:flex; width:100%; align-items:center; justify-content:space-between; gap:8px;
  padding:9px 11px; border:0; border-radius:9px; background:transparent; color:var(--ink);
  font-size:14px; text-align:left;
}
.langmenu button:hover{background:var(--bg)}
.langmenu button.sel{background:#FFF6DE}
.langmenu button .code{font-size:11px; color:var(--muted); font-variant:all-small-caps; letter-spacing:.04em}

/* ---------- hero ---------- */
.hero{max-width:760px; margin:0 auto; padding:46px 20px 18px; text-align:center}
.hero h1{
  font-family:var(--display); font-weight:800; letter-spacing:-.03em; line-height:1.02;
  font-size:clamp(30px,6vw,52px); margin:0 0 12px;
}
.hero h1 .hl{
  background:linear-gradient(180deg,transparent 58%, var(--accent) 58%, var(--accent) 92%, transparent 92%);
  padding:0 .06em;
}
.hero p.sub{color:var(--muted); font-size:clamp(15px,2.4vw,18px); margin:0 auto 22px; max-width:46ch}

.searchbox{position:relative; max-width:560px; margin:0 auto}
.searchbox .ic{position:absolute; inset-inline-start:18px; top:50%; transform:translateY(-50%);
  font-size:18px; color:var(--muted); pointer-events:none}
.searchbox input{
  width:100%; padding:17px 52px 17px 50px; font-family:var(--ui); font-size:18px; font-weight:500;
  color:var(--ink); background:var(--surface); border:1.5px solid var(--line-2);
  border-radius:999px; box-shadow:var(--shadow); transition:border-color .15s, box-shadow .15s;
}
.searchbox input::placeholder{color:#B6AE9F}
.searchbox input:focus{outline:none; border-color:var(--accent-deep);
  box-shadow:0 0 0 4px rgba(255,200,61,.32), var(--shadow)}
.searchbox .clr{position:absolute; inset-inline-end:14px; top:50%; transform:translateY(-50%);
  width:28px; height:28px; border-radius:50%; border:0; background:var(--bg); color:var(--muted);
  font-size:15px; display:none; place-items:center}
.searchbox .clr.show{display:grid}
.searchbox .clr:hover{background:var(--line); color:var(--ink)}

.examples{margin:14px 0 0; font-size:13.5px; color:var(--muted); display:flex; gap:7px;
  align-items:center; justify-content:center; flex-wrap:wrap; min-height:24px}
.examples .lab{color:#B6AE9F}
.examples .chip{padding:3px 10px; border-radius:999px; background:var(--surface);
  border:1px solid var(--line); color:var(--ink); font-weight:600; transition:transform .15s}
.examples .chip:hover{transform:translateY(-1px); border-color:var(--accent-deep)}

/* ---------- category tabs ---------- */
.cats{position:sticky; top:61px; z-index:30; background:rgba(251,250,246,.9);
  backdrop-filter:blur(8px); border-bottom:1px solid var(--line);
  display:flex; gap:6px; padding:10px 20px; overflow-x:auto; scrollbar-width:none}
.cats::-webkit-scrollbar{display:none}
.cats .ct{
  flex:0 0 auto; width:42px; height:42px; border-radius:12px; border:1px solid transparent;
  background:transparent; font-size:21px; line-height:1; display:grid; place-items:center;
  filter:grayscale(.15); opacity:.7; transition:transform .12s, background .12s, opacity .12s}
.cats .ct:hover{background:var(--surface); opacity:1; transform:translateY(-1px)}
.cats .ct.on{background:#FFF1CE; border-color:var(--accent); opacity:1; filter:none;
  box-shadow:inset 0 -3px 0 var(--accent)}

/* ---------- grid ---------- */
.stage{max-width:1080px; margin:0 auto; padding:18px 16px 160px}
.section-h{display:flex; align-items:center; gap:10px; margin:22px 4px 12px; color:var(--muted);
  font-size:13px; font-weight:700; letter-spacing:.04em; text-transform:uppercase}
.section-h .ico{font-size:18px}
.section-h .ln{flex:1; height:1px; background:var(--line)}
.count{color:var(--muted); font-size:14px; margin:4px 4px 14px}

.grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(58px,1fr)); gap:6px}
.cell{
  position:relative; aspect-ratio:1; border:1px solid transparent; border-radius:12px;
  background:transparent; font-size:30px; line-height:1; display:grid; place-items:center; overflow:hidden;
  transition:background .1s, transform .06s, border-color .1s;
}
.cell .g{display:inline-block; line-height:1; transform-origin:center center; will-change:transform}
.cell:hover{background:var(--surface); border-color:var(--line-2)}
.cell:active{transform:scale(.9)}
.cell:focus-visible{outline:none; border-color:var(--accent-deep);
  box-shadow:0 0 0 3px rgba(255,200,61,.4)}
.cell .add{
  position:absolute; top:3px; inset-inline-end:3px; width:18px; height:18px; border-radius:6px;
  border:0; background:var(--ink); color:#fff; font-size:12px; line-height:1; display:none;
  place-items:center; opacity:.85}
.cell:hover .add{display:grid}
.cell .add:hover{background:var(--accent-deep); color:var(--accent-ink); opacity:1}
.cell.flash{animation:pop .4s ease}
@keyframes pop{0%{background:var(--accent)}40%{background:var(--accent);transform:scale(1.12)}100%{background:transparent}}

/* collect mode */
body.collect .cell{cursor:copy}
body.collect .cell .add{display:none}
body.collect .cell:hover{background:#FFF1CE; border-color:var(--accent)}
.mode-banner{display:none; max-width:1080px; margin:0 auto; padding:0 16px}
body.collect .mode-banner{display:block}
.mode-banner .inner{margin-top:10px; padding:9px 14px; border-radius:12px; background:#FFF6DE;
  border:1px solid var(--accent); color:var(--accent-ink); font-size:14px; font-weight:600;
  display:flex; align-items:center; gap:8px}

.empty{text-align:center; padding:60px 20px; color:var(--muted)}
.empty .big{font-size:42px; margin-bottom:10px}

/* ---------- combo tray ---------- */
.tray{
  position:fixed; left:0; right:0; bottom:0; z-index:45;
  background:var(--surface); border-top:1px solid var(--line-2);
  box-shadow:0 -10px 30px rgba(33,29,23,.08); padding:12px 16px;
  transform:translateY(calc(100% - 0px)); transition:transform .26s cubic-bezier(.2,.7,.2,1)}
.tray.up{transform:translateY(0)}
.tray .row{max-width:1080px; margin:0 auto; display:flex; align-items:center; gap:12px}
.tray .tag{font-family:var(--display); font-weight:700; font-size:13px; color:var(--accent-deep);
  letter-spacing:.02em; flex:0 0 auto}
.strip{
  flex:1; min-height:48px; display:flex; align-items:center; gap:4px; overflow-x:auto;
  padding:6px 10px; border-radius:12px; scrollbar-width:thin;
  /* washi-tape look — the signature */
  background:repeating-linear-gradient(135deg,#FFF1CE 0 14px,#FFE7A8 14px 28px);
  border:1px dashed var(--accent-deep);
}
.strip .e{font-size:26px; line-height:1; flex:0 0 auto; padding:2px; cursor:pointer; border-radius:6px}
.strip .e:hover{background:rgba(0,0,0,.06)}
.strip .ph{color:var(--accent-ink); opacity:.6; font-weight:600; font-size:14px; font-family:var(--ui)}
.tray .acts{display:flex; gap:8px; flex:0 0 auto}
.btn{padding:11px 16px; border-radius:11px; border:1px solid var(--line-2); background:var(--surface);
  color:var(--ink); font-weight:600; font-size:14px; transition:transform .08s, background .12s}
.btn:hover{background:var(--bg)} .btn:active{transform:scale(.97)}
.btn.primary{background:var(--accent); border-color:var(--accent-deep); color:var(--accent-ink)}
.btn.primary:hover{background:var(--accent-deep)}
.btn.ghost{border-color:transparent; color:var(--muted)}
.btn.ghost:hover{color:var(--ink); background:var(--bg)}

.collect-toggle{
  position:fixed; inset-inline-end:18px; bottom:84px; z-index:44;
  display:flex; align-items:center; gap:8px; padding:11px 16px; border-radius:999px;
  border:1px solid var(--line-2); background:var(--surface); color:var(--ink);
  font-weight:600; font-size:14px; box-shadow:var(--shadow-lg)}
.collect-toggle:hover{border-color:var(--accent-deep)}
body.collect .collect-toggle{background:var(--accent); border-color:var(--accent-deep); color:var(--accent-ink)}

/* ---------- toast ---------- */
.toast{position:fixed; left:50%; bottom:96px; transform:translate(-50%,20px); z-index:60;
  background:var(--ink); color:#fff; padding:11px 18px; border-radius:999px; font-weight:600;
  font-size:15px; box-shadow:var(--shadow-lg); opacity:0; pointer-events:none;
  transition:opacity .2s, transform .2s; display:flex; align-items:center; gap:8px}
.toast.show{opacity:1; transform:translate(-50%,0)}
.toast .ok{color:#FFD86B}

footer{max-width:1080px; margin:0 auto; padding:28px 20px 120px; color:var(--muted);
  font-size:13.5px; text-align:center; border-top:1px solid var(--line)}
footer a{color:var(--accent-deep); text-decoration:none}

/* rtl: flip search text direction for arabic/hebrew/persian input */
body.rtl .searchbox input{direction:rtl; text-align:right; padding:17px 50px 17px 52px}

@media (max-width:640px){
  .hero{padding-top:32px}
  .grid{grid-template-columns:repeat(auto-fill,minmax(50px,1fr)); gap:4px}
  .cell{font-size:26px; border-radius:10px}
  .tray .tag{display:none}
  .collect-toggle{bottom:78px}
}
@media (prefers-reduced-motion:reduce){
  *{transition:none !important; animation:none !important}
}
