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

:root {
  --purple:      #7c3aed;
  --purple-dark: #2d1b69;
  --purple-light:#ede8ff;
}

/* ─── BACKGROUND IMAGE LAYER ─────────────────────────────── */
#bgLayer {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-position: center;
  transition: opacity .5s ease;
}

#bgLayer::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(0,0,0,0.4) 1px, transparent 1px);
  background-size: 6px 6px;
}

body {
  background: transparent;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Nunito', 'Arial Black', Arial, sans-serif;
}

/* ─── TOOLBAR ────────────────────────────────────────────── */
.toolbar {
  background: linear-gradient(135deg, var(--purple-dark) 0%, var(--purple) 100%);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 3px 16px rgba(124,58,237,.35);
  flex-shrink: 0;
  z-index: 20;
}
.toolbar-title { color:#fff; font-size:18px; font-weight:900; white-space:nowrap; }

.setting-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.setting-label {
  color: rgba(255,255,255,.72);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
}
.emoji-btn {
  font-size: 28px;
  background: rgba(255,255,255,.15);
  border: 2px solid rgba(255,255,255,.35);
  border-radius: 12px;
  width: 54px; height: 46px;
  cursor: pointer;
  transition: all .15s;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.emoji-btn:hover { background: rgba(255,255,255,.28); transform: scale(1.08); }
.emoji-btn.active { background: rgba(255,255,255,.35); border-color: #fff; }

.fly-btn {
  margin-left: auto;
  background: rgba(255,255,255,.16);
  border: 1.5px solid rgba(255,255,255,.5);
  color: #fff;
  padding: 7px 18px;
  border-radius: 20px;
  font-size: 13px; font-weight: 800;
  cursor: pointer;
  transition: transform .12s, background .15s;
  font-family: inherit;
  white-space: nowrap;
}
.fly-btn:hover  { background: rgba(255,255,255,.3); transform: scale(1.05); }
.fly-btn:active { transform: scale(.96); }
.fly-btn kbd {
  background: rgba(255,255,255,.28);
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 5px;
  padding: 0 5px;
  font-family: monospace;
  font-size: 11px;
  margin-left: 2px;
}

.clear-btn {
  background: rgba(255,255,255,.12);
  border: 1.5px solid rgba(255,255,255,.35);
  color: #fff;
  padding: 7px 18px;
  border-radius: 20px;
  font-size: 13px; font-weight: 800;
  cursor: pointer;
  transition: background .15s;
  font-family: inherit;
}
.clear-btn:hover { background: rgba(255,255,255,.25); }

.spin-btn {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  border: none;
  color: #fff;
  padding: 7px 18px;
  border-radius: 20px;
  font-size: 13px; font-weight: 800;
  cursor: pointer;
  transition: transform .12s, opacity .15s;
  font-family: inherit;
  white-space: nowrap;
}
.spin-btn:hover  { transform: scale(1.05); }
.spin-btn:active { transform: scale(.96); }
.spin-btn:disabled { opacity: .5; cursor: default; transform: none; }

/* ─── HIDE / SHOW UI (maximize the name area) ─────────────── */
/* Collapse the chrome so the notepad flexes to fill the whole screen. */
body.chrome-hidden .toolbar,
body.chrome-hidden .tiktok-bar,
body.chrome-hidden .hint { display: none; }

/* Floating button to restore the toolbars — only visible while hidden. */
.show-ui-btn {
  position: fixed;
  top: 10px; right: 12px;
  z-index: 21000;
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1.5px solid rgba(124,58,237,.35);
  background: rgba(255,255,255,.9);
  color: var(--purple);
  font-size: 18px; font-weight: 900;
  cursor: pointer;
  display: none;
  align-items: center; justify-content: center;
  box-shadow: 0 3px 14px rgba(0,0,0,.15);
  transition: transform .12s, background .15s, opacity .2s;
  opacity: .55;
}
.show-ui-btn:hover { opacity: 1; transform: scale(1.08); background: #fff; }
body.chrome-hidden .show-ui-btn { display: flex; }

/* ─── TOASTS (generic: spin winner, errors) ──────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  z-index: 20000;
  pointer-events: none;
}
.toast {
  background: #1a1a2e;
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  padding: 10px 16px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 800;
  font-family: 'Nunito', Arial, sans-serif;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  animation: toastIn .3s cubic-bezier(.34,1.56,.64,1) both;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast.fade-out { animation: toastOut .3s ease forwards; }
@keyframes toastIn  { from { opacity:0; transform:translateX(40px) scale(.9); } to { opacity:1; transform:none; } }
@keyframes toastOut { from { opacity:1; transform:none; } to { opacity:0; transform:translateX(40px) scale(.9); } }

/* ─── FOLLOW BANNER ──────────────────────────────────────── */
.follow-overlay {
  position: fixed;
  top: 130px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20000;
  pointer-events: none;
  text-align: center;
}
.follow-banner {
  background: linear-gradient(150deg, #1e0a4a 0%, #5b21b6 60%, #7c3aed 100%);
  border: 2px solid rgba(192,132,252,.55);
  border-radius: 26px;
  padding: 18px 48px 22px;
  box-shadow:
    0 0 0 1px rgba(192,132,252,.2),
    0 20px 60px rgba(109,40,217,.7),
    0 0 80px rgba(192,132,252,.25);
  animation: followDrop .5s cubic-bezier(.34,1.56,.64,1) both;
  min-width: 340px;
  white-space: nowrap;
}
.follow-banner.fade-out {
  animation: followRise .4s ease forwards;
}
.follow-label {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: #c084fc;
  margin-bottom: 6px;
  font-family: 'Nunito', Arial, sans-serif;
}
.follow-name {
  font-size: 52px;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  letter-spacing: -1px;
  font-family: 'Nunito', 'Arial Black', Arial, sans-serif;
  animation: followGlow 1.4s ease-in-out infinite;
}
@keyframes followDrop {
  0%   { opacity:0; transform:translateY(-80px) scale(.75); }
  65%  { transform:translateY(10px) scale(1.04); }
  100% { opacity:1; transform:translateY(0)     scale(1);   }
}
@keyframes followRise {
  from { opacity:1; transform:translateY(0)     scale(1); }
  to   { opacity:0; transform:translateY(-60px) scale(.85); }
}
@keyframes followGlow {
  0%, 100% { text-shadow: 0 0 16px rgba(192,132,252,.7), 0 0 40px rgba(192,132,252,.35); }
  50%       { text-shadow: 0 0 28px rgba(192,132,252,1),  0 0 70px rgba(192,132,252,.6), 0 0 110px rgba(168,85,247,.4); }
}

/* ─── LIKE BURST ─────────────────────────────────────────── */
.like-heart {
  position: fixed;
  bottom: 80px;
  font-size: 28px;
  pointer-events: none;
  animation: likeFloat 1.8s ease-out forwards;
  z-index: 19000;
}
@keyframes likeFloat {
  0%   { opacity: 1; transform: translateY(0)    scale(1)    rotate(0deg); }
  60%  { opacity: 1; transform: translateY(-120px) scale(1.2) rotate(-12deg); }
  100% { opacity: 0; transform: translateY(-220px) scale(.8)  rotate(10deg); }
}

/* ─── EMOJI PICKER PANEL (fixed, shared) ─────────────────── */
.emoji-panel {
  position: fixed;
  width: 340px;
  max-height: 420px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 12px 48px rgba(0,0,0,.22), 0 2px 10px rgba(0,0,0,.1);
  border: 1px solid #e0d6ff;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(.97);
  transition: opacity .18s, transform .18s;
}
.emoji-panel.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0) scale(1);
}

/* Search */
.ep-search-wrap {
  padding: 10px 10px 6px;
  flex-shrink: 0;
}
.ep-search {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1.5px solid #d8d0f8;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: #faf9ff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237c3aed' stroke-width='2.5'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 10px center;
  transition: border-color .15s;
}
.ep-search:focus { border-color: var(--purple); }

/* Category tabs */
.ep-cats {
  display: flex;
  gap: 2px;
  padding: 0 10px 8px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
.ep-cats::-webkit-scrollbar { display: none; }
.ep-cat-btn {
  flex-shrink: 0;
  font-size: 18px;
  background: none;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 3px 6px;
  cursor: pointer;
  transition: all .12s;
  line-height: 1;
}
.ep-cat-btn:hover { background: var(--purple-light); }
.ep-cat-btn.active { background: var(--purple-light); border-color: var(--purple); }

/* Grid */
.ep-grid-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 4px 10px 10px;
  scrollbar-width: thin;
  scrollbar-color: #d8d0f8 transparent;
}
.ep-grid-wrap::-webkit-scrollbar { width: 5px; }
.ep-grid-wrap::-webkit-scrollbar-thumb { background: #d8d0f8; border-radius: 3px; }

.ep-section-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: #a78bfa;
  padding: 6px 2px 4px;
}
.ep-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  margin-bottom: 6px;
}
.ep-grid button {
  font-size: 22px;
  background: none;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 4px 2px;
  cursor: pointer;
  transition: all .1s;
  line-height: 1;
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
}
.ep-grid button:hover {
  background: var(--purple-light);
  border-color: var(--purple);
  transform: scale(1.2);
}

.ep-empty {
  text-align: center;
  padding: 20px;
  color: #aaa;
  font-size: 13px;
}

/* ─── TIKTOK BAR ─────────────────────────────────────────── */
.tiktok-bar {
  background: #0a0a0a;
  padding: 7px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  border-bottom: 1px solid #1a1a1a;
}
.tt-logo { font-size: 16px; flex-shrink: 0; }
.tt-label {
  color: #555;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  white-space: nowrap;
}
.tt-input {
  background: #1a1a1a;
  border: 1.5px solid #2a2a2a;
  color: #fff;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 700;
  outline: none;
  width: 160px;
  transition: border-color .15s;
}
.tt-input::placeholder { color: #3a3a3a; }
.tt-input:focus { border-color: #ee1d52; }
.tt-btn {
  background: #ee1d52;
  border: none;
  color: #fff;
  padding: 5px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
  white-space: nowrap;
}
.tt-btn:hover { background: #c5173f; }
.tt-btn.secondary { background: #2a2a2a; }
.tt-btn.secondary:hover { background: #333; }
.tt-status {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  white-space: nowrap;
}
.tt-status.online      { color: #10b981; background: rgba(16,185,129,.15); }
.tt-status.offline     { color: #555;    background: rgba(255,255,255,.05); }
.tt-status.connecting  { color: #f59e0b; background: rgba(245,158,11,.12); }
.tt-status.error       { color: #f43f5e; background: rgba(244,63,94,.12); }
.tt-pause-btn {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  color: #666;
  padding: 4px 11px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  display: none;
  white-space: nowrap;
}
.tt-pause-btn.visible { display: block; }
.tt-pause-btn:hover { color: #ccc; background: rgba(255,255,255,.14); }
.tt-badge { font-size: 14px; opacity: .6; margin-right: 4px; flex-shrink: 0; }
.name-col { display: inline-flex; flex-direction: column; align-items: flex-start; }
.line-subtitle {
  font-size: 34px;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  text-shadow:
    0 2px 6px rgba(0,0,0,0.9),
    0 0 24px rgba(0,0,0,0.6);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── HINT BAR ───────────────────────────────────────────── */
.hint {
  background: transparent;
  border-bottom: 1px solid #e8e3ff;
  padding: 5px 24px;
  font-size: 12px;
  color: var(--purple);
  font-weight: 700;
  flex-shrink: 0;
}
.hint kbd {
  background: var(--purple-light);
  border: 1px solid #c4b5fd;
  border-radius: 4px;
  padding: 1px 5px;
  font-family: monospace;
  font-size: 11px;
  color: var(--purple-dark);
}

/* ─── NOTEPAD ────────────────────────────────────────────── */
.notepad {
  flex: 1;
  padding: 14px 26px;
  overflow-y: auto;
  outline: none;
  cursor: text;
  background: transparent;
}
.line { display: flex; align-items: center; min-height: 72px; padding: 3px 0; cursor: pointer; border-radius: 10px; transition: background .1s; }
.line:hover { background: #f5f2ff; }
.line.line-active { background: #ede8ff; }
.left-emoji {
  font-size: 48px; margin-right: 14px; flex-shrink: 0;
  display: inline-block; line-height: 1;
  animation: emojiFloat 3.5s ease-in-out infinite;
  will-change: transform;
}
.line-body { display: flex; align-items: center; flex-wrap: wrap; line-height: 1; }
.name-text {
  font-size: 22px;
  font-weight: 900;
  color: rgba(255,255,255,.75);
  line-height: 1;
  letter-spacing: -.5px;
  text-shadow:
    0 2px 6px rgba(0,0,0,0.9),
    0 0 24px rgba(0,0,0,0.6);
}
.cursor {
  display: inline-block; width: 3px; height: 50px;
  background: var(--purple); border-radius: 2px;
  margin-left: 3px; vertical-align: middle; flex-shrink: 0;
  animation: cursorBlink 1s step-end infinite;
}

/* ─── ANIMATIONS ─────────────────────────────────────────── */
@keyframes emojiFloat {
  0%   { transform: translateY(0)    rotate(0deg)  scale(1); }
  20%  { transform: translateY(-8px) rotate(-8deg) scale(1.07); }
  40%  { transform: translateY(0)    rotate(0deg)  scale(1); }
  65%  { transform: translateY(-4px) rotate(5deg)  scale(1.04); }
  82%  { transform: translateY(2px)  rotate(-2deg) scale(.97); }
  100% { transform: translateY(0)    rotate(0deg)  scale(1); }
}
@keyframes heartPop {
  0%   { transform: scale(0) rotate(-25deg); opacity: 0; }
  60%  { transform: scale(1.45) rotate(10deg); opacity: 1; }
  100% { transform: scale(1)   rotate(0deg);  opacity: 1; }
}
@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.3); }
  28% { transform: scale(1); }
  42% { transform: scale(1.15); }
  70% { transform: scale(1); }
}
@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ─── FULL-SCREEN FLYER OVERLAY ──────────────────────────── */
.fly-overlay {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 10000;
}
.flyer {
  position: absolute;
  top: 0; left: 0;
  will-change: transform;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.28));
  display: flex;
  align-items: center;
}
.fly-name-ribbon {
  display: inline-flex;
  align-items: center;
  font-weight: 900;
  white-space: nowrap;
  font-family: 'Nunito', 'Arial Black', Arial, sans-serif;
  text-shadow: 0 0 16px rgba(0,0,0,.2), 0 2px 6px rgba(0,0,0,.15);
}
.fly-ribbon-char {
  display: inline-block;
  will-change: transform;
  animation: ribbonWave 1.3s ease-in-out infinite;
}
@keyframes ribbonWave {
  0%, 100% { transform: translateY(0px); }
  25%       { transform: translateY(-32px); }
  75%       { transform: translateY(22px); }
}
.flyer-face { display: inline-block; }
.flyer-body {
  display: inline-block;
  animation: flyFlap .85s ease-in-out infinite;
}
@keyframes flyFlap {
  0%, 100% { transform: translateY(0)    rotate(0deg)  scale(1); }
  50%      { transform: translateY(-7px) rotate(-5deg) scale(1.06); }
}

.spark {
  position: absolute;
  top: 0; left: 0;
  pointer-events: none;
  will-change: transform, opacity;
  animation: sparkFade .9s ease-out forwards;
}
@keyframes sparkFade {
  0%   { opacity: .95; transform: translate(-50%, -50%) scale(1)   rotate(0deg); }
  100% { opacity: 0;   transform: translate(-50%, 26px) scale(.35) rotate(140deg); }
}
