/* Free City — cinematic interface. The image library and product flow stay unchanged. */
:root {
  color-scheme: dark;
  --night: #0e0b18;
  --surface: #1b1428;
  --surface-raised: #251c35;
  --ink: #fff1df;
  --muted: #b9acbf;
  --peach: #ffc4a0;
  --pink: #ef85ba;
  --lavender: #bcabed;
  --line: rgb(255 241 223 / 14%);
  --line-strong: rgb(255 241 223 / 30%);
  --focus: #ffd1b5;
  --page-width: 1200px;
  --page-gutter: clamp(20px, 5vw, 72px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --body-font: "Noto Sans SC", "PingFang SC", "Hiragino Sans", "Apple SD Gothic Neo", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 130px; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(ellipse at 75% 12%, rgb(108 58 130 / 17%), transparent 40%),
    radial-gradient(ellipse at 0% 67%, rgb(110 50 94 / 12%), transparent 38%),
    var(--night);
  color: var(--ink);
  font-family: var(--body-font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body.dialog-open { overflow: hidden; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
button { border: 0; }
a { color: inherit; text-decoration: none; }
button, a, input { touch-action: manipulation; }
button:disabled { opacity: .4; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 5px;
}
::selection { background: var(--peach); color: var(--night); }
img, video { display: block; max-width: 100%; }
svg { display: block; }
h1, h2, p { margin: 0; }
button svg:not(.brand-mark) { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.skip-link {
  position: fixed;
  top: 12px;
  left: 16px;
  z-index: 100;
  padding: 12px 20px;
  background: var(--peach);
  color: var(--night);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

/* One quiet navigation bar; the illustrated mark is the only decorative element. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 94px;
  padding: 9px var(--page-gutter);
  border-bottom: 1px solid rgb(255 241 223 / 7%);
  background: rgb(14 11 24 / 91%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; width: fit-content; }
.brand--main { gap: 10px; }
.brand-mark { width: 148px; height: auto; overflow: visible; flex: none; }
.brand-wordmark {
  fill: #fffdf8;
  stroke: #160d20;
  stroke-width: 7px;
  stroke-linejoin: round;
  paint-order: stroke fill;
  font-family: var(--body-font);
  font-size: 57px;
  font-weight: 900;
  letter-spacing: -3px;
}
html:lang(en) .brand-wordmark { font-family: "Anton", Impact, sans-serif; font-size: 59px; letter-spacing: -.8px; text-transform: uppercase; }
html:lang(ja) .brand-wordmark { font-size: 56px; letter-spacing: -3px; }
html:lang(ko) .brand-wordmark { font-size: 46px; letter-spacing: -2.7px; }
.brand-badge {
  display: flex;
  align-items: center;
  padding: 7px 0 7px 10px;
  border-left: 1px solid var(--line-strong);
}
.brand-badge img { width: 56px; height: auto; opacity: .72; }
.main-nav { display: flex; align-items: center; gap: 34px; }
.main-nav a { display: grid; min-height: 44px; place-items: center; font-size: 14px; font-weight: 700; color: var(--muted); transition: color 180ms; }
.main-nav a:hover, .main-nav a.is-active { color: var(--ink); }
.main-nav a.is-active { position: relative; }
.main-nav a.is-active::after { position: absolute; right: 0; bottom: 3px; left: 0; height: 2px; background: var(--peach); content: ""; }
.header-actions { display: flex; justify-content: flex-end; }
.language-control { position: relative; }
.language-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 170px;
  min-height: 50px;
  padding: 10px 17px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: #17181c;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  transition: border-color 180ms;
}
.language-select:hover, .language-select[aria-expanded="true"] { border-color: var(--peach); }
.language-select[aria-expanded="true"] { outline: 2px solid var(--peach); outline-offset: 4px; }
.language-select svg { width: 18px !important; height: 18px !important; }
.language-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 60;
  width: 100%;
  border: 1px solid #77717f;
  background: #17181c;
  box-shadow: 0 16px 36px rgb(0 0 0 / 40%);
}
.language-menu button { display: block; width: 100%; min-height: 48px; padding: 10px 17px; border-radius: 0; background: transparent; text-align: left; font-size: 16px; font-weight: 600; white-space: nowrap; }
.language-menu button:hover { background: #302a37; }
.language-menu button[aria-checked="true"] { background: #9dc8ff; color: #171b23; }
.language-menu button:focus-visible { position: relative; z-index: 1; outline-offset: -3px; }

/* One three-panel poster, with a shared headline over the image composition. */
main { width: min(var(--page-width), calc(100% - var(--page-gutter) * 2)); margin-inline: auto; }
.builder-section { padding-top: clamp(28px, 3.5vw, 46px); }
.creator-poster {
  position: relative;
  isolation: isolate;
  aspect-ratio: 2.12;
  min-height: 420px;
  overflow: hidden;
  border: 8px solid #220d30;
  background: #220d30;
  box-shadow: 0 28px 90px rgb(0 0 0 / 24%);
}
.builder-heading {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  pointer-events: none;
}
.builder-heading::before {
  position: absolute;
  inset: 12% -10%;
  z-index: -1;
  background: radial-gradient(ellipse at center, rgb(17 6 26 / 69%), rgb(17 6 26 / 28%) 40%, transparent 68%);
  content: "";
}
.builder-heading h1 {
  max-width: 100%;
  font-size: clamp(44px, 6.2vw, 80px);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -.045em;
  text-wrap: balance;
  color: #fff6e9;
  text-shadow: 0 3px 0 #29132c, 0 7px 28px rgb(0 0 0 / 58%);
  -webkit-text-stroke: 1px rgb(30 12 37 / 45%);
  paint-order: stroke fill;
}
.builder-heading p { margin-top: 18px; color: #fff1df; font-size: 18px; font-weight: 600; letter-spacing: .04em; text-shadow: 0 2px 10px #100818; }
.choice-row { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.choice-card {
  position: relative;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 0;
  background: transparent;
  text-align: left;
}
.choice-thumb {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--surface);
  background-repeat: no-repeat;
  transition: filter 240ms var(--ease);
}
.choice-thumb::after { position: absolute; inset: 0; background: linear-gradient(180deg, rgb(9 6 13 / 52%), transparent 22%, transparent 64%, rgb(9 6 13 / 86%)); content: ""; pointer-events: none; }
.choice-index { position: absolute; top: 19px; left: 20px; z-index: 2; color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-shadow: 0 1px 8px #000; }
.choice-index::before { display: inline-block; margin-right: 9px; font-family: "Anton", Impact, sans-serif; font-size: 12px; font-weight: 400; opacity: .65; }
.choice-card--character .choice-index::before { content: "01"; }
.choice-card--map .choice-index::before { content: "02"; }
.choice-card--event .choice-index::before { content: "03"; }
.choice-tag { position: absolute; top: 15px; right: 15px; z-index: 2; max-width: 58%; padding: 4px 9px; border: 1px solid rgb(255 255 255 / 23%); border-radius: 3px; background: rgb(17 11 25 / 67%); color: var(--ink); font-size: 11px; font-weight: 600; line-height: 1.5; text-align: center; backdrop-filter: blur(6px); }
.choice-info { position: absolute; right: 0; bottom: 0; left: 0; z-index: 2; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; min-height: 98px; padding: 30px 22px 24px; text-shadow: 0 2px 8px #0e0616; }
.choice-info > span:first-child { min-width: 0; }
.choice-info strong { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 22px; font-weight: 800; line-height: 1.4; letter-spacing: -.025em; overflow-wrap: anywhere; }
.replace-action { display: flex; flex: none; align-items: center; gap: 8px; margin-top: 4px; color: var(--peach); font-size: 12px; font-weight: 700; }
.replace-action svg { width: 20px !important; height: 20px !important; transition: transform 180ms; }
.choice-card:hover .choice-thumb { filter: brightness(1.12); }
.choice-card:hover .replace-action svg { transform: translateX(3px); }
.choice-card:focus-visible { outline-offset: -5px; }
.choice-card:active .choice-thumb { filter: brightness(.95); }
.event-sequence { position: absolute; bottom: 108px; left: 22px; z-index: 1; display: flex; gap: 6px; }
.event-sequence:has(.event-sequence-item:only-child) { display: none; }
.event-sequence-item { position: relative; display: block; width: 56px; aspect-ratio: 1; border: 2px solid var(--peach); border-radius: 2px; background-size: 500% auto; background-repeat: no-repeat; box-shadow: 0 2px 12px rgb(0 0 0 / 25%); }
.event-sequence-item b { position: absolute; right: 0; bottom: 0; display: grid; width: 20px; height: 20px; place-items: center; background: var(--peach); color: var(--night); font-size: 11px; font-style: normal; }
.event-sequence-item.is-custom { background: linear-gradient(145deg, #684074, #33213f); }
.event-sequence-item.is-custom::before { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink); font-size: 24px; font-style: normal; content: "+"; }
.build-summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 24px; }
.build-summary p { display: flex; align-items: baseline; flex-wrap: wrap; gap: 9px; color: var(--muted); font-size: 13px; }
.build-summary b { color: var(--ink); font-size: 19px; font-weight: 800; }
.build-summary small { margin-left: 13px; color: var(--muted); font-size: 12px; }
.random-button { display: inline-flex; flex: none; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 10px 16px; border: 1px solid var(--line-strong); border-radius: 3px; background: transparent; color: var(--ink); font-size: 13px; font-weight: 700; transition: border-color 180ms, background 180ms; }
.random-button svg { width: 18px !important; height: 18px !important; }
.random-button:hover { border-color: var(--peach); background: rgb(255 196 160 / 5%); }

/* The user's real case video stays large, unframed and easy to play. */
.case-section { margin-top: clamp(70px, 8vw, 112px); padding-bottom: 100px; }
.case-section h2 { margin-bottom: 26px; font-size: clamp(26px, 3vw, 38px); font-weight: 900; letter-spacing: -.04em; line-height: 1.3; }
.video-wrap { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: #08060d; box-shadow: 0 25px 75px rgb(0 0 0 / 24%); }
.video-wrap video { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #08060d; }
.video-topline { position: absolute; top: 0; right: 0; left: 0; z-index: 1; display: flex; justify-content: space-between; gap: 12px; padding: 22px 26px 40px; background: linear-gradient(rgb(8 6 13 / 75%), transparent); color: #fff5eb; font-size: 12px; font-weight: 700; letter-spacing: .04em; pointer-events: none; }
.video-topline span:last-child { font-variant-numeric: tabular-nums; }
.video-play { position: absolute; top: 50%; left: 50%; display: grid; width: 88px; height: 88px; place-items: center; border: 1px solid rgb(255 241 223 / 68%); border-radius: 50%; background: rgb(20 12 30 / 45%); color: #fff7e9; backdrop-filter: blur(8px); transform: translate(-50%, -50%); transition: background 180ms, opacity 180ms, scale 180ms; }
.video-play svg { width: 34px !important; height: 34px !important; margin-left: 5px; fill: currentColor !important; stroke-width: 0 !important; }
.video-play:hover { background: var(--peach); color: var(--night); scale: 1.06; }
.video-play.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 31px var(--page-gutter); border-top: 1px solid var(--line); background: rgb(5 4 10 / 22%); color: var(--muted); font-size: 11px; }
.brand--footer { min-height: 44px; }
.brand--footer .brand-logo { width: 100px; height: auto; opacity: .76; }

/* Secondary workspaces: image library on the left, ordered story on the right. */
.preset-dialog { width: min(1200px, calc(100% - 64px)); max-width: none; max-height: calc(100svh - 64px); margin: auto; padding: 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--night); color: var(--ink); box-shadow: 0 40px 140px rgb(0 0 0 / 65%); }
.preset-dialog::backdrop { background: rgb(5 3 10 / 79%); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.dialog-shell { display: flex; flex-direction: column; max-height: calc(100svh - 66px); }
.dialog-header { display: flex; flex: none; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 29px 32px 25px; border-bottom: 1px solid var(--line); background: linear-gradient(115deg, #21172f, #15101e); }
.dialog-header > div { min-width: 0; }
.dialog-header h2 { font-size: 34px; font-weight: 900; line-height: 1.3; letter-spacing: -.045em; overflow-wrap: anywhere; }
.dialog-header p { margin-top: 8px; color: var(--muted); font-size: 13px; }
.dialog-close { display: grid; flex: none; width: 44px; height: 44px; place-items: center; margin-top: 1px; border: 1px solid var(--line-strong); border-radius: 50%; background: transparent; transition: background 180ms, border-color 180ms; }
.dialog-close:hover { border-color: var(--peach); background: rgb(255 196 160 / 8%); }
.dialog-close svg { width: 21px !important; height: 21px !important; }
.dialog-body { min-height: 0; padding: 28px 32px 32px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #67526f transparent; }
.preset-gallery { min-width: 0; }
.dialog-presets { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px 16px; }
.preset-card { position: relative; min-width: 0; padding: 0; border: 1px solid transparent; border-radius: 3px; background: transparent; text-align: left; transition: border-color 180ms, background 180ms; }
.preset-image { display: block; width: 100%; aspect-ratio: 1; border-radius: 2px; background-color: var(--surface-raised); background-size: 500% auto; background-repeat: no-repeat; transition: filter 180ms; }
.preset-card-copy { display: block; padding: 12px 9px 11px; }
.preset-card-copy b { display: block; color: var(--ink); font-size: 14px; font-weight: 700; line-height: 1.45; overflow-wrap: anywhere; }
.preset-card-copy small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.preset-card:hover { background: rgb(255 241 223 / 4%); }
.preset-card:hover .preset-image { filter: brightness(1.1); }
.preset-card.is-selected { border-color: var(--peach); background: rgb(255 196 160 / 9%); }
.preset-card.is-selected .preset-card-copy b { color: var(--peach); }
.preset-check { position: absolute; top: 10px; right: 10px; display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid rgb(255 255 255 / 38%); border-radius: 50%; background: rgb(14 11 24 / 35%); opacity: 0; }
.preset-card:hover .preset-check { opacity: 1; }
.preset-card.is-selected .preset-check { border-color: var(--peach); background: var(--peach); color: var(--night); opacity: 1; }
.preset-check b { font-size: 13px; font-weight: 800; }
.preset-check svg { width: 17px !important; height: 17px !important; stroke-width: 2.5 !important; }
.upload-area { margin-bottom: 21px; }
.upload-area > button { display: flex; align-items: center; justify-content: center; gap: 13px; width: 100%; min-height: 66px; padding: 14px 20px; border: 1px dashed rgb(255 196 160 / 45%); border-radius: 3px; background: rgb(255 196 160 / 4%); transition: background 180ms, border-color 180ms; }
.upload-area > button:hover { border-color: var(--peach); background: rgb(255 196 160 / 9%); }
.upload-area > button > span { color: var(--peach); }
.upload-area b { color: var(--peach); font-size: 14px; font-weight: 700; }
.upload-area small { color: var(--muted); font-size: 11px; }
.upload-area > div { display: flex; align-items: center; gap: 12px; margin-top: 17px; color: var(--muted); font-size: 11px; }
.upload-area > div::before, .upload-area > div::after { flex: 1; height: 1px; background: var(--line); content: ""; }
.preset-dialog[data-category="events"] .dialog-body { display: grid; grid-template-columns: minmax(0, 1fr) 310px; align-items: start; gap: 32px; }
.preset-dialog[data-category="events"] .dialog-presets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.event-editor { position: sticky; top: 0; min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.event-limit-copy { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 10px; }
.event-limit-copy > span { font-size: 15px; font-weight: 800; }
.event-limit-copy strong { color: var(--peach); font-size: 11px; font-weight: 700; }
.event-limit-copy small { flex-basis: 100%; color: var(--muted); font-size: 11px; }
.event-timeline { display: grid; gap: 9px; margin-top: 18px; }
.timeline-chip { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr) 44px; align-items: center; column-gap: 9px; min-height: 62px; padding: 6px 0 6px 10px; border: 1px solid var(--line); border-radius: 3px; background: #21182d; }
.timeline-chip > span { grid-row: 1 / 3; display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: rgb(255 196 160 / 11%); color: var(--peach); font-size: 11px; font-weight: 800; }
.timeline-chip b { align-self: end; color: var(--ink); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.timeline-chip small { grid-column: 2; align-self: start; margin-top: 2px; color: var(--muted); font-size: 10px; }
.timeline-chip button { grid-column: 3; grid-row: 1 / 3; width: 44px; height: 44px; padding: 0; background: transparent; color: var(--muted); font-size: 21px; }
.timeline-chip button:hover { color: var(--peach); }
.custom-event { margin-top: 24px; }
.custom-event label { display: block; margin-bottom: 9px; color: var(--muted); font-size: 12px; font-weight: 600; }
.custom-event > div { display: flex; gap: 8px; }
.custom-event input { width: 100%; min-width: 0; min-height: 44px; padding: 10px 11px; border: 1px solid var(--line-strong); border-radius: 3px; background: var(--night); color: var(--ink); font-size: 12px; }
.custom-event input::placeholder { color: #9e90a9; opacity: 1; }
.custom-event button { flex: none; min-width: 48px; min-height: 44px; padding: 9px; border: 1px solid var(--line-strong); border-radius: 3px; background: transparent; color: var(--peach); font-size: 12px; font-weight: 700; }
.custom-event button:hover { border-color: var(--peach); }
.event-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 17px; margin-top: 25px; padding-top: 18px; border-top: 1px solid var(--line); }
.event-actions > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; width: 100%; }
.event-actions > div > span { color: var(--muted); font-size: 12px; }
.event-actions strong { font-size: 12px; font-weight: 500; }
.event-actions strong b { font-size: 26px; font-weight: 800; letter-spacing: -.04em; }
.event-actions > button { width: 100%; min-height: 48px; padding: 12px 20px; border-radius: 3px; background: linear-gradient(110deg, #ffc4a0, #efacbf); color: #241321; font-size: 14px; font-weight: 800; transition: filter 180ms; }
.event-actions > button:hover { filter: brightness(1.08); }
.event-limit.is-warning { animation: event-warning 480ms ease-out; }
@keyframes event-warning { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 65% { transform: translateX(3px); } }
.dialog-status { flex: none; max-height: 0; overflow: hidden; background: #3c2838; color: #ffd3b4; text-align: center; font-size: 13px; font-weight: 600; }
.dialog-status.is-visible { max-height: 120px; padding: 12px 24px; border-top: 1px solid rgb(255 196 160 / 25%); }
.toast { position: fixed; right: 20px; bottom: 28px; left: 20px; z-index: 60; width: fit-content; max-width: min(540px, calc(100% - 40px)); margin-inline: auto; padding: 13px 22px; border: 1px solid rgb(255 196 160 / 35%); border-radius: 4px; background: #302136; color: var(--ink); box-shadow: 0 12px 40px rgb(0 0 0 / 40%); font-size: 13px; font-weight: 600; text-align: center; opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity 180ms, transform 180ms, visibility 180ms; pointer-events: none; }
.toast.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }

@media (min-width: 1600px) {
  .site-header { padding-inline: max(var(--page-gutter), calc((100vw - 1440px) / 2)); }
}

@media (max-width: 1100px) {
  .choice-info { gap: 10px; }
  .choice-info strong { font-size: 19px; }
  .choice-index { top: 15px; left: 14px; }
  .choice-tag { top: 12px; right: 11px; font-size: 10px; }
  .preset-dialog { width: calc(100% - 40px); max-height: calc(100svh - 40px); }
  .dialog-shell { max-height: calc(100svh - 42px); }
  .dialog-header { padding: 24px; }
  .dialog-body { padding: 24px; }
  .dialog-presets { gap: 16px 12px; }
  .preset-dialog[data-category="events"] .dialog-body { grid-template-columns: minmax(0, 1fr) 274px; gap: 22px; }
  .event-editor { padding: 17px; }
}

@media (max-width: 800px) {
  :root { --page-gutter: 26px; }
  .site-header { min-height: 86px; grid-template-columns: 1fr auto; }
  .brand-mark { width: 136px; }
  .main-nav { display: none; }
  .language-select { width: 155px; min-height: 46px; }
  .builder-section { padding-top: 28px; }
  .creator-poster { min-height: 350px; aspect-ratio: 1.8; border-width: 6px; }
  .builder-heading { padding: 20px; }
  .builder-heading h1 { font-size: clamp(36px, 6.5vw, 52px); }
  .builder-heading p { margin-top: 13px; font-size: 14px; }
  .choice-row { gap: 5px; }
  .choice-index { top: 12px; left: 11px; font-size: 12px; }
  .choice-tag { top: 37px; right: auto; left: 11px; max-width: calc(100% - 22px); }
  .choice-info { flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 10px; min-height: 105px; padding: 18px 12px; }
  .choice-info strong { font-size: 18px; }
  .replace-action { margin-top: 0; font-size: 11px; }
  .event-sequence { top: 72px; bottom: auto; left: 12px; gap: 4px; }
  .event-sequence-item { width: 35px; }
  .event-sequence-item b { width: 15px; height: 15px; font-size: 9px; }
  .build-summary small { display: block; flex-basis: 100%; margin-left: 0; }
  .build-summary p { column-gap: 7px; row-gap: 3px; }
  .case-section { margin-top: 66px; padding-bottom: 66px; }
  .preset-dialog { width: calc(100% - 32px); max-height: calc(100svh - 32px); }
  .dialog-shell { max-height: calc(100svh - 34px); }
  .dialog-presets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .preset-dialog[data-category="events"] .dialog-body { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .event-editor { position: static; padding: 22px; }
  .event-actions { flex-wrap: nowrap; }
  .event-actions > div { width: auto; }
  .event-actions > button { width: 45%; }
}

@media (max-width: 540px) {
  :root { --page-gutter: 18px; }
  html { scroll-padding-top: 100px; }
  .site-header { min-height: 80px; padding-block: 8px; }
  .brand--main { gap: 0; align-items: flex-start; flex-direction: column; }
  .brand-mark { width: 112px; }
  .brand-badge { align-self: center; margin-top: -4px; padding: 0; border: 0; }
  .brand-badge img { width: 46px; opacity: .65; }
  .language-select { width: 127px; min-height: 44px; gap: 12px; padding: 10px 12px; font-size: 13px; }
  .language-menu button { min-height: 46px; padding: 10px 12px; font-size: 15px; }
  .builder-section { padding-top: 22px; }
  .creator-poster { min-height: 0; height: clamp(278px, 75vw, 360px); aspect-ratio: auto; border-width: 4px; }
  .builder-heading { padding: 12px; }
  .builder-heading h1 { font-size: clamp(25px, 7.8vw, 38px); line-height: 1.15; letter-spacing: -.055em; }
  .builder-heading p { margin-top: 11px; font-size: 11px; letter-spacing: 0; }
  .choice-row { gap: 4px; }
  .choice-index { top: 9px; left: 9px; font-size: 11px; letter-spacing: 0; }
  .choice-index::before { display: none; }
  .choice-tag { top: 32px; left: 7px; max-width: calc(100% - 14px); padding: 3px 5px; font-size: 8px; }
  .choice-info { gap: 9px; min-height: 90px; padding: 14px 8px; }
  .choice-info strong { font-size: 13px; font-weight: 800; line-height: 1.4; }
  .replace-action { gap: 5px; font-size: 10px; }
  .replace-action svg { width: 16px !important; height: 16px !important; }
  .event-sequence { top: 64px; right: 7px; bottom: auto; left: 7px; gap: 3px; }
  .event-sequence-item { width: min(26px, 31%); border-width: 1px; }
  .event-sequence-item b { width: 12px; height: 12px; font-size: 8px; }
  .event-sequence-item.is-custom::before { font-size: 17px; }
  .build-summary { align-items: center; gap: 10px; padding-top: 20px; }
  .build-summary p { font-size: 11px; }
  .build-summary b { font-size: 17px; }
  .build-summary small { font-size: 10px; line-height: 1.6; }
  .random-button { gap: 7px; padding: 9px 10px; font-size: 11px; min-height: 44px; }
  .random-button svg { width: 16px !important; height: 16px !important; }
  .case-section { margin-top: 55px; padding-bottom: 50px; }
  .case-section h2 { margin-bottom: 18px; font-size: 27px; }
  .video-wrap { border-radius: 3px; }
  .video-topline { padding: 12px 13px 28px; font-size: 10px; }
  .video-play { width: 60px; height: 60px; }
  .video-play svg { width: 25px !important; height: 25px !important; }
  footer { gap: 16px; padding-block: 21px; font-size: 9px; }
  .brand--footer .brand-logo { width: 83px; }
  .preset-dialog { width: 100%; max-height: 100svh; height: 100svh; border: 0; border-radius: 0; }
  .dialog-shell { height: 100%; max-height: 100svh; }
  .dialog-header { align-items: flex-start; gap: 14px; padding: max(22px, env(safe-area-inset-top)) 20px 20px; }
  .dialog-header h2 { font-size: 28px; }
  .dialog-header p { font-size: 12px; }
  .dialog-close { width: 44px; height: 44px; }
  .dialog-body { flex: 1; padding: 21px 18px max(26px, env(safe-area-inset-bottom)); }
  .dialog-presets, .preset-dialog[data-category="events"] .dialog-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 12px; }
  .preset-card-copy { padding: 10px 8px 12px; }
  .preset-card-copy b { font-size: 14px; }
  .preset-card-copy small { font-size: 10px; }
  .preset-check { top: 8px; right: 8px; width: 26px; height: 26px; }
  .upload-area > button { flex-wrap: wrap; justify-content: flex-start; gap: 6px 12px; padding: 15px; }
  .upload-area > button > span { grid-row: span 2; }
  .upload-area b { font-size: 13px; }
  .upload-area small { margin-left: auto; font-size: 10px; }
  .event-editor { padding: 19px; }
  .event-limit-copy > span { font-size: 16px; }
  .event-limit-copy strong { font-size: 12px; }
  .timeline-chip { min-height: 67px; }
  .timeline-chip b { font-size: 13px; }
  .timeline-chip small { font-size: 11px; }
  .custom-event input { min-height: 46px; font-size: 16px; }
  .custom-event input::placeholder { font-size: 12px; }
  .custom-event button { min-height: 46px; }
  .event-actions { margin-top: 22px; }
  .event-actions > button { min-height: 48px; }
  .event-actions > div { flex-direction: column; gap: 1px; }
  .dialog-status.is-visible { padding: 12px 20px max(12px, env(safe-area-inset-bottom)); font-size: 12px; }
  .toast { bottom: max(20px, env(safe-area-inset-bottom)); font-size: 12px; }
}

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