:root {
  /* Joyful game palette */
  --bg: #fff5eb;
  --paper: #ffffff;
  --elevated: #ffffff;
  --ink: #1a1040;
  --studio: #2d1b69;
  --studio-panel: #3d2a7a;
  --fg: #1a1040;
  --muted: #5c4d7a;
  --subtle: #8b7aa8;
  --accent: #ff4d8d;
  --accent-fg: #ffffff;
  --record: #ff3b5c;
  --success: #00c2a8;
  --border: #ffd6e8;
  --studio-fg: #fff8fc;
  --studio-muted: #d4b8ff;
  --studio-line: #5a3d9e;
  --fun-yellow: #ffd166;
  --fun-blue: #4cc9f0;
  --fun-purple: #7b5cff;
  --fun-orange: #ff8c42;
  --fun-lime: #b5e548;
  --font-display: "Newsreader", "Iowan Old Style", "Times New Roman", serif;
  --font-sans: "Figtree", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --radius-sm: 0.65rem;
  --radius-md: 0.9rem;
  --radius-lg: 1.15rem;
  --radius-xl: 1.6rem;
  --shadow: 0 0 0 2px rgba(255, 77, 141, 0.12), 0 4px 14px -6px rgba(45, 27, 105, 0.18);
  --shadow-hover: 0 0 0 2px rgba(255, 77, 141, 0.22), 0 12px 28px -12px rgba(45, 27, 105, 0.28);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(255, 209, 102, 0.35), transparent 50%),
    radial-gradient(ellipse 70% 45% at 95% 5%, rgba(76, 201, 240, 0.28), transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(255, 77, 141, 0.12), transparent 55%),
    var(--bg);
  color: var(--fg);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  text-wrap: balance;
  font-weight: 600;
  line-height: 1.2;
}

p { text-wrap: pretty; }

a { color: var(--accent); }
a:hover { opacity: 0.85; }

button:not(:disabled), [role="button"]:not(:disabled) { cursor: pointer; }
button:disabled { opacity: 0.4; cursor: not-allowed; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 245, 235, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--border);
}
.header-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--studio);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.brand span {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-left: 0.5rem;
  font-weight: 700;
}
.nav-desktop {
  display: none;
  gap: 1.5rem;
  list-style: none;
}
.nav-desktop a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
}
.nav-desktop a:hover { color: var(--fg); }
.header-actions { display: flex; align-items: center; gap: 0.35rem; position: relative; }
.icon-btn {
  background: transparent;
  border: none;
  color: var(--fg);
  min-height: 2.75rem;
  min-width: 2.75rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
}
.icon-btn:hover { background: rgba(255, 77, 141, 0.12); }
.lang-menu, .mobile-nav {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  background: var(--elevated);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hover);
  padding: 0.5rem;
  min-width: 11rem;
  z-index: 50;
}
.lang-menu.open, .mobile-nav.open { display: block; }
.lang-menu a, .mobile-nav a {
  display: block;
  padding: 0.65rem 0.85rem;
  text-decoration: none;
  color: var(--muted);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}
.lang-menu a:hover, .mobile-nav a:hover,
.lang-menu a.active, .mobile-nav a.active {
  background: var(--bg);
  color: var(--fg);
}
.mobile-toggle { display: inline-flex; }
@media (min-width: 768px) {
  .nav-desktop { display: flex; }
  .mobile-toggle { display: none; }
  .lang-label { display: inline; }
}
.lang-label { display: none; }
.icon-btn#lang-btn { color: var(--studio); font-weight: 600; }

/* Layout */
.wrap {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem;
  width: 100%;
}
.wrap-narrow { max-width: 48rem; margin: 0 auto; padding: 0 1rem; }
main { flex: 1; }

