:root {
  --bg: #F6F3FC;
  --text: #18131F;
  --dim: #6F6B7E;
  --dim2: #8B87A0;
  --line: rgba(30, 20, 60, 0.1);
  --surface: rgba(30, 20, 60, 0.045);
  --surface-soft: rgba(30, 20, 60, 0.03);
  --topbar-bg: rgba(246, 243, 252, 0.75);
  --accent: #8B5CFF;
  --accent-soft: rgba(139, 92, 255, 0.35);
  --accent-shadow: rgba(139, 92, 255, 0.35);
  --accent-tint: rgba(139, 92, 255, 0.07);
  --coral: #FF6A55;
  --success: #8FD35C;
  --modal-bg: #FFFFFF;
  --gen-bg: #0B0A10;
  --edit-bg: #1A1A1F;
  --font-head: "Unbounded", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --radius-card: 16px;
  --radius-pill: 999px;
  --shadow-cta: 0 12px 30px var(--accent-shadow);
  --shadow-result: 0 30px 70px rgba(0, 0, 0, 0.5);
  --shadow-modal: 0 16px 40px rgba(30, 20, 60, 0.15);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

a {
  color: #6B46E0;
}

a:hover {
  color: #4C2FB0;
}

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

/* —— blobs —— */
.blobs {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
}

.blob-a {
  width: 640px;
  height: 640px;
  left: -160px;
  top: -120px;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  animation: blobA 16s ease-in-out infinite;
}

.blob-b {
  width: 560px;
  height: 560px;
  right: -140px;
  top: 120px;
  background: radial-gradient(circle, rgba(255, 106, 85, 0.35), transparent 70%);
  animation: blobB 19s ease-in-out infinite;
}

.blob-c {
  width: 480px;
  height: 480px;
  left: 30%;
  bottom: -220px;
  background: radial-gradient(circle, rgba(240, 185, 61, 0.22), transparent 70%);
  filter: blur(48px);
  animation: blobC 21s ease-in-out infinite;
}

@keyframes blobA {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, -40px) scale(1.15); }
}

@keyframes blobB {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-50px, 50px) scale(1.1); }
}

@keyframes blobC {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, 60px) scale(1.2); }
}

@keyframes spinRing {
  to { transform: rotate(360deg); }
}

@keyframes floatY {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(-1deg); }
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

@keyframes kenBurns {
  0% { transform: scale(1); }
  100% { transform: scale(1.1); }
}

@keyframes balanceFlash {
  0% { opacity: 1; transform: translateY(0); }
  70% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(8px); }
}

@keyframes sheetUp {
  0% { transform: translateY(100%); }
  100% { transform: translateY(0); }
}

@keyframes scrimIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* —— topbar —— */
.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 44px;
  background: var(--topbar-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
}

.logo-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 4px 16px var(--accent-shadow);
}

.logo-wordmark {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.balance-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 6px 8px 6px 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  position: relative;
}

.balance-flash {
  position: absolute;
  right: 36px;
  top: -2px;
  color: var(--coral);
  font-size: 11px;
  font-weight: 700;
  animation: balanceFlash 1.4s ease forwards;
  pointer-events: none;
}

.balance-plus {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.avatar-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  overflow: hidden;
  border: 1px solid rgba(30, 20, 60, 0.15);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 13px;
  color: var(--dim);
}

.avatar-btn.active {
  border: 2px solid var(--accent);
  box-shadow: 0 6px 18px var(--accent-shadow);
}

.avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-login {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* —— main —— */
.main {
  position: absolute;
  top: 72px;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  z-index: 1;
}

.screen {
  width: 100%;
  height: 100%;
}

.hidden {
  display: none !important;
}

/* —— upload / home —— */
.screen-upload {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 56px;
  height: 100%;
  padding: 26px 60px 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.upload-copy {
  max-width: 440px;
}

.upload-copy h1 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 36px;
  line-height: 1.2;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}

.accent-text {
  background: var(--accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.upload-sub {
  color: var(--dim);
  font-size: 18px;
  line-height: 1.6;
  margin: 0 0 22px;
  max-width: 400px;
}

.advantage-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.6));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px 22px;
  margin-bottom: 22px;
  height: 168px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  box-shadow: 0 12px 30px rgba(80, 50, 150, 0.08);
  overflow: hidden;
}

