/* GigaGlitters — 2026 redesign */
@font-face { font-family: "gg-logo"; src: url("/fonts/cream-puff.ttf") format("truetype"); font-display: swap; }

:root {
  --bg: #0c0916;
  --bg-2: #141024;
  --surface: rgba(255, 255, 255, .045);
  --surface-2: rgba(255, 255, 255, .08);
  --line: rgba(255, 255, 255, .1);
  --text: #f5f0ff;
  --muted: #a99fc6;
  --pink: #ff5ccf;
  --violet: #9d6bff;
  --cyan: #4fdcff;
  --gold: #ffd35a;
  --grad: linear-gradient(100deg, var(--pink), var(--violet) 55%, var(--cyan));
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, .6);
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  min-height: 100vh;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(255, 92, 207, .18), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(79, 220, 255, .12), transparent 60%),
    radial-gradient(700px 600px at 50% 110%, rgba(157, 107, 255, .14), transparent 60%);
}
img { max-width: 100%; height: auto; }
a { color: #ffa6e6; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #fff; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(12, 9, 22, .72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.logo {
  font-family: "gg-logo", var(--font); font-size: 30px; line-height: 1; text-decoration: none; white-space: nowrap;
  background: url("/glitters/glit15.gif"); -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: .6px rgba(255, 255, 255, .55);
  filter: brightness(1.55) saturate(1.15) drop-shadow(0 0 10px rgba(255, 92, 207, .45));
}
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-left: auto; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: 15px;
  padding: 8px 14px; border-radius: 999px; white-space: nowrap;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.lang-switch { display: inline-flex; align-items: center; gap: 2px; margin-left: 8px; padding-left: 10px; border-left: 1px solid var(--line); }