/* Hero */
.hero {
  padding: 2.5rem 0 0.5rem;
}
.hero-kicker {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--studio);
  background: linear-gradient(90deg, var(--fun-yellow), #ffe8a8);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  box-shadow: 0 2px 0 rgba(255, 140, 66, 0.35);
}
.hero h1 {
  margin-top: 1rem;
  font-size: clamp(2.1rem, 4.5vw, 3.15rem);
  letter-spacing: -0.02em;
  max-width: 40rem;
  background: linear-gradient(120deg, var(--studio) 0%, #5a3d9e 40%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-lede {
  margin-top: 1rem;
  max-width: 36rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

/* Studio */
.studio {
  background:
    radial-gradient(circle at 15% 10%, rgba(123, 92, 255, 0.45), transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(255, 77, 141, 0.35), transparent 45%),
    linear-gradient(160deg, #2d1b69 0%, #1e1250 55%, #3a1870 100%);
  color: var(--studio-fg);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  margin: 2rem 0;
  box-shadow:
    0 0 0 3px rgba(255, 209, 102, 0.35),
    0 16px 40px -16px rgba(45, 27, 105, 0.55);
}
@media (min-width: 640px) { .studio { padding: 1.5rem; } }
.studio-head {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
@media (min-width: 640px) {
  .studio-head {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }
}
.studio-kicker {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--studio-muted);
}
.studio-head h2 {
  margin-top: 0.25rem;
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  color: var(--studio-fg);
}
.studio-how {
  max-width: 22rem;
  font-size: 0.875rem;
  color: var(--studio-muted);
  line-height: 1.5;
}
.mode-chips {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  margin-bottom: 1rem;
  scrollbar-width: thin;
}
.mode-chip {
  flex-shrink: 0;
  border: none;
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  font-size: 0.875rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.12);
  color: var(--studio-muted);
  transition: background 0.15s var(--ease), color 0.15s var(--ease), transform 0.15s var(--ease);
}
.mode-chip:hover { color: var(--studio-fg); background: rgba(255, 255, 255, 0.2); }
.mode-chip.active {
  background: linear-gradient(135deg, var(--fun-yellow), #ffb703);
  color: #1a1040;
  box-shadow: 0 3px 0 rgba(255, 140, 66, 0.55);
  transform: translateY(-1px);
}
.studio-blurb {
  font-size: 0.9rem;
  color: var(--studio-muted);
  margin-bottom: 1.15rem;
  line-height: 1.55;
}
.hint-box {
  background: var(--studio-panel);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.15rem;
  font-size: 0.875rem;
  color: var(--studio-muted);
}
.hint-box label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--studio-muted);
}
.hint-box select {
  margin-top: 0.5rem;
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--studio-line);
  background: var(--studio);
  color: var(--studio-fg);
  padding: 0.75rem;
  font-size: 0.875rem;
}
.hint-box .mono {
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.rate-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.15rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--studio-muted);
}
.rate-btn {
  border: none;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  background: var(--studio-panel);
  color: var(--studio-muted);
}
.rate-btn.active {
  background: var(--studio-fg);
  color: var(--studio);
}
.decks {
  display: grid;
  gap: 1rem;
}
.decks.duel { grid-template-columns: 1fr; }
@media (min-width: 900px) {
  .decks.duel { grid-template-columns: 1fr 1fr; }
}
.deck {
  background: var(--studio-panel);
  border-radius: var(--radius-lg);
  padding: 1rem;
}
.deck-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.deck-top h3 {
  font-size: 1.1rem;
  color: var(--studio-fg);
}
.step {
  border-left: 2px solid var(--studio-line);
  padding-left: 0.75rem;
  margin-bottom: 1rem;
}
.step-title {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--studio-fg);
}
.wave {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  height: 3.5rem;
  background: var(--studio);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  overflow: hidden;
}
.wave span {
  flex: 1;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--fun-blue), var(--fun-purple));
  min-height: 10%;
  height: 12%;
  opacity: 0.7;
  transition: height 0.06s linear;
  will-change: height;
}
.wave.live span {
  background: linear-gradient(180deg, #ff3b5c, #ffd166);
  opacity: 1;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  padding: 0 1rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--font-sans);
  transition: opacity 0.15s var(--ease), transform 0.15s var(--ease);
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: var(--accent-fg); box-shadow: 0 3px 0 #c2185b; }
.btn-studio {
  background: linear-gradient(135deg, var(--fun-yellow), #ffb703);
  color: #1a1040;
  font-weight: 700;
  box-shadow: 0 3px 0 rgba(255, 140, 66, 0.55);
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  color: var(--studio-fg);
  border: 1.5px solid rgba(255, 255, 255, 0.28);
}
.btn-record {
  background: linear-gradient(135deg, #ff3b5c, #ff6b6b);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 3px 0 #c62828;
}
.btn-success {
  background: linear-gradient(135deg, #00c2a8, #2dd4bf);
  color: #042f2e;
  font-weight: 700;
  box-shadow: 0 3px 0 #0f766e;
}
.btn-paper {
  background: var(--paper);
  color: var(--fg);
  box-shadow: var(--shadow);
}
.btn-accent {
  background: linear-gradient(135deg, var(--accent), #ff7eb3);
  color: var(--accent-fg);
  font-weight: 700;
  box-shadow: 0 3px 0 #c2185b;
}
audio {
  width: 100%;
  margin-top: 0.75rem;
  height: 2.25rem;
}
.compare {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}
@media (min-width: 640px) {
  .compare { grid-template-columns: 1fr 1fr; }
}
.compare-item {
  background: var(--studio);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}
.compare-item p {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--studio-muted);
  margin-bottom: 0.5rem;
}
.mic-banner {
  margin-top: 1.15rem;
  border: 1px solid var(--studio-line);
  background: var(--studio-panel);
  border-radius: var(--radius-md);
  padding: 1rem;
}
.mic-banner p { font-size: 0.875rem; color: var(--studio-muted); margin-top: 0.35rem; }
.mic-banner .btn { margin-top: 0.75rem; }

/* Content sections */
.section {
  padding: 3.5rem 0 0;
}
.section h2 {
  font-size: clamp(1.6rem, 3vw, 2rem);
  margin-bottom: 1.25rem;
}
.prose {
  max-width: 42rem;
  color: var(--muted);
  line-height: 1.7;
}
.prose p + p { margin-top: 1rem; }
.prose a { font-weight: 500; }
.grid-2 {
  display: grid;
  gap: 1rem;
}
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
}
.card {
  background: var(--paper);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  background-image:
    linear-gradient(var(--paper), var(--paper)),
    linear-gradient(135deg, #ffd166, #ff4d8d, #4cc9f0, #7b5cff);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}
.card h3 {
  font-size: 1.15rem;
  margin-top: 0.5rem;
  color: var(--studio);
}
.card p {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}
.card .num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
}
.links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
}
.faq {
  background: var(--paper);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-q {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--fg);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-sans);
}
.faq-a {
  display: none;
  padding: 0 1.25rem 1rem;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
}
.faq-item.open .faq-a { display: block; }

/* Article pages */
.article {
  padding: 3rem 0 4rem;
}
.article-kicker {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}
.article h1 {
  margin-top: 0.75rem;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.02em;
}
.article-lede {
  margin-top: 1.15rem;
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1.65;
}
.article-meta {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--subtle);
}
.article-body {
  margin-top: 2.5rem;
  line-height: 1.7;
  color: var(--fg);
}
.article-body h2 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-size: 1.4rem;
}
.article-body p + p { margin-top: 1rem; }
.article-body ul {
  margin: 1rem 0 1rem 1.25rem;
}
.article-body li { margin-bottom: 0.5rem; color: var(--muted); }
.article-body .mode-block {
  background: var(--paper);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  margin-top: 1.25rem;
}
.article-body .mode-block h2 { margin-top: 0.25rem; }
.article-body .mode-block .id {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

/* Contact form */
.form-grid {
  display: grid;
  gap: 2.5rem;
}
@media (min-width: 900px) {
  .form-grid { grid-template-columns: 1.2fr 0.8fr; }
}
.form-card label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 1rem;
}
.form-card label:first-child { margin-top: 0; }
.form-card input,
.form-card textarea {
  margin-top: 0.5rem;
  width: 100%;
  border: 1px solid var(--border);
  background: var(--elevated);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  color: var(--fg);
}
.form-card textarea { min-height: 8rem; resize: vertical; }
.form-status {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--muted);
}

