@import url('https://fonts.googleapis.com/css2?family=Golos+Text:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  color-scheme: dark;
  --bg: #090a0c;
  --text: #f3f4ef;
  --muted: #a6aab2;
  --line: #ffffff20;
  --accent: #ffacd7;
  --blue: #94b7e2;
  --panel: #101216;
  --mono: "IBM Plex Mono", monospace;
  font-family: "Golos Text", Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--text); background: var(--bg); }
button, input, select { font: inherit; }
button, a, input, select, .drop { outline-offset: 4px; }
:focus-visible { outline: 2px solid var(--accent); }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .52; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }

.promo { position: relative; overflow: hidden; background: #21121c; color: var(--accent); border-bottom: 1px solid #ffacd72e; }
.promo-track { display: flex; width: max-content; min-width: 200%; animation: promo-scroll 44s linear infinite; }
.promo-track span { flex: 1 0 auto; min-width: 50vw; padding: 8px 36px; text-align: center; white-space: nowrap; font-size: 13px; }
.promo-message { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@keyframes promo-scroll { to { transform: translateX(-50%); } }

.bar { border-bottom: 1px solid #ffffff15; background: #0c0d0ff2; }
.bar-inner, main, footer { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.bar-inner { display: flex; align-items: center; justify-content: space-between; height: 67px; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: -.035em; white-space: nowrap; }
.mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: #351127; }
.brand-sub { color: var(--muted); font: 500 9px var(--mono); letter-spacing: .14em; }
.nav { display: flex; gap: 8px; }
.outline, .balance {
  border: 1px solid var(--line); border-radius: 8px; background: #ffffff06;
  padding: 8px 12px; font-size: 13px; font-weight: 500; white-space: nowrap;
}
.outline:hover, .balance:hover { background: #ffffff12; }
.balance-icon { color: var(--accent); margin-right: 3px; }
.outline span { margin-left: 3px; color: var(--muted); }

.hero {
  position: relative; isolation: isolate; display: grid; align-items: center; min-height: 440px;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr); gap: clamp(12px, 3vw, 36px);
}
.hero::after {
  content: ""; position: absolute; inset: 0 0 0 35%; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 48% 48% at 53% 53%, #8c3a6532, transparent);
}
.hero-content { padding-block: 55px 48px; }
.eyebrow { display: flex; gap: 9px; align-items: center; color: #c1c6ce; font: 500 10px var(--mono); letter-spacing: .17em; margin-bottom: 17px; }
.signal { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 11px #ff8ac8b0; }
h1 { font-size: clamp(3rem, 6.5vw, 5.4rem); line-height: .98; letter-spacing: -.077em; font-weight: 700; }
h1 em { color: var(--accent); font-style: normal; }
.lead { color: var(--muted); max-width: 34ch; font-size: 15px; line-height: 1.55; margin-block: 18px; }
.primary {
  border: 1px solid #fff0fa66; border-radius: 9px; background: var(--accent); color: #351127;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  padding: 11px 14px; font-size: 14px; font-weight: 650;
}
.primary:not(:disabled):hover { background: #ffd0e9; }
.hero-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hero-cta span { font-size: 17px; }

.hero-character {
  position: relative; width: 100%; max-width: 520px; justify-self: end; margin: 10px 0 18px;
}
.hero-portrait {
  position: relative;
  mask-image: linear-gradient(to bottom, #000 89%, #0009 94%, transparent 98%);
}
.hero-portrait img {
  display: block; width: 100%; height: auto;
}
.hero-portrait .portrait-result {
  position: absolute; inset: 0; clip-path: inset(0 0 0 var(--portrait-split, 100%));
}
.portrait-result[hidden], .portrait-compare[hidden], .hero-portrait canvas[hidden] { display: none; }
.portrait-compare { position: absolute; inset: 0; pointer-events: none; }
.portrait-divider {
  position: absolute; inset-block: 4% 7%; left: var(--portrait-split, 100%);
  z-index: 1; width: 1px; transform: translateX(-50%); background: #fff4fb;
}
.portrait-compare input {
  position: absolute; top: 50%; left: -22px; width: calc(100% + 44px);
  margin: 0; transform: translateY(-50%); appearance: none; height: 44px;
  background: transparent; pointer-events: auto; cursor: ew-resize; touch-action: pan-y;
}
.portrait-compare input::-webkit-slider-thumb {
  appearance: none; width: 44px; height: 44px; border: 0; background: transparent;
}
.portrait-compare input::-moz-range-thumb {
  width: 44px; height: 44px; border: 0; background: transparent;
}
.portrait-divider::after {
  content: "‹　›"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  color: #fff4fb; font-size: 19px; line-height: 1; white-space: nowrap;
  text-shadow: 0 1px 4px #180f17;
}
.hero-portrait:has(.portrait-frame:not([hidden])) img { visibility: hidden; }
.hero-portrait canvas {
  display: block; position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
}
.studio { scroll-margin-top: 20px; }
.section-title { display: flex; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 13px; }
h2 { font-size: clamp(24px, 3.5vw, 36px); letter-spacing: -.055em; font-weight: 650; }
.pill { color: var(--accent); border: 1px solid #ffacd740; background: #ffacd712; border-radius: 20px; font-size: 11px; padding: 5px 9px; white-space: nowrap; }
.pill span { margin-right: 4px; }
.workspace { display: grid; grid-template-columns: 1.08fr 1fr; gap: 14px; align-items: stretch; }
.card {
  background: linear-gradient(145deg, #181b21, var(--panel) 54%); min-width: 0;
  padding: 17px; border: 1px solid var(--line); border-radius: 15px;
  box-shadow: inset 0 1px 0 #ffffff10, 0 12px 26px #0002;
}
.modes { display: flex; gap: 4px; padding: 4px; background: #090b0e; border: 1px solid #ffffff13; border-radius: 9px; margin-bottom: 12px; }
.modes button, .counts button, .amounts button {
  flex: 1; background: transparent; color: var(--muted); border: 1px solid transparent; border-radius: 6px;
  font-size: 13px; padding: 7px 8px; font-weight: 500;
}
.modes button span { margin-right: 3px; }
.modes button:hover, .counts button:hover, .amounts button:hover { background: #ffffff0e; }
.modes button[aria-pressed=true], .counts button[aria-pressed=true] { color: var(--text); border-color: #ffffff29; background: #252a30; }
.modes button[aria-pressed=true] span, .counts button[aria-pressed=true] { color: var(--accent); }
.drop {
  position: relative; display: grid; justify-items: center; text-align: center; gap: 5px; min-height: 142px;
  border: 1px dashed #a5b3c54f; border-radius: 10px; padding: 16px 10px; cursor: pointer;
  background: radial-gradient(ellipse at 50% 0, #6d8eb518, transparent 75%), #0d0f13;
}
.drop:hover, .drop.drag { border-color: var(--blue); background-color: #151b23; }
.upload-icon { width: 31px; height: 31px; border: 1px solid #9aacc549; border-radius: 8px; background: #b0cef315; color: #dbedff; display: grid; place-items: center; font-size: 20px; }
.drop strong { font-size: 14px; overflow-wrap: anywhere; }
.drop span:not(.upload-icon), .drop small, .label, .consent { color: var(--muted); font-size: 12px; }
.drop small { font-family: var(--mono); font-size: 10px; opacity: .86; }
.drop img { max-height: 145px; max-width: 100%; border-radius: 8px; object-fit: contain; grid-row: 1; }
.drop:has(img:not([hidden])) .upload-icon { display: none; }
.count-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; }
.counts, .amounts { display: flex; gap: 5px; }
.counts button, .amounts button { background: #101319; border-color: var(--line); }
.counts button { min-width: 31px; font: 500 12px var(--mono); }
.field { display: grid; gap: 6px; margin-block: 12px 8px; font-size: 13px; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px; color: var(--text); background: #0c0e12; }
.prompt-field textarea { font: inherit; font-size: 16px; resize: vertical; min-height: 78px; }
.prompt-field textarea::placeholder { color: var(--muted); }
.consent { display: flex; gap: 7px; align-items: start; line-height: 1.45; margin-block: 13px 10px; }
.consent input { accent-color: var(--accent); margin-left: 0; }
.action { width: 100%; margin-top: 5px; }
.create-action { justify-content: space-between; }
#cost { font: 500 11px var(--mono); }
.status { font-size: 12px; color: #bac3cf; line-height: 1.4; margin-top: 8px; }
.status:empty { display: none; }

.results { display: flex; flex-direction: column; background: radial-gradient(ellipse at 50% 20%, #2033493e, transparent 75%), #101216; }
.results-header, .dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.results-header { padding-bottom: 10px; border-bottom: 1px solid #ffffff16; }
.results-header h3 { font-size: 15px; }
.quiet { background: transparent; border: 1px solid transparent; padding: 3px 6px; color: var(--muted); }
.quiet:hover { color: var(--text); }
.refresh { font-size: 19px; line-height: 1; }
#results { flex: 1; display: grid; align-content: start; }
#results:has(.empty) { align-content: center; }
.empty { display: grid; justify-items: center; text-align: center; gap: 7px; padding: 24px; }
.empty-icon {
  width: 61px; height: 61px; display: grid; place-items: center; color: #d5e6fb; font-size: 31px; margin-bottom: 7px;
  border: 1px solid #a2c3ed42; border-radius: 15px; transform: rotate(-7deg);
  background: linear-gradient(151deg, #b7d7ff20, #26394f28); box-shadow: inset 0 1px 0 #d7e9ff30, 0 7px 18px #050a1180;
}
.empty strong { font-size: 14px; }
.empty p, .job p, dialog p { color: var(--muted); font-size: 13px; line-height: 1.5; }
.job { padding-block: 13px; border-bottom: 1px solid var(--line); }
.job p { margin-block: 5px; }
.frames { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.frames img { width: 100%; border-radius: 8px; display: block; aspect-ratio: 2/3; object-fit: cover; }
.frames a { font-size: 12px; color: var(--accent); }
.result-purchase { flex-wrap: wrap; margin-top: 10px; }
dialog { width: min(420px, calc(100vw - 28px)); background: #15181d; color: var(--text); border: 1px solid #ffffff35; border-radius: 15px; padding: 20px; }
dialog::backdrop { background: #050608ca; backdrop-filter: blur(5px); }
.dialog-heading { margin-bottom: 10px; }
.dialog-heading h2 { font-size: 25px; }
.close { font-size: 24px; line-height: 1; }
footer { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); margin-top: 36px; padding-block: 18px 25px; font-size: 12px; color: var(--muted); }
.foot-brand { font: 500 10px var(--mono); letter-spacing: .11em; }
footer a:hover { color: var(--text); }

.studio-guide { margin-top: 14px; padding: 12px; scroll-margin-top: 12px; }
.studio-guide-modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 225px), 1fr));
  gap: 8px;
}
.studio-guide-modes article { background: #1d1720; border: 1px solid #493445; border-radius: 8px; padding: 9px 11px; }
.studio-guide-modes h2 { font-size: 15px; line-height: 1.3; }
.studio-guide-mode { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.studio-guide-mode span, .studio-guide-offer strong { color: var(--accent); }
.studio-guide p { color: var(--muted); font-size: 13px; line-height: 1.45; }
.studio-guide-modes p { margin-top: 3px; }
.example-toggle { margin-top: 7px; }
.example-toggle[aria-expanded="true"] { border-color: #93617f; }
.example-toggle[aria-expanded="true"] span { display: inline-block; transform: rotate(180deg); }
.example-gallery { margin-top: 8px; padding: 10px; border: 1px solid #493445; border-radius: 8px; background: #17141b; }
.example-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-width: 510px; margin-inline: auto; }
.example-grid-photo { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 880px; }
.example-grid figure { margin: 0; }
.example-grid figcaption { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.example-grid img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: contain; background: #100e13; border-radius: 7px; }
.example-gallery .example-note { margin-top: 8px; color: var(--accent); font-size: 11px; font-weight: 650; text-align: center; }
.studio-guide-offer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 7px 12px; margin-top: 8px; }

@media (max-width: 720px) {
  .bar-inner, main, footer { width: calc(100% - 30px); }
  .bar-inner { height: 58px; }
  .hero { min-height: 300px; }
  .hero-content { padding-block: 38px; }
  .workspace { grid-template-columns: 1fr; }
  .results { min-height: 235px; }
}
@media (max-width: 560px) {
  .example-grid-photo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; gap: 0; }
  .hero-content { padding: 34px 0 20px; }
  .hero-character { justify-self: center; width: min(calc(100% - 40px), 400px); margin: 0 0 16px; }
}
@media (max-width: 420px) {
  .brand-sub { display: none; }
  h1 { font-size: clamp(2.8rem, 12.3vw, 3.6rem); }
  .lead { max-width: 31ch; }
  .card { padding: 12px; }
  .modes button { padding-inline: 4px; font-size: 12px; }
  .counts button { min-width: 27px; padding-inline: 5px; }
}
.wheel-section {
  margin-top: 28px; scroll-margin-top: 20px; display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: center; gap: clamp(18px, 5vw, 68px); padding: clamp(22px, 5vw, 52px);
  background: radial-gradient(ellipse at 23% 50%, #3c2035 0%, var(--panel) 63%);
}
.wheel-visual { width: min(100%, 320px); margin: 12px auto 0; position: relative; aspect-ratio: 1; }
.wheel-disk {
  width: 100%; height: 100%; position: relative; border-radius: 50%; border: 4px solid #ffacd7;
  background: repeating-conic-gradient(#9f3e70 0deg 44deg, #ffacd7 44deg 45deg, #342039 45deg 89deg, #ffacd7 89deg 90deg);
  box-shadow: 0 0 28px #ff79bc38, inset 0 0 25px #2a1023a0;
}
.wheel-label {
  position: absolute; left: 50%; top: 50%; height: 47%; width: 28%;
  transform-origin: 50% 0; transform: translateX(-50%) rotate(var(--sector));
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8%;
  color: #fff0f8; font: 600 clamp(10px, 1.6vw, 14px) var(--mono); white-space: nowrap;
}
.wheel-label span { transform: rotate(180deg); }
.wheel-pointer {
  position: absolute; z-index: 2; left: 50%; top: -9px; transform: translateX(-50%);
  width: 24px; height: 28px; background: #ffe1f1;
  clip-path: polygon(0 0, 100% 0, 50% 100%); filter: drop-shadow(0 2px 4px #000);
}
.wheel-hub {
  position: absolute; z-index: 1; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 17%; aspect-ratio: 1; display: grid; place-items: center;
  background: var(--accent); color: #351127; border-radius: 50%; box-shadow: 0 0 0 4px #311427;
}
.wheel-content h2, .channel h2 { font-size: clamp(22px, 4vw, 34px); letter-spacing: -.035em; }
.wheel-content > p:not(.status), .channel p { color: var(--muted); line-height: 1.55; margin: 8px 0 16px; }
.wheel-content .status { min-height: 22px; margin-top: 10px; }
.channel { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 16px; }
.channel p { margin-bottom: 0; }
@media (max-width: 640px) {
  .wheel-section { grid-template-columns: 1fr; gap: 18px; }
  .wheel-visual { width: min(100%, 250px); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-portrait canvas { display: none; }
  .promo-track { display: none; }
  .promo-message { position: static; width: auto; height: auto; clip-path: none; padding: 8px 12px; text-align: center; white-space: normal; font-size: 13px; }
}

.site-menu { position: relative; z-index: 20; }
.site-menu summary { list-style: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; cursor: pointer; font-size: 21px; }
.site-menu summary::-webkit-details-marker { display: none; }
.site-menu nav {
  position: absolute; top: calc(100% + 8px); right: 0;
  display: grid; gap: 3px; width: min(245px, calc(100vw - 32px)); padding: 6px;
  background: #241926; border: 1px solid #ffacd740; border-radius: 14px;
  box-shadow: 0 16px 40px #0a060bcc;
}
.site-menu nav :is(a, button) {
  display: flex; align-items: center; min-height: 44px; padding: 8px 12px;
  text-align: left; font: inherit; color: inherit; border: 0; border-radius: 8px;
  background: transparent; text-decoration: none;
}
.site-menu nav :is(a, button):hover { background: #ffacd71c; }
#generation-history { scroll-margin-top: 72px; }
.wheel-section {
  background: radial-gradient(ellipse at 21% 42%, #4b2340 0%, #201523 55%, #17101a 100%);
}
.wheel-disk {
  border-color: #f1a9ce;
  background: repeating-conic-gradient(#803662 0deg 44deg, #e9a0c7 44deg 45deg, #522648 45deg 89deg, #e9a0c7 89deg 90deg);
  box-shadow: 0 0 30px #ed70b04d, inset 0 0 24px #37102766;
}
.wheel-result { margin-top: 16px; padding-top: 12px; border-top: 1px solid #ffacd740; }
.wheel-result small { color: #e1bfd4; }
.wheel-result strong { display: block; color: #ffc4e1; font-size: clamp(21px, 3.5vw, 30px); line-height: 1.2; }
.wheel-content .status:empty { display: none; }

#topup { width: min(690px, calc(100% - 24px)); }
.frame-packs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.frame-pack {
  display: grid; gap: 4px; align-content: start; min-width: 0; padding: 12px;
  text-align: left; color: inherit; background: #261b2a; border: 1px solid #674660;
  border-radius: 12px; font: inherit; cursor: pointer;
}
.frame-pack b { font-size: clamp(18px, 4vw, 24px); }
.frame-pack small { color: #dcc1d4; }
.frame-pack .pack-saving { color: #ffacd9; font-weight: 650; }
.frame-pack.featured { background: #412037; border-color: #f393c8; }
.frame-pack .frame-pack-badge {
  grid-column: 1 / -1; grid-row: 1; justify-self: start;
  padding: 3px 9px; border-radius: 999px; background: #ffadd5;
  color: #31182a; font-weight: 700;
}
.frame-pack[aria-pressed="true"] { box-shadow: inset 0 0 0 1px #ffc0e2; }
.more-packs { margin-block: 12px; }
.more-packs summary {
  display: flex; justify-content: space-between; list-style: none; cursor: pointer;
  background: #44233a; border-color: #ef92c6; color: #ffe2f3; font-weight: 650;
}
.more-packs summary::-webkit-details-marker { display: none; }
.more-packs summary::after { content: "⌄"; }
.more-packs[open] summary::after { transform: rotate(180deg); }
.more-packs .frame-packs { margin-top: 8px; }
.pack-total { color: #ffc0e2; font-weight: 650; }
@media (max-width: 520px) {
  .frame-packs { grid-template-columns: 1fr; }
  .frame-pack { grid-template-columns: 1fr auto; align-items: center; }
  .frame-pack b, .frame-pack .pack-saving { text-align: right; }
  #frame-packs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #frame-packs .frame-pack { grid-template-columns: minmax(0, 1fr); }
  #frame-packs .frame-pack b { text-align: left; }
}

#earn { width: min(900px, calc(100vw - 28px)); }
.earn-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.earn-summary section, .earn-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.earn-summary span, .earn-summary small, .earn-link-info small { display: block; color: var(--muted); }
.earn-summary strong { display: block; margin-block: 5px; font-size: clamp(18px, 3vw, 28px); }
#earn-balance { color: var(--accent); }
.earn-panel { margin-block: 10px; }
.earn-link-form, .earn-link-row { display: flex; align-items: end; gap: 10px; justify-content: space-between; }
.earn-link-form .field { flex: 1; margin-bottom: 0; }
.earn-link-row { padding: 10px 0; margin-top: 8px; border-top: 1px solid var(--line); align-items: center; }
.earn-link-info { min-width: 0; overflow-wrap: anywhere; }
.earn-table { overflow-x: auto; }
.earn-table table { width: 100%; border-collapse: collapse; text-align: left; }
.earn-table th, .earn-table td { padding: 9px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.earn-table th { font-size: 12px; color: var(--muted); }
.earn-table td { font-size: 13px; }
.earn-table td:nth-last-child(-n+2), .earn-table th:nth-last-child(-n+2) { text-align: right; }
@media (max-width: 520px) {
  .earn-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .earn-summary section:last-child { grid-column: span 2; }
  .earn-link-form { align-items: stretch; flex-direction: column; }
}