.advantage-body {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.advantage-body.is-fading {
  opacity: 0;
  transform: scale(0.96);
}

.advantage-badge {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  font-size: 15px;
  color: #fff;
  box-shadow: 0 6px 16px var(--accent-shadow);
}

.advantage-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 15.5px;
  margin: 0 0 5px;
}

.advantage-desc {
  margin: 0;
  font-size: 12.5px;
  color: var(--dim);
  line-height: 1.55;
  min-height: 58px;
}

.advantage-dots {
  display: flex;
  gap: 5px;
  padding-left: 48px;
}

.advantage-dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: rgba(30, 20, 60, 0.15);
  transition: width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.35s ease, box-shadow 0.35s ease;
}

.advantage-dot.active {
  width: 20px;
  background: var(--accent);
  box-shadow: 0 2px 8px var(--accent-shadow);
}

.cta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-primary {
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 16.5px;
  padding: 17px 32px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-cta);
}

.btn-secondary {
  cursor: pointer;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(30, 20, 60, 0.12);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14.5px;
  padding: 16px 26px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-wrap {
  width: 400px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.hero-stage {
  width: 400px;
  height: 390px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-glow {
  position: absolute;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  filter: blur(30px);
  animation: glowPulse 3.4s ease-in-out infinite;
}

.hero-float {
  position: relative;
  width: 365px;
  height: 360px;
  animation: floatY 5s ease-in-out infinite;
}

.hero-photo {
  width: 365px;
  height: 360px;
  border-radius: 36px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
  opacity: 1;
  transition: opacity 0.4s ease;
}

.hero-photo.is-fading {
  opacity: 0;
}

.hero-photo-zoom {
  position: absolute;
  inset: 0;
  animation: kenBurns 13s ease-in-out infinite alternate;
}

.hero-photo-zoom img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* —— shared interior —— */
.screen-scroll {
  height: 100%;
  overflow-y: auto;
  padding: 44px 60px;
}

.screen-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
}

.screen-header.centered {
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

.screen-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 24px;
  margin-bottom: 4px;
}

.screen-sub {
  color: var(--dim);
  font-size: 13.5px;
}

.back-link {
  color: var(--dim);
  font-size: 13px;
  cursor: pointer;
}

.preset-banner {
  max-width: 860px;
  margin: -14px auto 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(139, 92, 255, 0.08);
  border: 1px solid rgba(139, 92, 255, 0.25);
  border-radius: 14px;
  padding: 12px 18px;
  font-size: 13.5px;
  gap: 16px;
}

.preset-clear {
  cursor: pointer;
  color: var(--dim);
  font-size: 13px;
  white-space: nowrap;
}

.params-layout {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.photo-col {
  width: 216px;
  flex: 0 0 auto;
}

.section-label {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 13.5px;
  margin: 0 0 12px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.photo-tile {
  width: 100%;
  aspect-ratio: 1;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  border: 1px dashed rgba(30, 20, 60, 0.18);
}

.photo-tile.filled {
  border-style: solid;
  border-color: var(--line);
}

.photo-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-tile-plus {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--dim2);
  pointer-events: none;
}

.photo-tile input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.photo-tile-del {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(20, 15, 30, 0.6);
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  z-index: 5;
}

.photo-tile.filled:hover .photo-tile-del {
  display: flex;
}

.params-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.model-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.model-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
}

.model-card.selected {
  border: 1.5px solid var(--accent);
  background: var(--accent-tint);
}

.model-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 4px;
}

.model-name {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 14px;
}

.model-cost {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--dim);
}

.model-desc {
  margin: 0;
  font-size: 12px;
  color: var(--dim);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: relative;
}

.chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  border-radius: var(--radius-pill);
  padding: 9px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chip.selected {
  border: 1.5px solid var(--accent);
  background: var(--accent-tint);
  color: var(--accent);
}

.chip .chev {
  opacity: 0.5;
  font-size: 10px;
}

.format-menu {
  position: absolute;
  top: 44px;
  left: 0;
  z-index: 20;
  background: #fff;
  border: 1px solid rgba(30, 20, 60, 0.12);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-modal);
  width: 320px;
}

