:root {
  --bg: #0d1117;
  --panel: #161b22;
  --panel-alt: #0f141b;
  --text: #e6edf3;
  --muted: #95a1ad;
  --line: #293342;
  --accent: #f4b942;
  --accent-strong: #f08c28;
  --radius: 22px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  background: #111111;
  height: 100%;
  overscroll-behavior: none;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(244, 185, 66, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(240, 140, 40, 0.16), transparent 24%),
    linear-gradient(180deg, #0a0f15 0%, #121923 100%);
}

.topbar {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding-top: 18px;
}

.topbar a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.topbar a:hover {
  color: var(--text);
}

.hero {
  padding: 28px 0 16px;
}

.hero-inner,
.page,
.info-grid,
.faq {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(320px, 1.4fr) minmax(280px, 0.8fr);
  gap: 24px;
  align-items: stretch;
}

.hero-copy,
.hero-card {
  background: rgba(22, 27, 34, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hero-copy {
  padding: 32px;
}

.hero-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(circle at top right, rgba(244, 185, 66, 0.22), transparent 38%),
    rgba(22, 27, 34, 0.82);
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 22px 0 20px;
}

.hero-points,
.hero-card-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero-points {
  display: grid;
  gap: 10px;
  color: var(--muted);
}

.hero-points li::before {
  content: "• ";
  color: var(--accent);
}

.hero-card-label {
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-card-list {
  display: grid;
  gap: 12px;
}

.hero-card-list span {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.page-links {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.page-link {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.94rem;
}

.page-link:hover,
.page-link.is-current {
  color: var(--text);
  border-color: rgba(244, 185, 66, 0.35);
}

.content {
  padding-bottom: 40px;
}

.page {
  padding: 32px 0;
  display: grid;
  grid-template-columns: minmax(320px, 440px) minmax(320px, 1fr);
  gap: 24px;
}

.page > * {
  min-width: 0;
}

.panel {
  background: rgba(22, 27, 34, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.controls {
  padding: 28px;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 12px 0 12px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.02;
}

h2,
h3 {
  margin: 0;
}

.intro {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.6;
}

.section-copy {
  margin: 10px 0 20px;
  color: var(--muted);
  line-height: 1.6;
}

.field {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.field span {
  font-size: 0.95rem;
  font-weight: 600;
}

textarea,
input[type="number"],
input[type="color"],
input[type="range"] {
  width: 100%;
}

textarea,
input[type="number"] {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
  color: var(--text);
  background: var(--panel-alt);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input[type="number"] {
  height: 50px;
}

input[type="color"] {
  height: 50px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-alt);
}

input[type="range"] {
  accent-color: var(--accent-strong);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.preset-header {
  margin-bottom: 12px;
}

.preset-header h3 {
  font-size: 1rem;
}

.preset-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.mode-header {
  margin: 8px 0 12px;
}

.theme-header {
  margin: 8px 0 12px;
}

.theme-header h3 {
  font-size: 1rem;
}

.theme-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.mode-header h3 {
  font-size: 1rem;
}

.mode-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.chip {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.chip:hover {
  border-color: rgba(244, 185, 66, 0.45);
}

.mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.theme-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.theme-chip,
.mode-chip {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.theme-chip:hover,
.mode-chip:hover {
  border-color: rgba(244, 185, 66, 0.45);
}

.theme-chip.is-active,
.mode-chip.is-active {
  color: #151515;
  background: linear-gradient(135deg, var(--accent), #ffd26f);
  border-color: transparent;
}

.toggles {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 6px 0 22px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.helper-card {
  margin: 18px 0 14px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.helper-label {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.helper-card h3 {
  margin: 10px 0 8px;
  font-size: 1.04rem;
}

.helper-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.helper-hint {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.5;
  background: rgba(244, 185, 66, 0.12);
  border: 1px solid rgba(244, 185, 66, 0.18);
}

.helper-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.qr-card {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  justify-items: start;
}

.import-panel {
  width: min(100%, 360px);
  display: grid;
  gap: 10px;
}

.import-panel[hidden] {
  display: none;
}

.import-input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
}

.import-input::placeholder {
  color: var(--muted);
}

.import-input:focus {
  outline: 2px solid rgba(244, 185, 66, 0.24);
  outline-offset: 2px;
  border-color: rgba(244, 185, 66, 0.24);
}

.feedback-footer {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  margin: 28px 0 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.feedback-footer a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.feedback-footer a:hover {
  text-decoration: underline;
}

.qr-image {
  width: 180px;
  height: 180px;
  border-radius: 14px;
  background: #ffffff;
  padding: 8px;
}

.qr-link {
  color: var(--text);
  word-break: break-all;
  text-decoration: none;
}

.qr-link:hover {
  color: var(--accent);
}

.cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 16px;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(244, 185, 66, 0.18), rgba(240, 140, 40, 0.12)),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(244, 185, 66, 0.24);
}

.cta-copy {
  display: grid;
  gap: 4px;
}

.cta-copy strong {
  font-size: 1rem;
}

.cta-copy span {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  color: #151515;
  background: linear-gradient(135deg, var(--accent), #ffd26f);
}

.cta-button {
  min-width: 220px;
  padding: 16px 22px;
  box-shadow: 0 14px 32px rgba(240, 140, 40, 0.28);
}

.button.secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tips {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.tips h2 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.tips h3 {
  font-size: 1rem;
}

.tips ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.preview-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 18px;
}

.preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 14px;
}

.status {
  color: var(--accent);
}

.preview-close {
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: rgba(17, 17, 17, 0.68);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.preview-close.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.preview {
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: 70vh;
  border-radius: calc(var(--radius) - 4px);
  background: #111111;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
}

body.is-fallback-expanded {
  overflow: hidden;
  overscroll-behavior: none;
}

.preview-panel.is-fallback-expanded {
  position: fixed;
  inset: 0;
  z-index: 9999;
  width: auto;
  height: auto;
  padding: 0;
  border-radius: 0;
  border: 0;
  background: #111111;
  overflow: hidden;
}

.preview-panel.is-fallback-expanded .preview-toolbar {
  position: absolute;
  top: max(env(safe-area-inset-top), 12px);
  right: max(env(safe-area-inset-right), 12px);
  left: auto;
  z-index: 2;
  margin-bottom: 0;
}

.preview-panel.is-fallback-expanded .preview-toolbar .status,
.preview-panel.is-fallback-expanded .preview-toolbar span:first-child {
  display: none;
}

.preview-panel.is-fallback-expanded .preview {
  position: absolute;
  inset: 0;
  min-height: 100dvh;
  height: 100dvh;
  width: 100dvw;
  padding: 0;
  border-radius: 0;
}

#preview:fullscreen,
#preview:-webkit-full-screen {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border-radius: 0;
}

#preview:fullscreen .display-text,
#preview:-webkit-full-screen .display-text {
  width: 100%;
}

#preview:fullscreen::backdrop,
#preview:-webkit-full-screen::backdrop {
  background: #111111;
}

.display-text {
  width: 100%;
  color: #ffffff;
  text-align: center;
  font-size: 96px;
  font-weight: 700;
  line-height: 1.1;
  word-break: break-word;
}

.display-text.is-mirrored {
  transform: scaleX(-1);
}

.display-text.is-neon {
  text-shadow:
    0 0 10px rgba(125, 249, 255, 0.35),
    0 0 24px rgba(125, 249, 255, 0.28),
    0 0 42px rgba(125, 249, 255, 0.22);
}

.display-text.is-glow {
  animation: glow-pulse 2.4s ease-in-out infinite;
  text-shadow:
    0 0 12px rgba(255, 255, 255, 0.22),
    0 0 26px rgba(255, 255, 255, 0.18),
    0 0 48px rgba(255, 255, 255, 0.14);
}

@keyframes glow-pulse {
  0%,
  100% {
    opacity: 0.88;
    filter: brightness(0.96);
  }

  50% {
    opacity: 1;
    filter: brightness(1.16);
  }
}

.display-text.is-blink {
  animation: blink-pulse 1.15s step-end infinite;
}

@keyframes blink-pulse {
  0%,
  44% {
    opacity: 1;
    filter: brightness(1);
  }

  45%,
  70% {
    opacity: 0.26;
    filter: brightness(0.76);
  }

  71%,
  100% {
    opacity: 1;
    filter: brightness(1.08);
  }
}

.display-text.is-gradient {
  background: linear-gradient(90deg, #ff7a18 0%, #ffd800 36%, #7df9ff 68%, #9d4edd 100%);
  color: transparent !important;
  -webkit-background-clip: text;
  background-clip: text;
}

.display-text.is-marquee {
  width: max-content;
  min-width: 100%;
  white-space: nowrap;
  animation: marquee-scroll 12s linear infinite;
}

@keyframes marquee-scroll {
  0% {
    transform: translateX(100%);
  }

  100% {
    transform: translateX(-120%);
  }
}

.display-text.is-marquee.is-mirrored {
  animation: marquee-scroll-mirror 12s linear infinite;
}

@keyframes marquee-scroll-mirror {
  0% {
    transform: translateX(-120%) scaleX(-1);
  }

  100% {
    transform: translateX(100%) scaleX(-1);
  }
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.info-card {
  padding: 24px;
  border-radius: var(--radius);
  background: rgba(22, 27, 34, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow);
}

.info-card p,
.info-card ol {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.info-card ol {
  padding-left: 20px;
}

.faq {
  padding: 24px;
}

.faq-item {
  padding: 18px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.faq-item:first-of-type {
  margin-top: 10px;
}

.faq-item h3 {
  margin-bottom: 10px;
  font-size: 1.06rem;
}

.faq-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

@media (max-width: 900px) {
  .hero-inner,
  .info-grid,
  .page {
    grid-template-columns: 1fr;
  }

  .preview {
    min-height: 52vh;
  }

  .preview-panel.is-fallback-expanded .preview {
    min-height: 100dvh;
    height: 100dvh;
  }
}

@media (max-width: 640px) {
  .topbar,
  .hero-inner,
  .page,
  .info-grid,
  .page-links,
  .faq {
    width: min(100% - 20px, 100%);
  }

  .page {
    padding: 16px 0 24px;
    gap: 16px;
  }

  .hero {
    padding-top: 16px;
  }

  .hero-copy,
  .hero-card,
  .controls,
  .preview-panel,
  .info-card,
  .faq {
    padding: 18px;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .cta-card {
    flex-direction: column;
    align-items: stretch;
  }

  .helper-card {
    padding: 16px;
  }

  .cta-button {
    width: 100%;
    min-width: 0;
  }

  h1 {
    font-size: 2rem;
  }

  .display-text {
    font-size: 72px;
  }
}
