:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  background: #0e0a14;
  color: #fff5fa;
  --pink: #ff88b7;
  --muted: #b5a6bc;
  --line: #382b42;
  --serif: Georgia, 'Times New Roman', serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: radial-gradient(ellipse at 75% 13%, #2b1535 0%, transparent 37%), #0e0a14; }
body, button, input { font-size: 1rem; }
button, input { font-family: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .62; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--pink); outline-offset: 5px; }
p, h1, h2, h3 { margin: 0; }
.shell { max-width: 1280px; width: calc(100% - 112px); margin-inline: auto; }
.topbar { border-bottom: 1px solid #2b2234; background: #100a16cc; }
.header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; font: 700 1.65rem var(--serif); letter-spacing: -.06em; white-space: nowrap; }
.brand-mark { color: var(--pink); margin-right: .45em; font: 1.2rem system-ui; text-shadow: 0 0 20px #ff6ba7a2; }
.brand-period { color: var(--pink); }
nav { display: flex; align-items: center; gap: 32px; color: #e1d1e4; font-size: .9rem; }
nav a:hover, .small-link:hover { color: var(--pink); }
.wallet-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; border: 1px solid #654361; border-radius: 7px; padding: 9px 14px; background: #28182d; color: #ffd4e8; font-size: .9rem; font-weight: 650; white-space: nowrap; }
.wallet-button:hover { background: #3b213d; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #f577a9; box-shadow: 0 0 12px #fa639fa6; }
.hero { display: grid; grid-template-columns: minmax(310px, .83fr) minmax(0, 1.17fr); align-items: center; gap: clamp(30px, 5vw, 88px); padding-block: 56px 50px; }
.intro { padding-bottom: 9px; }
.eyebrow { font-size: .875rem; font-weight: 700; line-height: 1.4; text-transform: uppercase; letter-spacing: .15em; color: #e6a4c8; }
.short-rule { display: inline-block; width: 23px; height: 1px; margin-right: 10px; background: var(--pink); vertical-align: .3em; }
h1 { margin: 18px 0; font: 400 clamp(5.1rem, 8.05vw, 8.7rem)/.85 var(--serif); letter-spacing: -.085em; }
h1 em { color: var(--pink); font-weight: 400; }
.intro-copy { max-width: 33ch; color: #cdbfd2; line-height: 1.65; font-size: 1.0625rem; margin-top: 27px; }
.hero-actions { display: flex; align-items: center; gap: 24px; margin-top: 28px; flex-wrap: wrap; }
.primary { padding: 13px 21px; min-height: 46px; border: 1px solid transparent; border-radius: 7px; background: #fd8cba; color: #230e1c; font-weight: 750; }
.primary:hover:not(:disabled) { background: #ffafcf; }
.small-link { min-height: 44px; display: inline-flex; align-items: center; color: #e3c4d5; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: #92677d; }
.pair { display: grid; position: relative; grid-template-columns: 1fr 1fr; gap: 12px; }
.portrait { position: relative; display: flex; align-items: flex-end; overflow: hidden; padding: 22px; border: 1px solid #80668755; border-radius: 14px; text-align: left; min-height: 320px; aspect-ratio: .79; background-color: #351b3e; color: #fff8fc; }
.portrait::before, .portrait::after { content: ''; position: absolute; inset: 0; }
.portrait::before { inset: 0 auto auto 50%; height: 100%; aspect-ratio: 1; transform: translateX(-50%); background-image: url('/cast-1.jpg'); background-repeat: no-repeat; background-size: 400% 400%; transition: transform 300ms ease; }
.portrait.nova::before { background-position: 0 0; }
.portrait.orbit::before { background-position: 33.3333% 0; }
.portrait::after { background: linear-gradient(transparent 47%, #100817c9 83%, #100817f0); }
.portrait:hover::before { transform: translateX(-50%) scale(1.025); }
.portrait-copy { display: grid; gap: 5px; position: relative; z-index: 1; }
.portrait-copy strong { font: 400 clamp(1.8rem, 4vw, 3.75rem)/.92 var(--serif); letter-spacing: -.07em; }
.portrait-copy span { color: #f2ddec; font-size: .9rem; line-height: 1.3; }
.pair-mark { position: absolute; z-index: 2; pointer-events: none; left: 50%; top: 51%; display: grid; place-items: center; width: 47px; height: 47px; transform: translate(-50%, -50%); border-radius: 50%; border: 1px solid #98587d; color: #ff9bc2; background: #2b1029; box-shadow: 0 0 26px #5b224d; font-size: 1.6rem; line-height: 1; }
.date-section, .cast-section, .discovery-section { scroll-margin-top: 24px; }
.section-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-block: 1px solid var(--line); min-height: 48px; }
.room-status, .cast-count { color: var(--muted); font-size: .9rem; }
.date-layout { display: grid; grid-template-columns: minmax(260px, .73fr) minmax(0, 1.27fr); gap: 16px; padding-top: 18px; }
.scene, .conversation { border: 1px solid var(--line); border-radius: 12px; background: #18101f; padding: 26px; }
.scene { background: radial-gradient(ellipse at 95% 0%, #2a1530, transparent 80%), #18101f; }
h2 { font: 400 clamp(2rem, 4vw, 3.6rem)/1.05 var(--serif); letter-spacing: -.055em; }
.scene h2 { margin-top: 11px; }
.muted { color: var(--muted); }
.scene p:not(.eyebrow) { margin-top: 12px; line-height: 1.55; }
.phases { padding: 0; list-style: none; margin: 24px 0 0; display: grid; gap: 9px; color: var(--muted); font-size: .9rem; }
.phases li { display: flex; align-items: center; gap: 10px; }
.phases li span { width: 7px; height: 7px; border-radius: 50%; border: 1px solid #906e93; }
.phases .current { color: #ffe9f3; }
.phases .current span, .phases .complete span { border-color: var(--pink); background: var(--pink); }
.conversation-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.conversation-head h3 { font: 400 1.6rem var(--serif); }
.conversation-head span { font-size: .9rem; color: var(--muted); }
.date-log { display: grid; gap: 0; }
.event { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; padding: 14px 0; border-bottom: 1px solid #34263c; }
.event p { line-height: 1.55; overflow-wrap: anywhere; }
.event strong { color: #fbb4d2; font-size: .9rem; }
.avatar { display: grid; place-items: center; border: 1px solid #ad82ae55; border-radius: 50%; width: 34px; aspect-ratio: 1; background: var(--tile, #482742); color: #fff0fa; font: 1.05rem var(--serif); }
.avatar.cast-portrait { background-size: 400% 400%; background-position: var(--column) var(--row); }
.sheet-1 { background-image: url('/cast-1.jpg'); }
.sheet-2 { background-image: url('/cast-2.jpg'); }
.portrait-column-0 { --column: 0%; }
.portrait-column-1 { --column: 33.3333%; }
.portrait-column-2 { --column: 66.6667%; }
.portrait-column-3 { --column: 100%; }
.portrait-row-0 { --row: 0%; }
.portrait-row-1 { --row: 33.3333%; }
.portrait-row-2 { --row: 66.6667%; }
.portrait-row-3 { --row: 100%; }
.synthetic-avatar { background: radial-gradient(circle at 35% 18%, var(--glow), #24132e 70%); }
.shell-color-0 { --glow: #9466ce; --shell: #c8a6e9; }
.shell-color-1 { --glow: #c44987; --shell: #ecc0d6; }
.shell-color-2 { --glow: #2e8982; --shell: #aedec8; }
.shell-color-3 { --glow: #ba6437; --shell: #f6c88e; }
.shell-color-4 { --glow: #4a71ae; --shell: #cad6fa; }
.shell-color-5 { --glow: #7a9065; --shell: #e2d8a2; }
.shell-color-6 { --glow: #8872b6; --shell: #ffa9a0; }
.synthetic-face { width: 69%; height: 62%; position: relative; background: linear-gradient(145deg, var(--shell), var(--glow)); border-radius: var(--shape, 39%); box-shadow: 0 4px 12px #160c23; }
.shell-shape-1 { --shape: 20% 20% 46% 46%; }
.shell-shape-2 { --shape: 48% 48% 24% 24%; }
.shell-shape-3 { --shape: 17% 40% 40% 17%; }
.shell-shape-4 { --shape: 50%; }
.synthetic-eyes { position: absolute; inset: 34% 11% 35%; display: flex; justify-content: space-evenly; border-radius: 20%; background: #1e152d; }
.synthetic-eyes::before, .synthetic-eyes::after { content: ''; align-self: center; width: 14%; height: 43%; border-radius: 50%; background: var(--shell); box-shadow: 0 0 6px var(--shell); }
.eye-shape-1 .synthetic-eyes { border-radius: 50%; }
.eye-shape-2 .synthetic-eyes::before, .eye-shape-2 .synthetic-eyes::after { height: 25%; width: 23%; }
.eye-shape-3 .synthetic-eyes::before, .eye-shape-3 .synthetic-eyes::after { border-radius: 2px; }
.eye-shape-4 .synthetic-eyes::after { height: 20%; }
.synthetic-mouth { position: absolute; bottom: 16%; width: 20%; height: 8%; left: 40%; border-bottom: 1px solid #24132e; border-radius: 50%; }
.face-mark-1 .synthetic-face { border-top: 2px solid #fff5; }
.face-mark-2 .synthetic-face { border-right: 2px dotted #321436a0; }
.face-mark-3 .synthetic-face { border-bottom: 2px solid #fff5; }
.face-mark-4 .synthetic-face { border-left: 2px dashed #321436a0; }
.room-note { color: var(--muted); line-height: 1.55; }
.room-note:not(:empty) { margin-top: 16px; }
.reveal { margin-top: 18px; border: 1px solid #734a6e; border-radius: 9px; padding: 15px; background: #2d1630; }
.reveal h3 { font: 400 1.65rem var(--serif); margin-bottom: 12px; }
.ballots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ballot { padding: 13px; border: 1px solid #674160; border-radius: 7px; background: #211024; }
.ballot strong { display: block; color: #ffabd0; margin-bottom: 4px; }
.ballot p { margin-top: 6px; line-height: 1.5; overflow-wrap: anywhere; }
.replay-link { margin-top: 7px; }
#automatic-dates { margin-top: 24px; }
#automatic-dates h2 { font-size: clamp(1.9rem, 3.4vw, 3rem); margin-bottom: 13px; }
.episode-card { padding: 14px 18px; border: 1px solid var(--line); border-radius: 9px; background: #18101f; margin-bottom: 8px; }
.episode-card summary { cursor: pointer; min-height: 42px; }
.episode-card summary strong { margin-right: 11px; }
.episode-guests { display: inline-flex; gap: 7px; vertical-align: middle; align-items: center; margin-right: 8px; }
.episode-guests .avatar { width: 33px; }
.episode-card > p { margin-top: 9px; line-height: 1.45; }
.episode-card .ballots { margin-top: 14px; }
.discovery-section { padding-top: 54px; }
.discovery-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.deck, .activity-panel { padding: 20px; background: #18101f; border: 1px solid var(--line); border-radius: 12px; }
.deck-picker { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: #f3dce9; font-size: .9rem; margin-bottom: 11px; }
.deck-picker select { color: inherit; background: #25162b; border: 1px solid #61465e; border-radius: 5px; padding: 7px 11px; min-height: 40px; }
.deck-card { display: grid; justify-items: start; gap: 7px; min-height: 235px; padding: 21px; border: 1px solid #744d70; border-radius: 9px; background: radial-gradient(ellipse at 86% 5%, #43223e, transparent 72%), #22142a; touch-action: pan-y; }
.deck-card .avatar { width: 72px; font-size: 1.35rem; }
.deck-card h3 { font: 400 2.25rem/1.1 var(--serif); letter-spacing: -.04em; }
.deck-card p { line-height: 1.5; overflow-wrap: anywhere; }
.deck-card .tags { margin-top: 4px; }
.deck-navigation, .deck-action { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 8px; }
.deck-navigation { margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.deck-action { margin-top: 10px; }
#deck-status:not(:empty) { margin-top: 10px; line-height: 1.5; }
.plain-link { border: 0; padding: 0; background: transparent; white-space: normal; }
.activity-tabs { display: flex; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.activity-tabs button { min-height: 44px; padding: 8px 13px; color: #f5dbe9; background: transparent; border: 1px solid transparent; border-radius: 5px; }
.activity-tabs button[aria-pressed='true'] { background: #42233f; border-color: #79506f; }
.activity-feed { max-height: 380px; overflow-y: auto; }
.activity-feed > p { padding-block: 13px; line-height: 1.5; }
.activity-row { padding: 14px 0; border-bottom: 1px solid var(--line); }
.activity-row strong { color: #f9b1d2; }
.activity-model { display: block; margin-top: 4px; color: #bda7c4; font-size: .875rem; }
.activity-row p { margin-top: 6px; line-height: 1.5; overflow-wrap: anywhere; }
.decision-note { margin-top: 8px; border-left: 2px solid #835373; padding: 2px 0 3px 11px; }
.decision-note summary { color: #ffc0db; min-height: 30px; cursor: pointer; font-size: .875rem; line-height: 2; }
.decision-note summary:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
.decision-note p { margin: 5px 0; color: #dbc6db; font-size: .9375rem; line-height: 1.5; overflow-wrap: anywhere; }
.decision-note p strong { display: block; color: #fbd9e8; font-size: .875rem; }
.profile-notes { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.profile-notes h3 { font: 400 1.5rem var(--serif); }
.profile-decision { padding-block: 11px; border-bottom: 1px solid var(--line); }
.profile-decision:last-child { border: 0; }
.profile-decision p { margin-top: 4px; overflow-wrap: anywhere; }
.cast-section { padding: 0 0 34px; }
.discovery-section { padding-bottom: 46px; }
#cast-more { margin-top: 7px; }
.cast-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0; flex-wrap: wrap; }
.cast-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.search-label input { color: inherit; border: 1px solid var(--line); border-radius: 7px; background: #18101f; padding: 10px 13px; min-height: 44px; }
.search-label input::placeholder { color: #b8a7bf; }
.cast-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.cast-card { color: #fff4fa; background: #1a1222; border: 1px solid #382b42; border-radius: 9px; text-align: left; display: flex; align-items: center; gap: 12px; min-height: 79px; padding: 12px; }
.cast-card:hover { background: #25172d; border-color: #775075; }
.cast-card .avatar { width: 48px; flex: 0 0 auto; }
.cast-card strong { display: block; }
.cast-card small { display: block; color: #c8b5cd; font-size: .875rem; line-height: 1.4; }
.tone-rose { --tile: #59263f; }
.tone-indigo { --tile: #38305d; }
.tone-teal { --tile: #24464b; }
.tone-amber { --tile: #573727; }
.cast-card .card-model, .card-model { color: #e6aac7; font-size: .875rem; }
.footer { display: flex; justify-content: space-between; gap: 20px; align-items: center; border-top: 1px solid var(--line); padding-block: 20px 28px; color: var(--muted); font-size: .9rem; }
.footer .brand { color: #fff5fa; font-size: 1.3rem; }
.profile-dialog { width: min(500px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); background: #201429; color: #fff5fa; border: 1px solid #755272; border-radius: 12px; padding: 28px; }
.profile-dialog::backdrop { background: #0c0713c9; }
.profile-dialog .avatar { width: 86px; font-size: 1.7rem; margin-bottom: 10px; }
.profile-dialog p { margin-top: 10px; line-height: 1.55; }
.profile-dialog .eyebrow { font-size: .875rem; }
.close { position: absolute; top: 12px; right: 12px; height: 44px; width: 44px; border: 1px solid var(--line); border-radius: 50%; color: #ffdfed; background: #291a31; font-size: 1.45rem; line-height: 1; }
.tags { list-style: none; display: flex; gap: 7px; flex-wrap: wrap; padding: 0; margin-bottom: 0; }
.tags li { border: 1px solid #67485e; padding: 4px 8px; border-radius: 4px; color: #f4c6dd; font-size: .875rem; }
.editor { width: min(610px, calc(100vw - 32px)); }
.editor h2 { margin-top: 6px; }
.editor #wallet-connect { margin-top: 16px; }
.editor #agent-form { display: grid; margin-top: 17px; gap: 13px; }
.editor-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.editor label { display: grid; gap: 5px; color: #f3dce9; font-size: .9rem; }
.editor input, .editor textarea, .editor select { width: 100%; border: 1px solid #61465e; padding: 9px; border-radius: 5px; color: #fff1fa; background: #160f1e; font: inherit; font-size: 1rem; }
.editor textarea { resize: vertical; }
.deck-picker select, .editor select {
  appearance: none;
  padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, #e4b8d4 50%), linear-gradient(135deg, #e4b8d4 50%, transparent 50%);
  background-position: right 14px center, right 9px center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.editor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.quiet-button { background: transparent; color: #e4c7db; min-height: 44px; border: 0; padding-inline: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 1000px) {
  .shell { width: calc(100% - 56px); }
  .hero { gap: 28px; }
  .portrait { min-height: 270px; padding: 16px; }
  .cast-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 740px) {
  .shell { width: calc(100% - 36px); }
  .header-inner { min-height: 60px; gap: 12px; }
  nav { gap: 16px; }
  .hero { grid-template-columns: 1fr; padding-block: 35px 29px; gap: 23px; }
  h1 { font-size: clamp(4.1rem, 13vw, 6.2rem); margin-block: 14px; }
  h1 br { display: none; }
  h1 em::before { content: ' '; }
  .intro-copy { margin-top: 16px; }
  .hero-actions { margin-top: 16px; }
  .portrait { min-height: unset; }
  .date-layout, .discovery-layout { grid-template-columns: 1fr; }
  .scene, .conversation { padding: 18px; }
  .cast-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 470px) {
  .header-inner nav { display: none; }
  .editor-row { grid-template-columns: 1fr; }
  .cast-actions { width: 100%; }
  .search-label { flex: 1; min-width: 0; }
  .search-label input { width: 100%; }
}
@media (max-width: 365px) {
  .shell { width: calc(100% - 25px); }
  .cast-card { padding: 8px; gap: 7px; }
  .cast-card .avatar { width: 30px; }
  .ballots { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::after, *::before { scroll-behavior: auto !important; transition: none !important; }
}