.format-group {
  margin-bottom: 12px;
}

.format-group:last-child {
  margin-bottom: 0;
}

.format-group-label {
  font-size: 11.5px;
  color: var(--dim);
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.format-group-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.format-item {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 6px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  text-align: center;
}

.format-item.selected {
  border: 1.5px solid var(--accent);
  background: var(--accent-tint);
  color: var(--accent);
}

.prompt-area {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.7);
}

.prompt-area:focus {
  outline: none;
  border-color: var(--accent);
}

.cost-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.cost-bar-label {
  margin: 0 0 2px;
  font-size: 12px;
  color: var(--dim);
}

.cost-bar-value {
  margin: 0;
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 600;
}

.btn-generate {
  font-weight: 700;
  font-size: 14.5px;
  padding: 14px 26px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.btn-generate:disabled {
  background: rgba(30, 20, 60, 0.15);
  color: var(--dim2);
  cursor: default;
  box-shadow: none;
}

/* —— styles gallery —— */
.screen-styles {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 44px 60px;
}

.styles-grid-wrap {
  flex: 1;
  overflow-y: auto;
}

.styles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  padding-bottom: 20px;
}

.style-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 3 / 4;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.style-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
}

.style-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.style-card-cost {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  border-radius: 20px;
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #fff;
}

.style-card-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  font-family: var(--font-head);
  font-size: 14.5px;
  font-weight: 500;
  color: #fff;
}

/* —— generating —— */
.screen-generating {
  height: 100%;
  position: relative;
  overflow: hidden;
  background: var(--gen-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
}

.gen-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(28px) brightness(0.55);
  transform: scale(1.15);
}

.gen-scrim {
  position: absolute;
  inset: 0;
  background: rgba(11, 10, 16, 0.55);
}

.gen-spinner {
  position: relative;
  z-index: 2;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gen-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  border-right-color: var(--coral);
  animation: spinRing 1s linear infinite;
}

.gen-core {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  box-shadow: 0 8px 24px var(--accent-shadow);
}

.gen-status,
.gen-cost {
  position: relative;
  z-index: 2;
  font-family: var(--font-mono);
  color: #fff;
  margin: 0;
}

.gen-status {
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gen-cost {
  font-size: 13px;
  font-weight: 600;
}

/* —— result —— */
.screen-result {
  height: 100%;
  position: relative;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.result-tile {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  height: 94%;
  aspect-ratio: 3 / 4;
  background: linear-gradient(135deg, var(--accent), var(--coral));
  box-shadow: var(--shadow-result);
}

.result-img {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

.result-actions {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
}

.result-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 58px;
  flex: 0 0 58px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: #fff;
  appearance: none;
  -webkit-appearance: none;
}

.result-action-btn {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  overflow: hidden;
}

.result-action-btn svg {
  display: block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.result-action-label {
  display: block;
  width: 100%;
  color: #fff;
  font-size: 10px;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* —— edit sheet —— */
.edit-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 10;
  animation: scrimIn 0.2s ease;
}

.edit-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 11;
  background: var(--edit-bg);
  border-radius: 20px 20px 0 0;
  overflow: hidden;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.4);
  padding: 20px 24px 28px;
  animation: sheetUp 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.edit-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.edit-sheet-title {
  color: #fff;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 15px;
  margin: 0;
}

.edit-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
}

.edit-textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  margin-bottom: 12px;
  outline: none;
}

.edit-textarea:focus {
  border-color: var(--accent);
}

.edit-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.edit-cost {
  color: #8B8798;
  font-size: 12px;
  font-family: var(--font-mono);
}

.btn-edit-submit {
  font-weight: 700;
  font-size: 13.5px;
  padding: 13px 20px;
  border-radius: var(--radius-pill);
  text-align: center;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.btn-edit-submit:disabled {
  background: rgba(255, 255, 255, 0.1);
  color: #8B8798;
  cursor: default;
}

/* —— profile —— */
.profile-guest {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.profile-guest p {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 22px;
  color: var(--dim);
  overflow: hidden;
  flex: 0 0 auto;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-name {
  font-family: var(--font-head);
  font-size: 19px;
  font-weight: 600;
  margin: 0 0 4px;
}

.profile-handle {
  font-size: 13px;
  color: var(--dim);
  margin: 0;
}

.profile-divider {
  height: 1px;
  background: rgba(30, 20, 60, 0.08);
  margin: 0 0 24px;
}

.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 34px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
}

.stat-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--dim);
  margin: 0 0 6px;
}