/* Footer */
.site-footer {
  margin-top: 5rem;
  background:
    radial-gradient(circle at 20% 0%, rgba(123, 92, 255, 0.35), transparent 50%),
    linear-gradient(180deg, #1a1040 0%, #0f0a28 100%);
  color: var(--studio-fg);
  border-top: 3px solid var(--accent);
}
.footer-grid {
  max-width: 72rem;
  margin: 0 auto;
  padding: 3.5rem 1rem;
  display: grid;
  gap: 2.5rem;
}
@media (min-width: 640px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1024px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}
.footer-brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
}
.footer-brand + p {
  margin-top: 0.75rem;
  max-width: 24rem;
  font-size: 0.875rem;
  color: var(--studio-muted);
  line-height: 1.6;
}
.footer-col h4 {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--studio-muted);
  font-weight: 600;
}
.footer-col ul {
  list-style: none;
  margin-top: 1rem;
}
.footer-col a {
  color: var(--studio-fg);
  text-decoration: none;
  font-size: 0.875rem;
  display: inline-block;
  margin-bottom: 0.5rem;
}
.footer-col a:hover { opacity: 0.8; }
.footer-bottom {
  border-top: 1px solid var(--studio-line);
  padding: 1.5rem 1rem;
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--studio-muted);
}
@media (min-width: 640px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}
.footer-langs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.footer-langs a {
  color: var(--studio-muted);
  text-decoration: none;
}
.footer-langs a:hover { color: var(--studio-fg); }

/* Cookie notice */
.cookie {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 60;
  padding: 1rem;
  display: none;
}
.cookie.show { display: block; }
.cookie-inner {
  max-width: 48rem;
  margin: 0 auto;
  background: var(--ink);
  color: var(--studio-fg);
  border-radius: var(--radius-xl);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow-hover);
}
@media (min-width: 640px) {
  .cookie-inner {
    flex-direction: row;
    align-items: center;
  }
}
.cookie-inner p {
  flex: 1;
  font-size: 0.875rem;
  color: var(--studio-muted);
  line-height: 1.55;
}
.cookie-inner a { color: var(--studio-fg); }

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