:root {
  --bg: #0b0a10;
  --surface: #13121a;
  --surface-2: #1a1824;
  --surface-3: #211e2d;
  --text: #f7f5ff;
  --muted: #aaa6ba;
  --line: rgba(255, 255, 255, 0.09);
  --accent: #8b5cf6;
  --accent-2: #ec4899;
  --accent-soft: rgba(139, 92, 246, 0.16);
  --ok: #34d399;
  --warn: #f59e0b;
  --danger: #fb7185;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
  --shell: min(1180px, calc(100vw - 40px));
  --topbar: 76px;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  line-height: 1.55;
  background: radial-gradient(circle at 80% -10%, rgba(139, 92, 246, 0.16), transparent 34%), var(--bg);
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid rgba(196, 181, 253, 0.55);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: -80px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff;
  color: #111;
}
.skip-link:focus { top: 12px; }
.shell { width: var(--shell); margin-inline: auto; }
.view { display: none; padding-top: 46px; padding-bottom: 90px; }
.view.is-active { display: block; }
.view#view-home { padding-top: 0; }
.view#view-play { padding: 0; min-height: calc(100vh - var(--topbar)); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar);
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 max(20px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(11, 10, 16, 0.84);
  backdrop-filter: blur(18px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--text);
}
.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  font-weight: 900;
  letter-spacing: -0.06em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.35);
}
.brand strong { display: block; font-size: 17px; line-height: 1.05; }
.brand small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.desktop-nav { display: flex; gap: 4px; margin-right: auto; }
.desktop-nav button, .mobile-nav button {
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--muted);
}
.desktop-nav button { min-height: 44px; padding: 10px 12px; }
.desktop-nav button:hover, .desktop-nav button.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.top-actions { display: flex; gap: 8px; }

