:root {
  --ink: #1d1b2e;
  --mute: #6b6880;
  --brand: #7b6cff;
  --brand-2: #5b8dff;
  --chip: #ffffff;
  --kb: #e7e8ee;
  --gray-key: #c9ccd6;
  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
:lang(en), :lang(fr), :lang(es) { --font: "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif; }
:lang(ja) { --font: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif; }
:lang(ko) { --font: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif; }
:lang(ar) { --font: "Noto Sans Arabic", "Geeza Pro", "Segoe UI", Tahoma, sans-serif; }
body, button, select, input { font-family: var(--font); }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 600px at 85% 30%, rgba(160, 150, 255, 0.28), transparent 60%),
    radial-gradient(800px 600px at 10% 90%, rgba(255, 238, 200, 0.55), transparent 60%),
    linear-gradient(135deg, #fbfaff 0%, #f1efff 50%, #f7f4ff 100%);
}
button { font: inherit; cursor: pointer; }

.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; justify-content: flex-end; align-items: center;
  max-width: 1100px; margin: 0 auto; padding: 18px 28px;
}
.links { display: flex; align-items: center; gap: 22px; }
.lang {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .7); border: 1px solid #e6e3f5; color: var(--ink); cursor: pointer;
}
.lang svg { width: 16px; height: 16px; color: var(--brand); }
.lang select {
  border: 0; background: transparent; color: inherit; font-size: 14px; outline: none; cursor: pointer;
  max-width: 170px;
}

.dots {
  position: fixed; right: 22px; top: 50%; transform: translateY(-50%); z-index: 20;
  list-style: none; margin: 0; padding: 0; display: grid; gap: 8px;
}
.dots li {
  width: 6px; height: 6px; border-radius: 6px; background: #c8c4dd; cursor: pointer;
  transition: height .3s ease, background .3s ease;
}
.dots li.on { height: 18px; background: var(--brand); }
[dir="rtl"] .dots { right: auto; left: 22px; }

.pager { height: 100vh; transition: transform .8s cubic-bezier(.7, 0, .2, 1); will-change: transform; }
.page { height: 100vh; position: relative; display: flex; align-items: center; }
.wrap {
  width: 100%; max-width: 1100px; margin: 0 auto; padding: 72px 28px 28px;
  display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 40px;
}

.copy h1 { font-size: clamp(36px, 5vw, 58px); font-weight: 900; margin: 0 0 16px; letter-spacing: .02em; }
.copy h2 { font-size: clamp(28px, 3.4vw, 42px); font-weight: 900; line-height: 1.3; margin: 8px 0 16px; }
.lead { font-size: clamp(20px, 2.2vw, 28px); line-height: 1.55; margin: 0 0 28px; font-weight: 500; }
.kicker { margin: 0; color: var(--brand); font-weight: 700; letter-spacing: .08em; font-size: 14px; }
.desc { color: var(--mute); font-size: 16px; line-height: 1.8; max-width: 30em; margin: 0; }

