:root {
  color-scheme: dark;
  color: #f8f0ef;
  background: #141015;
  font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  font-synthesis: none;
  --ink: #f8f0ef;
  --muted: #c4b6bd;
  --surface: #201922;
  --line: #fff6ee27;
  --accent: #f2bd91;
}
* {box-sizing: border-box;}
body {margin: 0; min-height: 100vh; background: radial-gradient(ellipse at 48% 8%, #38252d 0, #1b141c 44rem, #141015 78rem);}
h1,h2,h3,p {margin: 0;}
a {color: inherit; text-decoration: none;}
button,input,select {font: inherit; color: inherit;}
button {cursor: pointer;}
button:disabled {opacity: .55; cursor: not-allowed;}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible {outline: 2px solid var(--accent); outline-offset: 3px;}
img {display: block; max-width: 100%;}
[hidden] {display: none !important;}
.masthead {height: 62px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(15px, 4vw, 52px); border-bottom: 1px solid var(--line); background: #151018dc;}
.wordmark {display: inline-flex; align-items: center; gap: 9px; font-size: .9rem; letter-spacing: -.03em;}
.mark {display: grid; place-items: center; border: 1px solid #f5cead7a; width: 34px; height: 34px; border-radius: 11px; background: #3d2832; color: var(--accent); font-size: 20px;}
.brand-credit {font-size: .76rem; color: var(--muted);}
.brand-credit strong {color: var(--ink);}
.boot {padding: 4rem; text-align: center;}
.entry {min-height: calc(100vh - 62px); display: grid; place-items: center; padding: 20px;}
.entry-card {width: min(100%, 420px); padding: 24px; border-radius: 25px; background: var(--surface); border: 1px solid var(--line);}
.entry-art {width: 100%; height: 180px; object-fit: cover; object-position: center 32%; border-radius: 15px; margin-bottom: 16px;}
.entry-card h1 {font-size: 1.55rem; letter-spacing: -.045em;}
.entry-card p {margin-top: 6px; color: var(--muted); line-height: 1.55;}
.entry-card label {display: grid; gap: 7px; margin: 20px 0 10px; font-size: .88rem;}
.entry-card button {width: 100%;}
.entry-card input,.composer input,.composer select {background: #141018; border: 1px solid var(--line); border-radius: 12px; min-width: 0; padding: 11px 13px;}
.warning {padding-top: 9px; color: #ffd4ac; font-size: .83rem;}
.primary,.quiet,.icon-button {border: 1px solid var(--line); border-radius: 12px; font-weight: 650; min-height: 40px; padding: 8px 11px; background: #ffffff14;}
.primary {background: var(--accent); color: #2d1a1d; border-color: transparent;}
.primary:hover:not(:disabled) {background: #faddbc;}
.quiet:hover:not(:disabled),.icon-button:hover {background: #fff5ec28;}
.discovery {max-width: 1100px; margin: auto; padding: 31px clamp(14px, 3vw, 32px) 34px;}
.feed-heading {margin-bottom: 19px;}
.feed-heading h1 {font-size: clamp(1.85rem, 4vw, 3.2rem); font-weight: 780; letter-spacing: -.065em;}
.feed-heading p {font-size: .92rem; color: var(--muted); margin-top: 5px;}
.poster-grid {display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px;}
.poster {padding: 0; text-align: left; position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: flex-end; aspect-ratio: 3 / 5; border-radius: 19px; border: 1px solid #fff4e433; background: #34252c;}
.poster:hover {border-color: var(--accent);}
.poster-art,.stage-art {width: 100%; height: 100%; position: absolute; inset: 0; z-index: -2; object-fit: cover; object-position: center 34%;}
.poster::after,.stage::after {content: ""; position: absolute; inset: 0; z-index: -1;}
.poster::after {background: linear-gradient(0deg, #171019 3%, #16101bf2 17%, #17101978 47%, transparent 72%);}
.poster-tag {position: absolute; top: 10px; left: 10px; color: #fff4eb; background: #251a20cf; padding: 4px 8px; border-radius: 10px; border: 1px solid var(--line); font-size: .68rem; font-weight: 620; backdrop-filter: blur(8px);}
.poster-note {padding: 12px 14px 14px; width: 100%;}
.poster-genre {color: var(--accent); font-size: .72rem;}
.poster h2 {font-size: clamp(.98rem, 2.35vw, 1.35rem); line-height: 1.28; letter-spacing: -.06em; margin: 4px 0;}
.poster p {font-size: .77rem; line-height: 1.45; color: #e5d7d9;}
.poster-action {display: block; margin-top: 8px; color: #ffddc1; font-size: .74rem; font-weight: 650;}
.play-layout {width: min(100% - 32px, 925px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(265px, 320px); gap: 15px; align-items: start; margin: 15px auto 18px;}
.stage {height: clamp(575px, calc(100dvh - 100px), 970px); min-width: 0; position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; background: #392b35; border: 1px solid #fff2e44d; border-radius: 22px;}
.stage-art {object-position: center 26%;}
.stage::after {background: linear-gradient(180deg, #1a111bdc 0%, #1a111b45 15%, transparent 33%, #1a111b55 53%, #120f17e8 91%), linear-gradient(90deg, #150e1970, transparent 40%);}
.stage-bar {display: flex; align-items: center; gap: 9px; padding: 11px 12px 6px; z-index: 2;}
.stage-title {min-width: 0; flex: 1; text-shadow: 0 1px 14px #0b070a;}
.stage-title h1 {font-size: 1.14rem; line-height: 1.28; letter-spacing: -.045em;}
.stage-title p {font-size: .75rem; margin-top: 3px; color: #f6e8df;}
.icon-button {width: 38px; min-height: 38px; padding: 0; display: grid; place-items: center; font-size: 1.55rem; background: #16101cc2; backdrop-filter: blur(8px);}
.stage-settings {position: relative;}
.stage-settings summary {cursor: pointer; list-style: none;}
.stage-settings summary::-webkit-details-marker {display: none;}
.stage-settings > button {position: absolute; top: calc(100% + 5px); right: 0; white-space: nowrap; background: #2b1f2c;}
.cast-choice {display: flex; gap: 6px; padding: 5px 12px; overflow-x: auto; scrollbar-width: none; flex-shrink: 0;}
.cast-choice:empty {display: none;}
.cast-chip {background: #1b1220d8; border: 1px solid #f9ebdf48; border-radius: 30px; display: flex; align-items: center; gap: 5px; padding: 3px 7px; min-height: 29px; font-size: .72rem; white-space: nowrap; backdrop-filter: blur(7px);}
.cast-chip[aria-pressed=true] {background: #ffd6b6; border-color: #ffd6b6; color: #3c2426;}
.avatar {width: 33px; height: 33px; object-fit: cover; border-radius: 50%; background: #634452;}
.cast-chip .avatar {width: 17px; height: 17px;}
.transcript {min-height: 0; flex: 1; overflow: auto; overscroll-behavior: contain; display: flex; flex-direction: column; scrollbar-color: #b9a8a888 transparent;}
.conversation {margin-top: auto; padding: 120px 15px 10px;}
.opening-beat {padding: 12px 14px; margin: 0 0 12px; border-left: 3px solid #f3bf9496; border-radius: 2px 12px 12px 2px; background: #201622ed; box-shadow: 0 3px 18px #11091033;}
.opening-beat h2,.quick-replies h2 {font-size: .75rem; color: #f2bd91; font-weight: 680; margin: 0 0 5px;}
.scene-direction {color: #e9d7df; font-size: .93rem; line-height: 1.62; font-style: italic;}
.line {display: flex; align-items: flex-start; gap: 7px; margin: 0 0 10px;}
.line.visitor {justify-content: flex-end;}
.line-main {min-width: 0; max-width: min(82%, 470px);}
.line-name {display: flex; gap: 6px; align-items: baseline; padding: 1px 4px 4px; color: #fff8f1; text-shadow: 0 1px 9px #120911; font-size: .78rem;}
.line-name small {font-size: .68rem; color: #e8d1c5;}
.visitor .line-name {justify-content: flex-end;}
.bubble {background: #24192ac9; border: 1px solid #fff8f128; border-radius: 4px 15px 15px; padding: 8px 10px; line-height: 1.55; font-size: .88rem; white-space: pre-wrap; overflow-wrap: anywhere; backdrop-filter: blur(9px);}
.visitor .bubble {background: #603e4ee6; border-radius: 15px 4px 15px 15px;}
.direction {margin: 0 0 4px; padding: 5px 8px; border-radius: 8px; color: #efd9cd; background: #23192bb0; font-size: .81rem; font-style: italic;}
.quick-replies {padding: 7px 0 3px 40px;}
.suggested {display: flex; flex-wrap: wrap; gap: 6px;}
.reply-chip {font-size: .8rem; border: 1px solid #ffd8ba9c; background: #32212def; border-radius: 12px; padding: 8px 10px; text-align: left;}
.reply-chip:hover {background: #624452;}
.image-card {display: block; padding: 0; border-radius: 12px; overflow: hidden; text-align: left; background: #231824; border: 1px solid #f8dfd44b;}
.generated {width: auto; max-height: min(330px, 43dvh); object-fit: contain;}
.image-card span {font-size: .72rem; color: #ffdfc8; display: block; padding: 6px 9px;}
.image-dialog {width: min(98vw, 1800px); height: 96dvh; max-width: none; max-height: none; padding: 10px; border-radius: 15px; border: 1px solid var(--line); background: #100d13; color: var(--ink);}
.image-dialog[open] {display: flex; flex-direction: column; gap: 7px;}
.image-dialog::backdrop {background: #08060be8;}
.image-view-bar {display: flex; align-items: center; justify-content: space-between; gap: 10px;}
.image-view-position {font-size: .83rem; color: var(--muted);}
.image-view-canvas {flex: 1; min-height: 0; position: relative;}
.image-view-picture {display: block; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-out;}
.image-view-picture img {width: 100%; height: 100%; object-fit: contain;}
.image-view-arrow {position: absolute; top: 50%; transform: translateY(-50%); z-index: 1; width: 44px; min-height: 44px; border-radius: 99px; border: 1px solid var(--line); background: #120d16db; color: var(--ink); font-size: 1.8rem;}
.image-view-arrow:first-child {left: 5px;}
.image-view-arrow:last-child {right: 5px;}
.image-view-arrow:disabled {visibility: hidden;}
.image-view-caption {text-align: center; margin: 0; color: var(--ink); padding: 5px 12px; font-size: .85rem;}
.composer {padding: 8px 10px; background: #171119eb; border-top: 1px solid #f7ded331; backdrop-filter: blur(11px);}
.composer-row {display: flex; gap: 6px;}
.composer input {flex: 1; font-size: .91rem;}
.image-action {font-size: .78rem;}
.composer-hint {display: flex; flex-wrap: wrap; gap: 7px; align-items: center; justify-content: flex-end; color: #c5b4c0; font-size: .66rem; padding-top: 5px;}
.composer select {margin-right: auto; padding: 3px 5px;}
.play-status {background: #2e2230ec; color: #ffe4ca; padding: 6px 12px; font-size: .76rem;}
.meter {min-width: 0; background: #211a24; border: 1px solid var(--line); border-radius: 19px; max-height: calc(100dvh - 100px); min-height: 480px; display: flex; flex-direction: column; overflow: hidden;}
.meter-heading {padding: 16px 14px 11px; display: flex; justify-content: space-between; gap: 5px; align-items: flex-start;}
.meter-heading h2 {font-size: 1.06rem; letter-spacing: -.03em;}
.meter-heading p {font-size: .72rem; color: var(--muted); margin-top: 4px;}
.live {font-size: .66rem; white-space: nowrap; border: 1px solid #81edbc48; color: #a2f1cc; background: #7cddb21a; border-radius: 30px; padding: 3px 7px;}
.live.off {color: var(--muted); border-color: var(--line); background: #ffffff10;}
.total {margin: 0 12px; padding: 12px; border: 1px solid #f2c7aa42; border-radius: 14px; background: linear-gradient(135deg, #51333a, #322331);}
.total > span {color: #ffe3d4; font-size: .77rem;}
.total strong {display: block; font-size: clamp(1.95rem, 4.3vw, 3.05rem); font-variant-numeric: tabular-nums; letter-spacing: -.065em; margin: 2px 0;}
.total small,.cost-split span,.cost-split small,.receipt-detail {color: var(--muted); font-size: .69rem;}
.cost-split {display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 7px 12px 0;}
.cost-split > div {display: grid; gap: 2px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 10px;}
.cost-split strong {font-size: .85rem;}
.cost-split > div:last-child strong {color: #ffdbad;}
.breakdown {padding: 10px 14px 8px;}
.breakdown h3,.turn-list h3 {font-size: .75rem; color: var(--muted); margin-bottom: 4px;}
.subtotal,.receipt {display: flex; gap: 7px; justify-content: space-between; padding: 3px 0; font-size: .8rem; font-variant-numeric: tabular-nums;}
.turn-list {border-top: 1px solid var(--line); padding: 9px 14px; min-height: 100px; overflow: auto;}
.receipt {align-items: flex-start; border-bottom: 1px solid var(--line); padding: 7px 0;}
.receipt small {color: var(--muted); display: block; margin-top: 3px; font-size: .68rem;}
.receipt-detail {padding: 4px 0;}
.receipt-detail p {margin-top: 4px;}
.empty-meter {color: var(--muted); line-height: 1.5; font-size: .8rem;}
@media (max-width: 720px) {
  .poster-grid {grid-template-columns: repeat(2, minmax(0, 1fr));}
  .poster {aspect-ratio: 3 / 4.5;}
  .masthead {height: 52px;}
  .discovery {padding-top: 19px;}
  .play-layout {gap: 9px; width: calc(100% - 18px); grid-template-columns: minmax(0, 1fr) 205px; margin-block: 8px;}
  .stage {height: clamp(560px, calc(100dvh - 70px), 850px);}
}
@media (max-width: 560px) {
  .opening-beat {padding: 8px 10px;}
  .opening-beat h2,.quick-replies h2 {margin-bottom: 4px;}
  .scene-direction {font-size: .82rem;}
  .reply-chip {font-size: .76rem; padding: 7px 8px;}
  .quick-replies {padding-left: 0;}
  .play-layout {grid-template-columns: 1fr; width: min(100%, 455px); margin-top: 0; gap: 9px;}
  .stage {border-radius: 0 0 14px 14px; height: max(565px, calc(100dvh - 56px));}
  .meter {min-height: 370px; max-height: 520px; margin: 0 7px;}
  .poster-note {padding: 8px 10px 10px;}
  .poster p {font-size: .72rem;}
}

.rail-status {padding: 8px 14px 0; color: #ffe4ca; font-size: .76rem;}

.image-offer {margin-top: 6px; color: #ffdebd;}

.wallet-button,.premium-choice {border: 1px solid #ffd4ae6b; background: #251926df; color: #ffd1a6; border-radius: 20px; padding: 7px 9px; font-size: .73rem; white-space: nowrap;}
.premium-choice {font-size: .69rem; padding: 4px 7px;}
.premium-choice[aria-pressed=true] {background: #ffd2ac; color: #291a24;}
.mock-margin {display: grid; gap: 4px; padding: 8px 14px 1px; color: var(--muted); font-size: .73rem;}
.mock-margin:empty {padding: 0;}
.mock-margin strong {color: #f8dcc6;}
.credit-store {width: min(92vw,410px); border: 1px solid var(--line); border-radius: 19px; padding: 17px; background: #241b27; color: var(--ink);}
.credit-store::backdrop {background: #120b15c9;}
.store-heading {display: flex; justify-content: space-between; align-items: center; gap: 9px;}
.store-heading h2 {font-size: 1.2rem;}
.credit-store p {color: var(--muted); margin: 6px 0 9px; font-size: .84rem;}
.store-balance {display: block; color: var(--accent); margin-top: 12px;}
.store-packs {display: grid; gap: 7px;}
.store-pack {display: flex; align-items: center; justify-content: space-between; gap: 7px; color: var(--ink); padding: 12px; border-radius: 11px; border: 1px solid #ffd4ae61; background: #452d3b;}
.store-pack span {font-size: .77rem; color: #ffdfc9;}
@media (max-width: 400px) {.privacy-label {display: none;} .wallet-button {padding-inline: 6px;}}

.gallery-button {background: #211722dc; border: 1px solid #efcfb451; border-radius: 12px; font-size: .71rem; padding: 8px 7px; white-space: nowrap;}
.gallery-button:hover {background: #543747;}
.scene-gallery {width: min(94vw,760px); background: #251a27; color: var(--ink); border: 1px solid var(--line); border-radius: 19px; padding: 16px;}
.scene-gallery::backdrop {background: #120b15c9;}
.gallery-desc {color: var(--muted); font-size: .83rem; margin: 4px 0 12px;}
.gallery-grid {display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px;}
.gallery-card,.still-card {padding: 0; border: 1px solid #ffe4cc3f; border-radius: 11px; overflow: hidden; background: #392637; text-align: left; color: var(--ink);}
.gallery-locked {position: relative; display: grid; place-content: end center; min-height: 120px; aspect-ratio: 16/9; padding: 8px; overflow: hidden; isolation: isolate; color: var(--muted); font-size: .8rem; border: 1px dashed var(--line); border-radius: 11px; background: #211923;}
.gallery-locked::before {content: ""; z-index: -1; position: absolute; inset: 16% 18% 31%; clip-path: polygon(0 95%, 33% 34%, 47% 54%, 68% 5%, 100% 95%); background: #3b2d40;}
.gallery-generated-heading {font-size: .94rem; margin: 16px 0 8px;}
.gallery-card img,.still-card img {width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover;}
.gallery-caption {display: grid; gap: 2px; padding: 7px 9px;}
.gallery-caption strong {font-size: .82rem;}
.gallery-caption span {font-size: .72rem; color: var(--muted);}
.scene-still {width: min(100% - 40px,440px); margin: 8px 0 15px 40px; border: 1px solid #eecdb748; border-radius: 12px; overflow: hidden; background: #221822f5;}
.scene-awaiting {padding: 10px 12px; color: var(--muted); font-size: .83rem;}
.still-card {width: 100%; display: block; border: 0; border-radius: 0;}
.scene-still figcaption {display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 7px; padding: 8px 10px;}
.still-label {color: var(--accent); font-size: .66rem;}
.scene-still figcaption strong {font-size: .83rem;}
.scene-still figcaption p {width: 100%; color: var(--muted); font-size: .73rem;}
@media (max-width: 400px) {.stage-bar {gap: 5px; padding-inline: 8px;} .gallery-button {padding-inline: 5px;}}
.subtotal.subtotal-detail {padding-left: 12px; color: var(--muted); font-size: .78rem;}
.credit-hint {flex-basis: 100%; color: var(--muted); font-size: .72rem;}