.primary-button, .secondary-button, .ghost-button {
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 13px;
  font-weight: 800;
  transition: 0.2s transform, 0.2s background, 0.2s border-color, 0.2s filter;
}
.primary-button {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  box-shadow: 0 10px 26px rgba(139, 92, 246, 0.24);
}
.primary-button:hover { transform: translateY(-1px); filter: brightness(1.06); }
.secondary-button { color: #111; background: #fff; }
.secondary-button:hover { background: #eceaf3; }
.ghost-button { color: var(--text); background: transparent; border-color: var(--line); }
.ghost-button:hover { background: rgba(255, 255, 255, 0.05); }
.large { min-height: 52px; padding-inline: 22px; }
.full { width: 100%; }

.hero {
  min-height: 620px;
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  align-items: center;
  gap: 64px;
  padding-top: 48px;
  padding-bottom: 40px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #c4b5fd;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.15em;
}
.hero h1, .page-heading h1 {
  margin: 13px 0 20px;
  line-height: 1.02;
  letter-spacing: -0.055em;
}
.hero h1 { font-size: clamp(48px, 6vw, 84px); }
.hero h1 span {
  color: transparent;
  background: linear-gradient(90deg, #c4b5fd, #f9a8d4);
  background-clip: text;
  -webkit-background-clip: text;
}
.hero-copy > p { max-width: 660px; color: var(--muted); font-size: 18px; }
.hero-actions { display: flex; gap: 10px; margin-top: 30px; }
.trust-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.trust-row span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: #d6d3e1;
  font-size: 12px;
}
.hero-demo { position: relative; }
.hero-demo::before {
  content: "";
  position: absolute;
  inset: 8% 12%;
  background: var(--accent);
  filter: blur(80px);
  opacity: 0.22;
}
.demo-stack {
  position: relative;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(22, 20, 31, 0.86);
  box-shadow: var(--shadow);
  transform: rotate(1.2deg);
}
.demo-card {
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(160deg, #242132, #181620);
}
.demo-card small { color: #a78bfa; font-weight: 900; letter-spacing: 0.12em; }
.demo-card strong { font-size: 17px; }
.demo-card span { color: var(--muted); }
.demo-source { min-height: 140px; }
.demo-source strong { font-size: 22px; }
.compile-arrow { padding: 13px; text-align: center; color: #8f8a9d; font-size: 10px; font-weight: 900; letter-spacing: 0.18em; }
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.demo-card.featured { border-color: rgba(167, 139, 250, 0.3); background: linear-gradient(145deg, rgba(139, 92, 246, 0.28), rgba(236, 72, 153, 0.12)); }

.section-block { padding: 42px 0; }
.section-heading, .page-heading.split { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.section-heading { margin-bottom: 20px; }
.section-heading h2 { margin: 5px 0; font-size: 32px; letter-spacing: -0.04em; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.feature-card {
  min-height: 245px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  transition: 0.2s transform, 0.2s border-color, 0.2s background;
}
.feature-card:hover { transform: translateY(-3px); border-color: rgba(167, 139, 250, 0.35); background: var(--surface-2); }
.feature-card.accent { background: linear-gradient(145deg, rgba(139, 92, 246, 0.16), rgba(236, 72, 153, 0.08)), var(--surface); }
.feature-icon { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 30px; border-radius: 15px; background: var(--accent-soft); font-size: 28px; }
.feature-card strong { font-size: 23px; letter-spacing: -0.03em; }
.feature-card p { margin-bottom: auto; color: var(--muted); }
.text-link { color: #c4b5fd; font-weight: 800; }

.sample-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.sample-grid.large { grid-template-columns: repeat(3, 1fr); }
.sample-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.sample-art { height: 135px; display: flex; align-items: flex-end; padding: 16px; background: linear-gradient(150deg, var(--card-a, #312e81), var(--card-b, #831843)); font-size: 38px; }
.sample-body { padding: 17px; }
.sample-body small { color: #a7a3b4; }
.sample-body h3 { margin: 5px 0 7px; font-size: 18px; letter-spacing: -0.03em; }
.sample-body p { min-height: 42px; color: var(--muted); font-size: 13px; }
.sample-actions { display: flex; gap: 7px; margin-top: 15px; }
.sample-actions button { flex: 1; min-height: 42px; padding: 0 10px; border-radius: 11px; font-size: 12px; }

.page-heading { padding: 12px 0 32px; }
.page-heading h1 { margin-bottom: 12px; font-size: 52px; }
.page-heading p { max-width: 720px; margin: 0; color: var(--muted); }
.toolbar { display: flex; gap: 10px; margin-bottom: 22px; }
.search-box { flex: 1; display: flex; align-items: center; gap: 9px; padding: 0 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.search-box input { width: 100%; height: 46px; border: 0; outline: 0; background: transparent; color: var(--text); }
select, input, textarea { border: 1px solid var(--line); border-radius: 12px; outline: none; background: #0f0e15; color: var(--text); }
select { height: 46px; padding: 0 38px 0 14px; }
input[type="color"] { min-height: 46px; padding: 4px; }

.meme-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.meme-card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.meme-card-top { display: flex; justify-content: space-between; gap: 16px; }
.meme-card h2 { margin: 8px 0; font-size: 23px; letter-spacing: -0.04em; }
.meme-card p { color: var(--muted); }
.card-footnote { font-size: 12px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 5px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); color: #c9c6d3; font-size: 11px; }
.risk-low { color: #6ee7b7; }
.risk-mid { color: #fbbf24; }
.structure-box { margin-top: 16px; padding: 15px; border: 1px solid rgba(139, 92, 246, 0.16); border-radius: 14px; background: rgba(139, 92, 246, 0.08); }
.structure-box small { display: block; margin-bottom: 5px; color: #a78bfa; font-weight: 800; }
.meme-card-actions { display: flex; gap: 8px; margin-top: 16px; }
.meme-card-actions button { flex: 1; }

.format-tabs { width: max-content; display: flex; gap: 6px; margin-bottom: 18px; padding: 5px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.format-tabs button { min-height: 42px; padding: 10px 15px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 800; }
.format-tabs button[aria-selected="true"] { background: #fff; color: #111; }
.studio-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 0.78fr); gap: 16px; }
.editor-panel, .preview-panel, .form-card, .side-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.editor-panel { padding: 22px; }
.preview-panel { position: sticky; top: calc(var(--topbar) + 18px); align-self: start; padding: 16px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 3px 2px 14px; }
.studio-preview { min-height: 480px; display: grid; place-items: center; overflow: hidden; border-radius: 18px; background: #f4f1fb; color: #17131f; }
.preview-actions { display: flex; gap: 8px; margin-top: 12px; }
.preview-actions button { flex: 1; }
.editor-group { display: grid; gap: 13px; }
.editor-group label, .form-card label { display: grid; gap: 7px; color: #d8d5e2; font-size: 13px; font-weight: 750; }
.editor-group input, .editor-group textarea, .form-card input, .form-card textarea { width: 100%; padding: 11px 12px; }
.editor-group textarea, .form-card textarea { resize: vertical; }
.hint { margin: 0; color: var(--muted); font-size: 12px; }
.status-badge { padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 900; }
.status-badge.ok { background: rgba(52, 211, 153, 0.12); color: #6ee7b7; }
.status-badge.warn { background: rgba(245, 158, 11, 0.12); color: #fbbf24; }

.twocut-preview { width: 100%; height: 100%; display: grid; grid-template-rows: 1fr 1fr; }
.twocut-panel { min-height: 240px; display: flex; flex-direction: column; justify-content: flex-end; padding: 30px; }
.twocut-panel:first-child { background: #e9e5ff; }
.twocut-panel:last-child { background: #201c2e; color: #fff; }
.twocut-label { font-size: 14px; font-weight: 900; opacity: 0.65; }
.twocut-text { font-size: clamp(24px, 4vw, 42px); font-weight: 950; line-height: 1.12; letter-spacing: -0.05em; overflow-wrap: anywhere; }
.chat-preview { width: 100%; min-height: 480px; display: flex; flex-direction: column; justify-content: flex-end; gap: 12px; padding: 26px 18px; background: #ebe7f2; }
.chat-bubble { max-width: 78%; padding: 12px 15px; border-radius: 18px; background: #fff; box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06); overflow-wrap: anywhere; }
.chat-bubble.me { align-self: flex-end; background: #7c3aed; color: #fff; }
.chat-bubble small { display: block; margin-bottom: 3px; opacity: 0.58; }
.chat-system { text-align: center; color: #7a7389; font-size: 12px; }
.post-preview { width: 100%; min-height: 480px; padding: 34px; background: #fcfbff; }
.post-preview .post-card { padding: 24px; border: 1px solid #dcd7e5; border-radius: 18px; background: #fff; box-shadow: 0 10px 30px rgba(40, 30, 60, 0.07); }
.post-preview h3 { margin: 0 0 12px; font-size: 25px; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.post-preview p { font-size: 19px; white-space: pre-wrap; overflow-wrap: anywhere; }
.post-meta { margin-top: 24px; color: #837b91; font-size: 13px; }

.builder-heading-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.builder-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.builder-editor { display: grid; gap: 14px; }
.form-card { padding: 22px; }
.card-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.card-heading strong { display: block; font-size: 18px; }
.card-heading small { display: block; color: var(--muted); }
.step-number { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 32px; border-radius: 10px; background: var(--accent-soft); color: #c4b5fd; font-weight: 900; }
.form-grid { display: grid; gap: 10px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.form-card > label, .form-card .form-grid { margin-bottom: 13px; }
.scene-block { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.scene-block:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.scene-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.scene-head strong { color: #c4b5fd; }
.scene-head small { color: var(--muted); text-align: right; }
.choice-row { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 80px); gap: 7px; margin-top: 8px; }
.choice-row input { min-width: 0; min-height: 44px; padding: 8px; }
.choice-row input[type="number"] { text-align: center; }
.builder-side { min-width: 0; }
.sticky-card { position: sticky; top: calc(var(--topbar) + 18px); padding: 18px; }
.check-list { display: grid; gap: 8px; margin: 5px 0 16px; }
.check-item { display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: 12px; }
.check-item::before { content: "✓"; width: 20px; height: 20px; display: grid; place-items: center; flex: 0 0 20px; border-radius: 50%; background: rgba(52, 211, 153, 0.12); color: #6ee7b7; font-weight: 900; }
.check-item.warn::before { content: "!"; background: rgba(245, 158, 11, 0.12); color: #fbbf24; }
.side-actions { display: grid; gap: 8px; }
.privacy-note { margin: 14px 0 0; color: #817d8d; font-size: 11px; }

.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.project-card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.project-card h2 { margin: 10px 0 5px; letter-spacing: -0.03em; }
.project-card p { color: var(--muted); }
.project-meta { margin-top: 18px; color: #8f899b; font-size: 12px; }
.project-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 16px; }
.project-actions button { min-width: 0; padding: 0 8px; font-size: 12px; }
.empty-state { grid-column: 1 / -1; padding: 40px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; }

.help-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.help-card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.help-card > span { color: #a78bfa; font-size: 12px; font-weight: 900; letter-spacing: 0.14em; }
.help-card h2 { margin: 10px 0; font-size: 20px; }
.help-card p { margin-bottom: 0; color: var(--muted); }

.game-shell { width: min(900px, calc(100vw - 32px)); margin: 34px auto 100px; }
.game-card { overflow: hidden; border: 1px solid var(--line); border-radius: 28px; background: #121019; box-shadow: var(--shadow); }
.game-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.game-head small { color: #9891a5; }
.game-head h1 { margin: 3px 0 0; font-size: clamp(22px, 4vw, 34px); letter-spacing: -0.04em; }
.game-progress { height: 5px; background: rgba(255, 255, 255, 0.05); }
.game-progress > div { height: 100%; background: var(--game-accent, var(--accent)); transition: width 0.25s ease; }
.game-body { padding: clamp(22px, 5vw, 52px); }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 42px; }
.stat-box { padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, 0.025); }
.stat-box small { display: block; margin-bottom: 8px; color: #d8d3e2; }
.meter { height: 8px; overflow: hidden; border-radius: 99px; background: rgba(255, 255, 255, 0.1); }
.meter span { display: block; height: 100%; border-radius: inherit; background: var(--game-accent, var(--accent)); transition: width 0.25s ease; }
.scene-kicker { color: #a78bfa; font-size: 11px; font-weight: 900; letter-spacing: 0.16em; }
.scene-text { max-width: 760px; margin: 12px 0 30px; font-size: clamp(27px, 5vw, 46px); line-height: 1.18; letter-spacing: -0.045em; overflow-wrap: anywhere; }
.choice-list { display: grid; gap: 10px; }
.choice-button { min-height: 60px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-2); color: #fff; text-align: left; font-weight: 800; transition: 0.15s transform, 0.15s background, 0.15s border-color; }
.choice-button:hover { transform: translateY(-1px); border-color: rgba(167, 139, 250, 0.4); background: #242033; }
.game-footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 30px; color: #817b8d; font-size: 11px; }
.result-wrap { text-align: center; }
.result-emoji { margin: 4px 0 12px; font-size: 64px; }
.result-wrap h2 { margin: 10px 0; font-size: clamp(30px, 5vw, 48px); letter-spacing: -0.04em; }
.result-wrap > p { max-width: 660px; margin: 0 auto 26px; color: var(--muted); }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 650px; margin: 0 auto 20px; }
.result-stat { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.result-stat small { display: block; color: var(--muted); }
.result-stat strong { display: block; margin-top: 3px; font-size: 27px; }
.twist-box { max-width: 700px; margin: 22px auto; padding: 18px; border: 1px solid rgba(139, 92, 246, 0.2); border-radius: 16px; background: rgba(139, 92, 246, 0.09); }
.twist-box small { color: #a78bfa; }
.twist-box strong { display: inline-block; margin: 6px 0; font-size: 20px; }
.twist-box span { color: var(--muted); }
.result-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; max-width: 620px; margin: 24px auto 0; }
.result-actions button { min-height: 48px; }

.mobile-nav { display: none; }
.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: grid; gap: 8px; pointer-events: none; }
.toast { max-width: min(380px, calc(100vw - 36px)); padding: 12px 15px; border: 1px solid var(--line); border-radius: 13px; background: #24202e; box-shadow: 0 14px 38px rgba(0, 0, 0, 0.35); color: #fff; font-size: 13px; animation: toast-in 0.18s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1100px) {
  .desktop-nav { gap: 0; }
  .desktop-nav button { padding-inline: 9px; font-size: 13px; }
  .sample-grid { grid-template-columns: repeat(3, 1fr); }
  .hero { gap: 34px; }
}

@media (max-width: 820px) {
  :root { --shell: min(100% - 28px, 720px); --topbar: 64px; }
  body { padding-bottom: 74px; }
  .topbar { height: var(--topbar); padding: 0 14px; gap: 12px; }
  .desktop-nav { display: none; }
  .top-actions { margin-left: auto; }
  .top-actions .ghost-button { display: none; }
  .top-actions .primary-button { min-height: 42px; padding-inline: 13px; font-size: 12px; }
  .brand small { display: none; }
  .brand-mark { width: 36px; height: 36px; }

  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: 70px;
    padding: 7px max(7px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(7px, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background: rgba(12, 11, 17, 0.94);
    backdrop-filter: blur(18px);
  }
  .mobile-nav button { min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 5px 2px; font-size: 10px; }
  .mobile-nav button span { font-size: 18px; line-height: 1; }
  .mobile-nav button.is-active { background: rgba(139, 92, 246, 0.13); color: #fff; }

  .view { padding-top: 30px; padding-bottom: 32px; }
  .hero { min-height: auto; grid-template-columns: 1fr; gap: 34px; padding: 48px 0 24px; }
  .hero h1 { font-size: clamp(42px, 12vw, 66px); }
  .hero-copy > p { font-size: 16px; }
  .hero-demo { max-width: 620px; }
  .demo-stack { transform: none; }
  .feature-grid, .help-grid { grid-template-columns: 1fr; }
  .feature-card { min-height: 190px; }
  .feature-icon { margin-bottom: 18px; }
  .sample-grid, .sample-grid.large { grid-template-columns: repeat(2, 1fr); }
  .page-heading h1 { font-size: 42px; }
  .page-heading.split, .section-heading { align-items: flex-start; }
  .studio-layout, .builder-layout { grid-template-columns: 1fr; }
  .preview-panel, .sticky-card { position: static; }
  .meme-grid, .project-grid { grid-template-columns: 1fr; }
  .project-actions { grid-template-columns: repeat(2, 1fr); }
  .toast-region { right: 14px; bottom: 88px; }
}

@media (max-width: 620px) {
  :root { --shell: calc(100vw - 22px); }
  .top-actions .primary-button { padding-inline: 11px; }
  .hero { padding-top: 34px; }
  .hero h1 { font-size: clamp(38px, 13vw, 56px); }
  .hero-actions { display: grid; grid-template-columns: 1fr; }
  .hero-actions button { width: 100%; }
  .demo-grid { grid-template-columns: 1fr; }
  .demo-card { min-height: 88px; }
  .sample-grid, .sample-grid.large { grid-template-columns: 1fr; }
  .sample-body p { min-height: auto; }
  .toolbar { display: grid; grid-template-columns: 1fr; }
  .toolbar select { width: 100%; }
  .format-tabs { width: 100%; overflow-x: auto; }
  .format-tabs button { flex: 1 0 auto; }
  .studio-preview { min-height: 390px; }
  .twocut-panel { min-height: 195px; padding: 22px; }
  .chat-preview, .post-preview { min-height: 390px; padding: 20px 14px; }
  .preview-actions { display: grid; grid-template-columns: 1fr; }
  .page-heading.split { display: grid; }
  .builder-heading-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .builder-heading-actions .primary-button { grid-column: 1 / -1; }
  .form-grid.two, .form-grid.three { grid-template-columns: 1fr; }
  .choice-row { grid-template-columns: minmax(0, 1fr) repeat(3, 56px); }
  .choice-row input { padding: 7px 5px; font-size: 12px; }
  .scene-head { align-items: flex-start; flex-direction: column; }
  .scene-head small { text-align: left; }
  .game-shell { width: calc(100vw - 18px); margin-top: 12px; margin-bottom: 88px; }
  .game-card { border-radius: 20px; }
  .game-head { align-items: flex-start; padding: 16px; }
  .game-head .ghost-button { min-height: 40px; padding-inline: 12px; }
  .game-body { padding: 20px 15px 26px; }
  .stat-row { grid-template-columns: 1fr; gap: 7px; margin-bottom: 28px; }
  .stat-box { padding: 10px; }
  .scene-text { margin-bottom: 22px; font-size: clamp(26px, 8vw, 38px); }
  .choice-button { min-height: 58px; }
  .game-footer { flex-direction: column; gap: 5px; }
  .result-stats { grid-template-columns: 1fr; }
  .result-actions { grid-template-columns: 1fr; }
  .meme-card-actions { display: grid; grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
}