.lang-switch a { padding: 6px 8px; font-size: 13px; font-weight: 600; }
.lang-switch a[aria-current="true"] { color: var(--text); background: var(--surface-2); }
.font-warn { margin-top: 8px; font-size: 13px; color: #ffcf7a; }
.font-opt .ok { color: #7ee2a8; font-size: 11px; }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
@media (max-width: 860px) {
  .site-header .wrap { flex-wrap: wrap; gap: 0; padding-top: 10px; }
  .nav { width: 100%; margin: 6px -8px 8px; }
}

/* ---------- buttons & inputs ---------- */
.btn {
  --b: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 15px/1 var(--font); color: var(--text); text-decoration: none;
  padding: 12px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--b);
  cursor: pointer; transition: transform .15s, background .15s, box-shadow .15s; white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, .14); color: var(--text); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary {
  border: 0; background: var(--grad); color: #16081f; font-weight: 700; font-size: 17px; padding: 16px 28px;
  box-shadow: 0 10px 30px -8px rgba(255, 92, 207, .6);
}
.btn-primary:hover { background: var(--grad); color: #16081f; box-shadow: 0 14px 36px -8px rgba(157, 107, 255, .8); }
.btn-sm { padding: 8px 12px; font-size: 14px; }
.btn svg { width: 18px; height: 18px; flex: none; }

label.field { display: block; margin-bottom: 18px; }
.field-label { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
.field-label output { font-weight: 600; color: var(--text); text-transform: none; letter-spacing: 0; }
input[type="text"], textarea, select {
  width: 100%; font: 500 18px/1.3 var(--font); color: var(--text);
  background: rgba(0, 0, 0, .35); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 16px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input[type="text"]:focus, textarea:focus, select:focus { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(157, 107, 255, .25); }
input[type="range"] { width: 100%; accent-color: var(--pink); height: 28px; }

/* ---------- hero ---------- */
.hero { padding: 40px 0 18px; text-align: center; }
.hero p { color: var(--muted); font-size: clamp(1rem, 2vw, 1.2rem); max-width: 680px; margin: 0 auto; }
.pill { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 600; color: var(--muted); padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 16px; }

/* ---------- studio ---------- */
.studio {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); gap: 20px;
  margin: 24px auto 60px; align-items: start;
}
@media (max-width: 900px) { .studio { grid-template-columns: minmax(0, 1fr); } }
.studio > * { min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stage { padding: 14px; position: sticky; top: 80px; }
@media (max-width: 900px) { .stage { position: static; } }
.stage-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.stage-bar .hint { font-size: 13px; color: var(--muted); }
.bg-toggle { display: flex; gap: 6px; }
.bg-toggle button { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; padding: 0; }
.bg-toggle button[aria-pressed="true"] { border-color: #fff; }
.checker, .bg-toggle .checker {
  background-color: #fff;
  background-image: linear-gradient(45deg, #e6e3ee 25%, transparent 25%), linear-gradient(-45deg, #e6e3ee 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e6e3ee 75%), linear-gradient(-45deg, transparent 75%, #e6e3ee 75%);
  background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}
.preview {
  position: relative; min-height: 260px; border-radius: 14px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: #1b1630;
  transition: background-color .2s;
}
.preview.bg-dark { background: #1b1630; }
.preview.bg-light { background: #fff; }
.preview.loading::after {
  content: ""; position: absolute; top: 12px; right: 12px; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .3); border-top-color: var(--pink); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.pv { flex: none; display: grid; white-space: pre; line-height: 1.25; transform-origin: center; will-change: transform; }
.pv > span { grid-area: 1 / 1; padding: .12em .2em; position: relative; }
.pv-shadow { color: #000; }
.pv-back { color: #000; }
.pv-front {
  color: transparent; -webkit-background-clip: text; background-clip: text;
  background-repeat: repeat;
}
.stage-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.stage-actions .btn-primary { flex: 1; }

.controls { padding: 22px; }
.controls h2 { font-size: 1.1rem; margin-bottom: 16px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.font-current {
  width: 100%; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: rgba(0, 0, 0, .35); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 14px; color: var(--text); cursor: pointer; font: inherit;
}
.font-current:hover { border-color: var(--violet); }
.font-sprite { display: block; width: 280px; height: 40px; max-width: 100%; background: url("/assets/img/fonts-sprite.png") no-repeat; background-size: 280px auto; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chip {
  font: 600 13px/1 var(--font); color: var(--muted); padding: 7px 11px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); cursor: pointer; display: inline-flex; gap: 6px; align-items: center;
}
.chip i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.chip[aria-pressed="true"] { color: var(--text); border-color: rgba(255, 255, 255, .5); background: var(--surface-2); }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 6px; max-height: 190px; overflow-y: auto; padding: 2px; scrollbar-width: thin; }
.sw {
  aspect-ratio: 2 / 1; border-radius: 8px; border: 2px solid transparent; cursor: pointer; padding: 0;
  background-color: #2a2340; background-size: cover; outline: none;
}
.sw:hover { transform: scale(1.05); }
.sw[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 0 3px var(--violet); }
.colors { display: flex; gap: 8px; flex-wrap: wrap; }
.color-dot { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; padding: 0; }
.color-dot[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 0 3px var(--violet); }
.cap-swatches { grid-template-columns: repeat(5, 1fr); max-height: none; }
.cap-swatches .sw { aspect-ratio: auto; height: 40px; }
/* touch screens: bigger tap targets (≥40px) */
@media (pointer: coarse) {
  .swatches { grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; max-height: 232px; }
  .sw { aspect-ratio: auto; height: 42px; }
  .cap-swatches { grid-template-columns: repeat(5, 1fr); }
  .color-dot { width: 40px; height: 40px; }
  .colors { gap: 10px; }
  .chip { padding: 9px 12px; }
  .bg-toggle button { width: 34px; height: 34px; }
}
@media (max-width: 520px) {
  .row2:has(.colors) { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.toggle input { width: 20px; height: 20px; accent-color: var(--pink); }

/* font picker sheet */
.sheet { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(5, 3, 12, .7); backdrop-filter: blur(6px); }
.sheet[hidden] { display: none; }
.sheet-panel { width: min(760px, 100%); max-height: min(720px, 90vh); display: flex; flex-direction: column; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.sheet-head { display: flex; gap: 10px; align-items: center; padding: 14px; border-bottom: 1px solid var(--line); }
.sheet-head input { font-size: 16px; padding: 10px 14px; }
.font-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; padding: 14px; overflow-y: auto; }
.font-opt { background: var(--surface); border: 1px solid transparent; border-radius: 10px; padding: 10px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; color: var(--muted); font: 12px var(--font); }
.font-opt .font-sprite { width: 210px; height: 30px; background-size: 210px auto; }
.font-opt:hover { background: var(--surface-2); }
.font-opt[aria-pressed="true"] { border-color: var(--pink); }

/* result */
.result { margin-top: 16px; padding: 18px; border-radius: 16px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); animation: pop .35s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }
.result-img { display: grid; place-items: center; padding: 18px; border-radius: 12px; margin-bottom: 14px; overflow: auto; }
.result-img img { display: block; image-rendering: auto; }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.social { display: flex; flex-wrap: wrap; gap: 6px; }
.codes-tabs { display: flex; gap: 4px; margin-bottom: 8px; flex-wrap: wrap; }
.codes-tabs button { font: 600 13px var(--font); color: var(--muted); background: none; border: 0; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.codes-tabs button[aria-selected="true"] { color: var(--text); background: var(--surface-2); }
.code-box { display: flex; gap: 8px; }
.code-box textarea { font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; min-height: 64px; resize: vertical; padding: 10px 12px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; background: #fff; color: #16081f; font-weight: 600; padding: 10px 18px; border-radius: 999px; box-shadow: var(--shadow); animation: pop .25s ease; }
.error-msg { color: #ff8fa3; font-weight: 500; margin-top: 10px; }

/* ---------- content sections ---------- */
.section { padding: 56px 0; }
.section-head { max-width: 720px; margin-bottom: 28px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 16px; }
.step { padding: 22px; }
.step b { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--grad); color: #16081f; margin-bottom: 12px; }
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.6em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }
.faq details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--pink); font-size: 1.4rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); margin: 10px 0 0; }

.gif-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 14px; }
.gif-card { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.gif-card .gif-img { display: grid; place-items: center; min-height: 110px; border-radius: 12px; background: #1b1630; padding: 12px; }
.gif-card .gif-img img { max-height: 120px; width: auto; }
.gif-card .actions { display: flex; flex-wrap: wrap; gap: 6px; }
.gif-card .actions .btn { flex: 1 1 auto; padding: 8px 10px; font-size: 13px; }
.gif-card .codes { display: none; }
.gif-card.open .codes { display: block; }
.phrase-card { text-decoration: none; color: var(--text); padding: 16px; display: flex; flex-direction: column; gap: 10px; transition: transform .15s, border-color .15s; }
.phrase-card:hover { transform: translateY(-3px); border-color: rgba(255, 255, 255, .25); color: var(--text); }
.phrase-card .gif-img { display: grid; place-items: center; height: 110px; border-radius: 12px; background: #1b1630; padding: 10px; overflow: hidden; }
.phrase-card .gif-img img { max-height: 90px; width: auto; }
.links-row { display: flex; flex-wrap: wrap; gap: 8px; }

.cta { text-align: center; padding: 42px 24px; margin: 20px 0 60px; background: linear-gradient(135deg, rgba(255, 92, 207, .16), rgba(79, 220, 255, .1)); }
.cta p { color: var(--muted); }

/* sparkle text */
.sparkle-list { display: grid; gap: 10px; }
.sparkle-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.sparkle-item .out { flex: 1; font-size: 20px; overflow-wrap: anywhere; font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "Apple Symbols", var(--font); }
.sparkle-item small { display: block; color: var(--muted); font-size: 12px; }
.symbols { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.symbols button { font-size: 20px; aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.symbols button:hover { background: var(--surface-2); }
.symbols button.flash { background: var(--pink); color: #16081f; }
.sparkle-layout { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 40px; }
.sparkle-side { position: sticky; top: 80px; }
.symbols-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.symbols-hint { font-size: 13px; margin: 0 0 10px; }
.seg { display: inline-flex; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.seg button { font: 600 12px var(--font); color: var(--muted); background: none; border: 0; border-radius: 999px; padding: 5px 10px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); }
@media (max-width: 860px) {
  .sparkle-layout { grid-template-columns: minmax(0, 1fr); }
  .sparkle-side { position: static; padding: 14px; }
  .sparkle-side .symbols { display: flex; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .sparkle-side .symbols::-webkit-scrollbar { display: none; }
  .sparkle-side .symbols button { flex: 0 0 42px; height: 42px; }
  .sparkle-side .symbols-hint { display: none; }
}

/* photo maker */
.drop {
  display: grid; place-items: center; text-align: center; gap: 8px; min-height: 280px; padding: 24px; border-radius: 14px;
  border: 2px dashed rgba(255, 255, 255, .22); background: rgba(0, 0, 0, .25); cursor: pointer; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--pink); background: rgba(255, 92, 207, .08); }
.drop img { max-height: 420px; border-radius: 10px; }
.style-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.style-opts button { padding: 12px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; font: 600 13px var(--font); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.style-opts button span { font-size: 22px; }
.style-opts button[aria-pressed="true"] { border-color: var(--pink); background: var(--surface-2); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0 48px; color: var(--muted); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 20px 40px; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.ad-slot { margin: 24px auto; text-align: center; min-height: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