.stat-value {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 600;
  margin: 0;
}

.stat-suffix {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--success);
}

.topup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 34px;
  gap: 16px;
}

.topup-row-title {
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 4px;
}

.topup-row-sub {
  font-size: 12.5px;
  color: var(--dim);
  margin: 0;
}

.btn-topup {
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-pill);
  padding: 11px 22px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  flex: 0 0 auto;
}

.history-title {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 16px;
}

.history-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 14px;
}

.history-card {
  flex: 0 0 auto;
  width: 130px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
}

.history-thumb {
  position: relative;
  width: 130px;
  height: 130px;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 8px;
}

.history-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.history-thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(20, 15, 30, 0);
  transition: background 0.15s;
  pointer-events: none;
}

.history-card:hover .history-thumb-overlay {
  background: rgba(20, 15, 30, 0.16);
}

.history-card-title {
  font-size: 12px;
  margin: 0 0 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.history-card-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--dim);
  margin: 0;
}

.show-more {
  font-size: 13px;
  color: #6B4FE0;
  cursor: pointer;
  margin: 0 0 26px;
  font-weight: 500;
  background: none;
  border: none;
  padding: 0;
}

.tx-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 40px;
}

.tx-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: var(--surface-soft);
}

.tx-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 13px;
}

.tx-icon.in {
  background: rgba(143, 211, 92, 0.18);
  color: var(--success);
}

.tx-icon.out {
  background: rgba(255, 106, 85, 0.14);
  color: var(--coral);
}

.tx-title {
  font-size: 13px;
  margin: 0;
}

.tx-sub {
  font-size: 11.5px;
  color: var(--dim);
  margin: 2px 0 0;
}

.tx-amount {
  font-family: var(--font-mono);
  font-size: 13px;
}

.tx-amount.in {
  color: var(--success);
}

.tx-amount.out {
  color: var(--dim);
}

/* —— modals —— */
.modal-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-scrim.topup {
  background: rgba(0, 0, 0, 0.6);
}

.lightbox-card {
  width: 360px;
  background: var(--modal-bg);
  border-radius: 22px;
  overflow: hidden;
  position: relative;
}

.lightbox-close,
.topup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  font-size: 13px;
}

.topup-close {
  top: 16px;
  right: 16px;
  background: var(--surface);
  color: var(--dim);
}

.lightbox-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.lightbox-body {
  padding: 18px 20px;
}

.lightbox-title {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 4px;
}

.lightbox-sub {
  font-size: 12.5px;
  color: var(--dim);
  margin: 0 0 16px;
}

.btn-download {
  display: block;
  text-align: center;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-pill);
  padding: 11px 0;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
}

.topup-card {
  width: 380px;
  background: var(--modal-bg);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px;
  position: relative;
  box-shadow: var(--shadow-modal);
}

.topup-title {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 6px;
}

.topup-sub {
  font-size: 13px;
  color: var(--dim);
  margin: 0 0 22px;
}

.packs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pack-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 14px;
  cursor: pointer;
  text-align: left;
  background: var(--surface-soft);
}

.pack-card.popular {
  border: 1px solid var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 255, 0.12);
}

.pack-popular-label {
  font-size: 10px;
  color: var(--accent);
  font-family: var(--font-mono);
  text-transform: uppercase;
  margin: 0 0 8px;
}

.pack-amount {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px;
}

.pack-price {
  font-size: 12.5px;
  color: var(--dim);
  margin: 0;
}

@media (max-width: 980px) {
  .screen-upload {
    flex-direction: column;
    align-items: center;
    gap: 32px;
    padding: 24px 24px 40px;
  }

  .hero-wrap,
  .hero-stage {
    width: min(400px, 100%);
  }

  .params-layout {
    flex-direction: column;
  }

  .photo-col {
    width: 100%;
    max-width: 280px;
  }

  .stats-row {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 0 20px;
  }

  .screen-scroll,
  .screen-styles {
    padding: 28px 20px;
  }
}
