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

:root {
  --bg: #0e0d12;
  --surface: #16141d;
  --surface-high: #1e1b28;
  --outline: #2b2738;
  --text: #eae6f2;
  --muted: #9c94b0;
  --accent: #c4a5fd;
  --accent-soft: rgba(196, 165, 253, 0.12);
  --on-accent: #241546;
  --radius: 28px;
  --spring: cubic-bezier(0.34, 1.4, 0.64, 1);
}

html {
  color-scheme: dark;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
}

.topbar {
  width: 100%;
  max-width: 680px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 999px;
  padding: 12px 24px;
  margin-bottom: clamp(32px, 8vh, 80px);
}

.wordmark {
  color: var(--accent);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
}

.wave {
  display: inline-block;
  transition: transform 0.4s var(--spring);
}

.wordmark:hover .wave {
  transform: rotate(14deg) scale(1.15);
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 6px 14px;
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}

.nav-link:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  transition: background 0.2s, color 0.2s, transform 0.3s var(--spring);
}

.nav-icon:hover {
  transform: scale(1.1);
}

main {
  width: 100%;
  max-width: 680px;
  flex: 1;
}

.view {
  animation: rise 0.5s var(--spring);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h1 {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 12px;
}

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

.sub {
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 28px;
  max-width: 56ch;
}

.card {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--radius);
  padding: clamp(20px, 4vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card.center {
  align-items: center;
  text-align: center;
  padding-top: 40px;
  padding-bottom: 40px;
}

.big-emoji {
  font-size: 3.5rem;
}

textarea {
  width: 100%;
  background: var(--surface-high);
  color: var(--text);
  border: 1px solid var(--outline);
  border-radius: 18px;
  padding: 16px;
  font-family: ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
  font-size: 0.95rem;
  resize: vertical;
  min-height: 140px;
  transition: border-color 0.2s;
}

textarea:focus {
  outline: none;
  border-color: var(--accent);
}

textarea::placeholder {
  color: var(--muted);
}

.options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.options-label {
  color: var(--muted);
  font-size: 0.9rem;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip span {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--outline);
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.25s var(--spring);
  user-select: none;
}

.chip span:hover {
  border-color: var(--accent);
  color: var(--text);
}

.chip input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.chip input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.3s var(--spring), background 0.2s, opacity 0.2s;
}

.btn:hover {
  transform: scale(1.03);
}

.btn:active {
  transform: scale(0.97);
}

.btn-filled {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-filled:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-tonal {
  background: var(--accent-soft);
  color: var(--accent);
}

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

.row .btn {
  flex: 1;
  min-width: 140px;
}

.link-box {
  background: var(--surface-high);
  border: 1px solid var(--accent);
  border-radius: 18px;
  padding: 16px;
  font-family: ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
  font-size: 0.9rem;
  word-break: break-all;
  color: var(--accent);
}

pre#secret-output {
  background: var(--surface-high);
  border: 1px solid var(--outline);
  border-radius: 18px;
  padding: 16px;
  font-family: ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 50vh;
  overflow-y: auto;
}

.hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 16px;
  text-align: center;
}

footer {
  width: 100%;
  max-width: 680px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 32px 0 12px;
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

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

.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 999px;
  animation: pop 0.35s var(--spring);
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(12px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@media (max-width: 480px) {
  body {
    padding: 12px;
  }
  .topbar {
    padding: 10px 20px;
  }
  .row .btn {
    flex-basis: 100%;
  }
}