.cta { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.store {
  display: inline-flex; align-items: center; gap: 12px; justify-content: center;
  width: 100%; max-width: 320px; min-height: 56px;
  padding: 14px 36px; border-radius: 14px; background: #2a2340; color: #fff; text-decoration: none; border: 0;
  font-size: 18px; font-weight: 700; letter-spacing: .02em;
  box-shadow: 0 10px 24px rgba(42, 35, 64, .18); transition: transform .2s ease, background .2s ease;
}
.store:hover { transform: translateY(-2px); background: var(--brand); }
.store svg { width: 24px; height: 24px; }

.stage { position: relative; display: flex; justify-content: center; min-height: 440px; }
.card-back {
  position: absolute; width: 240px; height: 300px; border-radius: 26px;
  background: rgba(255, 255, 255, .55); box-shadow: 0 20px 50px rgba(123, 108, 255, .12);
}
.card-back.c1 { transform: translate(-70px, 40px) rotate(-12deg); }
.card-back.c2 { transform: translate(-40px, 30px) rotate(-6deg); }
.phone {
  position: relative; width: 300px; padding: 18px 14px 12px; border-radius: 28px;
  background: rgba(255, 255, 255, .92); box-shadow: 0 30px 70px rgba(91, 80, 180, .18);
}
.phone.live { display: flex; flex-direction: column; }
.phone.chat { max-height: min(78vh, 640px); overflow: auto; }
.phone.chat #styleReply { display: none; }

.thread {
  min-height: 72px; max-height: 110px; overflow-y: auto; padding-inline-end: 2px;
  display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px;
}
.thread .bubble { margin: 0; }

.bubble {
  font-size: 13px; line-height: 1.6; padding: 10px 14px; border-radius: 14px; margin: 0 0 10px;
  max-width: 92%;
}
.bubble.in { background: #fff; border: 1px solid #ecebf5; border-inline-start: 3px solid var(--brand); box-shadow: 0 6px 18px rgba(0,0,0,.04); }
.bubble.out { margin-inline-start: auto; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
.bubble.big { font-size: 13px; min-height: 40px; margin-bottom: 8px; transition: opacity .25s ease; }

.inputbar {
  display: flex; align-items: center; gap: 6px; color: #555; font-size: 14px;
  padding: 0 2px 8px; flex-shrink: 0;
}
.draft {
  flex: 1; min-width: 0; min-height: 22px; display: flex; align-items: center;
  font-size: 13px; line-height: 1.4;
}
.draft .placeholder { color: #a9a6bb; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.draft .text { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.caret { width: 2px; height: 16px; flex-shrink: 0; margin-inline-start: 2px; background: var(--brand); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.icon-btn, .tool, .mini-logo, .home {
  border: 0; background: #fff; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; color: #555; font-size: 13px; padding: 0; cursor: pointer;
}
.icon-btn { background: transparent; font-size: 15px; }
.icon-btn.on, .tool.on { color: #ff6b9a; background: #ffe6ef; }
.kb { background: var(--kb); border-radius: 16px; margin: 0 -14px -12px; padding: 8px 8px 10px; flex-shrink: 0; }
.kb-top { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 8px; }
.mini-logo { background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.tools { display: flex; gap: 8px; }
.tool { color: #555; }
#heartBtn { color: #ff6b9a; }
.kb-row { display: grid; grid-template-columns: 1fr 64px; gap: 6px; margin-bottom: 6px; }
.paste-area {
  border: 0; border-radius: 8px; background: #fff; color: var(--brand); padding: 9px 0; font-size: 13px;
}
.paste-area.done { background: #efeaff; }
.kb-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 64px; gap: 6px; }
.chip, .key {
  border: 0; border-radius: 8px; background: var(--chip); padding: 11px 4px; font-size: 13px; color: #333;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
  box-shadow: 0 1px 0 rgba(0,0,0,.08); transition: transform .12s ease, background .2s ease;
}
.chip:hover, .key:hover, .paste-area:hover { background: #f1efff; }
.chip.on { background: var(--brand); color: #fff; }
.chip:active, .key:active { transform: scale(.96); }
.key.blue { background: var(--brand); color: #fff; }
.key.blue:hover { background: #6958e8; }
.key.gray { background: var(--gray-key); }
.key.gray:hover { background: #b8bbc6; }
.kb-foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 10px 0; color: #555; }
.home { width: 90px; height: 4px; border-radius: 4px; background: #333; }

.chat-head {
  text-align: center; font-weight: 700; font-size: 13px; padding-bottom: 8px; margin-bottom: 8px;
  border-bottom: 1px solid #eeedf6;
}
.chat-head small { color: #3bbf7a; font-weight: 400; margin-inline-start: 4px; }
.gen { background: #f6f5ff; border-radius: 12px; padding: 8px; margin-bottom: 8px; }
.gen-title { margin: 0 0 6px; font-size: 12px; color: var(--brand); font-weight: 700; }
.gen-item {
  display: block; width: 100%; text-align: start;
  background: #fff; border-radius: 10px; padding: 7px 10px; font-size: 12px; line-height: 1.45;
  margin-bottom: 5px; cursor: pointer; border: 1px solid transparent;
}
.gen-item:hover { border-color: var(--brand); }
.gen-item.on { border-color: var(--brand); background: #efeaff; }
.gen-item:last-child { margin-bottom: 0; }

.meter { background: #f6f5ff; border-radius: 12px; padding: 8px 10px; margin: 0 0 8px; }
.meter-head { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; }
.meter-head b { color: var(--brand); }
.meter input[type="range"] { width: 100%; accent-color: var(--brand); }
.meter-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--mute); margin-top: 2px; gap: 4px; }
.meter-scale button {
  border: 0; background: transparent; color: inherit; padding: 2px 0; cursor: pointer; font-size: 11px;
}
.meter-scale button.on { color: var(--brand); font-weight: 700; }

.styles { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 6px; }
.styles button {
  border: 1px solid #e3e1f2; background: #fff; border-radius: 999px; padding: 5px 9px; font-size: 11px;
}
.styles button.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.page .copy, .page .stage { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.page.active .copy, .page.active .stage { opacity: 1; transform: none; }
.page.active .stage { transition-delay: .12s; }

.foot {
  position: absolute; left: 0; right: 0; bottom: 16px; text-align: center; color: #9a97ad; font-size: 12px;
}
.foot p { margin: 4px 0; }

.ghost {
  border: 0; background: transparent; color: var(--brand); font-weight: 700; font-size: 13px; padding: 0;
}
.kb-card, .font-card, .studio {
  width: min(380px, 100%);
}
.kb-card, .font-card {
  background: #fff; border-radius: 22px; padding: 14px;
  box-shadow: 0 24px 60px rgba(91, 80, 180, .16);
}
.studio { display: grid; gap: 12px; max-height: min(78vh, 680px); overflow: auto; padding: 2px; }
.kb-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 14px; }
.kb-card-head small { color: var(--mute); font-weight: 400; margin-inline-start: 6px; }
.tap-hint, .fx-label { text-align: center; color: var(--mute); font-size: 12px; margin: 8px 0; }
.qwerty {
  position: relative; overflow: hidden; border-radius: 16px; padding: 16px 12px 18px;
  background: #1b1433; direction: ltr;
}
.qwerty .fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.q-row { display: flex; justify-content: center; gap: 6px; margin: 5px 0; position: relative; z-index: 1; }
.qkey {
  border: 0; flex: 1 1 0; min-width: 0; max-width: 42px; height: 40px; padding: 0;
  border-radius: 10px; background: rgba(255,255,255,.12); color: #fff;
  font-size: 16px; font-weight: 600; text-transform: lowercase;
  box-shadow: 0 2px 0 rgba(0,0,0,.18);
}
.qkey.pressed { transform: scale(.94); filter: brightness(1.35); }
.qkey.wide { flex: 1.2; max-width: 56px; font-size: 13px; }
.qkey.space { flex: 4; max-width: 180px; font-size: 12px; letter-spacing: .01em; text-transform: none; }
.qkey.enter { flex: 1.4; max-width: 64px; background: var(--brand); font-size: 18px; }
.qwerty.mini { padding: 10px 8px 12px; }
.qwerty.mini .qkey { height: 30px; max-width: 32px; font-size: 13px; border-radius: 7px; }

[data-theme="galaxy"] .qwerty { background: radial-gradient(circle at 30% 20%, #3a2a7a, #120c28 70%); }
[data-theme="aurora"] .qwerty { background: linear-gradient(160deg, #12364a, #1c3d38 40%, #4b2a6a); }
[data-theme="snow"] .qwerty { background: linear-gradient(180deg, #d7e9ff, #8fb7e6); }
[data-theme="snow"] .qkey { background: rgba(255,255,255,.7); color: #1d3a62; }
[data-theme="neon"] .qwerty { background: #1a0520; }
[data-theme="neon"] .qkey { background: #ff2d8a; color: #fff; box-shadow: 0 0 10px #ff2d8a; }
[data-theme="hearts"] .qwerty { background: linear-gradient(160deg, #f3d4ee, #c9b6f2); }
[data-theme="hearts"] .qkey { background: rgba(255,255,255,.7); color: #6b3a7a; }
[data-theme="midnight"] .qwerty { background: #0b0b0d; }
[data-theme="midnight"] .qkey { background: #1c1c22; color: #e8d48b; }

.spark {
  position: absolute; pointer-events: none; z-index: 3; left: 0; top: 0;
  transform: translate(-50%, -50%); will-change: transform, opacity;
}
.qwerty[data-fx-kind="stars"] { box-shadow: inset 0 0 40px rgba(255, 220, 120, .28); }
.qwerty[data-fx-kind="snow"] { box-shadow: inset 0 -30px 50px rgba(255,255,255,.22); }
.qwerty[data-fx-kind="bubbles"] { box-shadow: inset 0 0 36px rgba(120, 210, 255, .3); }
.qwerty[data-fx-kind="hearts"] { box-shadow: inset 0 0 40px rgba(255, 120, 170, .28); }
.qwerty[data-fx-kind="fireflies"] { box-shadow: inset 0 0 50px rgba(40, 20, 0, .35); }

.fx-stars {
  color: #ffe9a0; font-size: 18px; line-height: 1;
  text-shadow: 0 0 8px #fff, 0 0 16px #ffd36a, 0 0 28px #ffb84d;
  animation: twinkle 1.3s ease-in-out forwards;
}
@keyframes twinkle {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.1) rotate(0); }
  30% { opacity: 1; transform: translate(-50%, -50%) scale(1.35) rotate(var(--spin, 40deg)); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(.2) rotate(calc(var(--spin, 40deg) + 50deg)); }
}
.fx-snow {
  color: #fff; font-size: 20px; line-height: 1; filter: drop-shadow(0 0 4px #fff);
  animation: snowfall 3s linear forwards;
}
@keyframes snowfall {
  0% { opacity: .95; transform: translate(-50%, -50%) rotate(0) scale(.8); }
  100% { opacity: .2; transform: translate(calc(-50% + var(--drift, 28px)), 260px) rotate(200deg) scale(1.1); }
}
.fx-bubbles {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,.95);
  background: radial-gradient(circle at 28% 28%, rgba(255,255,255,.9), rgba(150, 220, 255, .35) 46%, rgba(120, 190, 255, .08) 68%, transparent 72%);
  box-shadow: 0 0 10px rgba(140, 210, 255, .7), inset 0 0 6px rgba(255,255,255,.6);
  animation: bubbleup 2.4s ease-out forwards;
}
@keyframes bubbleup {
  0% { opacity: .9; transform: translate(-50%, -50%) scale(.4); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--drift, 16px)), -200px) scale(1.55); }
}
.fx-hearts {
  font-size: 22px; line-height: 1; filter: drop-shadow(0 0 6px rgba(255,120,170,.8));
  animation: heartfloat 1.9s ease-out forwards;
}
@keyframes heartfloat {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.3) rotate(-12deg); }
  16% { opacity: 1; transform: translate(-50%, -60%) scale(1.1) rotate(8deg); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--drift, 22px)), -150px) scale(1.25) rotate(-6deg); }
}
.fx-fireflies {
  width: 8px; height: 8px; border-radius: 50%;
  background: #fff6a8;
  box-shadow: 0 0 8px 3px rgba(255, 230, 90, 1), 0 0 18px 8px rgba(255, 180, 40, .55);
  animation: firefly 2.3s ease-in-out forwards;
}
@keyframes firefly {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.2); }
  18% { opacity: 1; transform: translate(calc(-50% + var(--dx, 16px)), calc(-50% + var(--dy, -30px))) scale(1.2); }
  55% { opacity: .35; transform: translate(calc(-50% - var(--dx, 16px)), calc(-50% + var(--dy, -30px) * .4)) scale(.7); }
  78% { opacity: 1; transform: translate(calc(-50% + var(--dx, 16px) * .3), calc(-50% + var(--dy, -30px) * 1.3)) scale(1.1); }
  100% { opacity: 0; transform: translate(calc(-50% - 8px), calc(-50% + var(--dy, -30px) * 1.6)) scale(.2); }
}

.theme-pills, .fx-pills { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.theme-pills button, .fx-pills button, .font-item {
  border: 1px solid #e3e1f2; background: #fff; border-radius: 999px; padding: 6px 11px; font-size: 12px;
}
.theme-pills button.on, .fx-pills button.on, .font-item.on {
  background: var(--brand); border-color: var(--brand); color: #fff;
}

.font-input { display: flex; gap: 8px; margin-bottom: 10px; }
.font-input input {
  flex: 1; border: 1px solid #e3e1f2; border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 14px;
}
.font-list { display: grid; gap: 8px; max-height: 220px; overflow: auto; }
.font-item {
  display: flex; justify-content: space-between; align-items: center; border-radius: 14px; padding: 10px 12px; width: 100%; text-align: start;
}
.font-item > span { min-width: 0; flex: 1; }
.font-item b { font-weight: 500; font-size: 18px; line-height: 1.4; display: block; word-break: break-word; }
.font-item small { color: var(--mute); display: block; font-size: 11px; margin-bottom: 2px; font-family: inherit; font-weight: 500; }
.font-item .copy { border: 0; background: #f3f1ff; color: var(--brand); border-radius: 8px; padding: 6px 10px; font-size: 12px; flex: none; white-space: nowrap; margin-inline-start: 8px; }
.font-item.on small { color: rgba(255,255,255,.78); }
.font-item.on .copy { background: #fff; color: var(--brand); }

.ff-script {
  font-family: "Ma Shan Zheng", "Long Cang", "Yomogi", "Nanum Pen Script", "Caveat", "Noto Naskh Arabic", cursive;
  font-weight: 400; font-size: 24px; letter-spacing: .04em;
}
.ff-bold {
  font-family: "Noto Sans SC", "Noto Sans JP", "Noto Sans KR", "Noto Sans Arabic", "Noto Sans", sans-serif;
  font-weight: 900; letter-spacing: .03em;
}
.ff-outline {
  font-family: "Noto Sans SC", "Noto Sans JP", "Noto Sans KR", "Noto Sans Arabic", "Noto Sans", sans-serif;
  font-weight: 900;
  color: #fff;
  -webkit-text-fill-color: #fff;
  -webkit-text-stroke: 1.8px #1c1730;
  paint-order: stroke fill;
}
.font-item.on .ff-outline {
  color: var(--brand);
  -webkit-text-fill-color: var(--brand);
  -webkit-text-stroke-color: #fff;
}
.ff-bubble { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 16px; }
.bub {
  display: inline-flex; width: 1.75em; height: 1.75em; border: 2px solid #2a2340; border-radius: 50%;
  align-items: center; justify-content: center; font-style: normal; font-size: 13px; font-weight: 800;
  font-family: "ZCOOL KuaiLe", "Noto Sans SC", "Noto Sans JP", "Noto Sans KR", "Noto Sans Arabic", sans-serif;
  flex: none; line-height: 1;
}
.font-item.on .bub { border-color: #fff; color: #fff; }
.ff-small {
  font-family: "Noto Sans SC", "Noto Sans JP", "Noto Sans KR", "Noto Sans Arabic", "Noto Sans", sans-serif;
  font-size: 13px; font-weight: 800; letter-spacing: .22em; text-transform: uppercase;
  font-variant-caps: all-small-caps;
}
.ff-gothic {
  font-family: "UnifrakturCook", "Noto Serif SC", "Noto Serif JP", "Noto Serif KR", "Noto Naskh Arabic", serif;
  font-weight: 900; letter-spacing: .06em;
}

.extras { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 22px 0 20px; max-width: 420px; }
.extra { background: rgba(255,255,255,.7); border-radius: 14px; padding: 12px; text-align: start; }
.extra b { display: block; font-size: 14px; margin: 4px 0 2px; }
.extra span { color: var(--mute); font-size: 12px; line-height: 1.4; }
.photo-btn {
  display: block; width: 100%; border: 1px dashed #cfc8f0; background: #f7f5ff; border-radius: 14px;
  padding: 10px 12px; margin: 8px 0 0; text-align: start; color: var(--brand);
}
.photo-btn small { display: block; color: var(--mute); font-weight: 400; margin-top: 2px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 60; transform: translateX(-50%) translateY(8px);
  background: #2a2340; color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 13px;
  box-shadow: 0 12px 30px rgba(42, 35, 64, .28); opacity: 0; transition: opacity .25s ease, transform .25s ease;
  pointer-events: none; max-width: min(90vw, 420px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

[dir="rtl"] .gen-item:hover { transform: translateX(-2px); }
[dir="rtl"] .card-back.c1 { transform: translate(90px, -10px) rotate(14deg); }
[dir="rtl"] .card-back.c2 { transform: translate(55px, -5px) rotate(7deg); }
[dir="rtl"] .copy h1, [dir="rtl"] .copy h2 { letter-spacing: 0; line-height: 1.5; }

@media (max-width: 860px) {
  html, body { overflow: auto; height: auto; }
  .pager { transform: none !important; height: auto; }
  .page { height: auto; min-height: 100vh; padding: 88px 0 56px; display: block; }
  .wrap { grid-template-columns: 1fr; text-align: center; padding: 0 16px; gap: 24px; }
  .desc { margin: 0 auto; }
  .cta { justify-content: center; }
  .dots { display: none; }
  .card-back { display: none; }
  .page .copy, .page .stage { opacity: 1; transform: none; }
  .foot { position: static; margin-top: 28px; }
  .nav { padding: 12px 16px; background: rgba(251, 250, 255, .85); backdrop-filter: blur(10px); }
  .lang select { max-width: 110px; }
  .extras { margin-left: auto; margin-right: auto; }
  .copy h1 { font-size: 32px; }
  .studio, .kb-card, .font-card { margin: 0 auto; }
}
